{"id":18449,"date":"2021-10-17T17:29:00","date_gmt":"2021-10-17T09:29:00","guid":{"rendered":"https:\/\/www.orczhou.com\/?p=18449"},"modified":"2026-08-01T17:38:32","modified_gmt":"2026-08-01T09:38:32","slug":"bsup-sup-b-tree-innodb","status":"publish","type":"post","link":"https:\/\/www.orczhou.com\/index.php\/2021\/10\/bsup-sup-b-tree-innodb\/","title":{"rendered":"B<sup>+<\/sup>-Tree\u7684\u5185\u90e8\u641c\u7d22\uff1aInnoDB\u7684\u5b9e\u73b0"},"content":{"rendered":"\n\n\n\n<p style=\"margin-top:4px\">\u5728\u524d\u9762\u4e24\u7bc7\u6587\u7ae0\uff0c\u8f83\u4e3a\u7cfb\u7edf\u4ecb\u7ecd\u4e86<code>B-Tree<\/code>\u548c<code>B<sup>+<\/sup>-Tree<\/code>\u7684\u57fa\u7840\u3002\u672c\u6587\u5219\u4ee5<code>InnoDB<\/code>\u4e3a\u4f8b\uff0c\u6765\u770b\u770b<code>B<sup>+<\/sup>-Tree<\/code>\u5185\u90e8\u6392\u5e8f\u7684\u5b9e\u73b0\u3002<\/p>\n\n\n\n\n\n\n<h3 class=\"wp-block-heading\">\u7b80\u5355\u56de\u987eB-Tree\u5b58\u50a8<\/h3>\n\n\n\n<p>\u5728\u524d\u9762<code>B-Tree<\/code>\u57fa\u7840\u6587\u7ae0\u4e2d\uff0c\u6211\u4eec\u4e86\u89e3\u5230\u5728\u4e00\u4e2a<code>B-Tree<\/code>\u6216<code>B<sup>+<\/sup>-Tree<\/code>\u7684\u201c\u8282\u70b9\u201d\u901a\u5e38\u53ef\u4ee5\u5b58\u653e\u5f88\u591a\u7684\u201c\u7d22\u5f15\u5165\u53e3\u201d\u3002\u5728\u6570\u636e\u5e93\u5b9e\u8df5\u4e2d\uff0c\u901a\u5e38\u4e00\u4e2a\u201c\u8282\u70b9\u201d\u5927\u5c0f\u4e3a<code>16KB<\/code>\u6216<code>8KB<\/code>\u3002\u4e00\u4e2a\u7d22\u5f15\u5165\u53e3\u7684\u7ed3\u6784\u4e00\u822c\u662f\uff1a\\( (k_i,p_i,\\alpha_i) \\) \u3001 \\( (k_i,p_i) \\)\u3001\\( (k_i,\\alpha_i) \\)\uff0c\u5177\u4f53\u7684\uff0c\u5728\u53f6\u5b50\u8282\u70b9\u4e0a\u901a\u5e38\u4e3a\\( (k_i,\\alpha_i) \\)\uff0c\u800c\u975e\u53f6\u5b50\u8282\u70b9\u5219\u4e3a\uff1a \\( (k_i,p_i) \\)\u3002<\/p>\n\n\n\n<p>\u90a3\u4e48\uff0c\u5728\u5b9e\u9645\u7684\u8bbe\u8ba1\u4e2d\uff0c\u4e00\u4e2a\u201c\u8282\u70b9\u201d\u53ef\u4ee5\u5b58\u50a8\u591a\u4e2a\u201c\u7d22\u5f15\u5165\u53e3\u201d\uff0c\u5728\u975e\u53f6\u5b50\u8282\u70b9\uff0c\u4e3b\u8981\u5b58\u50a8\u952e\u503c\u548c\u5230\u5b50\u8282\u70b9\u7684\u6307\u9488\uff0c\u5373 \\( (k_i,p_i) \\)\uff1b\u53f6\u5b50\u8282\u70b9\u4e2d\uff0c\u5219\u5b58\u50a8\u952e\u503c\u548c\u76f8\u5173\u6570\u636e\uff0c\u5373\\( (k_i,\\alpha_i) \\)\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u95ee\u9898\u63cf\u8ff0<\/h3>\n\n\n\n<p>\u5728\u5f88\u591a\u7684<code><code>B<sup>+<\/sup>-Tree<\/code><\/code>\u5b9e\u73b0\u4e2d\uff0c\u4e00\u4e2a\u8282\u70b9\u53ef\u4ee5\u5b58\u50a8\u51e0\u5341\u3001\u751a\u81f3\u6570\u767e\u4e2a\u7684\u201c\u7d22\u5f15\u5165\u53e3\u201d\u3002\u800c\u6211\u4eec<a href=\"https:\/\/www.orczhou.com\/index.php\/2025\/05\/understanding-innodb-and-b-tree-01\/\">\u5728\u524d\u9762<\/a>\u770b\u5230\u7684\u793a\u610f\u56fe\u4e2d\uff0c\u770b\u8d77\u6765\u8282\u70b9\u5185\u90e8\u7684\u6570\u636e\u4f3c\u4e4e\u662f\u6309\u7167\u952e\u503c\u6392\u597d\u5e8f\u7684\uff0c\u4f46\u5728\u5b9e\u9645\u5b9e\u73b0\u4e2d\uff0c\u8fd9\u91cc\u4ee5<code>InnoDB<\/code>\u7684<code>B<sup>+<\/sup>-Tree<\/code>\u5b9e\u73b0\u4e3a\u4f8b\uff0c\u95ee\u9898\u8981\u66f4\u590d\u6742\u4e00\u4e9b\uff0c\u4e3b\u8981\u8003\u8651\u5982\u4e0b\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code><code>B<sup>+<\/sup>-Tree<\/code><\/code>\u4e2d\u7684\u201c\u6570\u636e\u201d\\( \\alpha_i \\)\u53ef\u80fd\u662f\u53d8\u957f\u7684\uff0c\u5e76\u4e14\u5185\u5bb9\u5f88\u5927\uff0c\u4f8b\u5982200~300\u4e2a<code>Bytes<\/code>\u3002\u4f8b\u5982\uff0c\u5728InnoDB\u7684<code>Clustered Index<\/code>\u4e2d\uff0c\u8868\u7ed3\u6784\u662f <code>id int, nick varchar(32),realname varchar(32),birthday date,password char(32),email varchar(60)<\/code>\uff0c\u5b57\u7b26\u96c6\u662f<code>utf8mb4<\/code>\u3002<\/li>\n\n\n\n<li>\u67e5\u8be2\u641c\u7d22\u662f\u4e00\u65b9\u9762\uff0c\u8fd8\u9700\u8981\u66f4\u5feb\u7684\u5199\u5165\u901f\u5ea6\uff0c\u4ece\u800c\u63d0\u5347\u6570\u636e\u5e93\u7684\u4e8b\u52a1\u541e\u5410\u91cf<\/li>\n\n\n\n<li>\u4f9d\u65e7\u9700\u8981\u8282\u70b9\u5185\u90e8\u975e\u5e38\u4fbf\u5229\u7684\u987a\u5e8f\u67e5\u627e\uff0c\u4ee5\u6ee1\u8db3\u641c\u7d22\u3001\u8303\u56f4\u626b\u63cf\u7b49\u9700\u8981<\/li>\n<\/ul>\n\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u4ee5\u201c\u5806\u201d\u7684\u5f62\u5f0f\u5b58\u50a8<\/h3>\n\n\n\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-28f84493 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:66.66%\">\n<p>\u4e3a\u4e86\u6ee1\u8db3\u53d8\u957f\u3001\u5feb\u901f\u5b58\u50a8\u7684\u8981\u6c42\uff0c<code>InnoDB<\/code>\u9875\u9762\u5185\u90e8\u4f7f\u7528\u4e86\u5178\u578b\u7684\u201c\u5806\u201d\u7684\u5f62\u5f0f\u7ec4\u7ec7\u6570\u636e\uff0c\u8fd9\u4e5f\u662f\u6570\u636e\u5e93\u6570\u636e\u5b58\u50a8\u5b9e\u73b0\u7684\u4e00\u822c\u6a21\u5f0f\u3002\u5373\uff0c\u6bcf\u6b21\u6570\u636e\u5199\u5165\u65f6\uff0c\u5c06\u6570\u636e\u5b58\u50a8\u5728\u5806\u7684\u201c\u9876\u7aef\u201d\uff08\u6216\u8005\u4e2d\u95f4\u7684\u7a7a\u6d1e\uff09\uff0c\u5982\u53f3\u56fe\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u5bf9\u4e8e\u6700\u540e\u5199\u5165\u7684\u65b0\u8bb0\u5f55\\( (31,\\alpha_5) \\)\uff0c\u4e0d\u8003\u8651\u6392\u5e8f\uff0c\u76f4\u63a5\u653e\u5728\u201c\u5806\u9876\u7aef\u201d<\/li>\n\n\n\n<li>\u6bcf\u6761\u8bb0\u5f55\u7684\u5927\u5c0f\u4e0d\u540c\uff0c\u6309\u201c\u5806\u201d\u904d\u5386\u65f6\uff0c\u53ef\u4ee5\u6839\u636e\u6bcf\u6761\u8bb0\u5f55\u7684\u5143\u4fe1\u606f\uff0c\u5230\u4e00\u6761\u8bb0\u5f55\u7684\u5934\u90e8\uff08\u5373\u672c\u8bb0\u5f55\u7684\u5c3e\u90e8\uff09<\/li>\n<\/ul>\n\n\n\n<p>\u4f46\u5728<code><code><code>B<sup>+<\/sup>-Tree<\/code><\/code><\/code>\u4e2d\u904d\u5386\u65f6\uff0c\u66f4\u591a\u7684\u662f\u9700\u8981\u987a\u5e8f\u904d\u5386\uff0c\u4f8b\u5982\u952e\u503c\u641c\u7d22\u3001\u8303\u56f4\u67e5\u627e\u7b49\u573a\u666f\u3002\u90a3\u4e48\uff0c\u6309\u201c\u5806\u201d\u5b58\u50a8\u7684\u8bb0\u5f55\uff0c\u5c31\u9700\u8981\u4e00\u79cd\u987a\u5e8f\u904d\u5386\u7684\u65b9\u5f0f\u3002<\/p>\n<\/div>\n\n\n\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:33.33%\">\n<figure data-wp-context=\"{&quot;imageId&quot;:&quot;6a751b55743e6&quot;}\" data-wp-interactive=\"core\/image\" data-wp-key=\"6a751b55743e6\" class=\"wp-block-image aligncenter size-full is-resized wp-lightbox-container\"><img loading=\"lazy\" decoding=\"async\" width=\"288\" height=\"668\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/www.orczhou.com\/wp-content\/uploads\/2025\/05\/image-57.png\" alt=\"\" class=\"wp-image-18674\" style=\"width:173px;height:auto\" srcset=\"https:\/\/www.orczhou.com\/wp-content\/uploads\/2025\/05\/image-57.png 288w, https:\/\/www.orczhou.com\/wp-content\/uploads\/2025\/05\/image-57-129x300.png 129w\" sizes=\"auto, (max-width: 288px) 100vw, 288px\" \/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\taria-label=\"Enlarge\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.imageButtonRight\"\n\t\t\tdata-wp-style--top=\"state.imageButtonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure>\n<\/div>\n<\/div>\n\n\n\n<h3 class=\"wp-block-heading\">B<sup>+<\/sup>-Tree\u9875\u5185\u641c\u7d22\u5b9e\u73b0\u6982\u8ff0<\/h3>\n\n\n\n<h4 class=\"wp-block-heading\">\u903b\u8f91\u5b9e\u73b0\u8bf4\u660e<\/h4>\n\n\n\n<p>\u4e00\u79cd\u76f4\u89c2\u7684\u601d\u7ef4\u662f\u8fd9\u6837\uff0c\u5728\u9875\u9762\u7684\u67d0\u4e2a\u7279\u6b8a\u533a\u57df\uff0c\u65b0\u5efa\u4e00\u4e2a\u201c\u6570\u7ec4\u201d\uff08\u8bb0\u5f55\u6307\u9488\u6216\u504f\u79fb\uff09\uff0c\u987a\u5e8f\u6392\u5217\u6240\u6709\u7684\u8bb0\u5f55\u3002\u6bcf\u6b21\u9700\u8981\u641c\u7d22\u65f6\uff0c\u5219\u5728\u8be5\u6570\u636e\u4e2d\u8fdb\u884c\u4e8c\u5206\u6216\u63d2\u503c\u641c\u7d22\u3002\u8fd9\u79cd\u5b58\u50a8\u6a21\u5f0f\u7684\u4f18\u52bf\u662f\uff0c\u7b80\u5355\u800c\u76f4\u63a5\uff0c\u4e14\u6613\u4e8e\u7ef4\u62a4\u3002\u4f46\u5bf9\u4e8e\u5173\u7cfb\u578b\u6570\u636e\u5e93\u6765\u8bf4\uff0c\u5982\u679c\u6570\u636e\u5199\u5165\u6216\u66f4\u65b0\u9891\u7e41\uff0c\u90a3\u4e48\u8fd9\u4e2a\u6570\u7ec4\u7684\u7ef4\u62a4\u4f1a\u6709\u975e\u5e38\u9891\u7e41\u7684\u6570\u636e\u62f7\u8d1d\u3002<\/p>\n\n\n\n<p><code>InnoDB<\/code>\u7684\u5b9e\u73b0\uff08\u6211\u540e\u9762\u8981\u53bb\u770b\u770bJim Gray\u7684\u90a3\u672c\u4e66\uff0c\u770b\u770b\u662f\u5426\u6709\u63cf\u8ff0\u8fd9\u4e9b\u7ec6\u8282\uff09\u5e76\u6ca1\u6709\u4f7f\u7528\u8fd9\u79cd\u76f4\u63a5\u7684\u5b9e\u73b0\uff0c\u800c\u662f\u505a\u4e86\u4e00\u4e9b\u53d8\u5316\uff1a<\/p>\n\n\n\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-28f84493 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:66%\">\n<ul class=\"wp-block-list\">\n<li>\u5728\u6bcf\u6761\u88ab\u5b58\u50a8\u7684\u8bb0\u5f55<code>Header<\/code>\u90e8\u5206\uff0c\u90fd\u5b58\u50a8\u4e86\u6309\u6392\u5e8f\u987a\u5e8f\u7684\u4e0b\u4e00\u6761\u8bb0\u5f55\u7684\u4f4d\u7f6e\uff08\u9875\u5185\u504f\u79fb\u91cf\uff09\uff0c\u6240\u4ee5InnoDB\u7684\u9875\u5185\u8bb0\u5f55\u53ef\u4ee5\u770b\u505a\u662f\u4e00\u4e2a\u6309\u952e\u503c\u5927\u5c0f\u6392\u5e8f\u7684\u94fe\u8868<\/li>\n\n\n\n<li>\u9875\u9762\u5f00\u8f9f\u4e86\u4e00\u7247\u533a\u57df\uff08Page Directory\uff09\u5b58\u50a8\u201c\u90e8\u5206\u201d\u9875\u5185\u8bb0\u5f55\u7684\u504f\u79fb\uff0c\u8fd9\u4e9b\u8bb0\u5f55\u7684\u9009\u53d6\u4e0e<code>Skip List<\/code>\u5b9e\u73b0\u7c7b\u4f3c\u3002\u5373\u6309\u6392\u5e8f\u987a\u5e8f\uff0c\u5e76\u6309\u4e00\u5b9a\u7684\u95f4\u9694\u53d6\u90e8\u5206\u8bb0\u5f55\u653e\u5230<code>Page Directory<\/code>\u4e2d\uff0c\u5e76\u5c06<code>Page Directory<\/code>\u95f4\u9694\u4e24\u4e2a\u8bb0\u5f55\u4e4b\u95f4\u5728\u9875\u5185\u7684\u6240\u6709\u8bb0\u5f55\u79f0\u4e3a\u4e00\u4e2a<code>Slot<\/code>\uff0c<code>Page Directory<\/code>\u4e2d\u7684\u8fd9\u6761\u8bb0\u5f55\u5219\u53ef\u4ee5\u79f0\u4e3a\u4e00\u4e2a<code>Slot<\/code>\u7684<code>Slot Header<\/code>\u3002<\/li>\n<\/ul>\n<\/div>\n\n\n\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:33%\">\n<figure data-wp-context=\"{&quot;imageId&quot;:&quot;6a751b5574c6a&quot;}\" data-wp-interactive=\"core\/image\" data-wp-key=\"6a751b5574c6a\" class=\"wp-block-image size-large wp-lightbox-container\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"841\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/www.orczhou.com\/wp-content\/uploads\/2025\/05\/image-53-1024x841.png\" alt=\"\" class=\"wp-image-18625\" srcset=\"https:\/\/www.orczhou.com\/wp-content\/uploads\/2025\/05\/image-53-1024x841.png 1024w, https:\/\/www.orczhou.com\/wp-content\/uploads\/2025\/05\/image-53-300x247.png 300w, https:\/\/www.orczhou.com\/wp-content\/uploads\/2025\/05\/image-53-768x631.png 768w, https:\/\/www.orczhou.com\/wp-content\/uploads\/2025\/05\/image-53.png 1492w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\taria-label=\"Enlarge\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.imageButtonRight\"\n\t\t\tdata-wp-style--top=\"state.imageButtonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure>\n<\/div>\n<\/div>\n\n\n\n<p>\u4e0a\u53f3\u56fe\u662f\u5728<code>GitHub<\/code>\u4e0a\u641c\u7d22\u5230\u7684\u7531<code>SmartKeyerror<\/code>\u7ed8\u5236\u7684\u5173\u4e8e<code>Page Directory<\/code>\u7684\u793a\u610f\u56fe<sup>[6]<\/sup>\uff0c\u662f\u6bd4\u8f83\u51c6\u786e\u4e14\u76f4\u89c2\u7684\u3002<\/p>\n\n\n\n<p>\u6240\u4ee5\uff0c\u5728\u8fdb\u884c\u641c\u7d22\u65f6\uff08<code>InnoDB<\/code>\u7684\u5b9e\u73b0\uff09\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u9996\u5148\uff0c\u5728<code>Page Directory<\/code>\u4e2d\u7684\u5404\u4e2a<code>Slot Header<\/code>\u4e2d\u505a\u4e8c\u5206\u67e5\u627e<\/li>\n\n\n\n<li>\u7136\u540e\uff0c\u518d\u5728<code>Slot<\/code>\u4e2d\u8fdb\u884c\u7ebf\u6027\u641c\u7d22\uff0c\u5373\u9010\u4e2a\u5411\u524d\u6bd4\u8f83<\/li>\n<\/ul>\n\n\n\n<p>\u5728<code>InnoDB<\/code>\u4e2d\uff0c\u4e00\u4e2a<code>Slot<\/code>\u67094~8\u4e2a\u8bb0\u5f55\uff0c\u6240\u4ee5\uff0c\u53ef\u4ee5\u8ba4\u4e3a\u4e00\u4e2a<code>500<\/code>\u6761\u8bb0\u5f55\u7684\u9875\u9762\uff0c\u9700\u8981\u505a\u7684\u6bd4\u8f83\u6b21\u6570\u7ea6\u4e3a\uff08\u8003\u8651\u5e73\u5747\u6bcf\u4e2a<code>slot<\/code>\u4e2d6\u6761\u8bb0\u5f55\uff09\uff1a<\/p>\n\n\n<p>$$<br \/>\nlog_2(\\frac{500}{6}) + \\frac{6}{2} \\approx 9.38<br \/>\n$$<\/p>\n\n\n\n<p>\u5728\u5b9e\u9645\u4e2d\uff0c\u53ef\u80fd\u4f1a\u6709\u591a\u6b21<code>CPU<\/code>\u7684<code>Cache Miss<\/code>\u53d1\u751f\uff0c\u6240\u4ee5\u5b9e\u9645\u7684\u6210\u672c\u6bd4\u770b\u8d77\u6765\u7684<code>9.38<\/code>\u6b21\u8981\u7565\u5fae\u9ad8\u4e00\u4e9b\uff0c\u4f46\u4f5c\u4e3a\u7c97\u7565\u9884\u4f30\uff0c\u8fd9\u4e2a\u8ba1\u7b97\u4e5f\u662f\u5408\u7406\u7684\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">InnoDB \u7269\u7406\u5b58\u50a8\u5b9e\u73b0\u8bf4\u660e<\/h4>\n\n\n\n<p>\u5398\u6e05\u7269\u7406\u5c42\u7684\u5b9e\u73b0\uff0c\u8fd8\u662f\u7a0d\u5fae\u82b1\u4e86\u4e00\u4e9b\u65f6\u95f4\u7684\u3002\u5728Jeremy Cole 2013 <a href=\"https:\/\/blog.jcole.us\/2013\/01\/14\/efficiently-traversing-innodb-btrees-with-the-page-directory\/\">Efficiently traversing InnoDB B+Trees with the page directory<\/a> \u4e2d\u5bf9\u4e8e<code>Page Directory<\/code>\u5b9e\u73b0\u9875\u5185\u641c\u7d22\u505a\u4e86\u6bd4\u8f83\u8be6\u7ec6\u7684\u8bf4\u660e\uff0c\u5e76\u4e14\u5728\u8ba8\u8bba\u4e2d\u4e5f\u4e00\u4e9b\u6709\u610f\u601d\u7684\u8ba8\u8bba\u3002\u4f46\uff0c\u5bf9\u4e8e\u5176\u4e2d\u7684\u51e0\u4e2a\u95ee\u9898\u505a\u4e86\u4e00\u4e9b\u9a8c\u8bc1\uff0c\u8fd8\u662f\u6709\u4e00\u4e9b\u66f4\u7ec6\u81f4\u7684\u8865\u5145\u8bf4\u660e\u3002<\/p>\n\n\n\n<p>\u4e0a\u9762\uff0c<code>SmartKeyerror<\/code>\u7ed8\u5236\u7684\u5173\u4e8e<code>Page Directory<\/code>\u56fe\u5728\u903b\u8f91\u4e0a\u662f\u6ca1\u6709\u592a\u5927\u95ee\u9898\u7684\uff0c\u4f46\u5c31\u7269\u7406\u5b9e\u73b0\uff0c\u5219\u5bb9\u6613\u5f15\u8d77\u4e00\u4e9b\u8bef\u89e3\uff0c\u6545\u7ed8\u5236\u4e86\u65b0\u7684\u793a\u610f\u56fe\u5982\u53f3\u4e0b\uff0c\u4ee5\u66f4\u51c6\u786e\u7684\u53cd\u6620<code>InnoDB<\/code>\u7269\u7406\u5b58\u50a8\u7684\u7ed3\u6784\uff1a<\/p>\n\n\n\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-28f84493 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<ul class=\"wp-block-list\">\n<li><code>Page Directory<\/code>\u5c31\u662f\u4e00\u4e2a\u5b58\u50a8\u9875\u5185\u504f\u79fb\u7684\u201c\u6570\u7ec4\u201d\uff0c\u5c31\u662f\u53f3\u56fe\u7684\u6df1\u7ea2\u8272\u90e8\u5206<\/li>\n\n\n\n<li>\u6bcf\u4e2a<code>slot<\/code>\u4f7f\u7528<code>2 Bytes<\/code>\uff0c\u5b58\u50a8\u7684\u662f\u5bf9\u5e94\u8bb0\u5f55\u7684\u9875\u5185\u504f\u79fb<\/li>\n<\/ul>\n<\/div>\n\n\n\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:66%\">\n<figure data-wp-context=\"{&quot;imageId&quot;:&quot;6a751b5575479&quot;}\" data-wp-interactive=\"core\/image\" data-wp-key=\"6a751b5575479\" class=\"wp-block-image size-large wp-lightbox-container\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"498\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/www.orczhou.com\/wp-content\/uploads\/2025\/05\/image-56-1024x498.png\" alt=\"\" class=\"wp-image-18673\" srcset=\"https:\/\/www.orczhou.com\/wp-content\/uploads\/2025\/05\/image-56-1024x498.png 1024w, https:\/\/www.orczhou.com\/wp-content\/uploads\/2025\/05\/image-56-300x146.png 300w, https:\/\/www.orczhou.com\/wp-content\/uploads\/2025\/05\/image-56-768x374.png 768w, https:\/\/www.orczhou.com\/wp-content\/uploads\/2025\/05\/image-56-1536x747.png 1536w, https:\/\/www.orczhou.com\/wp-content\/uploads\/2025\/05\/image-56.png 1776w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\taria-label=\"Enlarge\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.imageButtonRight\"\n\t\t\tdata-wp-style--top=\"state.imageButtonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure>\n<\/div>\n<\/div>\n\n\n\n<p>\u76f8\u6bd4\u4e8e\u903b\u8f91\u7ed3\u6784\uff0c\u7269\u7406\u7ed3\u6784\u4e0a\uff0c\u9700\u8981\u6ce8\u610f\u7684\u662f\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u201c\u8bb0\u5f55\u201d\u5728\u9875\u5185\u7269\u7406\u4f4d\u7f6e\uff0c\u5e76\u4e0d\u662f\u6309\u952e\u503c\u5927\u5c0f\u6392\u5217\uff0c\u800c\u901a\u5e38\u662f\u6309\u7167\u63d2\u5165\u65f6\u95f4\u5411\u4e0b\u751f\u957f\u7684<\/li>\n\n\n\n<li><code>Page Directory<\/code>\u5b58\u50a8\u5728\u9875\u9762\u7684\u5e95\u90e8\uff0c\u4ece\u9ad8\u4f4d\u5730\u5740\u5411\u4f4e\u4f4d\u5730\u5740\u6269\u5c55\uff1b\u6b64\u5916\uff0c<code>Slot<\/code>\u662f<code>InnoDB<\/code>\u4e2d\u7684\u903b\u8f91\u6982\u5ff5<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">\u66f4\u591a\u5173\u4e8ePage Directory\u5b9e\u73b0\u7ec6\u8282<\/h3>\n\n\n\n<p>\u4e00\u822c\u7684\u4e86\u89e3\u4e86<code>Page Directory<\/code>\u7684\u5b9e\u73b0\u903b\u8f91\u4ee5\u53ca\u6982\u8ff0\uff0c\u57fa\u672c\u4e0a\u5c31\u53ef\u4ee5\u4e86\uff0c\u4e5f\u7b97\u662f\u6e05\u695a\u4e86<code>InnoDB<\/code>\u9875\u5185\u641c\u7d22\u7684\u5b9e\u73b0\u3002\u672c\u5c0f\u7ed3\u4e3a\u4e00\u4e2a\u6269\u5c55\u9605\u8bfb\u90e8\u5206\uff0c\u63cf\u8ff0\u66f4\u591a\u5173\u4e8e<code>slot<\/code>\u7ed3\u6784\u3001\u641c\u7d22\u3001\u67e5\u627e\u7684\u7ec6\u8282\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">InnoDB\u7684\u4ee3\u7801\u53c2\u8003<\/h3>\n\n\n\n<p>\u5728\u4e86\u89e3<code>Page Directory<\/code>\u7684\u8fc7\u7a0b\u4e2d\uff0c\u8fd8\u662f\u9605\u8bfb\u4e86\u90e8\u5206<code>InnoDB<\/code>\u7684\u4ee3\u7801\uff0c\u4e3b\u8981\u662f<code>innobase\/page\/page0page.c<\/code>\u4ee5\u53ca\u76f8\u5173\u7684\u4ee3\u7801\u3002\u5728\u8be5\u6587\u4ef6\u4e2d\uff0c\u4e5f\u6709\u5f88\u591a\u7684\u6ce8\u91ca\u53ef\u4ee5\u9605\u8bfb\u3002\u8fd9\u91cc\u5217\u4e3e\u90e8\u5206\u51fd\u6570\uff0c\u7b97\u662f\u9a8c\u8bc1\u4e00\u4e0b\u4e0a\u8ff0\u7684\u90e8\u5206\u7406\u89e3\u3002\u8fd9\u91cc\u7684\u793a\u4f8b\u4ee3\u7801\u6765\u81ea\u7248\u672c\uff1a<code>MySQL-4.1.7<\/code>\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">InnoDB \u4ee3\u7801\u4e2d\u7684Page Directory<\/h4>\n\n\n\n<h4 class=\"wp-block-heading\">page0page.c \u4e2d\u7684\u6ce8\u91ca<\/h4>\n\n\n\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-28f84493 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<p>\u8fd9\u6bb5\u6ce8\u91ca\u5728<code>page0page.c<\/code>\u6587\u4ef6\u4e2d\uff0c\u662f<code>InnoDB<\/code>\u6700\u65e9\u3001\u4e5f\u662f\u6700\u4e3a\u539f\u59cb\u7684\u5173\u4e8e<code>page directory<\/code>\u548c<code>slot<\/code>\u7684\u8bf4\u660e\u4e0e\u4ecb\u7ecd\uff0c\u975e\u5e38\u5efa\u8bae\u9605\u8bfb\u3002<\/p>\n\n\n\n<p>\u53e6\u5916\uff0c\u8fd9\u6bb5\u6ce8\u91ca\u4e2d\u6700\u540e\uff1a<code>50 x 4 bytes = 200 bytes<\/code>\u8fd9\u90e8\u5206\u4f30\u7b97\u5e94\u8be5\u662f\u6709\u9519\u8bef\u7684\uff0c\u5e94\u8be5\u662f<code>50 x 2 bytes = 100 bytes<\/code>\u3002\u5728<code>16KB<\/code>\u7684\u9875\u9762\u4e2d\uff0c<code>2 bytes<\/code>\u5b58\u50a8\u504f\u79fb\u91cf\u662f\u591f\u4e86\u7684\uff0c\u800c\u5b9e\u9645\u5b9e\u73b0\u4e2d\u4e5f\u662f<code>2 bytes<\/code>\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\" style=\"font-size:14px\"><code lang=\"c\" class=\"language-c\">#define PAGE_DIR_SLOT_SIZE  2<\/code><\/pre>\n\n\n\n<p>\u5f53\u7136\uff0c\u5982\u679c\u4e00\u5b9a\u8981\u201c\u627e\u8865\u201d\uff0c\u90a3\u4e48\u4e5f\u53ef\u4ee5\u628a\u6bcf\u6761\u8bb0\u5f55\u4e2d\u7528\u4e8e\u5b58\u653e<code>slot<\/code>\u4e2d\u8bb0\u5f55\u6570\u91cf\u7684<code>4-bit<\/code>\u4e5f\u7b97\u8fdb\u6765\u7684\u8bdd\uff0c\u90a3\u4e48\u5e73\u5747\u4e00\u4e2a<code>slot<\/code>\u9700\u8981\uff1a<\/p>\n\n\n\n<p>$$ 2+\\frac{6*4}{8} \\approx  5 $$<\/p>\n<\/div>\n\n\n\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:70%\">\n<pre class=\"wp-block-code\" style=\"font-size:12px\"><code lang=\"c\" class=\"language-c\">\/*          THE INDEX PAGE\n            ==============\n\nThe index page consists of a page header which contains the page's\nid and other information. On top of it are the the index records\nin a heap linked into a one way linear list according to alphabetic order.\n\nJust below page end is an array of pointers which we call page directory,\nto about every sixth record in the list. The pointers are placed in\nthe directory in the alphabetical order of the records pointed to,\nenabling us to make binary search using the array. Each slot n:o I\nin the directory points to a record, where a 4-bit field contains a count\nof those records which are in the linear list between pointer I and\nthe pointer I - 1 in the directory, including the record\npointed to by pointer I and not including the record pointed to by I - 1.\nWe say that the record pointed to by slot I, or that slot I, owns\nthese records. The count is always kept in the range 4 to 8, with\nthe exception that it is 1 for the first slot, and 1--8 for the second slot.\n\nAn essentially binary search can be performed in the list of index\nrecords, like we could do if we had pointer to every record in the\npage directory. The data structure is, however, more efficient when\nwe are doing inserts, because most inserts are just pushed on a heap.\nOnly every 8th insert requires block move in the directory pointer\ntable, which itself is quite small. A record is deleted from the page\nby just taking it off the linear list and updating the number of owned\nrecords-field of the record which owns it, and updating the page directory,\nif necessary. A special case is the one when the record owns itself.\nBecause the overhead of inserts is so small, we may also increase the\npage size from the projected default of 8 kB to 64 kB without too\nmuch loss of efficiency in inserts. Bigger page becomes actual\nwhen the disk transfer rate compared to seek and latency time rises.\nOn the present system, the page size is set so that the page transfer\ntime (3 ms) is 20 % of the disk random access time (15 ms).\n\nWhen the page is split, merged, or becomes full but contains deleted\nrecords, we have to reorganize the page.\n\nAssuming a page size of 8 kB, a typical index page of a secondary\nindex contains 300 index entries, and the size of the page directory\nis 50 x 4 bytes = 200 bytes. *\/<\/code><\/pre>\n<\/div>\n<\/div>\n\n\n\n<p>\u4ece\u8fd9\u91cc\u4e5f\u53ef\u4ee5\u770b\u51fa\u6765\uff0c\u56e0\u4e3aInnoDB\u7684\u9875\u5185\u5730\u5740\u5f88\u591a\u5730\u65b9\u662f\u7528\u7684<code>2 Bytes<\/code>\u7684\u5b58\u50a8\u504f\u79fb\u91cf\uff0c\u6240\u4ee5InnoDB\u5355\u4e2a\u9875\u9762\u5927\u5c0f\u4e5f\u53d7\u6b64\u9650\u5236\uff0c\u6700\u5927\u4e3a \\( 2^{16} \\text{Bytes} = 64 \\text{KB} \\)\u3002\uff08\u53c2\u8003\uff1a<a href=\"https:\/\/dev.mysql.com\/doc\/refman\/8.4\/en\/innodb-parameters.html#sysvar_innodb_page_size\">innodb_page_size<\/a>\uff09<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">page_dir_get_nth_slot<\/h4>\n\n\n\n<p>\u8be5\u51fd\u6570\u8f93\u5165\u662f\u4e00\u4e2a\u9875\u9762\u6307\u9488\uff0c\u8fd4\u56de\u8be5\u9875\u9762\u7684\u7b2c\\( n \\)\u4e2a<code>slot<\/code>\u7684\u6307\u9488\u3002\u4e0b\u53f3\u4e3a<code>InnoDB<\/code>\u4e2d\u7684\u6e90\u7801\uff0c\u4e0b\u5de6\u5219\u662f\u4ee3\u7801\u90e8\u5206\u5bf9\u5e94\u7684\u793a\u610f\u56fe\uff1a<\/p>\n\n\n\n<div class=\"wp-block-columns has-x-small-font-size is-layout-flex wp-container-core-columns-is-layout-28f84493 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:50%\">\n<figure data-wp-context=\"{&quot;imageId&quot;:&quot;6a751b5575eef&quot;}\" data-wp-interactive=\"core\/image\" data-wp-key=\"6a751b5575eef\" class=\"wp-block-image size-large wp-lightbox-container\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"555\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/www.orczhou.com\/wp-content\/uploads\/2025\/05\/image-55-1024x555.png\" alt=\"\" class=\"wp-image-18640\" srcset=\"https:\/\/www.orczhou.com\/wp-content\/uploads\/2025\/05\/image-55-1024x555.png 1024w, https:\/\/www.orczhou.com\/wp-content\/uploads\/2025\/05\/image-55-300x163.png 300w, https:\/\/www.orczhou.com\/wp-content\/uploads\/2025\/05\/image-55-768x416.png 768w, https:\/\/www.orczhou.com\/wp-content\/uploads\/2025\/05\/image-55-1536x833.png 1536w, https:\/\/www.orczhou.com\/wp-content\/uploads\/2025\/05\/image-55.png 1822w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\taria-label=\"Enlarge\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.imageButtonRight\"\n\t\t\tdata-wp-style--top=\"state.imageButtonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure>\n<\/div>\n\n\n\n<div class=\"wp-block-column has-x-small-font-size is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:50%\">\n<pre class=\"wp-block-code\" style=\"font-size:12px\"><code lang=\"c\" class=\"language-c\">Gets pointer to nth directory slot. *\/\nUNIV_INLINE\npage_dir_slot_t* page_dir_get_nth_slot(\n            \/* out: pointer to dir slot *\/\n    page_t* page,   \/* in: index page *\/\n    ulint   n)  \/* in: position *\/\n{\n    ut_ad(page_header_get_field(page, PAGE_N_DIR_SLOTS) &gt; n);\n    return(page + UNIV_PAGE_SIZE - PAGE_DIR\n                    - (n + 1) * PAGE_DIR_SLOT_SIZE);\n}<\/code><\/pre>\n<\/div>\n<\/div>\n\n\n\n<h3 class=\"wp-block-heading\">\u5176\u4ed6\u7684\u4f18\u5316<\/h3>\n\n\n\n<p>\u5728 G. Graefe 2010 <a href=\"https:\/\/citeseerx.ist.psu.edu\/document?repid=rep1&amp;type=pdf&amp;doi=0b19f413ffb5bc68b43f3bd05a97c282a7c6d6ab\">Modern B-Tree Techniques<\/a> \u4e2d\u6982\u8ff0\u4e86<code>B-Tree<\/code>\u4e2d\u4f7f\u7528<code>Interpolation Search<\/code>\u4f18\u5316<code>Binary Search<\/code>\u7684\u9009\u62e9\u95ee\u9898\u3002\u5173\u4e8e\u8fd9\u4e2a\u95ee\u9898\uff0cG. Graefe\u5728\u53e6\u4e00\u7bc7Survey\u6027\u8d28\u7684\u8bba\u6587\u4e2d\uff0c\u8f83\u4e3a\u7cfb\u7edf\u7684\u63cf\u8ff0\u4f7f\u7528\u63d2\u503c\u4f18\u5316\u7684\u4e00\u4e9b\u76f8\u5173\u6280\u672f\uff1a<a href=\"https:\/\/www.cs.cmu.edu\/~damon2006\/pdf\/graefe06btreeindexes.pdf\">B-tree indexes, interpolation search, and skew.<\/a><sup>[2]<\/sup>\u3002<\/p>\n\n\n\n<p>\u8fd9\u7bc7\u8bba\u6587<sup>[2]<\/sup>\u4ecb\u7ecd\u4e86\u5f88\u591a\u4f7f\u7528\u63d2\u503c\u4f18\u5316\u4e8c\u5206\u67e5\u627e\u7684\u8003\u8651\uff0c\u4f46\u5bf9\u4e8e<code>InnoDB<\/code>\u4f3c\u4e4e\u5e76\u4e0d\u9002\u7528\uff0c\u4e3b\u8981\u539f\u56e0\u662f\uff0c\u5728<code>InnoDB<\/code>\u4e2d\u5f88\u591a\u7684<code>Key<\/code>\u90fd\u4e0d\u662f\u6574\u6570\uff0c\u4e14<code>Key<\/code>\u7684\u7c7b\u578b\u4f1a\u6bd4\u8f83\u590d\u6742\uff0c\u4f8b\u5982\u5b57\u7b26\u4e32\u3001\u591a\u5b57\u6bb5\u7ec4\u5408\u7b49\uff0c\u5e76\u6ca1\u6709\u5f88\u7b80\u5355\u7684\u63d2\u503c\u8ba1\u7b97\u3002\u6b64\u5916\uff0c\u5728\u5f53\u524d\u7684<code>InnoDB<\/code>\u5b9e\u73b0\u4e2d\uff0c\u5404\u4e2a<code>Slot<\/code>\u5e76\u6ca1\u6709\u5b58\u50a8\u5b9e\u9645\u7684<code>Key<\/code>\u503c\uff0c\u800c\u662f\u5b58\u50a8<code>Key<\/code>\u6240\u5728\u7684\u9875\u5185\u504f\u79fb\uff0c\u5373\u5982\u679c\u8981\u8fdb\u884c<code>Key<\/code>\u6bd4\u8f83\uff0c\u5219\u4e00\u5b9a\u8981\u8df3\u8f6c\u5230\u9875\u9762\u7684\u5176\u4ed6\u4f4d\u7f6e\uff0c\u800c\u8fd9\u4e0e\u8bba\u6587\u4e2d\u7684\u63cf\u8ff0\u60f3\u907f\u514d<code>CPU<\/code>\u7684<code>Cache Miss<\/code>\u7684\u7406\u5ff5\u662f\u51b2\u7a81\u7684\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">\u4e00\u4e9b\u9057\u7559\u7684\u95ee\u9898\uff1a<\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u4e00\u4e2a<code>slot<\/code>\u7684<code>PAGE_DIR_SLOT_MAX_N_OWNED<\/code>\u5c31\u662f<code>8<\/code>\uff0c\u90a3\u4e48\u5982\u679c<code>b-tree<\/code>\u7ed3\u6784\u7684\u76f8\u540c<code>key<\/code>\u5c31\u8d85\u8fc78\u4e2a\uff0c\u5982\u4f55\u5904\u7406\uff1f \uff08\u53ef\u80fd\u5c31\u76f4\u63a5\u622a\u65ad\u5c31\u53ef\u4ee5\u4e86\uff0c\u5728\u641c\u7d22<code>slot<\/code>\u7684\u65f6\u5019\u9700\u8981\u6ce8\u610f\u5904\u7406\u8fd9\u79cd\u60c5\u51b5\uff09<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\"><a href=\"https:\/\/www.cs.cmu.edu\/~damon2006\/pdf\/graefe06btreeindexes.pdf\">B-tree indexes, interpolation search, and skew.<\/a><\/h4>\n\n\n\n<p>\u8fd9\u662f\u4e00\u7bc7\u7814\u7a76<code>B-Tree<\/code>\u5185\u90e8\u641c\u7d22\u6027\u80fd\u7684\u6587\u7ae0\u3002<code>B-Tree<\/code>\u7684\u6700\u4e3a\u4e3b\u8981\u7684\u8bbf\u95ee\u6210\u672c\u662f\u4ece\u5b58\u50a8\u5230\u5185\u5b58\uff0c\u4f46\u4f5c\u8005\u8ba4\u4e3a\uff0c\u5728\u67d0\u4e9b\u573a\u666f\u4e0b\uff0c\u9700\u8981\u5173\u6ce8CPU\u548c\u5185\u5b58\u5904\u7406\u7684\u6210\u672c\u3002\u8fd9\u91cc\u7684\u201c\u67d0\u4e9b\u573a\u666f\u201d\u4f5c\u8005\u8ba4\u4e3a\u5728\u53d8\u5f97\u66f4\u4e3a\u91cd\u8981\uff0c\u5177\u4f53\u7684\uff0c\u201c\u67d0\u4e9b\u573a\u666f\u201d\u5305\u62ec\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u73b0\u5728\u7684\u5185\u5b58\u53d8\u5f97\u5f88\u5927\uff0c\u9875\u9762\u547d\u4e2d\u7387\u53d8\u5f97\u975e\u5e38\u9ad8\uff0c\u53ea\u6709\u5f88\u5c11\u7684\u9875\u9762\u9700\u8981\u4ece\u5b58\u50a8\u8bfb\u53d6<\/li>\n\n\n\n<li>\u7531\u4e8e<code>B-Tree<\/code>\u7684\u7279\u6027\uff0c\u9875\u9762\u8bfb\u53d6\u7684\u6548\u7387\u5df2\u7ecf\u975e\u5e38\u4f18\u79c0\u4e86\uff0c\u5df2\u7ecf\u662f\u5bf9\u6570\u7ea7\u7684\u4e86<\/li>\n<\/ul>\n\n\n\n<p>\u6b64\u5916\uff0c\u4f5c\u8005\u8fd8\u6ce8\u610f\u5230\uff1a\u786c\u4ef6\u6280\u672f\u7684\u53d1\u5c55\u4e0a\uff0c\u66f4\u591a\u7684\u662f\u5e26\u5bbd\u7684\u63d0\u5347\uff0c\u800c\u4e0d\u662f\u5ef6\u8fdf\u7684\u63d0\u5347\uff0c\u8fd9\u5305\u62ec\u4e24\u4e2a\u65b9\u9762\uff08\u78c1\u76d8\u5230\u5185\u5b58\u3001\u5185\u5b58\u5230CPU\uff09\u3002<\/p>\n\n\n\n<p>\u6240\u4ee5\uff0c\u4f5c\u8005\u628a\u6ce8\u610f\u529b\u653e\u5230\u4e86CPU\u5904\u7406\u6548\u7387\u7684\u63d0\u5347\u4e0a\u3002\u4f5c\u8005\u5728\u8bba\u6587\u4e2d\u7684\u9884\u4f30\u662f\u8fd9\u6837\uff1a\u5728\u8fd9\u4e2a\u573a\u666f\u4e0b\uff0c\u5982\u679c\u4e00\u4e2a\u9875\u9762\u4e2d\u6709500\u4e2a\u7d22\u5f15\u5165\u53e3\uff0c\u90a3\u4e48\u9875\u9762\u5185\u90e8\u7684\u4e8c\u5206\u67e5\u627e\uff0c\u5c31\u9700\u8981\u505a\uff1a\\( log_{2}500 \\approx 18 \\) \u6b21\u6bd4\u8f83\u64cd\u4f5c\u4ee5\u53ca\u5bf9\u5e94\u7684\u5185\u5b58\u8bbf\u95ee\u64cd\u4f5c\u3002<\/p>\n\n\n\n<p>\u8fd9\u91cc\u505a\u8fc7\u4e86\u4e00\u4e9b\u521d\u6b65\u7684\u6d4b\u8bd5\uff0c\u5728\u5f53\u4ee3\u7684CPU\u4e2d\uff0c\u901a\u5e38\u90fd\u4f1a\u6709<code>32KB<\/code>\u7684<code>L1 Cache <\/code>\uff0c\u6545\u8fd9\u91cc\u7684\u90e8\u5206\u4e8b\u5b9e\u5df2\u7ecf\u4e0d\u6210\u7acb\u4e86\u3002\u4e0d\u8fc7\u8fd8\u662f\u628a\u8fd9\u7bc7\u8bba\u6587\u770b\u5b8c\uff0c\u770b\u770b\u4f5c\u8005\u7684\u601d\u8003\u662f\u4ec0\u4e48\u3002<\/p>\n\n\n\n<p>\u76f8\u6bd4\u4e8e\u4e8c\u5206\u67e5\u627e\uff0c\u63d2\u503c\u67e5\u627e\u5219\u6bcf\u6b21\u4ece\u533a\u95f4\u7684\u67d0\u4e2a\u76f8\u5bf9\u4f4d\u7f6e\u5f00\u59cb\u8fdb\u884c\u641c\u7d22\uff0c\u8fd9\u4e2a\u76f8\u5bf9\u4f4d\u7f6e\u5219\u4f7f\u7528\u63d2\u503c\u7684\u65b9\u5f0f\u83b7\u5f97\uff0c\u800c\u4e0d\u662f\u7b80\u5355\u7684\u4ece\u4e2d\u70b9\u5f00\u59cb\uff08\u4e8c\u5206\u67e5\u627e\uff09\u3002\u5982\u679c\uff0c\u952e\u503c\u6a21\u578b\u6070\u597d\u662f\u4e00\u4e2a\u7ebf\u6027\u6a21\u578b\u7684\u65f6\u5019\uff0c\u8fd9\u4e2a\u65f6\u5019\u7ebf\u6027\u63d2\u503c\u7684\u6548\u7387\u5c31\u4f1a\u975e\u5e38\u5b8c\u7f8e\u3002\u800c\u73b0\u5b9e\u4e2d\uff0c\u786e\u5b9e\u5f88\u591a\u5c31\u662f\u7ebf\u6027\u5206\u5e03\u7684\u3002\u8fd9\u7bc7\u6587\u7ae0\u7684\u76ee\u7684\uff1aThe topic and purpose of this paper is to survey techniques that avoid the worst case of interpolation search. \u770b\u770b\u6709\u54ea\u4e9b\u6280\u672f\uff0c\u907f\u514d\u5dee\u503c\u67e5\u627e\u7684\u7cdf\u7cd5\u60c5\u51b5\u53d1\u751f\u3002<\/p>\n\n\n\n<p>\u66f4\u7ec6\u81f4\u7684\u5173\u4e8eB-Tree\u548cCPU Cache\u76f8\u5173\u7684\u8ba8\u8bba\uff1a[GL 01] G Graefe, P Larson: B-tree indexes and CPU caches. ICDE 2001, 349-358.<\/p>\n\n\n\n<p>\u4e00\u4e9b\u7814\u7a76\u7684\u65b9\u5411\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u6700\u4e3a\u76f4\u63a5\u7684\uff1a\u4f7f\u7528\u4e00\u4e2a\u7c7b\u4f3c\u7684B-Tree\u7ed3\u6784\uff0c\u53ef\u80fd\u662f\u4e8c\u53c9\u6811\u3001\u7ea2\u9ed1\u6811\u7b49<\/li>\n\n\n\n<li>\u4e3a\u4e86\u8ba9\u8fd9\u90e8\u5206\u7d22\u5f15\u80fd\u591f\u66f4\u5feb\u901f\uff0c\u80fd\u591f\u8ba9\u5176\u5b58\u653e\u5230CPU\u7f13\u5b58\u4e2d\uff0c\u4f1a\u8003\u8651\u5220\u9664\u524d\u7f00\u6216\u540e\u7f00<\/li>\n\n\n\n<li>\u6b64\u5916\uff0c\u8003\u8651\u5229\u7528B-Tree\u7684\u591a\u5c42\u7d22\u5f15\uff0c\u4e0eCPU\u7684\u591a\u7ea7\u7f13\u5b58\u8fdb\u884c\u9002\u914d<\/li>\n<\/ul>\n\n\n\n<p>\u9605\u8bfb\u8fd9\u7bc7\u8bba\u6587\u7684\u6536\u83b7\u662f\u4e86\u89e3\u5927\u5bb6\u8003\u8651\u95ee\u9898\u7684\u65b9\u6cd5\uff0c\u5927\u5bb6\u7684\u601d\u8003\u65b9\u5f0f\uff0c\u4ee5\u53ca\u5bf9\u5404\u79cd\u6280\u672f\u8fb9\u754c\u7684\u62d3\u5c55\u3002\u4f8b\u5982\uff0c<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u4e86\u89e3\u5230\u5927\u5bb6\u5bf9\u4e8e\u7a0b\u5e8f\u5b9e\u73b0\u7684\u8003\u8651\uff0c\u5982\u4f55\u53bb\u601d\u8003\u5904\u7406\u5668\u6280\u672f\u5bf9\u4e8e\u7a0b\u5e8f\u6548\u7387\u7684\u5f71\u54cd\uff0cL1 Cache\u3001L2 Cache\u4ee5\u53ca\u6307\u4ee4Cache\u7b49\u5982\u4f55\u5f71\u54cdCPU\u7684\u6548\u7387\u3002\u8fd9\u4e9b\u6280\u672f\u8fdc\u770b\uff0c\u5176\u5b9e\u5e76\u4e0d\u7b97\u7279\u522b\u590d\u6742\uff0c\u4f46\u662f\u6709\u4e86\u8fd9\u4e9b\u601d\u8003\uff0c\u5bf9\u4e8e\u8ba1\u7b97\u673a\u6027\u80fd\u3001\u67b6\u6784\u7684\u7406\u89e3\u662f\u4e0d\u4e00\u6837\u7684\u3002\u5305\u62ec\u8fd9\u91cc\u63d0\u5230\u7684\u4e00\u4e2a\u8bba\u6587\u4e2d\u7684\u89c2\u70b9\uff1aL1 Cache for Instruction \u548c L2 Cache for Data \u5bf9\u4e8e\u4e8b\u52a1\u5904\u7406\u6280\u672f\u66f4\u4e3a\u91cd\u8981\u3002\u8fd9\u4e2a\u89c2\u70b9\u5c31\u5f88\u6709\u610f\u601d\uff0c\u5f53\u7136\uff0c\u5728\u5f53\u4e0b\uff0c\u5f53\u7136\u672a\u5fc5\u9002\u7528\uff0c\u4f46\u662f\u8fd9\u4e2a\u601d\u8003\u65b9\u5f0f\u53ef\u80fd\u662f\u5f88\u91cd\u8981\u7684\u3002\u5982\u679c\u5bf9\u4e8e\u8fd9\u4e9b\u6280\u672f\u975e\u5e38\u4e86\u89e3\uff0c\u624d\u6709\u53ef\u80fd\u5199\u51fa\uff0c\u8bf8\u5982Redis\u3001ClickHouse\u3001DuckDB\u7b49\u8fd9\u4e9b\u6027\u80fd\u975e\u5e38\u6781\u81f4\u7684\u4ea7\u54c1\uff08\u5927\u6982\u662f\u8fd9\u6837\u5427\uff09\u3002<\/li>\n<\/ul>\n\n\n\n<p>\u518d\u6bd4\u5982\u8fd9\u4e24\u7bc7\u8bba\u6587\u4e2d\u7684\u4e00\u4e9b\u8ba1\u7b97\uff0c\u53ef\u4ee5\u770b\u5230\u5982\u4f55\u8003\u8651\u7a0b\u5e8f\u7684\u6548\u7387\uff0c\u5305\u62ecCPU\u65f6\u95f4\u3001\u5b58\u50a8\u65f6\u95f4\u7b49\u3002<\/p>\n\n\n\n<p>\u5728\u8fd9\u91cc\u7684\u4e00\u4e9b\u8003\u8651\uff0c\u770b\u770b\u4ed6\u7684\u8ba1\u7b97\u548c\u5b9e\u73b0\u5427\uff1a\u5728\u5f53\u65f6\uff08\u8fd9\u7bc7\u8bba\u6587\u65f6\u5019\uff09\uff0c\u4e00\u6b21\\( \\text{Page Access} \\) \u8ba1\u4e3a \\( 8ms \\) \uff0c\u4f20\u8f93\u65f6\u95f4\u4e3a \\( 0.1ms \\)\uff0c\u5982\u679c\u9875\u9762\u4e2d\u6709 256 \u4e2a\u7d22\u5f15\u5165\u53e3\u3002<\/p>\n\n\n\n<p>\u8003\u8651\u4e00\u4e2a\u8ba1\u7b97\u6307\u6807\uff08 \u201cutility\u201d of a disk page \uff09\u5373\uff1a <\/p>\n\n\n<p>$$<br \/>\n\\frac{\\text{counter of comparison}}{\\text{page access latency} + \\text{page transfer time}}<br \/>\n$$<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>\u90a3\u4e48\uff0c256\u4e2a\u5165\u53e3\uff0c\u4e00\u4e2a\u5178\u578b\u7684\u4e8c\u5206\u67e5\u627e\u9700\u8981\u7ea6\uff1a\\( \\log_2{256} \\) \u6b21\u6bd4\u8f83\uff0c\u5219\uff1a\\( utility = \\frac{8}{8+0.1} = 0.987 \\)\uff1b<\/p>\n\n\n\n<p>\u90a3\u4e48\uff0c\u5982\u679c\u9875\u9762\u5927\u5c0f\u589e\u52a0\u5230\u5f53\u524d\u7684\u516b\u500d\uff0c\u90a3\u4e48\u9700\u8981\u7684\u6bd4\u8f83\u6b21\u6570\uff1a\\( \\log_2{256*8} = 11 \\)\uff0c\u5ef6\u8fdf\u4f9d\u65e7\u662f \\( 8ms \\) \uff0c\u4f20\u8f93\u65f6\u95f4\u5219\u4e3a\uff1a\\( 8*0.1 ms \\)\uff0c\u5219\uff1a\\( utility = \\frac{11}{8+0.8} = 1.25 \\)<\/p>\n\n\n\n<p>\u6839\u636e\u8fd9\u91cc\u7684\u8ba1\u7b97\uff0c\u6700\u4f18\u7684\u9875\u9762\u5927\u5c0f\uff0c\u5e94\u8be5\u8fdc\u8fdc\u5927\u4e8e\u5404\u4e2a\u6570\u636e\u5e93\u7cfb\u7edf\u4e2d\u5b9e\u9645\u4f7f\u7528\u503c\u3002\u5bf9\u4e8e\u73b0\u4ee3CPU\u6765\u8bf4\uff0c\u76f8\u6bd4\u4e8e\u5904\u7406\u6307\u4ee4\uff0c\u5904\u7406\u6027\u80fd\u9700\u8981\u4f18\u5148\u8003\u8651<code>cache miss<\/code>\u4ee5\u53capipeline stalls\u3002\u5728\u4e00\u4e9b\u8bba\u6587\u4e2d\u5bf9\u76f8\u5173\u95ee\u9898\u505a\u4e86\u4e00\u4e9b\u91cf\u5316\u5206\u6790\uff0c\u6709\u4e00\u4e9b\u53ef\u4ee5\u53c2\u8003\u7684\u7ed3\u8bba\uff0c\u4f8b\u5982\u5728\u4e8b\u52a1\u5904\u7406\u65f6\uff0c\u6700\u4e3a\u91cd\u8981\u7684\u662fL1\u7684\u6307\u4ee4\u7f13\u5b58\u548cL2\u7684\u6570\u636e\u7f13\u5b58\uff08[ADH 99].\uff09\u3002\u6240\u4ee5\u5b9e\u73b0\u7684\u4e3b\u8981\u8003\u8651\u5305\u62ec\uff1a\u4ee3\u7801\u91cf\uff08\u5177\u4f53\u7684\u67d0\u4e2a\u529f\u80fd\u6a21\u5757\uff09\u7684\u591a\u5c11\u3001\u590d\u6742\u5ea6\uff0c\u4ee5\u53caL2 Data Cache Miss\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">\u9875\u5927\u5c0f<\/h4>\n\n\n\n<p>\u6982\u8ff0\uff1a\u5bf9\u4e8e\u975e\u53f6\u5b50\u8282\u70b9\uff08\u5c24\u5176\u662f\u9760\u8fd1\u6839\u8282\u70b9\u7684\uff09\uff0c\u4f7f\u7528\u975e\u5e38\u5927\u7684\u9875\u9762\u5927\u5c0f\u662f\u6709\u4e00\u5b9a\u9053\u7406\u7684\uff0c\u4f46\u53f6\u5b50\u8282\u70b9\u5219\u4e0d\u5e94\u8be5\u9875\u9762\u592a\u5927\u3002\u975e\u53f6\u5b50\u8282\u70b9\u7684\u4f7f\u7528\u7387\u662f\u975e\u5e38\u9ad8\u7684\uff0c\u5e76\u4e14\u6570\u91cf\u76f8\u6bd4\u4e8e\u53f6\u5b50\u8282\u70b9\u8981\u5c11\u5f88\u591a\uff1b\u4f46\u53f6\u5b50\u8282\u70b9\uff0c\u5219\u4e0d\u540c\u3002\u5f53\u9700\u8981\u8bfb\u53d6\u67d0\u4e2a\u53f6\u5b50\u8282\u70b9\u65f6\uff0c\u901a\u5e38\u53ea\u662f\u4e3a\u4e86\u8bfb\u53d6\u67d0\u4e00\u6761\u8bb0\u5f55\uff08\u5178\u578b\u7684<code>OLTP<\/code>\u573a\u666f\uff09\uff0c\u4e3a\u4e86\u4e00\u6761\u8bb0\u5f55\u800c\u8bfb\u53d6\u8fc7\u5927\u7684\u9875\u9762\uff0c\u4f1a\u5bfc\u81f4\u5185\u5b58\u5229\u7528\u7387\u7684\u964d\u4f4e\uff0c\u53cd\u800c\u4f1a\u5bfc\u81f4\u6574\u4f53\u7684\u6027\u80fd\u964d\u4f4e\u3002<\/p>\n\n\n\n<p>\u5728\u5b9e\u8df5\u573a\u666f\u4e2d\uff0c\u5982\u679c\u8fd9\u4e2a\u95ee\u9898\u5f88\u5173\u952e\u6216\u8005\u6709\u4eba\u5bf9\u8fd9\u4e2a\u95ee\u9898\u611f\u5174\u8da3\uff0c\u662f\u53ef\u4ee5\u505a\u4e00\u4e9b\u91cf\u5316\u7684\u5206\u6790\u7684\u3002\u628a\u6574\u4e2a\u6d41\u7a0b\u7684\u65f6\u95f4\u3001\u547d\u4e2d\u7387\u3001\u6570\u636e\u5927\u5c0f\u7b49\u76f8\u5173\u7684\u56e0\u7d20\u90fd\u8003\u8651\u4e0a\uff0c\u7136\u540e\u505a\u4e00\u4e2a\u6700\u4f18\u5316\u7684\u5206\u6790\u3002\u53ea\u662f\u5462\uff0c<code>B-Tree<\/code>\u662f\u4e00\u4e2a\u6bd4\u8f83\u53e4\u8001\u7684\u8bdd\u9898\uff0c\u5927\u5bb6\u5bf9\u4e8e\u8fd9\u4e2a\u6570\u636e\u7ed3\u6784\u7684\u5173\u6ce8\u53ef\u80fd\u6ca1\u6709\u90a3\u4e48\u9ad8\u4e86\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">\u5206\u88c2\u548c\u5408\u5e76\u7684\u9009\u62e9<\/h4>\n\n\n\n<p>\u5206\u88c2\u4e0e\u5408\u5e76\uff0c\u4e0d\u540c\u7684\u5b9e\u73b0\u4f1a\u6709\u4e00\u4e9b\u4e0d\u540c\u9009\u62e9\uff0c\u5305\u62ec\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u63d0\u524d\u5206\u88c2\uff0c\u4f8b\u5982\u9875\u9762\u7684\u5360\u7528\u7387\u8d85\u8fc7\u4e86\u4e00\u5b9a\u7684\u6bd4\u7387\u5c31\u8fdb\u884c\u5206\u88c2\uff1b\u7ed3\u5408\u63d2\u503c\u7b97\u6cd5\u8003\u8651\uff0c\u5982\u679c\u9875\u9762\u91cc\u9762\u7684\u503c\uff0c\u53ef\u4ee5\u975e\u5e38\u597d\u7684\u5206\u88c2\u4e3a\u4e24\u4e2a\u975e\u5e38\u9002\u5408\u63d2\u503c\u7684\u533a\u95f4\uff0c\u4e5f\u53ef\u4ee5\u8003\u8651\u4f18\u5148\u8fdb\u884c\u5206\u88c2\u3002<\/li>\n\n\n\n<li>\u5728\u67d0\u4e9b\u5b9e\u73b0\u4e2d\uff0c\u5220\u9664\u7684\u65f6\u5019\uff0c\u4ece\u4e0d\u89e6\u53d1\u5408\u5e76\uff0c\u800c\u662f\u5728\u67d0\u79cd\u201c\u788e\u7247\u6574\u7406\u201d\u7684\u65f6\u5019\u624d\u8fdb\u884c\u5408\u5e76\u6216\u5206\u88c2\u5904\u7406<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">\u56de\u9000\u5230\u4e8c\u5206\u67e5\u627e<\/h4>\n\n\n\n<p>\u5728\u6570\u636e\u5206\u5e03\u975e\u5e38\u503e\u659c\u7684\u60c5\u51b5\uff0c\u63d2\u503c\u67e5\u627e\u7684\u6548\u7387\u53ef\u80fd\u4f1a\u975e\u5e38\u7cdf\u7cd5\u3002\u9700\u8981\u8003\u8651\u56de\u9000\u5230\u4e8c\u5206\u67e5\u627e\u3002\u4e00\u4e9b\u5e38\u89c1\u7684\u7b56\u7565\u662f\u8fd9\u6837\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u4f8b\u5982\uff0c\u8fdb\u884c\u4e863\u30014\u6b21\u5dee\u503c\u67e5\u627e\u8fd8\u6ca1\u6709\u627e\u5230\u76ee\u6807\uff0c\u90a3\u4e48\u53ef\u4ee5\u56de\u9000\u5230\u4e8c\u5206\u67e5\u627e<\/li>\n\n\n\n<li>\u53ef\u4ee5\u8003\u8651\u6839\u636e\u7b2c\u4e00\u3001\u4e8c\u6b21\u67e5\u627e\u7684\u6548\u7387\u505a\u4e00\u4e9b\u9884\u4f30\uff0c\u9884\u4f30\u6548\u679c\u5dee\uff0c\u5219\u56de\u9000\u5230\u4e8c\u5206\u67e5\u627e<\/li>\n\n\n\n<li>\u5728\u5dee\u503c\u67e5\u627e\u4e2d\uff0c\u8003\u8651\u4f7f\u7528\u4e8c\u5206\u67e5\u627e\u505a\u4e00\u4e9b\u4fee\u6b63\uff0c\u6700\u7ec8\u540e\u518d\u9000\u56de\u4e8c\u5206\u67e5\u627e<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">\u6b63\u89c4\u5316\u5904\u7406<\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u5f53<code>key<\/code>\u662f\u5b57\u7b26\u4e32\u7684\u65f6\u5019\uff0c\u901a\u5e38\u9700\u8981\u8003\u8651\u5148\u8fdb\u884c\u4e00\u5b9a\u7684\u6b63\u89c4\u5316\u5904\u7406\uff0c\u4ee5\u53ef\u4ee5\u66f4\u597d\u7684\u8fdb\u884c\u5927\u5c0f\u6bd4\u8f83\u3002<\/li>\n\n\n\n<li>\u524d\u7f00\u5220\u9664\u3002\u548c\u4e00\u822c\u7684\u7d22\u5f15\/\u641c\u7d22\u6280\u672f\u4e00\u6837\uff0c\u5982\u679c\u6709\u516c\u5171\u524d\u7f00\u53ef\u80fd\u4f1a\u5927\u5927\u964d\u4f4e\u6548\u7387\u3002<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">\u56de\u5f52\u5dee\u503c<\/h4>\n\n\n\n<p>\u5728\u8fdb\u884c\u4e86\u4e00\u4e9b\u63d2\u503c\u8ba1\u7b97\u540e\uff0c\u53ef\u4ee5\u8003\u8651\u4f7f\u7528\u8fd9\u4e9b\u503c\u8fdb\u884c\u56de\u5f52\u8ba1\u7b97\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">\u76f8\u5173\u6027\u5206\u6790<\/h4>\n\n\n\n<p>\u53ef\u4ee5\u5bf9\u4e00\u4e2a\u8282\u70b9\u5185\u7684\u503c\uff0c\u5148\u8fdb\u884c\u4e00\u6b21\u56de\u5f52\u5206\u6790\uff0c\u5e76\u8003\u8651\u5b9a\u671f\u8fdb\u884c\u56de\u5f52\u5206\u6790\uff0c\u4ece\u800c\u5224\u65ad\u63d2\u503c\u641c\u7d22\u7684\u6548\u679c\u3002<\/p>\n\n\n\n<p>\u4e00\u4e2a\u611f\u53d7\uff1a\u5728<code>SSD<\/code>\u63a8\u51fa\u4e4b\u521d\uff0c\u6709\u5f88\u591a\u4eba\u8ba4\u4e3a\uff0c<code>B-Tree<\/code>\u53ef\u80fd\u4e0d\u518d\u9002\u7528\u4e8e\u6570\u636e\u5e93\u7684\u5b58\u50a8\uff08\u6216\u5176\u4ed6\u573a\u666f\u7684\u5b58\u50a8\uff09\uff0c\u53ef\u80fd\u8981\u6709\u66f4\u6709\u7684\u5b58\u50a8\u7ed3\u6784\u9002\u914d\u65b0\u7684\u786c\u4ef6\uff08<code>SSD<\/code>\uff09\u3002\u4f46\u5b9e\u9645\u7684\u60c5\u51b5\u662f\uff0c\u5728\u73b0\u5728\u7684\u51e0\u4e4e\u6240\u6709\u7684\u5b58\u50a8\u786c\u4ef6\u4e2d\uff0c<code>B-Tree<\/code>\u4f9d\u65e7\u975e\u5e38\u6210\u529f\u3002\u8fd9\u662f\u56e0\u4e3a\uff0c<code>B-Tree<\/code>\u6240\u89e3\u51b3\u7684\u95ee\u9898\u672c\u8d28\u5e76\u6ca1\u6709\u6539\u53d8\uff1a\u5185\u5b58\u8bbf\u95ee\u7684\u901f\u5ea6\/\u6210\u672c\u8fdc\u9ad8\u4e8e\u201c\u78c1\u76d8\u201d\uff08HDD\u6216\u8005SDD\u3001\u751a\u81f3S3\u7b49\u5757\u5b58\u50a8\uff09\u5b58\u50a8\u8bbe\u5907\u3002\u8fd9\u65f6\u5019\uff0c<code>B-Tree<\/code>\u8fd9\u79cd\u591a\u8def\u3001\u5e73\u8861\u6811\u7ed3\u6784\u4f9d\u65e7\u975e\u5e38\u6709\u6548\u3002\uff08\u6ce8\uff1aLSM-Tree \u5728\u5f88\u591a\u6a21\u578b\u4e0b\uff0c\u4e5f\u662f\u975e\u5e38\u9002\u7528\u7684\uff0c\u8fd9\u662f\u53e6\u4e00\u4e2a\u95ee\u9898\uff09<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u540d\u8bcd\u8bf4\u660e<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>B+Tree<\/code>\u3001<code>B+-Tree<\/code> \u5747\u6307<code>B<sup>+<\/sup>-Tree<\/code><\/li>\n\n\n\n<li>\u4e00\u822c\u7684\uff0c<code>B-Tree<\/code>\u6307\u72ed\u4e49\u7684\u3001\u7ecf\u5178\u7684<code>B-Tree<\/code>\uff0c\u8be5\u7ed3\u6784\u4e3b\u8981\u53c2\u8003\uff1a<a href=\"https:\/\/www.orczhou.com\/index.php\/2025\/05\/understanding-innodb-and-b-tree-01\/\">\u4e86\u89e3 InnoDB \u7684\u7d22\u5f15\u7ed3\u6784\uff1aB-Tree \u57fa\u7840<\/a><\/li>\n\n\n\n<li>\u6709\u65f6\u5019\uff0c<code>B-Tree<\/code>\u4e5f\u4f1a\u6307\u4ee3<code>B<sup>+<\/sup>-Tree<\/code>\u6216\u5176\u4ed6<code>B-Tree<\/code>\u53d8\u79cd\uff1b\u8fd9\u79cd\u7528\u6cd5\u4e5f\u662f\u975e\u5e38\u5e7f\u6cdb\u7684\uff0c\u4f8b\u5982\uff0c\u5728<a href=\"https:\/\/dev.mysql.com\/doc\/refman\/8.4\/en\/innodb-physical-structure.html\"><code>MySQL\/InnoDB<\/code>\u7684\u6587\u6863<\/a>\u4e2d\uff0c\u4ec5\u4f7f\u7528<code>B-Tree<\/code>\uff0c\u800c\u66f4\u4e3a\u51c6\u786e\u7684\u8bf4\u662f<code>B+-Tree<\/code><\/li>\n\n\n\n<li>\u201c\u8282\u70b9\u201d\uff08<code>Node<\/code>\uff09\u3001\u201c\u9875\u9762\u201d\uff08<code>Page<\/code>\uff09\u3001\u201c\u6570\u636e\u5757\u201d\u3001\u201c\u5757\u201d(<code>Block<\/code>)\u7b49\u5747\u6307\u5b58\u50a8<code>B-Tree<\/code>\u6216<code>B<sup>+<\/sup>-Tree<\/code>\u7684\u8282\u70b9\uff0c\u5373\u6811\u7ed3\u6784\u7684\u8282\u70b9\uff0c\u5185\u90e8\u53ef\u4ee5\u5b58\u50a8\u591a\u4e2a\u952e\u503c\u3002\u5728\u4e0d\u540c\u7684\u8bed\u5883\u4e0b\uff0c\u5927\u5bb6\u4f1a\u7528\u4e0d\u540c\u7684\u8bcd\uff0c\u4f8b\u5982\u901a\u5e38\u5728\u7b97\u6cd5\u8bfe\u7a0b\/\u4e66\u7c4d\u4e2d\uff0c\u4f1a\u66f4\u591a\u7684\u4f7f\u7528\u201c\u8282\u70b9\u201d\uff08<code>Node<\/code>\uff09\uff1b\u800c\u5728\u6570\u636e\u5e93\u5b9e\u73b0\u4e2d\uff0c\u5219\u66f4\u559c\u6b22\u7528\u201c\u9875\u9762\u201d\uff08<code>Page<\/code>\uff09\u6216\u201c\u5757\u201d(<code>Block<\/code>)\uff1b\u66f4\u4e3a\u7ec6\u8282\u7684\uff0c\u5982\u679c\u5728\u5185\u5b58\u4e2d\uff0c\u5219\u66f4\u591a\u7684\u65f6\u5019\u7528\u201c\u9875\u9762\u201d\uff08<code>Page<\/code>\uff09\uff0c\u5728\u78c1\u76d8\u4e0a\uff0c\u5219\u66f4\u591a\u7684\u201c\u5757\u201d(<code>Block<\/code>)\u3002\u5404\u79cd\u60c5\u51b5\u4e0b\u6df7\u7528\u7684\u4e5f\u5f88\u591a\uff0c\u5e76\u6ca1\u6709\u4ec0\u4e48\u95ee\u9898\u3002<\/li>\n\n\n\n<li>\u201c\u8bb0\u5f55\u201d\uff08record\uff09\u3001\u201c\u884c\u201d\uff08row\uff09\u3001tuple\u90fd\u662f\u8868\u793a\u8868\u4e2d\u7684\u4e00\u884c\u8bb0\u5f55\uff0c\u901a\u5e38\u5305\u542b\u591a\u4e2a\u5b57\u6bb5\u6570\u636e\u3002<\/li>\n\n\n\n<li>\u7d22\u5f15\u5165\u53e3\uff08<code>Entry<\/code>\uff09\u7b49\u662f\u6307\u5b8c\u6574\u7684\u201c\u952e\u503c\u5bf9\u201d\uff0c\u5728\u53f6\u5b50\u8282\u70b9\u4e2d\uff0c\u901a\u5e38\u5305\u62ec\\( (k_i, a_i) \\)\uff1b\u5728\u975e\u53f6\u5b50\u8282\u70b9\u4e2d\u53ef\u80fd\u7684\u5f62\u5f0f\u662f\uff1a\\( (k_i,p_i, a_i) \\) \u6216 \\( (k_i, p_i) \\)<\/li>\n\n\n\n<li><code>TAOCP<\/code> \u662f \u201cThe Art of Computer Programming\u201d\u7684\u7f29\u5199<\/li>\n<\/ul>\n\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u53c2\u8003<\/h3>\n\n\n\n<p>\u672c\u6587\u4e3b\u8981\u53c2\u8003\u5185\u5bb9\u4e3a\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list is-style-no-disc\">\n<li>[1] G. Graefe 2010 <a href=\"https:\/\/citeseerx.ist.psu.edu\/document?repid=rep1&amp;type=pdf&amp;doi=0b19f413ffb5bc68b43f3bd05a97c282a7c6d6ab\">Modern B-Tree Techniques<\/a>  in Foundations and Trends\u0001R in Databases Vol. 3, No. 4 (2010) 203-402\u0001c 2011  DOI: 10.1561\/1900000028<\/li>\n\n\n\n<li>[2] Goetz Graefe. 2006. <a href=\"https:\/\/www.cs.cmu.edu\/~damon2006\/pdf\/graefe06btreeindexes.pdf\">B-tree indexes, interpolation search, and skew.<\/a> In Proceedings of the 2nd international workshop on Data management on new hardware (DaMoN &#8217;06). <\/li>\n\n\n\n<li>[3] 2004 Innobase Oy InnoDB Source Code \/ MySQL 4.1.7 (Created 2\/2\/1994 Heikki Tuuri)<\/li>\n\n\n\n<li>[4] Jeremy Cole 2013 <a href=\"https:\/\/blog.jcole.us\/2013\/01\/14\/efficiently-traversing-innodb-btrees-with-the-page-directory\/\">Efficiently traversing InnoDB B+Trees with the page directory<\/a> Blog Posts<\/li>\n\n\n\n<li>[5] Calvin Sun(Senior Manager, Twitter) 2013 <a href=\"https:\/\/topic.it168.com\/factory\/DTCC2013\/doc\/a30.pdf\">InnoDB Internals<\/a> DTCC topic in China<\/li>\n\n\n\n<li>[6] SmartKeyerror 2021 <a href=\"https:\/\/github.com\/SmartKeyerror\/Psyduck\/blob\/master\/database\/MySQL\/InnoDB-Page.pdf\">InnoDB-Page.pdf<\/a> Draw at GitHub<\/li>\n<\/ul>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5728\u524d\u9762\u4e24\u7bc7\u6587\u7ae0\uff0c\u8f83\u4e3a\u7cfb\u7edf\u4ecb\u7ecd\u4e86B-Tree\u548cB+-Tree\u7684\u57fa\u7840\u3002\u672c\u6587\u5219\u4ee5InnoDB\u4e3a\u4f8b\uff0c\u6765\u770b\u770bB+-Tree\u5185\u90e8\u6392\u5e8f\u7684\u5b9e\u73b0\u3002 \u7b80\u5355\u56de\u987eB-Tree\u5b58\u50a8 \u5728\u524d\u9762B-Tree\u57fa\u7840\u6587\u7ae0\u4e2d\uff0c\u6211\u4eec\u4e86\u89e3\u5230\u5728\u4e00\u4e2aB-Tree\u6216B+-Tree\u7684\u201c\u8282\u70b9\u201d\u901a\u5e38\u53ef\u4ee5\u5b58\u653e\u5f88\u591a\u7684\u201c\u7d22\u5f15\u5165\u53e3\u201d\u3002\u5728\u6570\u636e\u5e93\u5b9e\u8df5\u4e2d\uff0c\u901a\u5e38\u4e00\u4e2a\u201c\u8282\u70b9\u201d\u5927\u5c0f\u4e3a16KB\u62168KB\u3002\u4e00\u4e2a\u7d22\u5f15\u5165\u53e3\u7684\u7ed3\u6784\u4e00\u822c\u662f\uff1a\\( (k_i,p_i,\\alpha_i) \\) \u3001 \\( (k_i,p_i) \\)\u3001\\( (k_i,\\alpha_i) \\)\uff0c\u5177\u4f53\u7684\uff0c\u5728\u53f6\u5b50\u8282\u70b9\u4e0a\u901a\u5e38\u4e3a\\( (k_i,\\alpha_i) \\)\uff0c\u800c\u975e\u53f6\u5b50\u8282\u70b9\u5219\u4e3a\uff1a \\( (k_i,p_i) \\)\u3002 \u90a3\u4e48\uff0c\u5728\u5b9e\u9645\u7684\u8bbe\u8ba1\u4e2d\uff0c\u4e00\u4e2a\u201c\u8282\u70b9\u201d\u53ef\u4ee5\u5b58\u50a8\u591a\u4e2a\u201c\u7d22\u5f15\u5165\u53e3\u201d\uff0c\u5728\u975e\u53f6\u5b50\u8282\u70b9\uff0c\u4e3b\u8981\u5b58\u50a8\u952e\u503c\u548c\u5230\u5b50\u8282\u70b9\u7684\u6307\u9488\uff0c\u5373 \\( (k_i,p_i) \\)\uff1b\u53f6\u5b50\u8282\u70b9\u4e2d\uff0c\u5219\u5b58\u50a8\u952e\u503c\u548c\u76f8\u5173\u6570\u636e\uff0c\u5373\\( (k_i,\\alpha_i) \\)\u3002 \u95ee\u9898\u63cf\u8ff0 \u5728\u5f88\u591a\u7684B+-Tree\u5b9e\u73b0\u4e2d\uff0c\u4e00\u4e2a\u8282\u70b9\u53ef\u4ee5\u5b58\u50a8\u51e0\u5341\u3001\u751a\u81f3\u6570\u767e\u4e2a\u7684\u201c\u7d22\u5f15\u5165\u53e3\u201d\u3002\u800c\u6211\u4eec\u5728\u524d\u9762\u770b\u5230\u7684\u793a\u610f\u56fe\u4e2d\uff0c\u770b\u8d77\u6765\u8282\u70b9\u5185\u90e8\u7684\u6570\u636e\u4f3c\u4e4e\u662f\u6309\u7167\u952e\u503c\u6392\u597d\u5e8f\u7684\uff0c\u4f46\u5728\u5b9e\u9645\u5b9e\u73b0\u4e2d\uff0c\u8fd9\u91cc\u4ee5InnoDB\u7684B+-Tree\u5b9e\u73b0\u4e3a\u4f8b\uff0c\u95ee\u9898\u8981\u66f4\u590d\u6742\u4e00\u4e9b\uff0c\u4e3b\u8981\u8003\u8651\u5982\u4e0b\uff1a \u4ee5\u201c\u5806\u201d\u7684\u5f62\u5f0f\u5b58\u50a8 \u4e3a\u4e86\u6ee1\u8db3\u53d8\u957f\u3001\u5feb\u901f\u5b58\u50a8\u7684\u8981\u6c42\uff0cInnoDB\u9875\u9762\u5185\u90e8\u4f7f\u7528\u4e86\u5178\u578b\u7684\u201c\u5806\u201d\u7684\u5f62\u5f0f\u7ec4\u7ec7\u6570\u636e\uff0c\u8fd9\u4e5f\u662f\u6570\u636e\u5e93\u6570\u636e\u5b58\u50a8\u5b9e\u73b0\u7684\u4e00\u822c\u6a21\u5f0f\u3002\u5373\uff0c\u6bcf\u6b21\u6570\u636e\u5199\u5165\u65f6\uff0c\u5c06\u6570\u636e\u5b58\u50a8\u5728\u5806\u7684\u201c\u9876\u7aef\u201d\uff08\u6216\u8005\u4e2d\u95f4\u7684\u7a7a\u6d1e\uff09\uff0c\u5982\u53f3\u56fe\uff1a \u4f46\u5728B+-Tree\u4e2d\u904d\u5386\u65f6\uff0c\u66f4\u591a\u7684\u662f\u9700\u8981\u987a\u5e8f\u904d\u5386\uff0c\u4f8b\u5982\u952e\u503c\u641c\u7d22\u3001\u8303\u56f4\u67e5\u627e\u7b49\u573a\u666f\u3002\u90a3\u4e48\uff0c\u6309\u201c\u5806\u201d\u5b58\u50a8\u7684\u8bb0\u5f55\uff0c\u5c31\u9700\u8981\u4e00\u79cd\u987a\u5e8f\u904d\u5386\u7684\u65b9\u5f0f\u3002 B+-Tree\u9875\u5185\u641c\u7d22\u5b9e\u73b0\u6982\u8ff0 \u903b\u8f91\u5b9e\u73b0\u8bf4\u660e \u4e00\u79cd\u76f4\u89c2\u7684\u601d\u7ef4\u662f\u8fd9\u6837\uff0c\u5728\u9875\u9762\u7684\u67d0\u4e2a\u7279\u6b8a\u533a\u57df\uff0c\u65b0\u5efa\u4e00\u4e2a\u201c\u6570\u7ec4\u201d\uff08\u8bb0\u5f55\u6307\u9488\u6216\u504f\u79fb\uff09\uff0c\u987a\u5e8f\u6392\u5217\u6240\u6709\u7684\u8bb0\u5f55\u3002\u6bcf\u6b21\u9700\u8981\u641c\u7d22\u65f6\uff0c\u5219\u5728\u8be5\u6570\u636e\u4e2d\u8fdb\u884c\u4e8c\u5206\u6216\u63d2\u503c\u641c\u7d22\u3002\u8fd9\u79cd\u5b58\u50a8\u6a21\u5f0f\u7684\u4f18\u52bf\u662f\uff0c\u7b80\u5355\u800c\u76f4\u63a5\uff0c\u4e14\u6613\u4e8e\u7ef4\u62a4\u3002\u4f46\u5bf9\u4e8e\u5173\u7cfb\u578b\u6570\u636e\u5e93\u6765\u8bf4\uff0c\u5982\u679c\u6570\u636e\u5199\u5165\u6216\u66f4\u65b0\u9891\u7e41\uff0c\u90a3\u4e48\u8fd9\u4e2a\u6570\u7ec4\u7684\u7ef4\u62a4\u4f1a\u6709\u975e\u5e38\u9891\u7e41\u7684\u6570\u636e\u62f7\u8d1d\u3002 InnoDB\u7684\u5b9e\u73b0\uff08\u6211\u540e\u9762\u8981\u53bb\u770b\u770bJim Gray\u7684\u90a3\u672c\u4e66\uff0c\u770b\u770b\u662f\u5426\u6709\u63cf\u8ff0\u8fd9\u4e9b\u7ec6\u8282\uff09\u5e76\u6ca1\u6709\u4f7f\u7528\u8fd9\u79cd\u76f4\u63a5\u7684\u5b9e\u73b0\uff0c\u800c\u662f\u505a\u4e86\u4e00\u4e9b\u53d8\u5316\uff1a \u4e0a\u53f3\u56fe\u662f\u5728GitHub\u4e0a\u641c\u7d22\u5230\u7684\u7531SmartKeyerror\u7ed8\u5236\u7684\u5173\u4e8ePage Directory\u7684\u793a\u610f\u56fe[6]\uff0c\u662f\u6bd4\u8f83\u51c6\u786e\u4e14\u76f4\u89c2\u7684\u3002 \u6240\u4ee5\uff0c\u5728\u8fdb\u884c\u641c\u7d22\u65f6\uff08InnoDB\u7684\u5b9e\u73b0\uff09\uff1a \u5728InnoDB\u4e2d\uff0c\u4e00\u4e2aSlot\u67094~8\u4e2a\u8bb0\u5f55\uff0c\u6240\u4ee5\uff0c\u53ef\u4ee5\u8ba4\u4e3a\u4e00\u4e2a500\u6761\u8bb0\u5f55\u7684\u9875\u9762\uff0c\u9700\u8981\u505a\u7684\u6bd4\u8f83\u6b21\u6570\u7ea6\u4e3a\uff08\u8003\u8651\u5e73\u5747\u6bcf\u4e2aslot\u4e2d6\u6761\u8bb0\u5f55\uff09\uff1a \u5728\u5b9e\u9645\u4e2d\uff0c\u53ef\u80fd\u4f1a\u6709\u591a\u6b21CPU\u7684Cache Miss\u53d1\u751f\uff0c\u6240\u4ee5\u5b9e\u9645\u7684\u6210\u672c\u6bd4\u770b\u8d77\u6765\u76849.38\u6b21\u8981\u7565\u5fae\u9ad8\u4e00\u4e9b\uff0c\u4f46\u4f5c\u4e3a\u7c97\u7565\u9884\u4f30\uff0c\u8fd9\u4e2a\u8ba1\u7b97\u4e5f\u662f\u5408\u7406\u7684\u3002 InnoDB \u7269\u7406\u5b58\u50a8\u5b9e\u73b0\u8bf4\u660e \u5398\u6e05\u7269\u7406\u5c42\u7684\u5b9e\u73b0\uff0c\u8fd8\u662f\u7a0d\u5fae\u82b1\u4e86\u4e00\u4e9b\u65f6\u95f4\u7684\u3002\u5728Jeremy Cole 2013 Efficiently traversing InnoDB B+Trees with the page directory \u4e2d\u5bf9\u4e8ePage Directory\u5b9e\u73b0\u9875\u5185\u641c\u7d22\u505a\u4e86\u6bd4\u8f83\u8be6\u7ec6\u7684\u8bf4\u660e\uff0c\u5e76\u4e14\u5728\u8ba8\u8bba\u4e2d\u4e5f\u4e00\u4e9b\u6709\u610f\u601d\u7684\u8ba8\u8bba\u3002\u4f46\uff0c\u5bf9\u4e8e\u5176\u4e2d\u7684\u51e0\u4e2a\u95ee\u9898\u505a\u4e86\u4e00\u4e9b\u9a8c\u8bc1\uff0c\u8fd8\u662f\u6709\u4e00\u4e9b\u66f4\u7ec6\u81f4\u7684\u8865\u5145\u8bf4\u660e\u3002 \u4e0a\u9762\uff0cSmartKeyerror\u7ed8\u5236\u7684\u5173\u4e8ePage Directory\u56fe\u5728\u903b\u8f91\u4e0a\u662f\u6ca1\u6709\u592a\u5927\u95ee\u9898\u7684\uff0c\u4f46\u5c31\u7269\u7406\u5b9e\u73b0\uff0c\u5219\u5bb9\u6613\u5f15\u8d77\u4e00\u4e9b\u8bef\u89e3\uff0c\u6545\u7ed8\u5236\u4e86\u65b0\u7684\u793a\u610f\u56fe\u5982\u53f3\u4e0b\uff0c\u4ee5\u66f4\u51c6\u786e\u7684\u53cd\u6620InnoDB\u7269\u7406\u5b58\u50a8\u7684\u7ed3\u6784\uff1a [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":24394,"comment_status":"open","ping_status":"closed","sticky":false,"template":"wp-custom-template-a-1440-px-width-template","format":"standard","meta":{"_eb_attr":"","inline_featured_image":false,"_tocer_settings":[],"footnotes":""},"categories":[126,137],"tags":[],"class_list":["post-18449","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-database","category-learning-more"],"_links":{"self":[{"href":"https:\/\/www.orczhou.com\/index.php\/wp-json\/wp\/v2\/posts\/18449","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.orczhou.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.orczhou.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.orczhou.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.orczhou.com\/index.php\/wp-json\/wp\/v2\/comments?post=18449"}],"version-history":[{"count":94,"href":"https:\/\/www.orczhou.com\/index.php\/wp-json\/wp\/v2\/posts\/18449\/revisions"}],"predecessor-version":[{"id":24399,"href":"https:\/\/www.orczhou.com\/index.php\/wp-json\/wp\/v2\/posts\/18449\/revisions\/24399"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.orczhou.com\/index.php\/wp-json\/wp\/v2\/media\/24394"}],"wp:attachment":[{"href":"https:\/\/www.orczhou.com\/index.php\/wp-json\/wp\/v2\/media?parent=18449"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.orczhou.com\/index.php\/wp-json\/wp\/v2\/categories?post=18449"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.orczhou.com\/index.php\/wp-json\/wp\/v2\/tags?post=18449"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}