{"id":1627,"date":"2022-11-21T14:05:20","date_gmt":"2022-11-21T06:05:20","guid":{"rendered":"https:\/\/qaqaq.top\/?p=1627"},"modified":"2022-11-27T12:40:57","modified_gmt":"2022-11-27T04:40:57","slug":"mysqldumpslow%e7%94%a8%e6%b3%95%e8%ae%b2%e8%a7%a3","status":"publish","type":"post","link":"https:\/\/qaqaq.top\/?p=1627","title":{"rendered":"mysqldumpslow\u7528\u6cd5\u8bb2\u89e3"},"content":{"rendered":"\n<p>mysqldumpslow \u662fmysql\u5b98\u65b9\u63d0\u4f9b\u7684\u4e00\u4e2a\u6162\u65e5\u5fd7\u5206\u6790\u5de5\u5177<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># mysqldumpslow --help   ----------------------------------------------------\/\/\u6267\u884c\u547d\u4ee4\r\nUsage: mysqldumpslow &#91; OPTS... ] &#91; LOGS... ]\r\n \r\nParse and summarize the MySQL slow query log. Options are\r\n \r\n  --verbose    verbose\r\n  --debug      debug\r\n  --help       write this text to standard output\r\n \r\n  -v           verbose\r\n  -d           debug\r\n  -s ORDER     what to sort by (al, at, ar, c, l, r, t), 'at' is default\r\n                al: average lock time\r\n                ar: average rows sent\r\n                at: average query time\r\n                 c: count\r\n                 l: lock time\r\n                 r: rows sent\r\n                 t: query time  \r\n  -r           reverse the sort order (largest last instead of first)\r\n  -t NUM       just show the top n queries\r\n  -a           don't abstract all numbers to N and strings to 'S'\r\n  -n NUM       abstract numbers with at least n digits within names\r\n  -g PATTERN   grep: only consider stmts that include this string\r\n  -h HOSTNAME  hostname of db server for *-slow.log filename (can be wildcard),\r\n               default is '*', i.e. match all\r\n  -i NAME      name of server instance (if using mysql.server startup script)\r\n  -l           don't subtract lock time from total time<\/code><\/pre>\n\n\n\n<p>s:\u662f\u8868\u793a\u6309\u7167\u4f55\u79cd\u65b9\u5f0f\u6392\u5e8f<br>c:\u8bbf\u95ee\u6b21\u6570<br>i\uff1a\u9501\u5b9a\u65f6\u95f4<br>r\uff1a\u8fd4\u56de\u8bb0\u5f55<br>t\uff1a\u67e5\u8be2\u65f6\u95f4<br>al:\u5e73\u5747\u9501\u5b9a\u65f6\u95f4<br>ar\uff1a\u5e73\u5747\u8fd4\u56de\u8bb0\u5f55\u6570<br>at\uff1a\u5e73\u5747\u67e5\u8be2\u65f6\u95f4<br>t\uff1a\u5373\u4e3a\u8fd4\u56de\u524d\u9762\u591a\u5c11\u6761\u6570\u636e<br>g\uff1a\u540e\u8fb9\u642d\u914d\u4e00\u4e2a\u6b63\u5219\u5339\u914d\u6a21\u5f0f\uff0c\u5927\u5c0f\u5199\u4e0d\u654f\u611f<\/p>\n\n\n\n<p>1 \u8bbf\u95ee\u6b21\u6570\u6700\u591a\u768420\u4e2asql\u8bed\u53e5<\/p>\n\n\n\n<p>mysqldumpslow -s c -t 20 1d0a52e2683d-slow.log<\/p>\n\n\n\n<p>2 \u8fd4\u56de\u8bb0\u5f55\u96c6\u6700\u591a\u768420\u4e2asql<\/p>\n\n\n\n<p>mysqldumpslow -s r -t 20 1d0a52e2683d-slow.log<\/p>\n\n\n\n<p>3 \u5f97\u5230\u6309\u7167\u65f6\u95f4\u6392\u5e8f\u7684\u524d10\u6761\u91cc\u9762\u542b\u6709\u505a\u4e86\u8fde\u63a5\u7684\u67e5\u8be2SQL<\/p>\n\n\n\n<p>mysqldumpslow -s t -t 10 -g &#8220;left join&#8221; \/data\/mysql\/mysql-slow.log \/<\/p>\n","protected":false},"excerpt":{"rendered":"<p>mysqldumpslow \u662fmysql\u5b98\u65b9\u63d0\u4f9b\u7684\u4e00\u4e2a\u6162\u65e5\u5fd7\u5206\u6790\u5de5\u5177 s:\u662f\u8868\u793a\u6309\u7167\u4f55\u79cd\u65b9\u5f0f\u6392\u5e8fc:\u8bbf\u95ee\u6b21\u6570i [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[31],"tags":[47],"class_list":["post-1627","post","type-post","status-publish","format-standard","hentry","category-mysql-","tag-mysql"],"_links":{"self":[{"href":"https:\/\/qaqaq.top\/index.php?rest_route=\/wp\/v2\/posts\/1627"}],"collection":[{"href":"https:\/\/qaqaq.top\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/qaqaq.top\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/qaqaq.top\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/qaqaq.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1627"}],"version-history":[{"count":1,"href":"https:\/\/qaqaq.top\/index.php?rest_route=\/wp\/v2\/posts\/1627\/revisions"}],"predecessor-version":[{"id":1628,"href":"https:\/\/qaqaq.top\/index.php?rest_route=\/wp\/v2\/posts\/1627\/revisions\/1628"}],"wp:attachment":[{"href":"https:\/\/qaqaq.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1627"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/qaqaq.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1627"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/qaqaq.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1627"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}