After turning on profiling in MySQL
SET profiling=1;
I can run like a query like SELECT NOW();
and see profile results with it's execution time using:
SHOW PROFILES;
However, I can't figure how to clear out the profile listing. Anyone know the statement to delete old profile data? SET profiling=0;
just disables logging of new data and doesn't remove old stats.
Query Profiler, built into dbForge Studio for MySQL, is the best query optimization tool to tune MySQL queries and investigate query performance issues in an efficient and fast way. It helps build up a picture of how the queries are run to access data and what operations impact your application.
Query Profiler generates profiling results that can help you analyze and maximize query performance in SQL Server databases. The tool allows you to collect detailed statistics about executed queries, reveal and force slow queries and troubleshoot performance issues.
To remove previous query profiles set @@profiling_history_size=0
. The following snippet clears the profiles, sets the history to its maximum size and enables profiling
SET @@profiling = 0;
SET @@profiling_history_size = 0;
SET @@profiling_history_size = 100;
SET @@profiling = 1;
Tested on 5.6.17
For completeness' sake: Closing the current connection to the server and reconnecting resets the profiling counts.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With