Created
May 26, 2020 09:29
-
-
Save arashrasoulzadeh/15a636226fd24cad5c68d5e94257be12 to your computer and use it in GitHub Desktop.
performance schema sql statistics
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select DIGEST_TEXT AS query , COUNT_STAR as exec_count, | |
SEC_TO_TIME(SUM_TIMER_WAIT/1000000000000) as exec_time_total, | |
SEC_TO_TIME(MAX_TIMER_WAIT/1000000000000) as exec_time_max, | |
(AVG_TIMER_WAIT/1000000000) as exec_time_avg_ms, | |
SUM_ROWS_SENT as rows_sent, | |
SUM_ROWS_EXAMINED as rows_scanned | |
FROM performance_schema.events_statements_summary_by_digest ORDER BY SUM_TIMER_WAIT DESC |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment