MySQL: Using SQL Query Profiler finds total execution time and CPU information of the Queries

Microsoft SQL Server Profiler is one of the important tool which is useful to find different events and statues of the running queries on Microsoft SQL Server.

Do we have anything like SQL Profiler in MySQL?

I have found this question on many forums and many of MySQL professionals are curious about SQL Profiler in MySQL.

MySQL has SQL Profiler which is built into the database server and you can enable/disable via the MySQL client utility.

Before executing any queries you can enable SQL Profiler and it is only for your particular session.
Internally, it creates one profiling table into INFORMATION_SCHEMA database and when you disconnect with MySQL client, it destroys this table.

Enable SQL Profile at session level:

Execute sample query:

Check the execution time for each query:

Check the execution time for second query only:

Check the CPU information for second query only:

The Result:

MySQL CPU SQL Profiler

Please share your ideas and opinions about this topic with me, your contribution will add true value to this topic.
If anyone has doubts on this topic then please do let me know by leaving comments or send me an email.

If you like this post, then please share it with others.
Please follow, I will share my experience towards the success of Database Research and Development Activity.

I put up a post every day, please keep reading and learning.
Discover Yourself, Happy Blogging !
Anvesh M. Patel.

More from

Leave a Reply

Be the First to Comment!

Notify of