{"id":5499,"date":"2015-08-28T21:05:17","date_gmt":"2015-08-28T12:05:17","guid":{"rendered":"http:\/\/www.vincentina.net\/?p=5499"},"modified":"2020-02-23T18:48:13","modified_gmt":"2020-02-23T09:48:13","slug":"slow-query-report-to-be-changed-to-from-mysqldumpslow-to-qt-digest","status":"publish","type":"post","link":"https:\/\/www.vincentina.net\/?p=5499","title":{"rendered":"slow query report to be changed to from Mysqldumpslow to Qt-digest"},"content":{"rendered":"<p>At last the long hot days came to nearly over.<br \/>\nI&#8217;m takeken, How are you doing?<\/p>\n<p>A survey on a mysql slow queries was using the Mysqldumpslow, and I would like to use the Qt-digest on a whim.<\/p>\n<p>How to install.<\/p>\n<p>This is simple enough.<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nsudo rpm -ivh https:\/\/www.percona.com\/downloads\/percona-toolkit\/2.2.14\/RPM\/percona-toolkit-2.2.14-1.noarch.rpm\r\n<\/pre>\n<p>that&#8217;s all.<\/p>\n<p>well.<\/p>\n<p>How to use.<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nsudo pt-query-digest \/to\/path\/slow.log &gt; digest.txt\r\n<\/pre>\n<p>OK?<\/p>\n<p>And, let&#8217;s &#8220;crontab -e&#8221;<\/p>\n<p>OK?<\/p>\n<p>Let&#8217;s An email comes on the next morning.<\/p>\n<p>In mysqldumpslow case.<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nCount: 1  Time=0.02s (0s)  Lock=0.00s (0s)  Rows=0.0 (0), wpdata&#x5B;wpdata]@localhost\r\n  SELECT v.postid AS id FROM wp_popularpostsdata v WHERE NOT EXISTS (SELECT p.ID FROM wp_posts p WHERE v.postid = p.ID)\r\n\r\nCount: 6  Time=0.01s (0s)  Lock=0.00s (0s)  Rows=1.0 (6), wpdata&#x5B;wpdata]@localhost\r\n  SELECT COUNT(*) FROM wp_comments WHERE user_id = N AND comment_approved = N\r\n<\/pre>\n<p>Look at result, Very simple.<\/p>\n<p>In qt-query-digest case.<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n# 4.4s user time, 100ms system time, 25.77M rss, 113.67M vsz\r\n# Current date: Thu Aug 27 04:00:06 2015\r\n# Hostname: vincentina\r\n# Files: \/var\/lib\/mysql\/slow.log\r\n# Overall: 6.79k total, 17 unique, 0.08 QPS, 0.00x concurrency ___________\r\n# Time range: 2015-08-26 04:00:43 to 2015-08-27 04:00:00\r\n# Attribute          total     min     max     avg     95%  stddev  median\r\n# ============     ======= ======= ======= ======= ======= ======= =======\r\n# Exec time            11s   142us   215ms     2ms     5ms     4ms   626us\r\n# Lock time             1s    22us    13ms   160us   247us   282us   131us\r\n# Rows sent         79.57k       0     601   12.00    6.98   74.00    0.99\r\n# Rows examine       2.39M       0   4.20k  369.89  755.64  343.78  381.65\r\n# Query size         2.34M      31   1.14k  361.14  833.10  261.10  313.99\r\n<\/pre>\n<p>Wow!, full of letter. Since the smartphone screen is small , it is the meaning is difficult to understand.<br \/>\nqt-query-digest have rich content, but I knew so that email on smartphone is difficult read.<\/p>\n<p>something like that.<\/p>\n<div class='wp_social_bookmarking_light'>        <div class=\"wsbl_twitter\"><a href=\"https:\/\/twitter.com\/share\" class=\"twitter-share-button\" data-url=\"https:\/\/www.vincentina.net\/?p=5499\" data-text=\"slow query report to be changed to from Mysqldumpslow to Qt-digest\" data-via=\"TakekenTw\" data-lang=\"ja\">Tweet<\/a><\/div><\/div>\n<br class='wp_social_bookmarking_light_clear' \/>\n","protected":false},"excerpt":{"rendered":"<p>At last the long hot days came to nearly over. I&#8217;m takeken, How are you doing? A survey on a mysql slow  &hellip; <a href=\"https:\/\/www.vincentina.net\/?p=5499\" class=\"more-link\"><span class=\"screen-reader-text\">&#8220;slow query report to be changed to from Mysqldumpslow to Qt-digest&#8221; \u306e<\/span>\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[117],"tags":[],"class_list":["post-5499","post","type-post","status-publish","format-standard","hentry","category-english"],"_links":{"self":[{"href":"https:\/\/www.vincentina.net\/index.php?rest_route=\/wp\/v2\/posts\/5499","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.vincentina.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.vincentina.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.vincentina.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.vincentina.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5499"}],"version-history":[{"count":0,"href":"https:\/\/www.vincentina.net\/index.php?rest_route=\/wp\/v2\/posts\/5499\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.vincentina.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5499"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.vincentina.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5499"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.vincentina.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5499"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}