{"id":4227,"date":"2019-05-10T18:42:40","date_gmt":"2019-05-10T10:42:40","guid":{"rendered":"http:\/\/www.xttblog.com\/?p=4227"},"modified":"2019-05-10T18:42:40","modified_gmt":"2019-05-10T10:42:40","slug":"%e5%a4%84%e5%a4%84%e7%a6%bb%e4%b8%8d%e5%bc%80%e7%9a%84%e7%b4%a2%e5%bc%95%e5%92%8cmysql%e7%9a%84%e7%b4%a2%e5%bc%95","status":"publish","type":"post","link":"https:\/\/www.xttblog.com\/?p=4227","title":{"rendered":"\u5904\u5904\u79bb\u4e0d\u5f00\u7684\u7d22\u5f15\u548cMySQL\u7684\u7d22\u5f15"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">\u6bcf\u5929\u575a\u6301\u539f\u521b\u662f\u4e00\u4ef6\u975e\u5e38\u4e0d\u5bb9\u6613\u7684\u4e8b\u60c5\uff0c\u54ea\u6015\u6709\u5199\u7684\u4e0d\u5bf9\u7684\u5730\u65b9\uff0c\u4e5f\u5e0c\u671b\u5927\u5bb6\u80fd\u591f\u5e2e\u5fd9\u6307\u6b63(\u6628\u5929\u90a3\u7bc7\u6587\u7ae0\uff0c\u5f88\u591a\u4eba\u8bc4\u8bba\u7684\u5c31\u5f88\u597d)\u3002\u56e0\u4e3a\uff0c\u6211\u5e0c\u671b\u6211\u4eec\u4e00\u8d77\u8fdb\u6b65\uff01\u6bcf\u5929\u770b\u6587\u7ae0\uff0c\u6765\u6253\u4e2a\u5361\uff0c\u4e5f\u80fd\u7ed9\u81ea\u5df1\u5e26\u6765\u4e00\u4e9b\u6536\u83b7\u548c\u575a\u6301\u3002\u5e0c\u671b\u4eca\u540e\uff0c\u6211\u4eec\u80fd\u8fdb\u884c\u76f8\u4e92\u9f13\u52b1\uff0c\u5171\u540c\u8fdb\u6b65\uff01<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">MySQL\u662f\u4e00\u4e2a\u975e\u5e38\u590d\u6742\u7684\u7cfb\u7edf\u3002\u4e0d\u7ba1\u6211\u4eec\u7684\u6570\u636e\u662f\u5728\u51e0\u6761\uff0c\u8fd8\u662f\u4e0a\u5343\u4e07\u5230\u51e0\u4ebf\u6761\uff0c\u6bcf\u6b21\u67e5\u8be2\u7b49\u64cd\u4f5c\u5b83\u90fd\u80fd\u8fc7\u5feb\u901f\u7684\u7ed9\u6211\u4eec\u54cd\u5e94\u3002\u8fd9\u662f\u5982\u4f55\u8bbe\u8ba1\u7684\u5462\uff1f<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4f30\u8ba1\u5f88\u591a\u4eba\u4f1a\u56de\u7b54\u8bf4\uff0cMySQL \u8bbe\u8ba1\u7684\u597d\uff0c\u6709\u7d22\u5f15\u7b49\u3002\u90a3\u4e48 MySQL \u4e3a\u4ec0\u4e48\u8bbe\u8ba1\u7684\u597d\u5462\uff1f\u6709\u4ec0\u4e48\u9ad8\u6df1\u7684\u6280\u672f\u5417\uff1f<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u8fd8\u771f\u6ca1\u6709\u4ec0\u4e48\u592a\u9ad8\u5927\u4e0a\u7684\u65b0\u6280\u672f\u7b49\u65b0\u82b1\u6837\u3002\u5c31\u62ff\u7d22\u5f15\u6765\u8bf4\uff0c\u4f60\u4ee5\u4e3a\u5b83\u662f\u4ec0\u4e48\u5f88\u795e\u79d8\u7684\u4e1c\u897f\uff1f\u7d22\u5f15\u4f60\u53c8\u4e0d\u662f\u6ca1\u89c1\u8fc7\uff0c\u6bd4\u5982\u6211\u4eec\u8bbf\u95ee\u4e00\u4e2a\u6570\u7ec4\uff0c\u6839\u636e\u6570\u7ec4\u7684\u4e0b\u6807\u5c31\u80fd\u5feb\u901f\u7684\u8bbf\u95ee\u5230\u6570\u7ec4\u4e2d\u5bf9\u5e94\u7684\u5143\u7d20\u3002\u5176\u5b9e\u8fd9\u4e2a\u4e0b\u6807\u5c31\u662f\u4e00\u4e2a\u7d22\u5f15\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u518d\u6bd4\u5982\uff0c\u4e00\u4e2a Map\uff0c\u5065\u503c\u5bf9\u5f62\u5f0f\u7684\u6570\u636e\u7ed3\u6784\u3002\u6211\u4eec\u80fd\u5f88\u5feb\u7684\u8bbf\u95ee\u5230\uff0c\u662f\u56e0\u4e3a\u5b83\u7684 Key \u4f7f\u7528\u4e86 Hash\u3002\u8fd9\u4e2a Hash \u5c31\u662f\u4e00\u4e2a\u7d22\u5f15\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5728 MySQL \u4e2d\u7d22\u5f15\u5e38\u89c1\u7684\u5c31\u662f\u4e00\u4e2a BTREE\u3001B+Tree \u641c\u7d22\u6811\uff08HASH \u4e5f\u6709\u5b58\u50a8\u5f15\u64ce\u7528\u5230\uff09\u3002\u5982\u679c\u6ca1\u6709\u7d22\u5f15\uff0c\u90a3\u4e48\u4f60\u8981\u627e\u4e00\u6761\u6570\u636e\u5c31\u53ea\u80fd\u4ece\u7b2c\u4e00\u6761\u5f00\u59cb\uff0c\u4e00\u6761\u8bb0\u5f55\u4e00\u6761\u8bb0\u5f55\u7684\u904d\u5386\uff0c\u76f4\u5230\u627e\u5230\u8be5\u6761\u4fe1\u606f\u4e3a\u6b62\u3002\u5982\u679c\u6709\u4e86\u7d22\u5f15\uff0c\u5c31\u80fd\u591f\u4e8b\u534a\u529f\u500d\uff0c\u5feb\u901f\u7684\u5b9a\u4f4d\u5230\u6570\u636e\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">BTree \u662f\u5e73\u8861\u641c\u7d22\u591a\u53c9\u6811\uff0c\u4e5f\u6709\u4eba\u79f0\u4f5c B \u6811\u4e3a\u5e73\u8861\u591a\u8def\u67e5\u627e\u6811\u3002\u8bbe\u6811\u7684\u5ea6\u4e3a 2d\uff08d&gt;1\uff09\uff0c\u9ad8\u5ea6\u4e3a h\uff0c\u90a3\u4e48 BTree \u8981\u6ee1\u8db3\u4ee5\u4e00\u4e0b\u6761\u4ef6\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>\u6bcf\u4e2a\u53f6\u5b50\u7ed3\u70b9\u7684\u9ad8\u5ea6\u4e00\u6837\uff0c\u7b49\u4e8eh\uff1b <\/li><li>\u6bcf\u4e2a\u975e\u53f6\u5b50\u7ed3\u70b9\u7531 n-1 \u4e2a key \u548c n \u4e2a\u6307\u9488 point \u7ec4\u6210\uff0c\u5176\u4e2d d&lt;=n&lt;=2d\uff0ckey \u548c point \u76f8\u4e92\u95f4\u9694\uff0c\u7ed3\u70b9\u4e24\u7aef\u4e00\u5b9a\u662f key\uff1b <\/li><li>\u53f6\u5b50\u7ed3\u70b9\u6307\u9488\u90fd\u4e3a null\uff1b <\/li><li>\u975e\u53f6\u5b50\u7ed3\u70b9\u7684 key \u90fd\u662f [key,data] \u4e8c\u5143\u7ec4\uff0c\u5176\u4e2d key \u8868\u793a\u4f5c\u4e3a\u7d22\u5f15\u7684\u952e\uff0cdata \u4e3a\u952e\u503c\u6240\u5728\u884c\u7684\u6570\u636e<\/li><\/ul>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/images.weserv.nl\/?url=https:\/\/wx1.sinaimg.cn\/large\/8fa5dcfcgy1g2weal7iffj20ou08aac1.jpg\" alt=\"\" \/><figcaption>BTree \u5e73\u8861\u641c\u7d22\u591a\u53c9\u6811<\/figcaption><\/figure><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\u6211\u4e0d\u61c2\u7b97\u6cd5\uff0cBTree \u5927\u81f4\u4e0a\u5c31\u662f\u6da8\u7684\u5982\u4e0a\u56fe\u6240\u793a\u3002\u8fd9\u4e2a\u56fe\u7247\u6765\u6e90\u4e8e\u7f51\u7edc\uff0c\u81f3\u4e8e\u4e3a\u4ec0\u4e48 MySQL \u8981\u8bbe\u8ba1\u6210\u8fd9\u6837\uff0c\u6211\u540e\u9762\u5355\u72ec\u5199\u6587\u7ae0\u6765\u8bf4\u3002\u8fd9\u91cc\u9762\u5176\u5b9e\u8fd8\u6709\u5f88\u591a\u7cbe\u5999\u7684\u8bbe\u8ba1\uff0cBTree \u6570\u636e\u4f30\u8ba1\u4e0d\u5c11\u4eba\u6bd4\u6211\u8fd8\u61c2\u3002\u6211\u540e\u9762\u4e5f\u5f97\u62bd\u7a7a\u53bb\u5b66\u4e60\u5b66\u4e60\u6781\u5ba2\u65f6\u95f4\u7684\u300a\u6570\u636e\u7ed3\u6784\u4e0e\u7b97\u6cd5\u4e4b\u7f8e\u300b\u3002<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/images.weserv.nl\/?url=https:\/\/wx1.sinaimg.cn\/large\/8fa5dcfcgy1g2wedgos4mj20u01hc44o.jpg\" alt=\"\" \/><figcaption>\u300a\u6570\u636e\u7ed3\u6784\u4e0e\u7b97\u6cd5\u4e4b\u7f8e\u300b\u901a\u8fc7\u6211\u7684\u6d77\u62a5\u4e0a\u7684\u4e8c\u7ef4\u7801\u8d2d\u4e70\uff0c\u52a0 xttblog \u5fae\u4fe1\uff0c\u8fd4\u73b024<\/figcaption><\/figure><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">B+Tree \u662f\u5728 B-Tree \u57fa\u7840\u4e0a\u7684\u4e00\u79cd\u4f18\u5316\uff0c\u6211\u540e\u9762\u4f1a\u6709\u5355\u72ec\u7684\u6587\u7ae0\u6765\u5199\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u603b\u4e4b\uff0c\u8fd8\u662f\u6211\u4e4b\u524d\u63d0\u5230\u7684\u90a3\u53e5\u8bdd\u201c\u5927\u9053\u81f3\u7b80\u201d\u3002MySQL \u7684\u7d22\u5f15\u867d\u7136\u4f60\u7528\u8d77\u6765\u5f88\u723d\uff0c\u4f46\u662f\u7ef4\u62a4\u8d77\u6765\u4e5f\u76f8\u5f53\u7684\u9ebb\u70e6\u3002\u5c31\u50cf\u4f60\u7684\u6570\u7ec4\u4e00\u6837\uff0c\u5220\u9664\u6570\u636e\uff0c\u662f\u4e0d\u662f\u8981\u79fb\u52a8\u5143\u7d20\u3002\u540c\u6837\u7684\uff0c\u4f60\u5728 MySQL \u4e2d\u5220\u9664\u3001\u66f4\u65b0\u3001\u63d2\u5165\u8bb0\u5f55\u7b49\u90fd\u662f\u9700\u8981\u65f6\u95f4\u548c\u7a7a\u95f4\u6765\u7ef4\u62a4\u7d22\u5f15\u7684\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4e00\u4e2a\u7cfb\u7edf\uff0c\u5f53\u4f60\u6df1\u5165\u7684\u7406\u89e3\u540e\uff0c\u4f60\u4f1a\u53d1\u73b0\u3002\u539f\u6765\u8fd9\u4e9b\u8bbe\u8ba1\u90fd\u662f\u5728\u57fa\u7840\u7684\u77e5\u8bc6\u4e4b\u4e0a\uff0c\u4e00\u70b9\u4e00\u70b9\u5806\u79ef\u8d77\u6765\u7684\u800c\u5df2\u3002\u81ea\u7136\u754c\u4e5f\u662f\u4e00\u6837\u7684\uff0c\u8fd9\u79cd\u5143\u7d20\u52a0\u90a3\u79cd\u5143\u7d20\uff0c\u7ed3\u5408\u8d77\u6765\u7ec4\u6210\u4e00\u4e2a\u5206\u5b50\u3002\u8fd9\u79cd\u5206\u5b50\uff0c\u90a3\u79cd\u5206\u5b50\u7ec4\u5408\u8d77\u6765\uff0c\u6162\u6162\u7684\u6784\u6210\u7ec6\u80de\u7b49\u7ed3\u6784\uff0c\u7ec6\u80de\u7b49\u7ec4\u7ec7\u5728\u6162\u6162\u7684\u7ec4\u6210\u4e00\u4e2a\u4e2a\u751f\u547d\u4f53\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u6570\u636e\u5e93\u4e5f\u662f\u7531\u5404\u79cd\u6570\u636e\u7ed3\u6784\uff0c\u6570\u636e\u6a21\u578b\uff0c\u7269\u7406\u6a21\u578b\u7b49\u7ec4\u6210\uff0c\u62ff\u7740\u663e\u5fae\u955c\u4f60\u624d\u6709\u604d\u7136\u5927\u609f\u7684\u611f\u89c9\u3002\u6700\u8fd1\u6211\u5c31\u6709\u8fd9\u79cd\u611f\u89c9\uff0c\u4f60\u662f\u4e0d\u662f\u4e5f\u9700\u8981\u8fd9\u79cd\u611f\u89c9\uff1f\u8bf7\u6bcf\u5929\u8ddf\u6211\u4e00\u8d77\u6765\u6253\u5361\uff0c\u4e00\u70b9\u4e00\u70b9\u5730\u6210\u957f\u3002\u81f3\u5c11\u4e5f\u80fd\u4ea4\u5230\u4e0d\u5c11\u70ed\u5fc3\u7684\u670b\u53cb\uff0c\u4f60\u8bf4\u4e0d\u662f\u5417\uff1f<\/p>\n<!-- <audio autoplay=\"autoplay\" height=\"100\" width=\"100\" hidden=\"true\"><source src=\"https:\/\/c.coka.la\/orAvPR.mp3\" type=\"audio\/mp3\"\/><\/audio><img decoding=\"async\" src=\"https:\/\/images.weserv.nl\/?url=https:\/\/ws3.sinaimg.cn\/large\/8fa5dcfcgy1g4em3rzar5j20ib089ae0.jpg\" alt=\"\u4e1a\u4f59\u8349\u516c\u4f17\u53f7\"\/> --><p><!-- <img decoding=\"async\" src=\"https:\/\/raw.githubusercontent.com\/xmt1139057136\/xttblog\/master\/8fa5dcfcgy1g4em3rzar5j20ib089ae0.jpg\" alt=\"\u4e1a\u4f59\u8349\u516c\u4f17\u53f7\"\/>--><img decoding=\"async\" src=\"https:\/\/saas.51autoparts.cn\/api\/admin\/sys-file\/oss\/file?fileName=84db51f8561e448f9a4fda2eff0811f9.jpg\" alt=\"\u4e1a\u4f59\u8349\u516c\u4f17\u53f7\"\/><\/p><p>\u6700\u540e\uff0c\u6b22\u8fce\u5173\u6ce8\u6211\u7684\u4e2a\u4eba\u5fae\u4fe1\u516c\u4f17\u53f7\uff1a\u4e1a\u4f59\u8349\uff08yyucao\uff09\uff01<b>\u53ef\u52a0\u4f5c\u8005\u5fae\u4fe1\u53f7\uff1a<font color=\"red\">xttblog2<\/font>\u3002\u5907\u6ce8\uff1a\u201c1\u201d\uff0c\u6dfb\u52a0\u535a\u4e3b\u5fae\u4fe1\u62c9\u4f60\u8fdb\u5fae\u4fe1\u7fa4\u3002\u5907\u6ce8\u9519\u8bef\u4e0d\u4f1a\u540c\u610f\u597d\u53cb\u7533\u8bf7\u3002<\/b>\u518d\u6b21\u611f\u8c22\u60a8\u7684\u5173\u6ce8\uff01\u540e\u7eed\u6709\u7cbe\u5f69\u5185\u5bb9\u4f1a\u7b2c\u4e00\u65f6\u95f4\u53d1\u7ed9\u60a8\uff01\u539f\u521b\u6587\u7ae0\u6295\u7a3f\u8bf7\u53d1\u9001\u81f3532009913@qq.com\u90ae\u7bb1\u3002\u5546\u52a1\u5408\u4f5c\u4e5f\u53ef\u6dfb\u52a0\u4f5c\u8005\u5fae\u4fe1\u8fdb\u884c\u8054\u7cfb\uff01<\/p><p>\u672c\u6587\u539f\u6587\u51fa\u5904\uff1a<a href=\"https:\/\/www.xttblog.com\">\u4e1a\u4f59\u8349<\/a>\uff1a &raquo; <a href=\"https:\/\/www.xttblog.com\/?p=4227\">\u5904\u5904\u79bb\u4e0d\u5f00\u7684\u7d22\u5f15\u548cMySQL\u7684\u7d22\u5f15<\/a><\/p><!-- <div class=\"bd-reward-stl\"><button id=\"bdRewardBtn\"><span><\/span><\/button><\/div> -->","protected":false},"excerpt":{"rendered":"<p>\u6bcf\u5929\u575a\u6301\u539f\u521b\u662f\u4e00\u4ef6\u975e\u5e38\u4e0d\u5bb9\u6613\u7684\u4e8b\u60c5\uff0c\u54ea\u6015\u6709\u5199\u7684\u4e0d\u5bf9\u7684\u5730\u65b9\uff0c\u4e5f\u5e0c\u671b\u5927\u5bb6\u80fd\u591f\u5e2e\u5fd9\u6307\u6b63(\u6628\u5929\u90a3\u7bc7\u6587\u7ae0\uff0c\u5f88\u591a\u4eba\u8bc4\u8bba\u7684\u5c31 [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12],"tags":[83,392,391,156,1452],"class_list":["post-4227","post","type-post","status-publish","format-standard","hentry","category-sql","tag-mysql","tag-156","tag-1452"],"_links":{"self":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts\/4227","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4227"}],"version-history":[{"count":1,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts\/4227\/revisions"}],"predecessor-version":[{"id":4228,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts\/4227\/revisions\/4228"}],"wp:attachment":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4227"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4227"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4227"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}