{"id":7076,"date":"2024-11-14T08:57:36","date_gmt":"2024-11-14T00:57:36","guid":{"rendered":"https:\/\/fwq.ai\/blog\/7076\/"},"modified":"2024-11-14T08:57:36","modified_gmt":"2024-11-14T00:57:36","slug":"%e4%b8%ba%e4%bb%80%e4%b9%88-select-from-new_pool-where-chlid-news_top-%e7%9a%84-explain-%e7%bb%93%e6%9e%9c%e4%b8%ad-indextype-%e4%b8%ba-all%ef%bc%9f","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/7076\/","title":{"rendered":"\u4e3a\u4ec0\u4e48 `select * from new_pool where chlid != &#8220;news_top&#8221; &#038;&#038; chlid != &#8220;news_ent&#8221; limit 1;` \u7684 `EXPLAIN` \u7ed3\u679c\u4e2d `indexType` \u4e3a `ALL`\uff1f"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/173042085622065.jpg\" class=\"aligncenter\" title=\"\u4e3a\u4ec0\u4e48 `select * from new_pool where chlid != &#8220;news_top&#8221; &#038;&#038; chlid != &#8220;news_ent&#8221; limit 1;` \u7684 `EXPLAIN` \u7ed3\u679c\u4e2d `indexType` \u4e3a `ALL`\uff1f\u63d2\u56fe\" alt=\"\u4e3a\u4ec0\u4e48 `select * from new_pool where chlid != &#8220;news_top&#8221; &#038;&#038; chlid != &#8220;news_ent&#8221; limit 1;` \u7684 `EXPLAIN` \u7ed3\u679c\u4e2d `indexType` \u4e3a `ALL`\uff1f\u63d2\u56fe\" \/><\/p>\n<p><strong>MySQL EXPLAIN \u4e2d indexType \u4e3a All \u7684\u539f\u56e0<\/strong><\/p>\n<p>\u5728 MySQL \u4e2d\uff0cEXPLAIN \u8bed\u53e5\u53ef\u4ee5\u7528\u6765\u5206\u6790\u67e5\u8be2\u8ba1\u5212\uff0c\u5176\u4e2d indexType \u5217\u8868\u793a\u4e86\u67e5\u8be2\u6240\u4f7f\u7528\u7684\u7d22\u5f15\u7c7b\u578b\u3002\u7136\u800c\uff0c\u5728\u67d0\u4e9b\u60c5\u51b5\u4e0b\uff0c\u67e5\u8be2\u53ef\u80fd\u4e0d\u4f1a\u4f7f\u7528\u7d22\u5f15\uff0c\u800c\u662f\u8fdb\u884c\u5168\u8868\u626b\u63cf\uff0c\u6b64\u65f6 indexType \u4f1a\u663e\u793a\u4e3a ALL\u3002<\/p>\n<p>\u8fd9\u7bc7\u6587\u7ae0\u5c31\u5c06\u63a2\u8ba8\u4e00\u4e2a\u793a\u4f8b\u67e5\u8be2\uff0c\u5373 select * from new_pool where chlid != &#8220;news_top&#8221; &amp;&amp; chlid != &#8220;news_ent&#8221; limit 1;\uff0c\u5e76\u89e3\u91ca\u4e3a\u4ec0\u4e48\u5b83\u7684 indexType \u4e3a ALL\u3002<\/p>\n<p><strong>\u95ee\u9898\u5206\u6790<\/strong><\/p>\n<p>\u793a\u4f8b\u67e5\u8be2\u7684 new_pool \u8868\u5177\u6709\u4e00\u4e2a\u591a\u5217\u7d22\u5f15 (chlid, indexType, pubtime)\u3002\u4f46\u5f53\u6267\u884c EXPLAIN \u65f6\uff0c\u53d1\u73b0\u5b83\u7684 indexType \u5374\u662f ALL\u3002<\/p>\n<p><strong>\u539f\u56e0<\/strong><\/p>\n<p>MySQL \u4f18\u5316\u5668\u4f1a\u5c06\u4f7f\u7528\u7d22\u5f15\u4e0e\u5168\u8868\u626b\u63cf\u7684\u6210\u672c\u8fdb\u884c\u6bd4\u8f83\u3002\u5982\u679c\u4f7f\u7528\u7d22\u5f15\u7684\u6210\u672c\u8d85\u8fc7\u4e00\u5b9a\u9608\u503c\uff0c\u4f18\u5316\u5668\u5c31\u4f1a\u9009\u62e9\u8fdb\u884c\u5168\u8868\u626b\u63cf\u3002<\/p>\n<p>\u5728\u793a\u4f8b\u67e5\u8be2\u4e2d\uff0c\u7531\u4e8e != \u64cd\u4f5c\u7b26\u7684\u6210\u672c\u5f88\u9ad8\uff0c\u4f7f\u7528\u7d22\u5f15\u7684\u6210\u672c\u53ef\u80fd\u8d85\u8fc7\u4e86\u5168\u8868\u626b\u63cf\u7684\u6210\u672c\u3002\u56e0\u6b64\uff0c\u4f18\u5316\u5668\u9009\u62e9\u4e86\u5168\u8868\u626b\u63cf\uff0c\u5bfc\u81f4 indexType \u663e\u793a\u4e3a ALL\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u4e3a\u4ec0\u4e48 `select * from new_pool where chlid != &#8220;news_top&#8221; &amp;&amp; chlid != &#8220;news_ent&#8221; limit 1;` \u7684 `EXPLAIN` \u7ed3\u679c\u4e2d `indexType` \u4e3a `ALL`\uff1f\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u7f51\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>MySQL EXPLAIN \u4e2d indexType \u4e3a All \u7684\u539f\u56e0 \u5728 MySQL \u4e2d\uff0cEXPLAIN \u8bed\u53e5\u53ef\u4ee5\u7528\u6765\u5206\u6790\u67e5\u8be2\u8ba1\u5212\uff0c\u5176\u4e2d indexType \u5217\u8868\u793a\u4e86\u67e5\u8be2\u6240\u4f7f\u7528\u7684\u7d22\u5f15\u7c7b\u578b\u3002\u7136\u800c\uff0c\u5728\u67d0\u4e9b\u60c5\u51b5\u4e0b\uff0c\u67e5\u8be2\u53ef\u80fd\u4e0d\u4f1a\u4f7f\u7528\u7d22\u5f15\uff0c\u800c\u662f\u8fdb\u884c\u5168\u8868\u626b\u63cf\uff0c\u6b64\u65f6 indexType \u4f1a\u663e\u793a\u4e3a ALL\u3002 \u8fd9\u7bc7\u6587\u7ae0\u5c31\u5c06\u63a2\u8ba8\u4e00\u4e2a\u793a\u4f8b\u67e5\u8be2\uff0c\u5373 select * from new_pool where chlid != &#8220;news_top&#8221; &amp;&amp; chlid != &#8220;news_ent&#8221; limit 1;\uff0c\u5e76\u89e3\u91ca\u4e3a\u4ec0\u4e48\u5b83\u7684 indexType \u4e3a ALL\u3002 \u95ee\u9898\u5206\u6790 \u793a\u4f8b\u67e5\u8be2\u7684 new_pool \u8868\u5177\u6709\u4e00\u4e2a\u591a\u5217\u7d22\u5f15 (chlid, indexType, pubtime)\u3002\u4f46\u5f53\u6267\u884c EXPLAIN \u65f6\uff0c\u53d1\u73b0\u5b83\u7684 indexType \u5374\u662f ALL\u3002 \u539f\u56e0 MySQL \u4f18\u5316\u5668\u4f1a\u5c06\u4f7f\u7528\u7d22\u5f15\u4e0e\u5168\u8868\u626b\u63cf\u7684\u6210\u672c\u8fdb\u884c\u6bd4\u8f83\u3002\u5982\u679c\u4f7f\u7528\u7d22\u5f15\u7684\u6210\u672c\u8d85\u8fc7\u4e00\u5b9a\u9608\u503c\uff0c\u4f18\u5316\u5668\u5c31\u4f1a\u9009\u62e9\u8fdb\u884c\u5168\u8868\u626b\u63cf\u3002 \u5728\u793a\u4f8b\u67e5\u8be2\u4e2d\uff0c\u7531\u4e8e != \u64cd\u4f5c\u7b26\u7684\u6210\u672c\u5f88\u9ad8\uff0c\u4f7f\u7528\u7d22\u5f15\u7684\u6210\u672c\u53ef\u80fd\u8d85\u8fc7\u4e86\u5168\u8868\u626b\u63cf\u7684\u6210\u672c\u3002\u56e0\u6b64\uff0c\u4f18\u5316\u5668\u9009\u62e9\u4e86\u5168\u8868\u626b\u63cf\uff0c\u5bfc\u81f4 indexType \u663e\u793a\u4e3a ALL\u3002 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-7076","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/7076","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=7076"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/7076\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=7076"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=7076"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=7076"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}