Created
October 4, 2022 18:56
-
-
Save toriaezunama/e0287201a2ea5703937c97251f0ba28d to your computer and use it in GitHub Desktop.
10 slow queries by average time taken to execute the query
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 SCHEMA_NAME, | |
DIGEST, | |
DIGEST_TEXT, | |
FORMAT(COUNT_STAR, 0) as COUNT_STAR, | |
CONCAT(ROUND(SUM_TIMER_WAIT * 0.000000000001, 2), 's') as SUM_TIMER_WAIT_S, | |
CONCAT(ROUND(MIN_TIMER_WAIT * 0.000000001, 2), 'ms') as MIN_TIMER_WAIT_MS, | |
CONCAT(ROUND(AVG_TIMER_WAIT * 0.000000000001, 2), 's') as AVG_TIMER_WAIT_S, | |
CONCAT(ROUND(MAX_TIMER_WAIT * 0.000000001, 2), 'ms') as MAX_TIMER_WAIT_MS, | |
CONCAT(ROUND(SUM_LOCK_TIME * 0.000000000001, 2), 's') as SUM_LOCK_TIME_S | |
from events_statements_summary_by_digest | |
order by AVG_TIMER_WAIT desc | |
limit 10\G |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment