{"id":123741,"date":"2022-04-14T02:14:02","date_gmt":"2022-04-13T18:14:02","guid":{"rendered":"http:\/\/www.idc.net\/help\/123741\/"},"modified":"2022-04-14T02:14:02","modified_gmt":"2022-04-13T18:14:02","slug":"%e5%a6%82%e4%bd%95%e6%9f%a5%e7%9c%8bmysql%e7%9a%84%e6%89%80%e6%9c%89%e7%b4%a2%e5%bc%95%ef%bc%9f-mysql-%e6%9f%a5%e7%9c%8b%e6%95%b0%e6%8d%ae%e5%ba%93%e6%89%80%e6%9c%89%e7%b4%a2%e5%bc%95","status":"publish","type":"post","link":"https:\/\/idc.net\/help\/123741\/","title":{"rendered":"\u5982\u4f55\u67e5\u770bMySQL\u7684\u6240\u6709\u7d22\u5f15\uff1f (mysql \u67e5\u770b\u6570\u636e\u5e93\u6240\u6709\u7d22\u5f15)"},"content":{"rendered":"<p>MySQL\u662f\u4e00\u79cd\u975e\u5e38\u6d41\u884c\u7684\u5173\u7cfb\u578b\u6570\u636e\u5e93\u7ba1\u7406\u7cfb\u7edf\u3002\u5b83\u4e0d\u4ec5\u652f\u6301\u5927\u89c4\u6a21\u6570\u636e\u5b58\u50a8\uff0c\u8fd8\u5177\u6709\u9ad8\u6027\u80fd\u548c\u53ef\u6269\u5c55\u6027\u7b49\u4f18\u70b9\u3002\u5728MySQL\u4e2d\uff0c\u7d22\u5f15\u662f\u4e00\u79cd\u975e\u5e38\u91cd\u8981\u7684\u6570\u636e\u7ed3\u6784\uff0c\u5b83\u80fd\u591f\u5e2e\u52a9\u6211\u4eec\u5feb\u901f\u5730\u67e5\u627e\u548c\u8bbf\u95ee\u6570\u636e\u5e93\u4e2d\u7684\u6570\u636e\u3002\u672c\u6587\u5c06\u4ecb\u7ecd\u5982\u4f55\u67e5\u770bMySQL\u7684\u6240\u6709\u7d22\u5f15\uff0c\u4ee5\u4fbf\u4e8e\u7ba1\u7406\u548c\u4f18\u5316\u6570\u636e\u5e93\u6027\u80fd\u3002<\/p>\n<p>\u4e00\u3001\u4f7f\u7528SHOW INDEXES\u8bed\u53e5<\/p>\n<p>MySQL\u63d0\u4f9b\u4e86SHOW INDEXES\u8bed\u53e5\u6765\u663e\u793a\u8868\u4e2d\u7684\u6240\u6709\u7d22\u5f15\u4fe1\u606f\u3002\u5176\u8bed\u6cd5\u5982\u4e0b\uff1a<\/p>\n<p>SHOW INDEXES FROM \u8868\u540d [WHERE \u6761\u4ef6];<\/p>\n<p>\u5176\u4e2d\uff0c\u8868\u540d\u662f\u9700\u8981\u67e5\u770b\u7d22\u5f15\u7684\u8868\u540d\u79f0\uff0c\u6761\u4ef6\u662f\u53ef\u9009\u53c2\u6570\uff0c\u7528\u4e8e\u8fc7\u6ee4\u6240\u663e\u793a\u7684\u7d22\u5f15\u4fe1\u606f\u3002\u6267\u884c\u8be5\u8bed\u53e5\u540e\uff0c\u5c06\u663e\u793a\u4ee5\u4e0b\u4fe1\u606f\uff1a<\/p>\n<p>1\u3001\u8868\u7684\u540d\u79f0\uff1b<\/p>\n<p>2\u3001\u7d22\u5f15\u540d\u79f0\uff1b<\/p>\n<p>3\u3001\u7d22\u5f15\u7c7b\u578b\uff1b<\/p>\n<p>4\u3001\u7d22\u5f15\u7684\u5b57\u6bb5\u540d\u79f0\uff1b<\/p>\n<p>5\u3001\u7d22\u5f15\u7684\u987a\u5e8f\uff1b<\/p>\n<p>6\u3001\u552f\u4e00\u6027\uff1b<\/p>\n<p>7\u3001\u5f53\u7d22\u5f15\u88ab\u521b\u5efa\u65f6\u4f7f\u7528\u7684\u65b9\u6cd5\uff1b<\/p>\n<p>8\u3001\u7d22\u5f15\u5360\u7528\u7684\u7a7a\u95f4\u5927\u5c0f\uff1b<\/p>\n<p>9\u3001\u6ce8\u91ca\u3002<\/p>\n<p>\u4f8b\u5982\uff0c\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u67e5\u770bMySQL\u4e2demployees\u8868\u7684\u6240\u6709\u7d22\u5f15\u4fe1\u606f\uff1a<\/p>\n<p>SHOW INDEXES FROM employees;<\/p>\n<p>\u4e8c\u3001\u4f7f\u7528information_schema\u6570\u636e\u5e93<\/p>\n<p>information_schema\u662fMySQL\u4e2d\u7684\u4e00\u4e2a\u7279\u6b8a\u6570\u636e\u5e93\uff0c\u5b83\u5305\u542b\u4e86\u8bb8\u591a\u6709\u7528\u7684\u5173\u4e8eMySQL\u6570\u636e\u5e93\u7684\u5143\u6570\u636e\u4fe1\u606f\u3002\u8fd9\u4e9b\u5143\u6570\u636e\u4fe1\u606f\u5305\u62ec\u4e86\u8868\u4fe1\u606f\u3001\u7d22\u5f15\u4fe1\u606f\u3001\u7528\u6237\u4fe1\u606f\u3001\u8868\u7a7a\u95f4\u4fe1\u606f\u7b49\u7b49\u3002\u4f7f\u7528information_schema\u6570\u636e\u5e93\u53ef\u4ee5\u76f4\u63a5\u67e5\u8be2\u6570\u636e\u5e93\u4e2d\u7684\u5143\u6570\u636e\u4fe1\u606f\uff0c\u65b9\u4fbf\u6570\u636e\u5e93\u7684\u7ba1\u7406\u548c\u4f18\u5316\u3002<\/p>\n<p>\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u8bed\u53e5\u67e5\u8be2information_schema\u6570\u636e\u5e93\u4e2d\u7684\u7d22\u5f15\u4fe1\u606f\uff1a<\/p>\n<p>SELECT *<\/p>\n<p>FROM information_schema.statistics<\/p>\n<p>WHERE table_name = \u2018\u8868\u540d\u2019;<\/p>\n<p>\u5176\u4e2d\uff0ctable_name\u662f\u9700\u8981\u67e5\u8be2\u7d22\u5f15\u7684\u8868\u540d\u79f0\uff0c\u5728\u4e0a\u8ff0\u67e5\u8be2\u4e2d\uff0c\u6211\u4eec\u9009\u62e9\u4e86information_schema.statistics\u8868\u3002\u8be5\u8868\u7528\u4e8e\u5b58\u50a8MySQL\u6570\u636e\u5e93\u4e2d\u6240\u6709\u8868\u7684\u7d22\u5f15\u4fe1\u606f\u3002\u6267\u884c\u4ee5\u4e0a\u8bed\u53e5\u540e\uff0c\u5c06\u4f1a\u663e\u793a\u8868\u540d\u3001\u7d22\u5f15\u540d\u3001\u7d22\u5f15\u7c7b\u578b\u3001\u7d22\u5f15\u5360\u7528\u7684\u7a7a\u95f4\u5927\u5c0f\u3001\u975e\u552f\u4e00\u7d22\u5f15\u7684\u5b57\u6bb5\u540d\u7b49\u4fe1\u606f\u3002<\/p>\n<p>\u4f8b\u5982\uff0c\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u67e5\u8be2MySQL\u4e2demployees\u8868\u7684\u6240\u6709\u7d22\u5f15\u4fe1\u606f\uff1a<\/p>\n<p>SELECT *<\/p>\n<p>FROM information_schema.statistics<\/p>\n<p>WHERE table_name = \u2019employees\u2019;<\/p>\n<p>\u4e09\u3001\u4f7f\u7528EXPLN\u8bed\u53e5<\/p>\n<p>EXPLN\u8bed\u53e5\u662fMySQL\u4e2d\u7528\u4e8e\u4f18\u5316\u67e5\u8be2\u7684\u4e00\u4e2a\u975e\u5e38\u6709\u7528\u7684\u5de5\u5177\u3002\u901a\u8fc7\u4f7f\u7528EXPLN\u8bed\u53e5\uff0c\u53ef\u4ee5\u67e5\u770b\u67e5\u8be2\u4e2d\u6d89\u53ca\u5230\u7684\u6240\u6709\u7d22\u5f15\u4fe1\u606f\u3002EXPLN\u8bed\u53e5\u4f1a\u8fd4\u56de\u4e00\u5f20\u8868\u683c\uff0c\u5176\u4e2d\u5305\u542b\u4e86SQL\u67e5\u8be2\u8bed\u53e5\u7684\u6267\u884c\u8ba1\u5212\u8be6\u7ec6\u4fe1\u606f\u3002<\/p>\n<p>\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u8bed\u53e5\u67e5\u8be2MySQL\u4e2demployees\u8868\u4e2d\u7684\u7d22\u5f15\u4fe1\u606f\uff1a<\/p>\n<p>EXPLN SELECT *<\/p>\n<p>FROM employees<\/p>\n<p>WHERE last_name = \u2018ith\u2019;<\/p>\n<p>\u4e0a\u8ff0\u8bed\u53e5\u5c06\u67e5\u8be2employees\u8868\u4e2d\u6240\u6709\u59d3\u4e3aith\u7684\u5458\u5de5\u4fe1\u606f\uff0c\u5e76\u663e\u793aSQL\u67e5\u8be2\u8bed\u53e5\u6267\u884c\u8fc7\u7a0b\u4e2d\u6240\u9700\u8981\u7684\u6240\u6709\u7d22\u5f15\u4fe1\u606f\u3002\u901a\u8fc7\u89c2\u5bdf\u8fd4\u56de\u7684\u4fe1\u606f\uff0c\u6211\u4eec\u53ef\u4ee5\u53d1\u73b0\u662f\u5426\u5b58\u5728\u9700\u8981\u4f18\u5316\u7684\u7d22\u5f15\u3002<\/p>\n<p>\u4ee5\u4e0a\u4e09\u79cd\u65b9\u6cd5\u90fd\u53ef\u4ee5\u7528\u4e8e\u67e5\u770bMySQL\u6570\u636e\u5e93\u4e2d\u7684\u6240\u6709\u7d22\u5f15\u4fe1\u606f\u3002\u4f7f\u7528SHOW INDEXES\u8bed\u53e5\u53ef\u4ee5\u5feb\u901f\u7684\u663e\u793a\u8868\u4e2d\u7684\u6240\u6709\u7d22\u5f15\u4fe1\u606f\uff0cinformation_schema\u6570\u636e\u5e93\u53ef\u4ee5\u76f4\u63a5\u67e5\u8be2\u5404\u79cd\u5143\u6570\u636e\u4fe1\u606f\uff0c\u800cEXPLN\u8bed\u53e5\u5219\u53ef\u4ee5\u5e2e\u52a9\u6211\u4eec\u4f18\u5316\u67e5\u8be2\u4ee5\u53ca\u67e5\u770b\u7d22\u5f15\u4f7f\u7528\u60c5\u51b5\u3002\u638c\u63e1\u8fd9\u4e9b\u6280\u5de7\u53ef\u4ee5\u5e2e\u52a9\u5f00\u53d1\u8005\u66f4\u597d\u5730\u7ba1\u7406\u548c\u4f18\u5316MySQL\u6570\u636e\u5e93\uff0c\u63d0\u9ad8\u7cfb\u7edf\u7684\u6027\u80fd\u548c\u7a33\u5b9a\u6027\u3002<\/p>\n<p><strong>\u76f8\u5173\u95ee\u9898\u62d3\u5c55\u9605\u8bfb\uff1a<\/strong><\/p>\n<ul>\n<li>mysql\u4e2d\u5982\u4f55\u67e5\u770b\u548c\u5220\u9664\u552f\u4e00\u7d22\u5f15<\/li>\n<li>mysql\u7d22\u5f15\u6709\u51e0\u79cd<\/li>\n<\/ul>\n<h3>mysql\u4e2d\u5982\u4f55\u67e5\u770b\u548c\u5220\u9664\u552f\u4e00\u7d22\u5f15<\/h3>\n<p>mysql\u4e2d\u5982\u71c3\u68ee\u4f55\u67e5\u770b\u548c\u5220\u9664\u552f\u4e00\u7d22\u5f15\u3002<\/p>\n<p>\u3000\u3000\u67e5\u770b\u552f\u4e00\u7d22\u5f15:<\/p>\n<p>\u3000\u3000show<\/p>\n<p>index<\/p>\n<p>from<\/p>\n<p>mytable;\/\/mytable<\/p>\n<p>\u662f\u8868\u540d<\/p>\n<p>\u3000\u3000\u67e5\u8be2\u7ed3\u679c\u5982\u4e0b\uff1a<\/p>\n<p>\u3000\u3000\u67e5\u8ba9\u5c18\u8be2\u5230\u552f\u4e00\u7d22\u5f15\u540e\uff0c\u5982\u4f55\u5220\u9664\u552f\u4e00\u7d22\u5f15\u5462\uff0c\u4f7f\u7528\u5982\u4e0b\u547d\u4ee4\uff1a<\/p>\n<p>\u3000\u76ae\u6ed1\u4ea9\u3000alter<\/p>\n<p>table<\/p>\n<p>mytable<\/p>\n<p>drop<\/p>\n<p>index<\/p>\n<p>mdl_tag_use_ix;\/\/mdl_tag_use_ix\u662f\u4e0a\u8868\u67e5\u51fa\u7684\u7d22\u5f15\u540d\uff0ckey_name<\/p>\n<h3>mysql\u7d22\u5f15\u6709\u51e0\u79cd<\/h3>\n<p>Mysql\u76ee\u524d\u4e3b\u8981\u6709\u4ee5\u4e0b\u51e0\u79cd\u7d22\u5f15\u7c7b\u578b\uff1aFULLTEXT\uff0cHASH\uff0cREE\uff0cRTREE\u3002<\/p>\n<p>\u90a3\u4e48\uff0c\u8fd9\u51e0\u79cd\u7d22\u5f15\u6709\u4ec0\u4e48\u529f\u80fd\u548c\u6027\u80fd\u4e0a\u7684\u4e0d\u540c\u5462\uff1f<\/p>\n<p>FULLTEXT<\/p>\n<p>\u5373\u4e3a\u5168\u6587\u7d22\u5f15\uff0c\u76ee\u524d\u53ea\u6709MyISAM\u5f15\u64ce\u652f\u6301\u3002\u5176\u53ef\u4ee5\u5728CREATE TABLE \uff0cALTER TABLE \uff0cCREATE INDEX \u4f7f\u7528\uff0c\u4e0d\u8fc7\u76ee\u524d\u53ea\u6709 CHAR\u3001VARCHAR \uff0cTEXT \u5217\u4e0a\u53ef\u4ee5\u521b\u5efa\u5168\u6587\u7d22\u5f15\u3002\u503c\u5f97\u4e00\u63d0\u7684\u662f\uff0c\u5728\u6570\u636e\u91cf\u8f83\u5927\u65f6\u5019\uff0c\u73b0\u5c06\u6570\u636e\u653e\u5165\u4e00\u4e2a\u6ca1\u6709\u5168\u5c40\u7d22\u5f15\u7684\u8868\u4e2d\uff0c\u7136\u540e\u518d\u7528CREATE INDEX\u521b\u5efaFULLTEXT\u7d22\u5f15\uff0c\u8981\u6bd4\u5148\u4e3a\u4e00\u5f20\u8868\u5efa\u7acbFULLTEXT\u7136\u540e\u518d\u5c06\u6570\u636e\u5199\u5165\u7684\u901f\u5ea6\u5feb\u5f88\u591a\u3002<\/p>\n<p>\u5168\u6587\u7d22\u5f15\u5e76\u4e0d\u662f\u548cMyISAM\u4e00\u8d77\u8bde\u751f\u7684\uff0c\u5b83\u7684\u51fa\u73b0\u662f\u4e3a\u4e86\u89e3\u51b3WHERE name LIKE \u201c%word%\u201d\u8fd9\u7c7b\u9488\u5bf9\u6587\u672c\u7684\u6a21\u7cca\u67e5\u8be2\u6548\u7387\u8f83\u4f4e\u7684\u95ee\u9898\u3002\u5728\u6ca1\u6709\u5168\u6587\u7d22\u5f15\u4e4b\u524d\uff0c\u8fd9\u6837\u4e00\u4e2a\u67e5\u8be2\u8bed\u53e5\u662f\u8981\u8fdb\u884c\u904d\u5386\u6570\u636e\u8868\u64cd\u4f5c\u7684\uff0c\u53ef\u89c1\uff0c\u5728\u6570\u636e\u91cf\u8f83\u5927\u65f6\u662f\u6781\u5176\u7684\u8017\u65f6\u7684\uff0c\u5982\u679c\u6ca1\u6709\u5f02\u6b65IO\u5904\u7406\uff0c\u8fdb\u7a0b\u5c06\u88ab\u631f\u6301\uff0c\u5f88\u6d6a\u8d39\u65f6\u95f4\uff0c\u5f53\u7136\u8fd9\u91cc\u4e0d\u5bf9\u5f02\u6b65IO\u4f5c\u8fdb\u4e00\u6b65\u8bb2\u89e3\uff0c\u60f3\u4e86\u89e3\u7684\u7ae5\u978b\uff0c\u81ea\u884c\u8c37\u54e5\u3002<\/p>\n<p>\u5168\u6587\u7d22\u5f15\u7684\u4f7f\u7528\u65b9\u6cd5\u5e76\u4e0d\u590d\u6742\uff1a<\/p>\n<p>\u521b\u5efaALTER TABLE table ADD INDEX `FULLINDEX` USING FULLTEXT(`cname1`);<\/p>\n<\/p>\n<p>\u4f7f\u7528SELECT * FROM table WHERE MATCH(cname1) AGAINST (\u2018word\u2019 MODE );<\/p>\n<\/p>\n<p>\u5176\u4e2d\uff0c MODE\u4e3a\u641c\u5bfb\u65b9\u5f0f\uff08IN BOOLEAN MODE \uff0cIN NATURAL LANGUAGE MODE \uff0cIN NATURAL LANGUAGE MODE WITH QUERY EXPANSION \/ WITH QUERY EXPANSION\uff09\u3002<\/p>\n<p>\u5173\u4e8e\u8fd9\u4e09\u79cd\u641c\u5bfb\u65b9\u5f0f\uff0c\u611a\u5b89\u5728\u8fd9\u91cc\u4e5f\u4e0d\u591a\u505a\u4ea4\u4ee3\uff0c\u7b80\u5355\u5730\u8bf4\uff0c\u5c31\u662f\uff0c\u5e03\u5c14\u6a21\u5f0f\uff0c\u5141\u8bb8word\u91cc\u542b\u4e00\u4e9b\u7279\u6b8a\u5b57\u7b26\u7528\u4e8e\u6807\u8bb0\u4e00\u4e9b\u5177\u4f53\u7684\u8981\u6c42\uff0c\u5982+\u8868\u793a\u4e00\u5b9a\u8981\u6709\uff0c-\u8868\u793a\u4e00\u5b9a\u6ca1\u6709\uff0c*\u8868\u793a\u901a\u7528\u5339\u914d\u7b26\uff0c\u662f\u4e0d\u662f\u60f3\u8d77\u4e86\u6b63\u5219\uff0c\u7c7b\u4f3c\u5427\uff1b\u81ea\u7136\u8bed\u8a00\u6a21\u5f0f\uff0c\u5c31\u662f\u7b80\u5355\u7684\u5355\u8bcd\u5339\u914d\uff1b\u542b\u8868\u8fbe\u5f0f\u7684\u81ea\u7136\u8bed\u8a00\u6a21\u5f0f\uff0c\u5c31\u662f\u5148\u7528\u81ea\u7136\u8bed\u8a00\u6a21\u5f0f\u5904\u7406\uff0c\u5bf9\u8fd4\u56de\u7684\u7ed3\u679c\uff0c\u518d\u8fdb\u884c\u8868\u8fbe\u5f0f\u5339\u914d\u3002<\/p>\n<p>\u5bf9\u641c\u7d22\u5f15\u64ce\u7a0d\u5fae\u6709\u70b9\u4e86\u89e3\u7684\u540c\u5b66\uff0c\u80af\u5b9a\u77e5\u9053\u5206\u8bcd\u8fd9\u4e2a\u6982\u5ff5\uff0cFULLTEXT\u7d22\u5f15\u4e5f\u662f\u6309\u7167\u5206\u8bcd\u539f\u7406\u5efa\u7acb\u7d22\u5f15\u7684\u3002\u897f\u6587\u4e2d\uff0c\u5927\u90e8\u5206\u4e3a\u5b57\u6bcd\u6587\u5b57\uff0c\u5206\u8bcd\u53ef\u4ee5\u5f88\u65b9\u4fbf\u7684\u6309\u7167\u7a7a\u683c\u8fdb\u884c\u5206\u5272\u3002\u4f46\u5f88\u660e\u663e\uff0c\u4e2d\u6587\u4e0d\u80fd\u6309\u7167\u8fd9\u79cd\u65b9\u5f0f\u8fdb\u884c\u5206\u8bcd\u3002\u90a3\u53c8\u600e\u4e48\u529e\u5462\uff1f\u8fd9\u4e2a\u5411\u5927\u5bb6\u4ecb\u7ecd\u4e00\u4e2aMysql\u7684\u4e2d\u6587\u5206\u8bcd\u63d2\u4ef6Mysqlcft\uff0c\u6709\u4e86\u5b83\uff0c\u5c31\u53ef\u4ee5\u5bf9\u4e2d\u6587\u8fdb\u884c\u5206\u8bcd\uff0c\u60f3\u4e86\u89e3\u7684\u540c\u5b66\u8bf7\u79fb\u6b65Mysqlcft\uff0c\u5f53\u7136\u8fd8\u6709\u5176\u4ed6\u7684\u5206\u8bcd\u63d2\u4ef6\u53ef\u4ee5\u4f7f\u7528\u3002<\/p>\n<p>HASH<\/p>\n<p>Hash\u8fd9\u4e2a\u8bcd\uff0c\u53ef\u731c\u5144\u4ee5\u8bf4\uff0c\u81ea\u6253\u6211\u4eec\u5f00\u59cb\u7801\u7684\u90a3\u4e00\u5929\u8d77\uff0c\u5c31\u5f00\u59cb\u4e0d\u505c\u5730\u89c1\u5230\u548c\u4f7f\u7528\u5230\u4e86\u3002\u5176\u5b9e\uff0chash\u5c31\u662f\u4e00\u79cd\uff08key=&gt;value\uff09\u5f62\u5f0f\u7684\u952e\u503c\u5bf9\uff0c\u5982\u6570\u5b66\u4e2d\u7684\u51fd\u6570\u6620\u5c04\uff0c\u5141\u8bb8\u591a\u4e2akey\u5bf9\u5e94\u76f8\u540c\u7684value\uff0c\u4f46\u4e0d\u5141\u8bb8\u4e00\u4e2akey\u5bf9\u5e94\u591a\u4e2avalue\u3002\u6b63\u662f\u7531\u4e8e\u8fd9\u4e2a\u7279\u6027\uff0chash\u5f88\u9002\u5408\u505a\u7d22\u5f15\uff0c\u4e3a\u67d0\u4e00\u5217\u6216\u51e0\u5217\u5efa\u7acbhash\u7d22\u5f15\uff0c\u5c31\u4f1a\u5229\u7528\u8fd9\u4e00\u5217\u6216\u51e0\u5217\u7684\u503c\u901a\u8fc7\u4e00\u5b9a\u7684\u7b97\u6cd5\u8ba1\u7b97\u51fa\u4e00\u4e2ahash\u503c\uff0c\u5bf9\u5e94\u4e00\u884c\u6216\u51e0\u884c\u6570\u636e\uff08\u8fd9\u91cc\u5728\u6982\u5ff5\u4e0a\u548c\u51fd\u6570\u6620\u5c04\u6709\u533a\u522b\uff0c\u4e0d\u8981\u6df7\u6dc6\uff09\u3002\u5728java\u8bed\u8a00\u4e2d\uff0c\u6bcf\u4e2a\u7c7b\u90fd\u6709\u81ea\u5df1\u7684hashcode()\u65b9\u6cd5\uff0c\u6ca1\u6709\u663e\u793a\u5b9a\u4e49\u7684\u90fd\u7ee7\u627f\u81eaobject\u7c7b\uff0c\u8be5\u65b9\u6cd5\u4f7f\u5f97\u6bcf\u4e00\u4e2a\u5bf9\u8c61\u90fd\u662f\u552f\u4e00\u7684\uff0c\u5728\u8fdb\u884c\u5bf9\u8c61\u95f4equal\u6bd4\u8f83\uff0c\u548c\u5e8f\u5217\u5316\u4f20\u8f93\u4e2d\u8d77\u5230\u4e86\u5f88\u91cd\u5e26\u5146\u95ed\u8981\u7684\u4f5c\u7528\u3002hash\u7684\u751f\u6210\u65b9\u6cd5\u6709\u5f88\u591a\u79cd\uff0c\u8db3\u53ef\u4ee5\u4fdd\u8bc1hash\u7801\u7684\u552f\u4e00\u6027\uff0c\u4f8b\u5982\u5728MongoDB\u4e2d\uff0c\u6bcf\u4e00\u4e2adocument\u90fd\u6709\u7cfb\u7edf\u4e3a\u5176\u751f\u6210\u7684\u552f\u4e00\u7684objectID\uff08\u5305\u542b\u65f6\u95f4\u6233\uff0c\u4e3b\u673a\u6563\u5217\u503c\uff0c\u8fdb\u7a0bPID\uff0c\u548c\u81ea\u589eID\uff09\u4e5f\u662f\u4e00\u79cdhash\u7684\u8868\u73b0\u3002\u989d\uff0c\u6211\u597d\u50cf\u626f\u8fdc\u4e86-_-!<\/p>\n<p>\u7531\u4e8ehash\u7d22\u5f15\u53ef\u4ee5\u4e00\u6b21\u5b9a\u4f4d\uff0c\u4e0d\u9700\u8981\u50cf\u6811\u5f62\u7d22\u5f15\u90a3\u6837\u9010\u5c42\u67e5\u627e,\u56e0\u6b64\u5177\u6709\u6781\u9ad8\u7684\u6548\u7387\u3002\u90a3\u4e3a\u4ec0\u4e48\u8fd8\u9700\u8981\u5176\u8822\u88c2\u4ed6\u7684\u6811\u5f62\u7d22\u5f15\u5462\uff1f<\/p>\n<p>\u5728\u8fd9\u91cc\u611a\u5b89\u5c31\u4e0d\u81ea\u5df1\u603b\u7ed3\u4e86\u3002\u5f15\u7528\u4e0b\u56ed\u5b50\u91cc\u5176\u4ed6\u5927\u795e\u7684\u6587\u7ae0\uff1a\u6765\u81ea 14\u7684\u8def \u7684MySQL\u7684btree\u7d22\u5f15\u548chash\u7d22\u5f15\u7684\u533a\u522b<\/p>\n<p>\uff081\uff09Hash \u7d22\u5f15\u4ec5\u4ec5\u80fd\u6ee1\u8db3\u201d=\u201d,\u201dIN\u201d\u548c\u201d\u201d\u67e5\u8be2\uff0c\u4e0d\u80fd\u4f7f\u7528\u8303\u56f4\u67e5\u8be2\u3002 <\/p>\n<p>\u7531\u4e8e Hash \u7d22\u5f15\u6bd4\u8f83\u7684\u662f\u8fdb\u884c Hash \u8fd0\u7b97\u4e4b\u540e\u7684 Hash \u503c\uff0c\u6240\u4ee5\u5b83\u53ea\u80fd\u7528\u4e8e\u7b49\u503c\u7684\u8fc7\u6ee4\uff0c\u4e0d\u80fd\u7528\u4e8e\u57fa\u4e8e\u8303\u56f4\u7684\u8fc7\u6ee4\uff0c\u56e0\u4e3a\u7ecf\u8fc7\u76f8\u5e94\u7684 Hash \u7b97\u6cd5\u5904\u7406\u4e4b\u540e\u7684 Hash \u503c\u7684\u5927\u5c0f\u5173\u7cfb\uff0c\u5e76\u4e0d\u80fd\u4fdd\u8bc1\u548cHash\u8fd0\u7b97\u524d\u5b8c\u5168\u4e00\u6837\u3002 <\/p>\n<p>\uff082\uff09Hash \u7d22\u5f15\u65e0\u6cd5\u88ab\u7528\u6765\u907f\u514d\u6570\u636e\u7684\u6392\u5e8f\u64cd\u4f5c\u3002 <\/p>\n<p>\u7531\u4e8e Hash \u7d22\u5f15\u4e2d\u5b58\u653e\u7684\u662f\u7ecf\u8fc7 Hash \u8ba1\u7b97\u4e4b\u540e\u7684 Hash \u503c\uff0c\u800c\u4e14Hash\u503c\u7684\u5927\u5c0f\u5173\u7cfb\u5e76\u4e0d\u4e00\u5b9a\u548c Hash \u8fd0\u7b97\u524d\u7684\u952e\u503c\u5b8c\u5168\u4e00\u6837\uff0c\u6240\u4ee5\u6570\u636e\u5e93\u65e0\u6cd5\u5229\u7528\u7d22\u5f15\u7684\u6570\u636e\u6765\u907f\u514d\u4efb\u4f55\u6392\u5e8f\u8fd0\u7b97\uff1b <\/p>\n<p>\uff083\uff09Hash \u7d22\u5f15\u4e0d\u80fd\u5229\u7528\u90e8\u5206\u7d22\u5f15\u952e\u67e5\u8be2\u3002 <\/p>\n<p>\u5bf9\u4e8e\u7ec4\u5408\u7d22\u5f15\uff0cHash \u7d22\u5f15\u5728\u8ba1\u7b97 Hash \u503c\u7684\u65f6\u5019\u662f\u7ec4\u5408\u7d22\u5f15\u952e\u5408\u5e76\u540e\u518d\u4e00\u8d77\u8ba1\u7b97 Hash \u503c\uff0c\u800c\u4e0d\u662f\u5355\u72ec\u8ba1\u7b97 Hash \u503c\uff0c\u6240\u4ee5\u901a\u8fc7\u7ec4\u5408\u7d22\u5f15\u7684\u524d\u9762\u4e00\u4e2a\u6216\u51e0\u4e2a\u7d22\u5f15\u952e\u8fdb\u884c\u67e5\u8be2\u7684\u65f6\u5019\uff0cHash \u7d22\u5f15\u4e5f\u65e0\u6cd5\u88ab\u5229\u7528\u3002 <\/p>\n<p>\uff084\uff09Hash \u7d22\u5f15\u5728\u4efb\u4f55\u65f6\u5019\u90fd\u4e0d\u80fd\u907f\u514d\u8868\u626b\u63cf\u3002 <\/p>\n<p>\u524d\u9762\u5df2\u7ecf\u77e5\u9053\uff0cHash \u7d22\u5f15\u662f\u5c06\u7d22\u5f15\u952e\u901a\u8fc7 Hash \u8fd0\u7b97\u4e4b\u540e\uff0c\u5c06 Hash\u8fd0\u7b97\u7ed3\u679c\u7684 Hash \u503c\u548c\u6240\u5bf9\u5e94\u7684\u884c\u6307\u9488\u4fe1\u606f\u5b58\u653e\u4e8e\u4e00\u4e2a Hash \u8868\u4e2d\uff0c\u7531\u4e8e\u4e0d\u540c\u7d22\u5f15\u952e\u5b58\u5728\u76f8\u540c Hash \u503c\uff0c\u6240\u4ee5\u5373\u4f7f\u53d6\u6ee1\u8db3\u67d0\u4e2a Hash \u952e\u503c\u7684\u6570\u636e\u7684\u8bb0\u5f55\u6761\u6570\uff0c\u4e5f\u65e0\u6cd5\u4ece Hash \u7d22\u5f15\u4e2d\u76f4\u63a5\u5b8c\u6210\u67e5\u8be2\uff0c\u8fd8\u662f\u8981\u901a\u8fc7\u8bbf\u95ee\u8868\u4e2d\u7684\u5b9e\u9645\u6570\u636e\u8fdb\u884c\u76f8\u5e94\u7684\u6bd4\u8f83\uff0c\u5e76\u5f97\u5230\u76f8\u5e94\u7684\u7ed3\u679c\u3002 <\/p>\n<p>\uff085\uff09Hash \u7d22\u5f15\u9047\u5230\u5927\u91cfHash\u503c\u76f8\u7b49\u7684\u60c5\u51b5\u540e\u6027\u80fd\u5e76\u4e0d\u4e00\u5b9a\u5c31\u4f1a\u6bd4B-Tree\u7d22\u5f15\u9ad8\u3002 <\/p>\n<p>\u5bf9\u4e8e\u9009\u62e9\u6027\u6bd4\u8f83\u4f4e\u7684\u7d22\u5f15\u952e\uff0c\u5982\u679c\u521b\u5efa Hash \u7d22\u5f15\uff0c\u90a3\u4e48\u5c06\u4f1a\u5b58\u5728\u5927\u91cf\u8bb0\u5f55\u6307\u9488\u4fe1\u606f\u5b58\u4e8e\u540c\u4e00\u4e2a Hash \u503c\u76f8\u5173\u8054\u3002\u8fd9\u6837\u8981\u5b9a\u4f4d\u67d0\u4e00\u6761\u8bb0\u5f55\u65f6\u5c31\u4f1a\u975e\u5e38\u9ebb\u70e6\uff0c\u4f1a\u6d6a\u8d39\u591a\u6b21\u8868\u6570\u636e\u7684\u8bbf\u95ee\uff0c\u800c\u9020\u6210\u6574\u4f53\u6027\u80fd\u4f4e\u4e0b\u3002<\/p>\n<p>\u611a\u5b89\u6211\u7a0d\u4f5c\u8865\u5145\uff0c\u8bb2\u4e00\u4e0bHASH\u7d22\u5f15\u7684\u8fc7\u7a0b\uff0c\u987a\u4fbf\u89e3\u91ca\u4e0b\u4e0a\u9762\u7684\u7b2c4,5\u6761\uff1a<\/p>\n<p>\u5f53\u6211\u4eec\u4e3a\u67d0\u4e00\u5217\u6216\u67d0\u51e0\u5217\u5efa\u7acbhash\u7d22\u5f15\u65f6\uff08\u76ee\u524d\u5c31\u53ea\u6709MEMORY\u5f15\u64ce\u663e\u5f0f\u5730\u652f\u6301\u8fd9\u79cd\u7d22\u5f15\uff09\uff0c\u4f1a\u5728\u786c\u76d8\u4e0a\u751f\u6210\u7c7b\u4f3c\u5982\u4e0b\u7684\u6587\u4ef6\uff1a<\/p>\n<p>hash\u503c \u5b58\u50a8\u5730\u5740<\/p>\n<p>1db54bc745a#45b5 <\/p>\n<p>4bca452157d#4556,77#45cc\u2026 <\/p>\n<p>\u2026<\/p>\n<p>hash\u503c\u5373\u4e3a\u901a\u8fc7\u7279\u5b9a\u7b97\u6cd5\u7531\u6307\u5b9a\u5217\u6570\u636e\u8ba1\u7b97\u51fa\u6765\uff0c\u78c1\u76d8\u5730\u5740\u5373\u4e3a\u6240\u5728\u6570\u636e\u884c\u5b58\u50a8\u5728\u786c\u76d8\u4e0a\u7684\u5730\u5740\uff08\u4e5f\u6709\u53ef\u80fd\u662f\u5176\u4ed6\u5b58\u50a8\u5730\u5740\uff0c\u5176\u5b9eMEMORY\u4f1a\u5c06hash\u8868\u5bfc\u5165\u5185\u5b58\uff09\u3002<\/p>\n<p>\u8fd9\u6837\uff0c\u5f53\u6211\u4eec\u8fdb\u884cWHERE age = 18 \u65f6\uff0c\u4f1a\u5c0618\u901a\u8fc7\u76f8\u540c\u7684\u7b97\u6cd5\u8ba1\u7b97\u51fa\u4e00\u4e2ahash\u503c==&gt;\u5728hash\u8868\u4e2d\u627e\u5230\u5bf9\u5e94\u7684\u50a8\u5b58\u5730\u5740==&gt;\u6839\u636e\u5b58\u50a8\u5730\u5740\u53d6\u5f97\u6570\u636e\u3002<\/p>\n<p>\u6240\u4ee5\uff0c\u6bcf\u6b21\u67e5\u8be2\u65f6\u90fd\u8981\u904d\u5386hash\u8868\uff0c\u76f4\u5230\u627e\u5230\u5bf9\u5e94\u7684hash\u503c\uff0c\u5982\uff084\uff09\uff0c\u6570\u636e\u91cf\u5927\u4e86\u4e4b\u540e\uff0chash\u8868\u4e5f\u4f1a\u53d8\u5f97\u5e9e\u5927\u8d77\u6765\uff0c\u6027\u80fd\u4e0b\u964d\uff0c\u904d\u5386\u8017\u65f6\u589e\u52a0\uff0c\u5982\uff085\uff09\u3002<\/p>\n<p>REE<\/p>\n<p>REE\u7d22\u5f15\u5c31\u662f\u4e00\u79cd\u5c06\u7d22\u5f15\u503c\u6309\u4e00\u5b9a\u7684\u7b97\u6cd5\uff0c\u5b58\u5165\u4e00\u4e2a\u6811\u5f62\u7684\u6570\u636e\u7ed3\u6784\u4e2d\uff0c\u76f8\u4fe1\u5b66\u8fc7\u6570\u636e\u7ed3\u6784\u7684\u7ae5\u978b\u90fd\u5bf9\u5f53\u521d\u5b66\u4e60\u4e8c\u53c9\u6811\u8fd9\u79cd\u6570\u636e\u7ed3\u6784\u7684\u7ecf\u5386\u8bb0\u5fc6\u72b9\u65b0\uff0c\u53cd\u6b63\u611a\u5b89\u6211\u5f53\u65f6\u4e3a\u4e86\u8f6f\u8003\u53ef\u662f\u88ab\u8fd9\u73a9\u610f\u513f\u597d\u597d\u5730\u6298\u817e\u4e86\u4e00\u756a\uff0c\u4e0d\u8fc7\u90a3\u6b21\u8003\u8bd5\u597d\u50cf\u6ca1\u600e\u4e48\u8003\u8fd9\u4e2a\u3002\u5982\u4e8c\u53c9\u6811\u4e00\u6837\uff0c\u6bcf\u6b21\u67e5\u8be2\u90fd\u662f\u4ece\u6811\u7684\u5165\u53e3root\u5f00\u59cb\uff0c\u4f9d\u6b21\u904d\u5386node\uff0c\u83b7\u53d6leaf\u3002<\/p>\n<p>REE\u5728MyISAM\u91cc\u7684\u5f62\u5f0f\u548cInnodb\u7a0d\u6709\u4e0d\u540c<\/p>\n<p>\u5728 Innodb\u91cc\uff0c\u6709\u4e24\u79cd\u5f62\u6001\uff1a\u4e00\u662fprimary key\u5f62\u6001\uff0c\u5176leaf node\u91cc\u5b58\u653e\u7684\u662f\u6570\u636e\uff0c\u800c\u4e14\u4e0d\u4ec5\u5b58\u653e\u4e86\u7d22\u5f15\u952e\u7684\u6570\u636e\uff0c\u8fd8\u5b58\u653e\u4e86\u5176\u4ed6\u5b57\u6bb5\u7684\u6570\u636e\u3002\u4e8c\u662fsecondary index\uff0c\u5176leaf node\u548c\u666e\u901a\u7684REE\u5dee\u4e0d\u591a\uff0c\u53ea\u662f\u8fd8\u5b58\u653e\u4e86\u6307\u5411\u4e3b\u952e\u7684\u4fe1\u606f.<\/p>\n<p>\u800c\u5728MyISAM\u91cc\uff0c\u4e3b\u952e\u548c\u5176\u4ed6\u7684\u5e76\u6ca1\u6709\u592a\u5927\u533a\u522b\u3002\u4e0d\u8fc7\u548cInnodb\u4e0d\u592a\u4e00\u6837\u7684\u5730\u65b9\u662f\u5728MyISAM\u91cc\uff0cleaf node\u91cc\u5b58\u653e\u7684\u4e0d\u662f\u4e3b\u952e\u7684\u4fe1\u606f\uff0c\u800c\u662f\u6307\u5411\u6570\u636e\u6587\u4ef6\u91cc\u7684\u5bf9\u5e94\u6570\u636e\u884c\u7684\u4fe1\u606f.<\/p>\n<p>RTREE<\/p>\n<p>RTREE\u5728mysql\u5f88\u5c11\u4f7f\u7528\uff0c\u4ec5\u652f\u6301geometry\u6570\u636e\u7c7b\u578b\uff0c\u652f\u6301\u8be5\u7c7b\u578b\u7684\u5b58\u50a8\u5f15\u64ce\u53ea\u6709MyISAM\u3001BDb\u3001InnoDb\u3001NDb\u3001Archive\u51e0\u79cd\u3002<\/p>\n<p>\u76f8\u5bf9\u4e8eREE\uff0cRTREE\u7684\u4f18\u52bf\u5728\u4e8e\u8303\u56f4\u67e5\u627e.<\/p>\n<p>\u5404\u79cd\u7d22\u5f15\u7684\u4f7f\u7528\u60c5\u51b5<\/p>\n<p>\uff081\uff09\u5bf9\u4e8eREE\u8fd9\u79cdMysql\u9ed8\u8ba4\u7684\u7d22\u5f15\u7c7b\u578b\uff0c\u5177\u6709\u666e\u904d\u7684\u9002\u7528\u6027<\/p>\n<p>\uff082\uff09\u7531\u4e8eFULLTEXT\u5bf9\u4e2d\u6587\u652f\u6301\u4e0d\u662f\u5f88\u597d\uff0c\u5728\u6ca1\u6709\u63d2\u4ef6\u7684\u60c5\u51b5\u4e0b\uff0c\u66f4\u597d\u4e0d\u8981\u4f7f\u7528\u3002\u5176\u5b9e\uff0c\u4e00\u4e9b\u5c0f\u7684\u535a\u5ba2\u5e94\u7528\uff0c\u53ea\u9700\u8981\u5728\u6570\u636e\u91c7\u96c6\u65f6\uff0c\u4e3a\u5176\u5efa\u7acb\u5173\u952e\u5b57\u5217\u8868\uff0c\u901a\u8fc7\u5173\u952e\u5b57\u7d22\u5f15\uff0c\u4e5f\u662f\u4e00\u4e2a\u4e0d\u9519\u7684\u65b9\u6cd5\uff0c\u81f3\u5c11\u611a\u5b89\u6211\u662f\u7ecf\u5e38\u8fd9\u4e48\u505a\u7684\u3002<\/p>\n<p>\uff083\uff09\u5bf9\u4e8e\u4e00\u4e9b\u641c\u7d22\u5f15\u64ce\u7ea7\u522b\u7684\u5e94\u7528\u6765\u8bf4\uff0cFULLTEXT\u540c\u6837\u4e0d\u662f\u4e00\u4e2a\u597d\u7684\u5904\u7406\u65b9\u6cd5\uff0cMysql\u7684\u5168\u6587\u7d22\u5f15\u5efa\u7acb\u7684\u6587\u4ef6\u8fd8\u662f\u6bd4\u8f83\u5927\u7684\uff0c\u800c\u4e14\u6548\u7387\u4e0d\u662f\u5f88\u9ad8\uff0c\u5373\u4fbf\u662f\u4f7f\u7528\u4e86\u4e2d\u6587\u5206\u8bcd\u63d2\u4ef6\uff0c\u5bf9\u4e2d\u6587\u5206\u8bcd\u652f\u6301\u4e5f\u53ea\u662f\u4e00\u822c\u3002\u771f\u8981\u78b0\u5230\u8fd9\u79cd\u95ee\u9898\uff0cApache\u7684Lucene\u6216\u8bb8\u662f\u4f60\u7684\u9009\u62e9\u3002<\/p>\n<p>\uff084\uff09\u6b63\u662f\u56e0\u4e3ahash\u8868\u5728\u5904\u7406\u8f83\u5c0f\u6570\u636e\u91cf\u65f6\u5177\u6709\u65e0\u53ef\u6bd4\u62df\u7684\u7d20\u7684\u4f18\u52bf\uff0c\u6240\u4ee5hash\u7d22\u5f15\u5f88\u9002\u5408\u505a\u7f13\u5b58\uff08\u5185\u5b58\u6570\u636e\u5e93\uff09\u3002\u5982mysql\u6570\u636e\u5e93\u7684\u5185\u5b58\u7248\u672cMemsql\uff0c\u4f7f\u7528\u91cf\u5f88\u5e7f\u6cdb\u7684\u7f13\u5b58\u5de5\u5177Mencached\uff0cNoSql\u6570\u636e\u5e93redis\u7b49\uff0c\u90fd\u4f7f\u7528\u4e86hash\u7d22\u5f15\u8fd9\u79cd\u5f62\u5f0f\u3002\u5f53\u7136\uff0c\u4e0d\u60f3\u5b66\u4e60\u8fd9\u4e9b\u4e1c\u897f\u7684\u8bddMysql\u7684MEMORY\u5f15\u64ce\u4e5f\u662f\u53ef\u4ee5\u6ee1\u8db3\u8fd9\u79cd\u9700\u6c42\u7684\u3002<\/p>\n<p>\uff085\uff09\u81f3\u4e8eRTREE\uff0c\u611a\u5b89\u6211\u81f3\u4eca\u8fd8\u6ca1\u6709\u4f7f\u7528\u8fc7\uff0c\u5b83\u5177\u4f53\u600e\u4e48\u6837\uff0c\u6211\u5c31\u4e0d\u77e5\u9053\u4e86\u3002\u6709RTREE\u4f7f\u7528\u7ecf\u5386\u7684\u540c\u5b66\uff0c\u5230\u65f6\u53ef\u4ee5\u4ea4\u6d41\u4e0b\uff01<\/p>\n<p>\u5728\u6ee1\u8db3\u8bed\u53e5\u9700\u6c42\u7684\u60c5\u51b5\u4e0b\uff0c\u5c3d\u91cf\u5c11\u7684\u8bbf\u95ee\u8d44\u6e90\u662f\u6570\u636e\u5e93\u8bbe\u8ba1\u7684\u91cd\u8981\u539f\u5219\uff0c\u8fd9\u548c\u6267\u884c\u7684 SQL \u6709\u76f4\u63a5\u7684\u5173\u7cfb\uff0c\u7d22\u5f15\u95ee\u9898\u53c8\u662f SQL \u95ee\u9898\u4e2d\u51fa\u73b0\u9891\u7387\u66f4\u9ad8\u7684\uff0c\u5e38\u89c1\u7684\u7d22\u5f15\u95ee\u9898\u5305\u62ec\uff1a\u65e0\u7d22\u5f15\uff08\u5931\u6548\uff09\u3001\u9690\u5f0f\u8f6c\u6362\u3002<\/p>\n<p>1. SQL \u6267\u884c\u6d41\u7a0b\u770b\u4e00\u4e2a\u95ee\u9898\uff0c\u5728\u4e0b\u9762\u8fd9\u4e2a\u8868 T \u4e2d\uff0c\u5982\u679c\u6211\u8981\u6267\u884c select * from T where k between 3 and 5; \u9700\u8981\u6267\u884c\u51e0\u6b21\u6811\u7684\u641c\u7d22\u64cd\u4f5c\uff0c\u4f1a\u626b\u63cf\u591a\u5c11\u884c\uff1fmysql&gt; create table T ( &nbsp; &nbsp;-&gt; ID int primary key, &nbsp; &nbsp;-&gt; k int NOT NULL DEFAULT 0, &nbsp; &nbsp;-&gt; s varchar(16) NOT NULL DEFAULT \u201d, &nbsp; &nbsp;-&gt; index k(k)) &nbsp; &nbsp;-&gt; engine=InnoDB;mysql&gt; insert into T values(100,1, \u2018aa\u2019),(200,2,\u2019bb\u2019),\\ &nbsp; &nbsp; &nbsp;(300,3,\u2019cc\u2019),(500,5,\u2019ee\u2019),(600,6,\u2019ff\u2019),(700,7,\u2019gg\u2019);<\/p>\n<p>\u8fd9\u5206\u522b\u662f ID \u5b57\u6bb5\u7d22\u5f15\u6811\u3001k \u5b57\u6bb5\u7d22\u5f15\u6811\u3002&nbsp;<\/p>\n<p>\u8fd9\u6761 SQL \u8bed\u53e5\u7684\u6267\u884c\u6d41\u7a0b\uff1a<\/p>\n<p>1. \u5728 k \u7d22\u5f15\u6811\u4e0a\u627e\u5230 k=3\uff0c\u83b7\u5f97 ID=3002. \u56de\u8868\u5230 ID \u7d22\u5f15\u6811\u67e5\u627e ID=300 \u7684\u8bb0\u5f55\uff0c\u5bf9\u5e94 R33. \u5728 k \u7d22\u5f15\u6811\u627e\u5230\u4e0b\u4e00\u4e2a\u503c k=5\uff0cID=5004. \u518d\u56de\u5230\u54ea\u950b ID \u7d22\u5f15\u6811\u627e\u5230\u5bf9\u5e94 ID=500 \u7684 R4<\/p>\n<p>5. \u5728 k \u7d22\u5f15\u6811\u53bb\u4e0b\u4e00\u4e2a\u503c k=6\uff0c\u4e0d\u7b26\u5408\u6761\u4ef6\uff0c\u5faa\u73af\u7ed3\u675f<\/p>\n<p>\u8fd9\u4e2a\u8fc7\u7a0b\u8bfb\u53d6\u4e86 k \u7d22\u5f15\u6811\u7684\u4e09\u6761\u8bb0\u5f55\uff0c\u56de\u8868\u4e86\u4e24\u6b21\u3002\u56e0\u4e3a\u67e5\u8be2\u7ed3\u679c\u6240\u9700\u8981\u7684\u6570\u636e\u53ea\u5728\u4e3b\u952e\u7d22\u5f15\u4e0a\u6709\uff0c\u6240\u4ee5\u5fc5\u987b\u5f97\u56de\u8868\u3002\u6240\u4ee5\uff0c\u6211\u4eec\u8be5\u5982\u4f55\u901a\u8fc7\u4f18\u5316\u7d22\u5f15\uff0c\u6765\u907f\u514d\u56de\u8868\u5462\uff1f<\/p>\n<p>2. \u5e38\u89c1\u7d22\u5f15\u4f18\u53162.1 \u8986\u76d6\u7d22\u5f15\u8986\u76d6\u7d22\u5f15\uff0c\u6362\u8a00\u4e4b\u5c31\u662f\u7d22\u5f15\u8981\u8986\u76d6\u6211\u4eec\u7684\u67e5\u8be2\u8bf7\u6c42\uff0c\u65e0\u9700\u56de\u8868\u3002<\/p>\n<p>\u5982\u679c\u6267\u884c\u7684\u8bed\u53e5\u662f select ID from T wherek between 3 and 5;\uff0c\u8fd9\u6837\u7684\u8bdd\u56e0\u4e3a ID \u7684\u503c\u5728 k \u7d22\u5f15\u6811\u4e0a\uff0c\u5c31\u4e0d\u9700\u8981\u56de\u8868\u4e86\u3002<\/p>\n<p>\u8986\u76d6\u7d22\u5f15\u53ef\u4ee5\u51cf\u5c11\u6811\u7684\u641c\u7d22\u6b21\u6570\uff0c\u663e\u8457\u63d0\u5347\u67e5\u8be2\u6027\u80fd\uff0c\u662f\u5e38\u7528\u7684\u6027\u80fd\u4f18\u5316\u624b\u6bb5\u3002<\/p>\n<p>\u4f46\u662f\uff0c\u7ef4\u62a4\u7d22\u5f15\u662f\u6709\u4ee3\u4ef7\u7684\uff0c\u6240\u4ee5\u5728\u5efa\u7acb\u5197\u4f59\u7d22\u5f15\u6765\u652f\u6301\u8986\u76d6\u7d22\u5f15\u65f6\u8981\u6743\u8861\u5229\u5f0a\u3002<\/p>\n<p>2.2 \u6700\u5de6\u524d\u7f00\u539f\u5219<\/p>\n<p>B+ \u6811\u7684\u6570\u636e\u9879\u662f\u590d\u5408\u7684\u6570\u636e\u7ed3\u6784\uff0c\u6bd4\u5982 (name,sex\uff0cage) \u7684\u65f6\u5019\uff0cB+ \u6811\u662f\u6309\u7167\u4ece\u5de6\u5230\u53f3\u7684\u987a\u5e8f\u6765\u5efa\u7acb\u641c\u7d22\u6811\u7684\uff0c\u5f53 (\u5f20\u4e09,F,26) \u8fd9\u6837\u7684\u6570\u636e\u6765\u68c0\u7d22\u7684\u65f6\u5019\uff0cB+ \u6811\u4f1a\u4f18\u5148\u6bd4\u8f83 name \u6765\u786e\u5b9a\u4e0b\u4e00\u6b65\u7684\u68c0\u7d22\u65b9\u5411\uff0c\u5982\u679c name \u76f8\u540c\u518d\u4f9d\u6b21\u6bd4\u8f83 sex \u548c age\uff0c\u6700\u540e\u5f97\u5230\u68c0\u7d22\u7684\u6570\u636e\u3002<\/p>\n<p># \u6709\u8fd9\u6837\u4e00\u4e2a\u8868\u674e\u6e90\u664c P<\/p>\n<p>mysql&gt; create table P (id int primary key, name varchar(10) not null, sex varchar(1), age int, index tl(name,sex,age)) engine=IInnoDB;<\/p>\n<p>mysql&gt; insert into P values(1,\u2019\u5f20\u4e09\u2019,\u2019F\u2019,26),(2,\u2019\u5f20\u88c2\u5dee\u4e09\u2019,\u2019M\u2019,27),(3,\u2019\u674e\u56db\u2019,\u2019F\u2019,28),(4,\u2019\u4e4c\u5179\u2019,\u2019F\u2019,22),(5,\u2019\u5f20\u4e09\u2019,\u2019M\u2019,21),(6,\u2019\u738b\u4e94\u2019,\u2019M\u2019,28);<\/p>\n<p># \u4e0b\u9762\u7684\u8bed\u53e5\u7ed3\u679c\u76f8\u540c<\/p>\n<p>mysql&gt; select * from P where name=\u2019\u5f20\u4e09\u2019 and sex=\u2019F\u2019; &nbsp; &nbsp; ## A1<\/p>\n<p>mysql&gt; select * from P where sex=\u2019F\u2019 and age=26;## A2<\/p>\n<p># explain \u770b\u4e00\u4e0b<\/p>\n<p>mysql&gt; explain select * from P where name=\u2019\u5f20\u4e09\u2019 and sex=\u2019F\u2019;<\/p>\n<p>+\u2014-++++\u2014\u2014+-+\u2014\u2014+++\u2014\u2014+++<\/p>\n<p>| id | select_type | table | partitions | type | possible_keys | key &nbsp;| key_len | ref| rows | filtered | Extra|<\/p>\n<p>+\u2014-++++\u2014\u2014+-+\u2014\u2014+++\u2014\u2014+++<\/p>\n<p>| &nbsp;1 | SIMPLE &nbsp; &nbsp; &nbsp;| P &nbsp; &nbsp; | NULL| ref &nbsp;| tl| tl &nbsp; || const,const | &nbsp; &nbsp;1 | &nbsp; 100.00 | Using index |<\/p>\n<p>+\u2014-++++\u2014\u2014+-+\u2014\u2014+++\u2014\u2014+++<\/p>\n<p>mysql&gt; explain select * from P where sex=\u2019F\u2019 and age=26;<\/p>\n<p>+\u2014-+++++-+\u2014\u2014++\u2014\u2014+\u2014\u2014+++<\/p>\n<p>| id | select_type | table | partitions | type &nbsp;| possible_keys | key &nbsp;| key_len | ref &nbsp;| rows | filtered | Extra &nbsp; &nbsp; &nbsp;|<\/p>\n<p>+\u2014-+++++-+\u2014\u2014++\u2014\u2014+\u2014\u2014+++<\/p>\n<p>| &nbsp;1 | SIMPLE &nbsp; &nbsp; &nbsp;| P &nbsp; &nbsp; | NULL| index | NULL| tl &nbsp; || NULL | &nbsp; &nbsp;6 | &nbsp; &nbsp;16.67 | Using where; Using index |<\/p>\n<p>+\u2014-+++++-+\u2014\u2014++\u2014\u2014+\u2014\u2014+++<\/p>\n<p>\u53ef\u4ee5\u6e05\u695a\u7684\u770b\u5230\uff0cA1 \u4f7f\u7528 tl \u7d22\u5f15\uff0cA2 \u8fdb\u884c\u4e86\u5168\u8868\u626b\u63cf\uff0c\u867d\u7136 A2 \u7684\u4e24\u4e2a\u6761\u4ef6\u90fd\u5728 tl \u7d22\u5f15\u4e2d\u51fa\u73b0\uff0c\u4f46\u662f\u6ca1\u6709\u4f7f\u7528\u5230 name \u5217\uff0c\u4e0d\u7b26\u5408\u6700\u5de6\u524d\u7f00\u539f\u5219\uff0c\u65e0\u6cd5\u4f7f\u7528\u7d22\u5f15\u3002\u6240\u4ee5\u5728\u5efa\u7acb\u8054\u5408\u7d22\u5f15\u7684\u65f6\u5019\uff0c\u5982\u4f55\u5b89\u6392\u7d22\u5f15\u5185\u7684\u5b57\u6bb5\u6392\u5e8f\u662f\u5173\u952e\u3002\u8bc4\u4f30\u6807\u51c6\u662f\u7d22\u5f15\u7684\u590d\u7528\u80fd\u529b\uff0c\u56e0\u4e3a\u652f\u6301\u6700\u5de6\u524d\u7f00\uff0c\u6240\u4ee5\u5f53\u5efa\u7acb\uff08a\uff0cb\uff09\u8fd9\u4e2a\u8054\u5408\u7d22\u5f15\u4e4b\u540e\uff0c\u5c31\u4e0d\u9700\u8981\u7ed9 a \u5355\u72ec\u5efa\u7acb\u7d22\u5f15\u3002\u539f\u5219\u4e0a\uff0c\u5982\u679c\u901a\u8fc7\u8c03\u6574\u987a\u5e8f\uff0c\u53ef\u4ee5\u5c11\u7ef4\u62a4\u4e00\u4e2a\u7d22\u5f15\uff0c\u90a3\u4e48\u8fd9\u4e2a\u987a\u5e8f\u5f80\u5f80\u5c31\u662f\u9700\u8981\u4f18\u5148\u8003\u8651\u91c7\u7528\u7684\u3002\u4e0a\u9762\u8fd9\u4e2a\u4f8b\u5b50\u4e2d\uff0c\u5982\u679c\u67e5\u8be2\u6761\u4ef6\u91cc\u53ea\u6709 b\uff0c\u5c31\u662f\u6ca1\u6cd5\u5229\u7528\uff08a\uff0cb\uff09\u8fd9\u4e2a\u8054\u5408\u7d22\u5f15\u7684\uff0c\u8fd9\u65f6\u5019\u5c31\u4e0d\u5f97\u4e0d\u7ef4\u62a4\u53e6\u4e00\u4e2a\u7d22\u5f15\uff0c\u4e5f\u5c31\u662f\u8bf4\u8981\u540c\u65f6\u7ef4\u62a4\uff08a\uff0cb\uff09\u3001\uff08b\uff09\u4e24\u4e2a\u7d22\u5f15\u3002\u8fd9\u6837\u7684\u8bdd\uff0c\u5c31\u9700\u8981\u8003\u8651\u7a7a\u95f4\u5360\u7528\u4e86\uff0c\u6bd4\u5982\uff0cname \u548c age \u7684\u8054\u5408\u7d22\u5f15\uff0cname \u5b57\u6bb5\u6bd4 age \u5b57\u6bb5\u5360\u7528\u7a7a\u95f4\u5927\uff0c\u6240\u4ee5\u521b\u5efa\uff08name\uff0cage\uff09\u8054\u5408\u7d22\u5f15\u548c\uff08age\uff09\u7d22\u5f15\u5360\u7528\u7a7a\u95f4\u662f\u8981\u5c0f\u4e8e\uff08age\uff0cname\uff09\u3001(name\uff09\u7d22\u5f15\u7684\u3002<\/p>\n<p>2.3 \u7d22\u5f15\u4e0b\u63a8<\/p>\n<p>\u4ee5\u4eba\u5458\u8868\u7684\u8054\u5408\u7d22\u5f15\uff08name, age\uff09\u4e3a\u4f8b\u3002\u5982\u679c\u73b0\u5728\u6709\u4e00\u4e2a\u9700\u6c42\uff1a\u68c0\u7d22\u51fa\u8868\u4e2d\u201c\u540d\u5b57\u4e4b\u4e00\u4e2a\u5b57\u662f\u5f20\uff0c\u800c\u4e14\u5e74\u9f84\u662f26\u5c81\u7684\u6240\u6709\u7537\u6027\u201d\u3002\u90a3\u4e48\uff0cSQL \u8bed\u53e5\u662f\u8fd9\u4e48\u5199\u7684mysql&gt; select * from tuser where name like \u2018\u5f20%\u2019 and age=26 and sex=M;<\/p>\n<p>\u901a\u8fc7\u6700\u5de6\u524d\u7f00\u7d22\u5f15\u89c4\u5219\uff0c\u4f1a\u627e\u5230 ID1\uff0c\u7136\u540e\u9700\u8981\u5224\u65ad\u5176\u4ed6\u6761\u4ef6\u662f\u5426\u6ee1\u8db3\u5728 MySQL 5.6 \u4e4b\u524d\uff0c\u53ea\u80fd\u4ece ID1 \u5f00\u59cb\u4e00\u4e2a\u4e2a\u56de\u8868\u3002\u5230\u4e3b\u952e\u7d22\u5f15\u4e0a\u627e\u51fa\u6570\u636e\u884c\uff0c\u518d\u5bf9\u6bd4\u5b57\u6bb5\u503c\u3002\u800c MySQL 5.6 \u5f15\u5165\u7684\u7d22\u5f15\u4e0b\u63a8\u4f18\u5316(index condition pushdown)\uff0c\u53ef\u4ee5\u5728\u7d22\u5f15\u904d\u5386\u8fc7\u7a0b\u4e2d\uff0c\u5bf9\u7d22\u5f15\u4e2d\u5305\u542b\u7684\u5b57\u6bb5\u5148\u505a\u5224\u65ad\uff0c\u76f4\u63a5\u8fc7\u6ee4\u6389\u4e0d\u6ee1\u8db3\u6761\u4ef6\u7684\u8bb0\u5f55\uff0c\u51cf\u5c11\u56de\u8868\u6b21\u6570\u3002\u8fd9\u6837\uff0c\u51cf\u5c11\u4e86\u56de\u8868\u6b21\u6570\u548c\u4e4b\u540e\u518d\u6b21\u8fc7\u6ee4\u7684\u5de5\u4f5c\u91cf\uff0c\u660e\u663e\u63d0\u9ad8\u68c0\u7d22\u901f\u5ea6\u3002<\/p>\n<p>2.4 \u9690\u5f0f\u7c7b\u578b\u8f6c\u5316<\/p>\n<p>\u9690\u5f0f\u7c7b\u578b\u8f6c\u5316\u4e3b\u8981\u539f\u56e0\u662f\uff0c\u8868\u7ed3\u6784\u4e2d\u6307\u5b9a\u7684\u6570\u636e\u7c7b\u578b\u4e0e\u4f20\u5165\u7684\u6570\u636e\u7c7b\u578b\u4e0d\u540c\uff0c\u5bfc\u81f4\u7d22\u5f15\u65e0\u6cd5\u4f7f\u7528\u3002\u6240\u4ee5\u6709\u4e24\u79cd\u65b9\u6848\uff1a<\/p>\n<p>\u4fee\u6539\u8868\u7ed3\u6784\uff0c\u4fee\u6539\u5b57\u6bb5\u6570\u636e\u7c7b\u578b\u3002<\/p>\n<p>\u4fee\u6539\u5e94\u7528\uff0c\u5c06\u5e94\u7528\u4e2d\u4f20\u5165\u7684\u5b57\u7b26\u7c7b\u578b\u6539\u4e3a\u4e0e\u8868\u7ed3\u6784\u76f8\u540c\u7c7b\u578b\u3002<\/p>\n<p>3. \u4e3a\u4ec0\u4e48\u4f1a\u9009\u9519\u7d22\u5f153.1 \u4f18\u5316\u5668\u9009\u62e9\u7d22\u5f15\u662f\u4f18\u5316\u5668\u7684\u5de5\u4f5c\uff0c\u5176\u76ee\u7684\u662f\u627e\u5230\u4e00\u4e2a\u66f4\u4f18\u7684\u6267\u884c\u65b9\u6848\uff0c\u7528\u6700\u5c0f\u7684\u4ee3\u4ef7\u53bb\u6267\u884c\u8bed\u53e5\u3002\u5728\u6570\u636e\u5e93\u4e2d\uff0c\u626b\u63cf\u884c\u6570\u662f\u5f71\u54cd\u6267\u884c\u4ee3\u4ef7\u7684\u56e0\u7d20\u4e4b\u4e00\u3002\u626b\u63cf\u7684\u884c\u6570\u8d8a\u5c11\uff0c\u610f\u5473\u7740\u8bbf\u95ee\u78c1\u76d8\u6570\u636e\u7684\u6b21\u6570\u8d8a\u5c11\uff0c\u6d88\u8017\u7684 CPU \u8d44\u6e90\u8d8a\u5c11\u3002\u5f53\u7136\uff0c\u626b\u63cf\u884c\u6570\u5e76\u4e0d\u662f\u552f\u4e00\u7684\u5224\u65ad\u6807\u51c6\uff0c\u4f18\u5316\u5668\u8fd8\u4f1a\u7ed3\u5408\u662f\u5426\u4f7f\u7528\u4e34\u65f6\u8868\u3001\u662f\u5426\u6392\u5e8f\u7b49\u56e0\u7d20\u8fdb\u884c\u7efc\u5408\u5224\u65ad\u3002<\/p>\n<p>3.2 \u626b\u63cf\u884c\u6570<\/p>\n<p>MySQL \u5728\u771f\u6b63\u5f00\u59cb\u6267\u884c\u8bed\u53e5\u4e4b\u524d\uff0c\u5e76\u4e0d\u80fd\u7cbe\u786e\u7684\u77e5\u9053\u6ee1\u8db3\u8fd9\u4e2a\u6761\u4ef6\u7684\u8bb0\u5f55\u6709\u591a\u5c11\u6761\uff0c\u53ea\u80fd\u901a\u8fc7\u7d22\u5f15\u7684\u533a\u5206\u5ea6\u6765\u5224\u65ad\u3002\u663e\u7136\uff0c\u4e00\u4e2a\u7d22\u5f15\u4e0a\u4e0d\u540c\u7684\u503c\u8d8a\u591a\uff0c\u7d22\u5f15\u7684\u533a\u5206\u5ea6\u5c31\u8d8a\u597d\uff0c\u800c\u4e00\u4e2a\u7d22\u5f15\u4e0a\u4e0d\u540c\u503c\u7684\u4e2a\u6570\u6211\u4eec\u79f0\u4e3a\u201c\u57fa\u6570\u201d\uff0c\u4e5f\u5c31\u662f\u8bf4\uff0c\u8fd9\u4e2a\u57fa\u6570\u8d8a\u5927\uff0c\u7d22\u5f15\u7684\u533a\u5206\u5ea6\u8d8a\u597d\u3002# \u901a\u8fc7 show index \u65b9\u6cd5\uff0c\u67e5\u770b\u7d22\u5f15\u7684\u57fa\u6570mysql&gt; show index from t;++++++++++\u2014\u2014+++-+| Table | Non_unique | Key_name | Seq_in_index | Column_name | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment | Index_comment |++++++++++\u2014\u2014+++-+| t &nbsp; &nbsp; || PRIMARY &nbsp;|| id| A|| &nbsp; &nbsp; NULL | NULL &nbsp; | &nbsp; &nbsp; &nbsp;| REE &nbsp; &nbsp; &nbsp;|| || t &nbsp; &nbsp; || a|| a| A|| &nbsp; &nbsp; NULL | NULL &nbsp; | YES &nbsp;| REE &nbsp; &nbsp; &nbsp;|| || t &nbsp; &nbsp; || b|| b| A|| &nbsp; &nbsp; NULL | NULL &nbsp; | YES &nbsp;| REE &nbsp; &nbsp; &nbsp;|| |++++++++++\u2014\u2014+++-+<\/p>\n<p>MySQL \u4f7f\u7528\u91c7\u6837\u7edf\u8ba1\u65b9\u6cd5\u6765\u4f30\u7b97\u57fa\u6570\uff1a\u91c7\u6837\u7edf\u8ba1\u7684\u65f6\u5019\uff0cInnoDB \u9ed8\u8ba4\u4f1a\u9009\u62e9 N \u4e2a\u6570\u636e\u9875\uff0c\u7edf\u8ba1\u8fd9\u4e9b\u9875\u9762\u4e0a\u7684\u4e0d\u540c\u503c\uff0c\u5f97\u5230\u4e00\u4e2a\u5e73\u5747\u503c\uff0c\u7136\u540e\u4e58\u4ee5\u8fd9\u4e2a\u7d22\u5f15\u7684\u9875\u9762\u6570\uff0c\u5c31\u5f97\u5230\u4e86\u8fd9\u4e2a\u7d22\u5f15\u7684\u57fa\u6570\u3002\u800c\u6570\u636e\u8868\u662f\u4f1a\u6301\u7eed\u66f4\u65b0\u7684\uff0c\u7d22\u5f15\u7edf\u8ba1\u4fe1\u606f\u4e5f\u4e0d\u4f1a\u56fa\u5b9a\u4e0d\u53d8\u3002\u6240\u4ee5\uff0c\u5f53\u53d8\u66f4\u7684\u6570\u636e\u884c\u6570\u8d85\u8fc7 1\/M \u7684\u65f6\u5019\uff0c\u4f1a\u81ea\u52a8\u89e6\u53d1\u91cd\u65b0\u505a\u4e00\u6b21\u7d22\u5f15\u7edf\u8ba1\u3002<\/p>\n<p>\u5728 MySQL \u4e2d\uff0c\u6709\u4e24\u79cd\u5b58\u50a8\u7d22\u5f15\u7edf\u8ba1\u7684\u65b9\u5f0f\uff0c\u53ef\u4ee5\u901a\u8fc7\u8bbe\u7f6e\u53c2\u6570 innodb_stats_persistent \u7684\u503c\u6765\u9009\u62e9\uff1a<\/p>\n<p>on \u8868\u793a\u7edf\u8ba1\u4fe1\u606f\u4f1a\u6301\u4e45\u5316\u5b58\u50a8\u3002\u9ed8\u8ba4 N = 20\uff0cM = 10\u3002<\/p>\n<p>off \u8868\u793a\u7edf\u8ba1\u4fe1\u606f\u53ea\u5b58\u50a8\u5728\u5185\u5b58\u4e2d\u3002\u9ed8\u8ba4 N = 8\uff0cM = 16\u3002<\/p>\n<p>\u7531\u4e8e\u662f\u91c7\u6837\u7edf\u8ba1\uff0c\u6240\u4ee5\u4e0d\u7ba1 N \u662f 20 \u8fd8\u662f 8\uff0c\u8fd9\u4e2a\u57fa\u6570\u90fd\u5f88\u5bb9\u6613\u4e0d\u51c6\u786e\u3002\u6240\u4ee5\uff0c\u51a4\u6709\u5934\u503a\u6709\u4e3b\uff0cMySQL \u9009\u9519\u7d22\u5f15\uff0c\u8fd8\u5f97\u5f52\u548e\u5230\u6ca1\u80fd\u51c6\u786e\u5730\u5224\u65ad\u51fa\u626b\u63cf\u884c\u6570\u3002<\/p>\n<p>\u53ef\u4ee5\u7528 yze table \u6765\u91cd\u65b0\u7edf\u8ba1\u7d22\u5f15\u4fe1\u606f\uff0c\u8fdb\u884c\u4fee\u6b63\u3002<\/p>\n<p>ANAZE TABLE tbl_name \u2026<\/p>\n<p>\u5173\u4e8emysql \u67e5\u770b\u6570\u636e\u5e93\u6240\u6709\u7d22\u5f15\u7684\u4ecb\u7ecd\u5230\u6b64\u5c31\u7ed3\u675f\u4e86\uff0c\u4e0d\u77e5\u9053\u4f60\u4ece\u4e2d\u627e\u5230\u4f60\u9700\u8981\u7684\u4fe1\u606f\u4e86\u5417 \uff1f\u5982\u679c\u4f60\u8fd8\u60f3\u4e86\u89e3\u66f4\u591a\u8fd9\u65b9\u9762\u7684\u4fe1\u606f\uff0c\u8bb0\u5f97\u6536\u85cf\u5173\u6ce8\u672c\u7ad9\u3002<\/p>\n<p><a href=\"http:https:\/\/idc.net\/\">\u9999\u6e2f\u670d\u52a1\u5668<\/a>\u9996\u9009\u540e\u6d6a\u4e91\uff0c2H2G\u9996\u670810\u5143\u5f00\u901a\u3002<br \/>\u540e\u6d6a\u4e91\uff08www.IDC.Net\uff09\u63d0\u4f9b\u7b80\u5355\u597d\u7528\uff0c\u4ef7\u683c\u539a\u9053\u7684\u9999\u6e2f\/\u7f8e\u56fd\u4e91\u670d\u52a1\u5668\u548c\u72ec\u7acb\u670d\u52a1\u5668\u3002IDC+ISP+ICP\u8d44\u8d28\u3002ARIN\u548cAPNIC\u4f1a\u5458\u3002\u6210\u719f\u6280\u672f\u56e2\u961f15\u5e74\u884c\u4e1a\u7ecf\u9a8c\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>MySQL\u662f\u4e00\u79cd\u975e\u5e38\u6d41\u884c\u7684\u5173\u7cfb\u578b\u6570\u636e\u5e93\u7ba1\u7406\u7cfb\u7edf\u3002\u5b83\u4e0d\u4ec5\u652f\u6301\u5927\u89c4\u6a21\u6570\u636e\u5b58\u50a8\uff0c\u8fd8\u5177\u6709\u9ad8\u6027\u80fd\u548c\u53ef\u6269\u5c55\u6027\u7b49\u4f18\u70b9\u3002\u5728My [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7038],"tags":[],"class_list":["post-123741","post","type-post","status-publish","format-standard","hentry","category-database"],"_links":{"self":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/posts\/123741","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/comments?post=123741"}],"version-history":[{"count":0,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/posts\/123741\/revisions"}],"wp:attachment":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/media?parent=123741"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/categories?post=123741"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/tags?post=123741"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}