{"id":7686,"date":"2024-11-14T12:12:13","date_gmt":"2024-11-14T04:12:13","guid":{"rendered":"https:\/\/fwq.ai\/blog\/7686\/"},"modified":"2024-11-14T12:12:13","modified_gmt":"2024-11-14T04:12:13","slug":"%e5%a6%82%e4%bd%95%e6%9f%a5%e7%9c%8bmysql%e5%8d%95%e4%b8%aa%e7%b4%a2%e5%bc%95%e7%9a%84%e7%a3%81%e7%9b%98%e7%a9%ba%e9%97%b4%e4%bd%bf%e7%94%a8%e6%83%85%e5%86%b5%ef%bc%9f","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/7686\/","title":{"rendered":"\u5982\u4f55\u67e5\u770bMySQL\u5355\u4e2a\u7d22\u5f15\u7684\u78c1\u76d8\u7a7a\u95f4\u4f7f\u7528\u60c5\u51b5\uff1f"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/173114373195116.jpg\" class=\"aligncenter\" title=\"\u5982\u4f55\u67e5\u770bMySQL\u5355\u4e2a\u7d22\u5f15\u7684\u78c1\u76d8\u7a7a\u95f4\u4f7f\u7528\u60c5\u51b5\uff1f\u63d2\u56fe\" alt=\"\u5982\u4f55\u67e5\u770bMySQL\u5355\u4e2a\u7d22\u5f15\u7684\u78c1\u76d8\u7a7a\u95f4\u4f7f\u7528\u60c5\u51b5\uff1f\u63d2\u56fe\" \/><\/p>\n<p><strong>\u67e5\u770b  \u7d22\u5f15\u78c1\u76d8\u7a7a\u95f4\u4f7f\u7528\u60c5\u51b5<\/strong><\/p>\n<p>\u5728 mysql \u4e2d\uff0cshow table status; \u547d\u4ee4\u53ea\u80fd\u663e\u793a\u6240\u6709\u7d22\u5f15\u7684\u603b\u78c1\u76d8\u7a7a\u95f4\u5360\u7528\u60c5\u51b5\u3002\u4f46\u662f\uff0c\u901a\u8fc7\u67e5\u8be2 information_schema.files \u8868\uff0c\u53ef\u4ee5\u83b7\u53d6\u6bcf\u4e2a\u7d22\u5f15\u7684\u78c1\u76d8\u7a7a\u95f4\u4f7f\u7528\u60c5\u51b5\uff1a<\/p>\n<pre>SELECT\n    table_schema,\n    table_name,\n    index_name,\n    file_size\nFROM\n    INFORMATION_SCHEMA.FILES\nWHERE\n    table_schema = '&lt;your_database_name&gt;'\n    AND table_name = '&lt;your_table_name&gt;'\n    AND index_name IS NOT NULL;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>\u6ce8\u610f\uff1a<\/strong><br \/>\u8be5\u67e5\u8be2\u7ed3\u679c\u4e2d\u7684 file_size \u5b57\u6bb5\u8868\u793a\u7d22\u5f15\u6240\u5728\u8868\u7a7a\u95f4\u7684\u6587\u4ef6\u5927\u5c0f\uff0c\u800c\u4e0d\u662f\u7d22\u5f15\u672c\u8eab\u7684\u5927\u5c0f\u3002\u8981\u83b7\u5f97\u66f4\u51c6\u786e\u7684\u7d22\u5f15\u5927\u5c0f\uff0c\u53ef\u4ee5\u4f7f\u7528 mysql \u7684 analyze table \u547d\u4ee4\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u5982\u4f55\u67e5\u770bMySQL\u5355\u4e2a\u7d22\u5f15\u7684\u78c1\u76d8\u7a7a\u95f4\u4f7f\u7528\u60c5\u51b5\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>\u67e5\u770b \u7d22\u5f15\u78c1\u76d8\u7a7a\u95f4\u4f7f\u7528\u60c5\u51b5 \u5728 mysql \u4e2d\uff0cshow table status; \u547d\u4ee4\u53ea\u80fd\u663e\u793a\u6240\u6709\u7d22\u5f15\u7684\u603b\u78c1\u76d8\u7a7a\u95f4\u5360\u7528\u60c5\u51b5\u3002\u4f46\u662f\uff0c\u901a\u8fc7\u67e5\u8be2 information_schema.files \u8868\uff0c\u53ef\u4ee5\u83b7\u53d6\u6bcf\u4e2a\u7d22\u5f15\u7684\u78c1\u76d8\u7a7a\u95f4\u4f7f\u7528\u60c5\u51b5\uff1a SELECT table_schema, table_name, index_name, file_size FROM INFORMATION_SCHEMA.FILES WHERE table_schema = &#8216;&lt;your_database_name&gt;&#8217; AND table_name = &#8216;&lt;your_table_name&gt;&#8217; AND index_name IS NOT NULL; \u767b\u5f55\u540e\u590d\u5236 \u6ce8\u610f\uff1a\u8be5\u67e5\u8be2\u7ed3\u679c\u4e2d\u7684 file_size \u5b57\u6bb5\u8868\u793a\u7d22\u5f15\u6240\u5728\u8868\u7a7a\u95f4\u7684\u6587\u4ef6\u5927\u5c0f\uff0c\u800c\u4e0d\u662f\u7d22\u5f15\u672c\u8eab\u7684\u5927\u5c0f\u3002\u8981\u83b7\u5f97\u66f4\u51c6\u786e\u7684\u7d22\u5f15\u5927\u5c0f\uff0c\u53ef\u4ee5\u4f7f\u7528 mysql \u7684 analyze table \u547d\u4ee4\u3002 \u4ee5\u4e0a\u5c31\u662f\u5982\u4f55\u67e5\u770bMySQL\u5355\u4e2a\u7d22\u5f15\u7684\u78c1\u76d8\u7a7a\u95f4\u4f7f\u7528\u60c5\u51b5\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},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-7686","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/7686","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=7686"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/7686\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=7686"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=7686"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=7686"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}