{"id":3621,"date":"2013-10-23T15:11:47","date_gmt":"2013-10-23T06:11:47","guid":{"rendered":"http:\/\/www.vincentina.net\/?p=3621"},"modified":"2013-10-23T15:16:44","modified_gmt":"2013-10-23T06:16:44","slug":"slo%ef%bd%97querylog%e3%81%ae%e7%b5%90%e6%9e%9c%e3%81%8b%e3%82%89%e3%82%a4%e3%83%b3%e3%83%87%e3%83%83%e3%82%af%e3%82%b9%e3%82%92%e5%bc%b5%e3%81%a3%e3%81%a6%e3%81%bf%e3%81%9f","status":"publish","type":"post","link":"https:\/\/www.vincentina.net\/?p=3621","title":{"rendered":"Slo\uff57querylog\u306e\u7d50\u679c\u304b\u3089\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3092\u5f35\u3063\u3066\u307f\u305f"},"content":{"rendered":"<p>\u3082\u30462\u304b\u6708\u8fd1\u304f\u524d\u306e\u4e8b\u306b\u306a\u308b\u3051\u3069\u3001SlowqueryLog\u3092\u53d6\u308b\u3088\u3046\u306b\u8a2d\u5b9a\u3057\u305f\u3002<\/p>\n<p><a title=\"Slowquerylog\u3092\u53d6\u3063\u3066\u307f\u308b\u3053\u3068\u306b\u3057\u3066\u307f\u305f\" href=\"http:\/\/www.vincentina.net\/?p=3455\" target=\"_blank\" rel=\"bookmark\">Slowquerylog\u3092\u53d6\u3063\u3066\u307f\u308b\u3053\u3068\u306b\u3057\u3066\u307f\u305f<\/a><\/p>\n<p>\u6bce\u671d\u30ed\u30b0\u3092\u898b\u3066\u3044\u308b\u3082\u306e\u306e\u3001\u898b\u3066\u308b\u3060\u3051\uff5e\uff08\u61d0\u304b\u3057\u3044\u306a\u3042\uff09\u3067\u3068\u304f\u306b\u4f55\u3082\u3057\u3066\u3044\u306a\u304b\u3063\u305f\u306e\u3060\u304c\u3001\u3053\u308c\u3067\u306f\u5b9d\u306e\u6301\u3061\u8150\u308c\uff5e\u3063\u3060\u3063\u305f\u308f\u3051\u3060\u3051\u3069\u3001\u3053\u30532\u30ab\u6708\u304f\u3089\u3044\u305a\u3063\u3068\u4eee\u60f3\u74b0\u5883\u306b\u306f\u307e\u3063\u3066\u305f\u306e\u3067\u307e\u3042\u3044\u3044\u304b\u306a\u3068\u3002<\/p>\n<p>\u4eca\u306fDebian\u306ePreceed\u4f5c\u6210\u304c\u9806\u8abf\u306b\u9032\u3093\u3067\u3044\u308b\u3068\u3053\u3060\u3051\u3069\u3001\u6c17\u307e\u3050\u308c\u3067\u5225\u306e\u4e8b\u3092\u3061\u3087\u3053\u3063\u3068\u8abf\u3079\u305f\u3089\u3001\u3061\u3087\u3063\u3068\u306f\u307e\u3063\u3066\u3057\u307e\u3063\u3066\u3057\u3070\u3089\u304f\u5f04\u3063\u3066\u305f\u306e\u3067\u3001\u65e5\u8a18\u306b\u30a2\u30c3\u30d7\u3057\u3088\u3046\u3068\u601d\u3063\u305f\u3002<\/p>\n<h1>\u30ed\u30b0\u3092\u8abf\u3079\u3066\u307f\u3088\u3046<\/h1>\n<p>\u30e1\u30fc\u30eb\u3082\u6765\u3066\u3044\u308b\u3051\u3069\u3001\u305b\u3063\u304b\u304f\u30ed\u30b0\u30a4\u30f3\u3057\u305f\u3057\u30b3\u30de\u30f3\u30c9\u3067\u898b\u3066\u307f\u3088\u3046\u3002<\/p>\n<pre># mysqldumpslow -s t \/var\/lib\/mysql\/slow.log<\/pre>\n<p>\u4e0a\u306e\u30b3\u30de\u30f3\u30c9\u3067\u9806\u756a\u306b\u4e26\u3079\u3066\u304f\u308c\u308b\u3089\u3057\u3044\u3002\u3053\u3053\u6570\u65e5\u306e\u3082\u306e\u3092\u8abf\u3079\u3066\u307f\u305f\u30891\u500b\u3060\u3051\u6570\u5b57\u304c\u3067\u304b\u3044\u306e\u304c\u3042\u3063\u305f\u3002<\/p>\n<pre>Reading mysql slow query log from \/var\/lib\/mysql\/slow.log.20131022\r\nCount: 884\u00a0 Time=0.02s (20s)\u00a0 Lock=0.00s (0s)\u00a0 Rows=277.2 (245047), wpdata[wpdata]@localhost\r\n\u00a0 SELECT option_name, option_value FROM wp_options WHERE autoload = 'S'\r\n\r\nReading mysql slow query log from \/var\/lib\/mysql\/slow.log.20131023\r\nCount: 1165\u00a0 Time=0.02s (26s)\u00a0 Lock=0.00s (0s)\u00a0 Rows=277.6 (323453), wpdata[wpdata]@localhost\r\n\u00a0 SELECT option_name, option_value FROM wp_options WHERE autoload = 'S'\r\n\r\nReading mysql slow query log from \/var\/lib\/mysql\/slow.log.20131021\r\nCount: 1354\u00a0 Time=0.02s (31s)\u00a0 Lock=0.00s (0s)\u00a0 Rows=277.8 (376113), wpdata[wpdata]@localhost\r\n\u00a0 SELECT option_name, option_value FROM wp_options WHERE autoload = 'S'<\/pre>\n<p>\u3053\u308c\u306f\u6539\u5584\u306e\u4f59\u5730\u304c\u3042\u308a\u305d\u3046\u3060\uff08\u305f\u3076\u3093\uff09\u3002DB\u30b5\u30fc\u30d0\u30fc\u306e\u30c1\u30e5\u30fc\u30f3\u3067\u306fExplain\u3068\u3044\u3046\u306e\u304c\u5b9a\u756a\u306a\u3088\u3046\u3067\u3001\u305d\u306eExplain\u3092\u4f7f\u3063\u3066\u3053\u306e\u30c6\u30fc\u30d6\u30eb\u3092\u3061\u3087\u3063\u3068\u8abf\u3079\u3066\u307f\u308b\u3002<\/p>\n<pre>mysql&gt; EXPLAIN SELECT option_name, option_value FROM wp_options WHERE autoload = 'S'\\G;\r\n*************************** 1. row ***************************\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 id: 1\r\n\u00a0 select_type: SIMPLE\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 table: wp_options\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 type: ALL\r\npossible_keys: NULL\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 key: NULL\r\n\u00a0\u00a0\u00a0\u00a0\u00a0 key_len: NULL\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 ref: NULL\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 rows: 13516\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Extra: Using where\r\n1 row in set (0.00 sec)\r\n\r\nERROR: \r\nNo query specified<\/pre>\n<p>\u3053\u3093\u306a\u611f\u3058\u3089\u3057\u3044\u3002<br \/>\n\u30bf\u30a4\u30c8\u30eb\u306b\u3082\u306a\u3063\u3066\u308b\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3092\u5f35\u308b\u3063\u3066\u3053\u3068\u3060\u3051\u3069\u3001\u3053\u308c\u306f\u305d\u306e\u307e\u307e\u306e\u610f\u5473\u3067\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3092\u3064\u3051\u307e\u3059\u3002<br \/>\n\u3042\u306e\u6587\u623f\u5177\u5c4b\u3055\u3093\u3067\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u304f\u3060\u3055\u3044\u3063\u3066\u8a00\u3063\u305f\u3089\u51fa\u3066\u304f\u308b\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u305d\u306e\u3082\u306e\u3067\u3059\u308f\u3002<\/p>\n<p>\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3092\u5f35\u308b\u306e\u3082\u4f55\u7a2e\u985e\u304b\u65b9\u6cd5\u304c\u3042\u308b\u307f\u305f\u3044\u3060\u3051\u3069\u3001\u4eca\u56de\u306fCreate index\u3092\u4f7f\u3063\u305f\u3002<br \/>\n\u3063\u3066\u3044\u3046\u304bMysql\u306b\u306f\u5168\u7136\u8a73\u3057\u304f\u306a\u304f\u3063\u3066\u3001\u898b\u305f\u307e\u307e\u66f8\u3044\u3066\u308b\u306e\u3067\u305d\u3053\u306f\u53c2\u8003\u306b\u3057\u3088\u3046\u3068\u3057\u3066\u3044\u308b\u4eba\u306f\u6ce8\u610f\u3057\u3066\u306a\u3002<\/p>\n<p>\u30ed\u30b0\u30a4\u30f3\u3057\u3066\u3055\u3063\u305d\u304f\u5f35\u3063\u3066\u307f\u308b\u3002<\/p>\n<pre>mysql&gt; create index idx01_wp_options on wp_options(autoload);\r\nQuery OK, 14331 rows affected (0.35 sec)\r\nRecords: 14331\u00a0 Duplicates: 0\u00a0 Warnings: 0<\/pre>\n<p>\u3053\u308c\u3067\u7d42\u308f\u308a\u3060\u3002\u3067\u306f\u3082\u3063\u304b\u3044Explain\u3067\u30c6\u30fc\u30d6\u30eb\u3092\u898b\u308b\u3068\u3002<\/p>\n<pre>mysql&gt; EXPLAIN SELECT option_name, option_value FROM wp_options WHERE autoload = 'S'\\G;\r\n*************************** 1. row ***************************\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 id: 1\r\n\u00a0 select_type: SIMPLE\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 table: wp_options\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 type: ref\r\npossible_keys: idx01_wp_options\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 key: idx01_wp_options\r\n\u00a0\u00a0\u00a0\u00a0\u00a0 key_len: 62\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 ref: const\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 rows: 1\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Extra: Using where\r\n1 row in set (0.00 sec)\r\n\r\nERROR: \r\nNo query specified<\/pre>\n<p>\u3053\u308c\u3067\u660e\u65e5\u4ee5\u964d\u306e\u30ed\u30b0\u3092\u898b\u3066\u306e\u304a\u697d\u3057\u307f\u3063\u3066\u306a\u3002<br \/>\n\u3082\u306e\u306b\u3088\u3063\u3066\u306f\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u306f\u5f35\u3089\u305a\u306bALL\u306e\u307e\u307e\u306e\u65b9\u304c\u826f\u304b\u3063\u305f\u308a\u3059\u308b\u3089\u3057\u3044\u306e\u3067\u3001\u8a2d\u5b9a\u3057\u3066\u8ca0\u8377\u304c\u4e0a\u304c\u3063\u305f\u308a\u3057\u305f\u3089\u5373\u6b62\u3081\u3067\u3044\u3044\u3068\u601d\u3046\u3051\u3069\u3001\u3058\u3063\u304f\u308a\u6642\u9593\u3092\u304b\u3051\u308b\u5fc5\u8981\u304c\u3042\u308a\u305d\u3046\u3060\u306d\u3002<\/p>\n<p>\u4eca\u56de\u306f\u30c6\u30fc\u30d6\u30eb1\u500b\u3067\u7d42\u308f\u308b\u3051\u3069\uff57<\/p>\n<p>\u307e\u3060\u307b\u304b\u306b\u3082\u30c1\u30e5\u30fc\u30f3\u3067\u304d\u305d\u3046\u306a\u30ed\u30b0\u306f\u3042\u308b\u306e\u3067\u3001\u4eca\u56de\u306e\u7d50\u679c\u304c\u826f\u304b\u3063\u305f\u3089\u307e\u305f\u3084\u308a\u305f\u3044\u3067\u3059\u306d\u3002<\/p>\n<p>\u53c2\u8003\u30b5\u30a4\u30c8<\/p>\n<p>\u30d7\u30ed\u30b0\u30e9\u30e0\u3068\u7d75\u3068\u5199\u771f<br \/>\n<a href=\"http:\/\/www.kakashi.biz\/%E3%83%97%E3%83%AD%E3%82%B0%E3%83%A9%E3%83%A0\/mysql5-5-%E3%81%A7-slow-query-log-%E3%82%B9%E3%83%AD%E3%83%BC%E3%82%AF%E3%82%A8%E3%83%AA%E3%83%BC%E3%83%AD%E3%82%B0-%E3%82%92%E6%8E%A1%E3%82%8B\/\" target=\"_blank\">mysql5.5 \u3067 slow query log \u30b9\u30ed\u30fc\u30af\u30a8\u30ea\u30fc\u30ed\u30b0 \u3092\u63a1\u308b<\/a><\/p>\n<p>QuickKnowLedge<br \/>\n<a href=\"http:\/\/www.s-quad.com\/wordpress\/?p=762\" target=\"_blank\">\u9045\u3044\u30af\u30a8\u30ea\u30fc\u3092\u691c\u51fa\u3059\u308b\u2460<\/a><\/p>\n<p>MySQL.COM<br \/>\n<a href=\"http:\/\/dev.mysql.com\/doc\/refman\/5.1\/ja\/explain.html\" target=\"_blank\">6.2.1. <code>EXPLAIN<\/code>\u3092\u4f7f\u7528\u3057\u3066\u3001\u30af\u30a8\u30ea\u3092\u6700\u9069\u5316\u3059\u308b<\/a><\/p>\n<p>&nbsp;<\/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=3621\" data-text=\"Slo\uff57querylog\u306e\u7d50\u679c\u304b\u3089\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3092\u5f35\u3063\u3066\u307f\u305f\" data-via=\"TakekenTw\" data-lang=\"ja\">Tweet<\/a><\/div><\/div>\n<br class='wp_social_bookmarking_light_clear' \/>\n","protected":false},"excerpt":{"rendered":"<p>\u3082\u30462\u304b\u6708\u8fd1\u304f\u524d\u306e\u4e8b\u306b\u306a\u308b\u3051\u3069\u3001SlowqueryLog\u3092\u53d6\u308b\u3088\u3046\u306b\u8a2d\u5b9a\u3057\u305f\u3002 Slowquerylog\u3092\u53d6\u3063\u3066\u307f\u308b\u3053\u3068\u306b\u3057\u3066\u307f\u305f \u6bce\u671d\u30ed\u30b0\u3092\u898b\u3066\u3044\u308b\u3082\u306e\u306e\u3001\u898b\u3066\u308b\u3060\u3051\uff5e\uff08\u61d0\u304b\u3057\u3044\u306a\u3042\uff09\u3067\u3068\u304f\u306b\u4f55\u3082\u3057\u3066\u3044\u306a\u304b\u3063\u305f\u306e\u3060\u304c\u3001 &hellip; <a href=\"https:\/\/www.vincentina.net\/?p=3621\" class=\"more-link\"><span class=\"screen-reader-text\">&#8220;Slo\uff57querylog\u306e\u7d50\u679c\u304b\u3089\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3092\u5f35\u3063\u3066\u307f\u305f&#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":[6],"tags":[],"class_list":["post-3621","post","type-post","status-publish","format-standard","hentry","category-server"],"_links":{"self":[{"href":"https:\/\/www.vincentina.net\/index.php?rest_route=\/wp\/v2\/posts\/3621","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=3621"}],"version-history":[{"count":0,"href":"https:\/\/www.vincentina.net\/index.php?rest_route=\/wp\/v2\/posts\/3621\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.vincentina.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3621"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.vincentina.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3621"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.vincentina.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3621"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}