Last active
July 2, 2021 15:28
-
-
Save jonathanvx/ed691b04b44a86cc0ed63b64ddfbb0c6 to your computer and use it in GitHub Desktop.
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
pt-query-digest mysql-slowquery.log --limit=25 > slow.txt | |
pt-query-digest mysql-slowquery.log --limit=8 --order-by=Lock_time:sum > locked.txt 2>/dev/null | |
pt-query-digest mysql-slowquery.log --filter '($event->{Rows_examined} > 0) && ($event->{Row_ratio} = $event->{Rows_sent} / ($event->{Rows_examined})) && 1' --limit=8 > select_ratio.txt | |
pt-query-digest mysql-slowquery.log --filter '($event->{fingerprint} =~ m/^(!?select)/) && ($event->{Rows_examined} > 0) && ($event->{fingerprint} !~ m/(information_schema|performance_schema|mysql)/)' --no-report --output=slowlog >select.log | |
pt-query-digest mysql-slowquery.log --filter '$event->{fingerprint} =~ m/table/' --no-report --output=slowlog >table.log | |
pt-query-digest table.log --limit=100% > table.txt | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment