{"id":16333,"date":"2024-09-11T15:48:33","date_gmt":"2024-09-11T07:48:33","guid":{"rendered":"https:\/\/92it.top\/?p=16333"},"modified":"2024-09-11T15:48:33","modified_gmt":"2024-09-11T07:48:33","slug":"mysql-explain%e6%89%a7%e8%a1%8c%e8%ae%a1%e5%88%92%ef%bc%8c%e5%a6%82%e4%bd%95%e5%88%86%e6%9e%90%ef%bc%9f","status":"publish","type":"post","link":"https:\/\/92it.top\/?p=16333","title":{"rendered":"MySQL EXPLAIN\u6267\u884c\u8ba1\u5212\uff0c\u5982\u4f55\u5206\u6790\uff1f"},"content":{"rendered":"\n<p>\u8f6c\u8f7d\uff1a<a href=\"https:\/\/mp.weixin.qq.com\/s?__biz=MzIwNDAyOTI2Nw==&amp;mid=2247499359&amp;idx=1&amp;sn=9cee009edbeeba50aaf8bed342dabb42&amp;chksm=96c4d263a1b35b75c646509ab734c3efc2a2ee287ad9cc258f620b77ee5578357460b21e3235&amp;cur_album_id=2818595943724974083&amp;scene=190#rd\">MySQL EXPLAIN\u6267\u884c\u8ba1\u5212\uff0c\u5982\u4f55\u5206\u6790\uff1f<\/a><\/p>\n\n\n\n<p>\u5728\u5b9e\u9645\u5f00\u53d1\u4e2d\uff0c\u5982\u679c\u9009\u62e9\u7684\u662f MySQL \u6570\u636e\u5e93\uff0c\u901a\u5e38\u4f1a\u4f7f\u7528<code>EXPLAIN<\/code>\u5173\u952e\u5b57\u6765\u663e\u793a\u67e5\u8be2 SQL \u7684\u6267\u884c\u8ba1\u5212\uff0c\u4ece\u800c\u5e2e\u52a9\u6211\u4eec\u4f18\u5316\u67e5\u8be2\u6027\u80fd\u3002\u90a3\u4e48\uff0c<code>EXPLAIN<\/code>\u662f\u5982\u4f55\u5de5\u4f5c\u7684\uff1f<code>EXPLAIN<\/code>\u7ed3\u679c\u91cc\u9762\u7684\u5b57\u6bb5\u8be5\u5982\u4f55\u7406\u89e3\uff0c\u8fd9\u7bc7\u6587\u7ae0\uff0c\u6211\u4eec\u5c06\u8be6\u7ec6\u5206\u6790\u3002<\/p>\n\n\n\n<p><strong>\u5b57\u6bb5\u89e3\u6790<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p>\u5f53\u6211\u4eec\u5bf9\u4e00\u4e2a\u67e5\u8be2\u8bed\u53e5\u6267\u884c<code>EXPLAIN<\/code>\u65f6\uff0c<code>EXPLAIN<\/code>\u901a\u5e38\u4f1a\u8fd4\u56de\u4ee5\u4e0b\u5b57\u6bb5\uff0c\u4e0b\u9762\u6211\u4eec\u5c06\u5bf9\u5404\u4e2a\u5217\u7684\u542b\u4e49\u53ca\u5176\u793a\u4f8b\u8fdb\u884c\u8bf4\u660e\u3002<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>id<\/th><th>select_type<\/th><th>table<\/th><th>partitions<\/th><th>type<\/th><th>possible_keys<\/th><th>key<\/th><th>key_len<\/th><th>ref<\/th><th>rows<\/th><th>filtered<\/th><th>Extra<\/th><\/tr><\/thead><tbody><tr><td>1<\/td><td>SIMPLE<\/td><td>users<\/td><td>NULL<\/td><td>ALL<\/td><td>NULL<\/td><td>NULL<\/td><td>NULL<\/td><td>NULL<\/td><td>1000<\/td><td>10.00<\/td><td>Using where<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p><strong>1. id<\/strong><\/p>\n\n\n\n<p><code>id<\/code>\u8868\u793a\u67e5\u8be2\u7684\u6807\u8bc6\u7b26\u3002\u5982\u679c\u4e00\u4e2a\u67e5\u8be2\u5305\u542b\u5b50\u67e5\u8be2\u6216\u8054\u5408\u67e5\u8be2\uff0c\u6bcf\u4e2a\u5b50\u67e5\u8be2\u6216\u8054\u5408\u67e5\u8be2\u90fd\u4f1a\u6709\u4e00\u4e2a\u552f\u4e00\u7684 id\u3002\u6bd4\u5982\uff1a<code>1<\/code><\/p>\n\n\n\n<p><strong>2. select_type<\/strong><\/p>\n\n\n\n<p><code>select_type<\/code>\u8868\u793a\u67e5\u8be2\u7684\u7c7b\u578b\uff0c\u8868\u793a\u67e5\u8be2\u662f\u7b80\u5355\u67e5\u8be2\u3001\u8054\u5408\u67e5\u8be2\u3001\u5b50\u67e5\u8be2\u7b49\u3002<\/p>\n\n\n\n<p>\u5e38\u89c1\u503c\uff1a<\/p>\n\n\n\n<ul>\n<li><code>SIMPLE<\/code>: \u7b80\u5355\u67e5\u8be2\uff0c\u4e0d\u5305\u542b\u5b50\u67e5\u8be2\u6216\u8054\u5408\u67e5\u8be2\u3002<\/li>\n\n\n\n<li><code>PRIMARY<\/code>: \u6700\u5916\u5c42\u67e5\u8be2\u3002<\/li>\n\n\n\n<li><code>SUBQUERY<\/code>: \u5b50\u67e5\u8be2\u4e2d\u7684\u7b2c\u4e00\u4e2a SELECT\u3002<\/li>\n\n\n\n<li><code>DERIVED<\/code>: \u6d3e\u751f\u8868\uff08\u5b50\u67e5\u8be2\u4e2d\u7684 FROM \u5b50\u53e5\uff09\u3002<\/li>\n<\/ul>\n\n\n\n<p>\u6bd4\u5982\uff1a<code>SIMPLE<\/code><\/p>\n\n\n\n<p><strong>3. table<\/strong><\/p>\n\n\n\n<p><code>table<\/code>\u4ee3\u8868\u4e86\u67e5\u8be2\u6d89\u53ca\u7684\u8868\u540d\u6216\u522b\u540d\u3002<\/p>\n\n\n\n<p>\u6bd4\u5982\uff1a<code>users<\/code><\/p>\n\n\n\n<p><strong>4. partitions<\/strong><\/p>\n\n\n\n<p><code>partitions<\/code>\u4ee3\u8868\u67e5\u8be2\u6d89\u53ca\u7684\u5206\u533a\uff08\u5982\u679c\u6709\uff09\u3002\u6bd4\u5982\uff1a<code>NULL<\/code><\/p>\n\n\n\n<p><strong>5. type<\/strong><\/p>\n\n\n\n<p><code>type<\/code>\u8868\u793a\u8fde\u63a5\u7c7b\u578b\uff0c\u53cd\u6620\u4e86 MySQL \u5982\u4f55\u67e5\u627e\u8868\u4e2d\u7684\u884c\u3002<\/p>\n\n\n\n<p>\u5e38\u89c1\u503c\uff08\u6309\u6548\u7387\u4ece\u9ad8\u5230\u4f4e\u6392\u5e8f\uff09\uff1a<\/p>\n\n\n\n<ul>\n<li><code>system<\/code>: \u8868\u53ea\u6709\u4e00\u884c\uff08\u7b49\u540c\u4e8e\u7cfb\u7edf\u8868\uff09\u3002<\/li>\n\n\n\n<li><code>const<\/code>: \u8868\u6700\u591a\u6709\u4e00\u4e2a\u5339\u914d\u884c\uff08\u4e3b\u952e\u6216\u552f\u4e00\u7d22\u5f15\uff09\u3002<\/li>\n\n\n\n<li><code>eq_ref<\/code>: \u5bf9\u4e8e\u6bcf\u4e2a\u6765\u81ea\u524d\u8868\u7684\u884c\u7ec4\u5408\uff0c\u4ece\u8be5\u8868\u8bfb\u53d6\u4e00\u884c\u3002<\/li>\n\n\n\n<li><code>ref<\/code>: \u5bf9\u4e8e\u6bcf\u4e2a\u6765\u81ea\u524d\u8868\u7684\u884c\u7ec4\u5408\uff0c\u4ece\u8be5\u8868\u8bfb\u53d6\u6240\u6709\u5339\u914d\u884c\u3002<\/li>\n\n\n\n<li><code>range<\/code>: \u53ea\u68c0\u7d22\u7ed9\u5b9a\u8303\u56f4\u7684\u884c\uff0c\u4f7f\u7528\u7d22\u5f15\u6765\u9009\u62e9\u884c\u3002<\/li>\n\n\n\n<li><code>index<\/code>: \u5168\u7d22\u5f15\u626b\u63cf\u3002<\/li>\n\n\n\n<li><code>ALL<\/code>: \u5168\u8868\u626b\u63cf\u3002<\/li>\n<\/ul>\n\n\n\n<p>\u6bd4\u5982\uff1a<code>ref<\/code><\/p>\n\n\n\n<p><strong>6. possible_keys<\/strong><code>possible_keys<\/code>\u8868\u793a MySQL \u8ba4\u4e3a\u53ef\u4ee5\u4f7f\u7528\u7684\u7d22\u5f15\u3002\u6bd4\u5982\uff1a<code>PRIMARY<\/code><\/p>\n\n\n\n<p><strong>7. key<\/strong><code>key<\/code>\u8868\u793a\u5b9e\u9645\u4f7f\u7528\u7684\u7d22\u5f15\u3002\u6bd4\u5982\uff1a<code>PRIMARY<\/code><\/p>\n\n\n\n<p><strong>8. key_len<\/strong><code>key_len<\/code>\u8868\u793a\u4f7f\u7528\u7684\u7d22\u5f15\u7684\u957f\u5ea6\u3002\u6bd4\u5982\uff1a<code>4<\/code><\/p>\n\n\n\n<p><strong>9. ref<\/strong><code>ref<\/code>\u663e\u793a\u4f7f\u7528\u54ea\u4e2a\u5217\u6216\u5e38\u6570\u4e0e key \u4e00\u8d77\u4ece\u8868\u4e2d\u9009\u62e9\u884c\u3002\u6bd4\u5982\uff1a<code>const<\/code><\/p>\n\n\n\n<p><strong>10. rows<\/strong><code>rows<\/code>\u8868\u793a MySQL \u4f30\u8ba1\u8981\u626b\u63cf\u7684\u884c\u6570\u3002\u6bd4\u5982\uff1a<code>1<\/code><\/p>\n\n\n\n<p><strong>11. filtered<\/strong><\/p>\n\n\n\n<p><code>filtered<\/code>\u8868\u793a\u8fd4\u56de\u7ed3\u679c\u7684\u884c\u5360\u603b\u884c\u6570\u7684\u767e\u5206\u6bd4\u3002\u6bd4\u5982\uff1a<code>100.00<\/code><\/p>\n\n\n\n<p><strong>12. Extra<\/strong><code>Extra<\/code>\u8868\u793a\u989d\u5916\u7684\u4fe1\u606f\uff0c\u63cf\u8ff0\u67e5\u8be2\u6267\u884c\u8fc7\u7a0b\u4e2d\u4e00\u4e9b\u7279\u5b9a\u7684\u64cd\u4f5c\u3002<\/p>\n\n\n\n<p>\u5e38\u89c1\u503c\uff1a<\/p>\n\n\n\n<ul>\n<li><code>Using index<\/code>: \u4f7f\u7528\u8986\u76d6\u7d22\u5f15\uff08\u53ea\u4ece\u7d22\u5f15\u4e2d\u8bfb\u53d6\u4fe1\u606f\uff0c\u800c\u4e0d\u662f\u4ece\u5b9e\u9645\u8868\u4e2d\u8bfb\u53d6\uff09\u3002<\/li>\n\n\n\n<li><code>Using where<\/code>: \u4f7f\u7528 WHERE \u5b50\u53e5\u8fc7\u6ee4\u884c\u3002<\/li>\n\n\n\n<li><code>Using temporary<\/code>: \u4f7f\u7528\u4e34\u65f6\u8868\u4fdd\u5b58\u4e2d\u95f4\u7ed3\u679c\u3002<\/li>\n\n\n\n<li><code>Using filesort<\/code>: \u9700\u8981\u989d\u5916\u7684\u6392\u5e8f\u64cd\u4f5c\uff08\u6587\u4ef6\u6392\u5e8f\uff09\u3002<\/li>\n<\/ul>\n\n\n\n<p>\u6bd4\u5982\uff1a<code>Using where<\/code><\/p>\n\n\n\n<p><strong>\u793a\u4f8b<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p>\u4e3a\u4e86\u66f4\u597d\u7684\u89e3\u91ca\uff0c\u6211\u4eec\u6765\u770b\u4e00\u4e0b\u793a\u4f8b\u8bf4\u660e\uff0c\u5047\u8bbe\u6709\u4e00\u4e2a\u7b80\u5355\u7684\u8868 <code>users<\/code>\uff0c\u7ed3\u6784\u5982\u4e0b\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">CREATE TABLE users (\n    id INT PRIMARY KEY,\n    name VARCHAR(100),\n    age INT,\n    city VARCHAR(100)\n);<\/pre>\n\n\n\n<p>\u6267\u884c\u4e00\u4e2a\u67e5\u8be2\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">EXPLAIN SELECT * FROM users WHERE age > 25;<\/pre>\n\n\n\n<p>\u53ef\u80fd\u5f97\u5230\u7684\u8f93\u51fa\u5982\u4e0b\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>id<\/th><th>select_type<\/th><th>table<\/th><th>partitions<\/th><th>type<\/th><th>possible_keys<\/th><th>key<\/th><th>key_len<\/th><th>ref<\/th><th>rows<\/th><th>filtered<\/th><th>Extra<\/th><\/tr><\/thead><tbody><tr><td>1<\/td><td>SIMPLE<\/td><td>users<\/td><td>NULL<\/td><td>ALL<\/td><td>NULL<\/td><td>NULL<\/td><td>NULL<\/td><td>NULL<\/td><td>1000<\/td><td>10.00<\/td><td>Using where<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>\u89e3\u91ca\uff1a<\/p>\n\n\n\n<ul>\n<li><code>id<\/code>: \u67e5\u8be2\u7684\u6807\u8bc6\u7b26\uff0c\u53ea\u6709\u4e00\u4e2a\u7b80\u5355\u67e5\u8be2\uff0c\u6240\u4ee5 id \u662f 1\u3002<\/li>\n\n\n\n<li><code>select_type<\/code>: \u67e5\u8be2\u7c7b\u578b\uff0c\u8fd9\u91cc\u662f <code>SIMPLE<\/code>\uff0c\u8868\u793a\u7b80\u5355\u67e5\u8be2\u3002<\/li>\n\n\n\n<li><code>table<\/code>: \u67e5\u8be2\u6d89\u53ca\u7684\u8868\uff0c\u8fd9\u91cc\u662f <code>users<\/code>\u3002<\/li>\n\n\n\n<li><code>partitions<\/code>: \u6ca1\u6709\u4f7f\u7528\u5206\u533a\uff0c\u6240\u4ee5\u662f <code>NULL<\/code>\u3002<\/li>\n\n\n\n<li><code>type<\/code>: \u8fde\u63a5\u7c7b\u578b\uff0c\u8fd9\u91cc\u662f <code>ALL<\/code>\uff0c\u8868\u793a\u5168\u8868\u626b\u63cf\u3002<\/li>\n\n\n\n<li><code>possible_keys<\/code>: \u53ef\u80fd\u4f7f\u7528\u7684\u7d22\u5f15\uff0c\u8fd9\u91cc\u6ca1\u6709\u7d22\u5f15\u53ef\u4ee5\u4f7f\u7528\u3002<\/li>\n\n\n\n<li><code>key<\/code>: \u5b9e\u9645\u4f7f\u7528\u7684\u7d22\u5f15\uff0c\u8fd9\u91cc\u6ca1\u6709\u4f7f\u7528\u7d22\u5f15\uff0c\u6240\u4ee5\u662f <code>NULL<\/code>\u3002<\/li>\n\n\n\n<li><code>key_len<\/code>: \u7d22\u5f15\u957f\u5ea6\uff0c\u8fd9\u91cc\u6ca1\u6709\u4f7f\u7528\u7d22\u5f15\uff0c\u6240\u4ee5\u662f <code>NULL<\/code>\u3002<\/li>\n\n\n\n<li><code>ref<\/code>: \u5f15\u7528\u7684\u5217\u6216\u5e38\u6570\uff0c\u8fd9\u91cc\u6ca1\u6709\u4f7f\u7528\u7d22\u5f15\uff0c\u6240\u4ee5\u662f <code>NULL<\/code>\u3002<\/li>\n\n\n\n<li><code>rows<\/code>: \u4f30\u8ba1\u8981\u626b\u63cf\u7684\u884c\u6570\uff0c\u8fd9\u91cc\u4f30\u8ba1\u8981\u626b\u63cf 1000 \u884c\u3002<\/li>\n\n\n\n<li><code>filtered<\/code>: \u8fc7\u6ee4\u767e\u5206\u6bd4\uff0c\u8fd9\u91cc\u662f 10%\uff0c\u8868\u793a\u5927\u7ea6 10% \u7684\u884c\u6ee1\u8db3 <code>WHERE<\/code> \u6761\u4ef6\u3002<\/li>\n\n\n\n<li><code>Extra<\/code>: \u989d\u5916\u4fe1\u606f\uff0c\u8fd9\u91cc\u662f <code>Using where<\/code>\uff0c\u8868\u793a\u4f7f\u7528\u4e86 <code>WHERE<\/code> \u5b50\u53e5\u8fdb\u884c\u8fc7\u6ee4\u3002<\/li>\n<\/ul>\n\n\n\n<p>\u901a\u8fc7<code>EXPLAIN<\/code>\u7684\u7ed3\u679c\uff0c\u6211\u4eec\u53ef\u4ee5\u770b\u5230\u67e5\u8be2\u7684\u6267\u884c\u8ba1\u5212\uff0c\u5e76\u636e\u6b64\u4f18\u5316\u67e5\u8be2\u3002\u4f8b\u5982\uff0c\u53ef\u4ee5\u8003\u8651\u5728 <code>age<\/code> \u5217\u4e0a\u6dfb\u52a0\u7d22\u5f15\u4ee5\u63d0\u9ad8\u67e5\u8be2\u6027\u80fd\u3002<\/p>\n\n\n\n<p><strong>\u4f18\u5316\u5efa\u8bae<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p>\u6839\u636e<code>EXPLAIN<\/code>\u7684\u8f93\u51fa\uff0c\u53ef\u4ee5\u91c7\u53d6\u4ee5\u4e0b\u4f18\u5316\u63aa\u65bd\uff1a<\/p>\n\n\n\n<p><strong>1. \u4f7f\u7528\u5408\u9002\u7684\u7d22\u5f15<\/strong>\u786e\u4fdd\u5728\u67e5\u8be2\u4e2d\u4f7f\u7528\u7684\u5217\u4e0a\u5efa\u7acb\u7d22\u5f15\u3002\u4f8b\u5982\uff0c\u5bf9\u4e8e WHERE \u5b50\u53e5\u4e2d\u7684\u5217\u3001JOIN \u5b50\u53e5\u4e2d\u7684\u8fde\u63a5\u5217\u3001ORDER BY \u548c GROUP BY \u5b50\u53e5\u4e2d\u7684\u5217\uff0c\u90fd\u5e94\u8003\u8651\u5efa\u7acb\u7d22\u5f15\u3002<\/p>\n\n\n\n<p><strong>2. \u907f\u514d\u5168\u8868\u626b\u63cf\uff1a<\/strong>\u5982\u679c type \u5217\u663e\u793a\u4e3a ALL\uff0c\u8868\u793a\u5168\u8868\u626b\u63cf\u3002\u5e94\u8be5\u8003\u8651\u6dfb\u52a0\u7d22\u5f15\u4ee5\u907f\u514d\u5168\u8868\u626b\u63cf\u3002<\/p>\n\n\n\n<p><strong>3. \u4f18\u5316\u8fde\u63a5\u987a\u5e8f\uff1a<\/strong>\u5bf9\u4e8e\u591a\u8868\u8fde\u63a5\uff0c\u4f18\u5316\u5668\u4f1a\u9009\u62e9\u6700\u4f18\u7684\u8fde\u63a5\u987a\u5e8f\u3002\u53ef\u4ee5\u901a\u8fc7<code>EXPLAIN<\/code>\u67e5\u770b\u8fde\u63a5\u987a\u5e8f\uff0c\u5e76\u8c03\u6574\u67e5\u8be2\u4ee5\u4f18\u5316\u8fde\u63a5\u987a\u5e8f\u3002<\/p>\n\n\n\n<p><strong>4. \u4f7f\u7528\u8986\u76d6\u7d22\u5f15<\/strong>\u5982\u679c<code>Extra<\/code>\u5217\u663e\u793a\u4e3a<code>Using index<\/code>\uff0c\u8868\u793a\u67e5\u8be2\u53ea\u4ece\u7d22\u5f15\u4e2d\u8bfb\u53d6\u6570\u636e\uff0c\u800c\u4e0d\u9700\u8981\u8bbf\u95ee\u5b9e\u9645\u8868\u3002\u53ef\u4ee5\u901a\u8fc7\u6dfb\u52a0\u5408\u9002\u7684\u7d22\u5f15\u6765\u5b9e\u73b0\u8986\u76d6\u7d22\u5f15\u3002<\/p>\n\n\n\n<p><strong>5. \u51cf\u5c11\u8fd4\u56de\u7684\u884c\u6570<\/strong>\u4f7f\u7528<code>LIMIT<\/code>\u5b50\u53e5\u9650\u5236\u8fd4\u56de\u7684\u884c\u6570\uff0c\u51cf\u5c11\u626b\u63cf\u7684\u884c\u6570\u3002<\/p>\n\n\n\n<p><strong>6. \u907f\u514d\u4f7f\u7528 SELECT<\/strong>\u5c3d\u91cf\u907f\u514d\u4f7f\u7528<code>SELECT *<\/code>\uff0c\u53ea\u9009\u62e9\u9700\u8981\u7684\u5217\u4ee5\u51cf\u5c11\u6570\u636e\u4f20\u8f93\u91cf\u3002<\/p>\n\n\n\n<p><strong>7. \u4f18\u5316\u5b50\u67e5\u8be2<\/strong>\u5bf9\u4e8e\u5b50\u67e5\u8be2\uff0c\u53ef\u4ee5\u8003\u8651\u4f7f\u7528<code>JOIN<\/code>\u6216\u6d3e\u751f\u8868\u6765\u66ff\u4ee3\uff0c\u51cf\u5c11\u67e5\u8be2\u7684\u590d\u6742\u5ea6\u3002<\/p>\n\n\n\n<p><strong>\u603b\u7ed3<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p>\u672c\u6587\uff0c\u6211\u4eec\u8be6\u7ec6\u5730\u5206\u6790\u4e86<code>EXPLAIN<\/code>\uff0c\u5b83\u662f MySQL \u4e2d\u7528\u4e8e\u663e\u793a SQL \u67e5\u8be2\u6267\u884c\u8ba1\u5212\u7684\u5173\u952e\u5b57\u3002<code>EXPLAIN<\/code>\u63d0\u4f9b\u4e86\u67e5\u8be2\u4f18\u5316\u5668\u9009\u62e9\u7684\u6267\u884c\u8def\u5f84\uff0c\u5305\u62ec\u8868\u8bbf\u95ee\u987a\u5e8f\u3001\u7d22\u5f15\u4f7f\u7528\u60c5\u51b5\u3001\u8fde\u63a5\u7c7b\u578b\u548c\u626b\u63cf\u884c\u6570\u7b49\u4fe1\u606f\u3002\u901a\u8fc7<code>EXPLAIN<\/code>\u7684\u8f93\u51fa\uff0c\u5f00\u53d1\u8005\u53ef\u4ee5\u8bc6\u522b\u6027\u80fd\u74f6\u9888\uff0c\u5982\u5168\u8868\u626b\u63cf\u3001\u7d22\u5f15\u672a\u4f7f\u7528\u7b49\uff0c\u5e76\u8fdb\u884c\u9488\u5bf9\u6027\u7684\u4f18\u5316\uff0c\u4f8b\u5982\u6dfb\u52a0\u7d22\u5f15\u3001\u4f18\u5316\u8fde\u63a5\u987a\u5e8f\u548c\u51cf\u5c11\u8fd4\u56de\u884c\u6570\u7b49\u3002<\/p>\n\n\n\n<p>\u56e0\u6b64\uff0c\u5728\u5b9e\u9645\u5f00\u53d1\u4e2d\uff0c\u6211\u4eec\u5e94\u8be5\u5408\u7406\u5730\u4f7f\u7528<code>EXPLAIN<\/code>\u5173\u952e\u5b57\u6765\u5e2e\u52a9\u6211\u4eec\u6765\u4f18\u5316\u67e5\u8be2\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u8f6c\u8f7d\uff1aMySQL EXPLAIN\u6267\u884c\u8ba1\u5212\uff0c\u5982\u4f55\u5206\u6790\uff1f \u5728\u5b9e\u9645\u5f00\u53d1\u4e2d\uff0c\u5982\u679c\u9009\u62e9\u7684\u662f MySQL \u6570\u636e\u5e93\uff0c\u901a\u5e38\u4f1a\u4f7f [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[23],"tags":[],"_links":{"self":[{"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/posts\/16333"}],"collection":[{"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/92it.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=16333"}],"version-history":[{"count":2,"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/posts\/16333\/revisions"}],"predecessor-version":[{"id":16336,"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/posts\/16333\/revisions\/16336"}],"wp:attachment":[{"href":"https:\/\/92it.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=16333"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/92it.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=16333"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/92it.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=16333"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}