slow query report to be changed to from Mysqldumpslow to Qt-digest

At last the long hot days came to nearly over.
I’m takeken, How are you doing?

A survey on a mysql slow queries was using the Mysqldumpslow, and I would like to use the Qt-digest on a whim.

How to install.

This is simple enough.

sudo rpm -ivh

that’s all.


How to use.

sudo pt-query-digest /to/path/slow.log > digest.txt


And, let’s “crontab -e”


Let’s An email comes on the next morning.

In mysqldumpslow case.

Count: 1  Time=0.02s (0s)  Lock=0.00s (0s)  Rows=0.0 (0), wpdata[wpdata]@localhost
  SELECT v.postid AS id FROM wp_popularpostsdata v WHERE NOT EXISTS (SELECT p.ID FROM wp_posts p WHERE v.postid = p.ID)

Count: 6  Time=0.01s (0s)  Lock=0.00s (0s)  Rows=1.0 (6), wpdata[wpdata]@localhost
  SELECT COUNT(*) FROM wp_comments WHERE user_id = N AND comment_approved = N

Look at result, Very simple.

In qt-query-digest case.

# 4.4s user time, 100ms system time, 25.77M rss, 113.67M vsz
# Current date: Thu Aug 27 04:00:06 2015
# Hostname: vincentina
# Files: /var/lib/mysql/slow.log
# Overall: 6.79k total, 17 unique, 0.08 QPS, 0.00x concurrency ___________
# Time range: 2015-08-26 04:00:43 to 2015-08-27 04:00:00
# Attribute          total     min     max     avg     95%  stddev  median
# ============     ======= ======= ======= ======= ======= ======= =======
# Exec time            11s   142us   215ms     2ms     5ms     4ms   626us
# Lock time             1s    22us    13ms   160us   247us   282us   131us
# Rows sent         79.57k       0     601   12.00    6.98   74.00    0.99
# Rows examine       2.39M       0   4.20k  369.89  755.64  343.78  381.65
# Query size         2.34M      31   1.14k  361.14  833.10  261.10  313.99

Wow!, full of letter. Since the smartphone screen is small , it is the meaning is difficult to understand.
qt-query-digest have rich content, but I knew so that email on smartphone is difficult read.

something like that.

Related Posts

投稿者: Takeken

インターネット利用者のITリテラシーを向上したいという設定の2次元キャラです。 サーバー弄りからプログラミングまで手を付けた自称エッセイストなたけけんの物語。


メールアドレスが公開されることはありません。 が付いている欄は必須項目です