Have you ever seen BIG weird numbers in mk-query-digest report that just seem wrong? I have! Here’s one report I got today:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | ... # Attribute total min max avg 95% stddev median # ============ ======= ======= ======= ======= ======= ======= ======= # Exec time 5088s 1us 171s 2ms 467us 104ms 28us # Lock time 76s 0 3s 26us 69us 3ms 0 # Rows sent 9.80M 0 1.05M 3.50 0.99 642.32 0 # Rows examine 5.59G 0 82.56M 2.00k 0.99 97.41k 0 # Rows affecte 457.30k 0 2.62k 0.16 0.99 1.68 0 # Rows read 2.16G 0 82.56M 788.53 21.45 82.91k 0.99 # Bytes sent 2.14T 0 4.00G 781.27k 3.52k 47.84M 84.10 # Merge passes 273.47G 0 4.00G 97.69k 0 10.35M 0 # Tmp tables 225.85G 0 4.00G 80.67k 0 7.89M 0 # Tmp disk tbl 381.88G 0 4.00G 136.41k 0 14.08M 0 # Tmp tbl size 255.54G 0 2.39G 91.28k 0 8.59M 0 # Query size 418.38M 6 257.39k 149.45 563.87 1.49k 42.48 # InnoDB: # IO r bytes 272.92G 0 1.58G 479.74k 0 18.19M 0 # IO r ops 328.05G 0 2.00G 576.65k 0 23.08M 0 # IO r wait 237964272912s 0 3377771733s 398921s 0 22888946s 0 # pages distin 156.50G 0 2.39G 275.11k 27.38 14.48M 4.96 # queue wait 143150489533s 0 3377769328s 239976s 0 16014027s 0 # rec lock wai 216352062699s 0 4085510331s 362690s 0 27625029s 0 ... |
That can’t be right! Apparently there are couple bugs in the slowlog patch that aren’t really critical as the numbers are only wrong for the administrator commands. Yet when aggregated it kind of messes up the whole mk-query-digest output.
There’s a simple solution to that though — mk-query-digest –filter. With just a small change it will completely ignore administrator commands:
1 | mk-query-digest --filter='$event->{arg} !~ m/administrator command/' in > out |
If these bugs are really bugging you, feel free to sponsor the fix. Otherwise enjoy the power of the almighty mk-query-digest!