Last active
June 18, 2021 11:53
-
-
Save uso5/f1f4cab06e0693bd8e11ae5727f8533b to your computer and use it in GitHub Desktop.
Performance schema useful queries
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
# Locked threads | |
SELECT * FROM `events_waits_current` LIMIT 0,10000; | |
# top used queries with UPDATE and their percentage | |
SELECT | |
digest_text, | |
count_star / update_total * 100 as percentage_of_all | |
FROM events_statements_summary_by_digest, | |
( SELECT sum(count_star) update_total | |
FROM events_statements_summary_by_digest | |
WHERE digest_text LIKE 'UPDATE%' | |
) update_totals | |
WHERE digest_text LIKE 'UPDATE%' | |
ORDER BY percentage_of_all DESC | |
LIMIT 10 | |
# info about triggers and their running time | |
SELECT * FROM `events_statements_summary_by_program` LIMIT 0,10000; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment