{"id":4210,"date":"2014-07-05T11:00:36","date_gmt":"2014-07-05T03:00:36","guid":{"rendered":"https:\/\/www.icocean.com\/blog\/?p=4210"},"modified":"2014-07-05T11:22:17","modified_gmt":"2014-07-05T03:22:17","slug":"%e6%95%b0%e6%8d%ae%e5%ba%93%e7%9a%84%e6%9c%80%e7%ae%80%e5%8d%95%e5%ae%9e%e7%8e%b0","status":"publish","type":"post","link":"https:\/\/www.icocean.com\/blog\/?p=4210","title":{"rendered":"\u6570\u636e\u5e93\u7684\u6700\u7b80\u5355\u5b9e\u73b0"},"content":{"rendered":"<p style=\"color: #111111;\">\u6240\u6709\u5e94\u7528\u8f6f\u4ef6\u4e4b\u4e2d\uff0c\u6570\u636e\u5e93\u53ef\u80fd\u662f\u6700\u590d\u6742\u7684\u3002<\/p>\n<p style=\"color: #111111;\">MySQL\u7684\u624b\u518c\u67093000\u591a\u9875\uff0cPostgreSQL\u7684\u624b\u518c\u67092000\u591a\u9875\uff0cOracle\u7684\u624b\u518c\u66f4\u662f\u6bd4\u5b83\u4eec\u76f8\u52a0\u8fd8\u8981\u539a\u3002<\/p>\n<p style=\"color: #111111;\">\u4f46\u662f\uff0c\u81ea\u5df1\u5199\u4e00\u4e2a\u6700\u7b80\u5355\u7684\u6570\u636e\u5e93\uff0c\u505a\u8d77\u6765\u5e76\u4e0d\u96be\u3002Reddit\u4e0a\u9762\u6709\u4e00\u4e2a<a style=\"color: #112233;\" href=\"http:\/\/www.reddit.com\/r\/Database\/comments\/27u6dy\/how_do_you_build_a_database\/ciggal8\" target=\"_blank\">\u5e16\u5b50<\/a>\uff0c\u53ea\u7528\u4e86\u51e0\u767e\u4e2a\u5b57\uff0c\u5c31\u628a\u539f\u7406\u8bb2\u6e05\u695a\u4e86\u3002\u4e0b\u9762\u662f\u6211\u6839\u636e\u8fd9\u4e2a\u5e16\u5b50\u6574\u7406\u7684\u5185\u5bb9\u3002<\/p>\n<h2 style=\"color: #000000;\">\u4e00\u3001\u6570\u636e\u4ee5\u6587\u672c\u5f62\u5f0f\u4fdd\u5b58<\/h2>\n<p style=\"color: #111111;\">\u7b2c\u4e00\u6b65\uff0c\u5c31\u662f\u5c06\u6240\u8981\u4fdd\u5b58\u7684\u6570\u636e\uff0c\u5199\u5165\u6587\u672c\u6587\u4ef6\u3002\u8fd9\u4e2a\u6587\u672c\u6587\u4ef6\u5c31\u662f\u4f60\u7684\u6570\u636e\u5e93\u3002<\/p>\n<p style=\"color: #111111;\">\u4e3a\u4e86\u65b9\u4fbf\u8bfb\u53d6\uff0c\u6570\u636e\u5fc5\u987b\u5206\u6210\u8bb0\u5f55\uff0c\u6bcf\u4e00\u6761\u8bb0\u5f55\u7684\u957f\u5ea6\u89c4\u5b9a\u4e3a\u7b49\u957f\u3002\u6bd4\u5982\uff0c\u5047\u5b9a\u6bcf\u6761\u8bb0\u5f55\u7684\u957f\u5ea6\u662f800\u5b57\u8282\uff0c\u90a3\u4e48\u7b2c5\u6761\u8bb0\u5f55\u7684\u5f00\u59cb\u4f4d\u7f6e\u5c31\u57283200\u5b57\u8282\u3002<\/p>\n<p style=\"color: #111111;\">\u5927\u591a\u6570\u65f6\u5019\uff0c\u6211\u4eec\u4e0d\u77e5\u9053\u67d0\u4e00\u6761\u8bb0\u5f55\u5728\u7b2c\u51e0\u4e2a\u4f4d\u7f6e\uff0c\u53ea\u77e5\u9053<a style=\"color: #112233;\" href=\"http:\/\/zh.wikipedia.org\/zh\/%E5%85%B3%E7%B3%BB%E9%94%AE\" target=\"_blank\">\u4e3b\u952e<\/a>\uff08primary key\uff09\u7684\u503c\u3002\u8fd9\u65f6\u4e3a\u4e86\u8bfb\u53d6\u6570\u636e\uff0c\u53ef\u4ee5\u4e00\u6761\u6761\u6bd4\u5bf9\u8bb0\u5f55\u3002\u4f46\u662f\u8fd9\u6837\u505a\u6548\u7387\u592a\u4f4e\uff0c\u5b9e\u9645\u5e94\u7528\u4e2d\uff0c\u6570\u636e\u5e93\u5f80\u5f80\u91c7\u7528<a style=\"color: #112233;\" href=\"http:\/\/en.wikipedia.org\/wiki\/B-tree\" target=\"_blank\">B\u6811<\/a>\uff08B-tree\uff09\u683c\u5f0f\u50a8\u5b58\u6570\u636e\u3002<\/p>\n<h2 style=\"color: #000000;\">\u4e8c\u3001\u4ec0\u4e48\u662fB\u6811\uff1f<\/h2>\n<p style=\"color: #111111;\">\u8981\u7406\u89e3B\u6811\uff0c\u5fc5\u987b\u4ece<a style=\"color: #112233;\" href=\"http:\/\/zh.wikipedia.org\/wiki\/%E4%BA%8C%E5%85%83%E6%90%9C%E5%B0%8B%E6%A8%B9\" target=\"_blank\">\u4e8c\u53c9\u67e5\u627e\u6811<\/a>\uff08Binary search tree\uff09\u8bb2\u8d77\u3002<\/p>\n<p style=\"color: #111111;\"><img decoding=\"async\" title=\"\" src=\"https:\/\/www.icocean.com\/blog\/wp-content\/uploads\/2014\/07\/\u4e8c\u53c9\u6811.png\" alt=\"\u4e8c\u53c9\u67e5\u627e\u6811\" \/><\/p>\n<p style=\"color: #111111;\">\u4e8c\u53c9\u67e5\u627e\u6811\u662f\u4e00\u79cd\u67e5\u627e\u6548\u7387\u975e\u5e38\u9ad8\u7684\u6570\u636e\u7ed3\u6784\uff0c\u5b83\u6709\u4e09\u4e2a\u7279\u70b9\u3002<\/p>\n<blockquote style=\"color: #111111;\"><p>\uff081\uff09\u6bcf\u4e2a\u8282\u70b9\u6700\u591a\u53ea\u6709\u4e24\u4e2a\u5b50\u6811\u3002<\/p>\n<p>\uff082\uff09\u5de6\u5b50\u6811\u90fd\u4e3a\u5c0f\u4e8e\u7236\u8282\u70b9\u7684\u503c\uff0c\u53f3\u5b50\u6811\u90fd\u4e3a\u5927\u4e8e\u7236\u8282\u70b9\u7684\u503c\u3002<\/p>\n<p>\uff083\uff09\u5728n\u4e2a\u8282\u70b9\u4e2d\u627e\u5230\u76ee\u6807\u503c\uff0c\u4e00\u822c\u53ea\u9700\u8981log(n)\u6b21\u6bd4\u8f83\u3002<\/p><\/blockquote>\n<p style=\"color: #111111;\">\u4e8c\u53c9\u67e5\u627e\u6811\u7684\u7ed3\u6784\u4e0d\u9002\u5408\u6570\u636e\u5e93\uff0c\u56e0\u4e3a\u5b83\u7684\u67e5\u627e\u6548\u7387\u4e0e\u5c42\u6570\u76f8\u5173\u3002\u8d8a\u5904\u5728\u4e0b\u5c42\u7684\u6570\u636e\uff0c\u5c31\u9700\u8981\u8d8a\u591a\u6b21\u6bd4\u8f83\u3002\u6781\u7aef\u60c5\u51b5\u4e0b\uff0cn\u4e2a\u6570\u636e\u9700\u8981n\u6b21\u6bd4\u8f83\u624d\u80fd\u627e\u5230\u76ee\u6807\u503c\u3002\u5bf9\u4e8e\u6570\u636e\u5e93\u6765\u8bf4\uff0c\u6bcf\u8fdb\u5165\u4e00\u5c42\uff0c\u5c31\u8981\u4ece\u786c\u76d8\u8bfb\u53d6\u4e00\u6b21\u6570\u636e\uff0c\u8fd9\u975e\u5e38\u81f4\u547d\uff0c\u56e0\u4e3a\u786c\u76d8\u7684\u8bfb\u53d6\u65f6\u95f4\u8fdc\u8fdc\u5927\u4e8e\u6570\u636e\u5904\u7406\u65f6\u95f4\uff0c\u6570\u636e\u5e93\u8bfb\u53d6\u786c\u76d8\u7684\u6b21\u6570\u8d8a\u5c11\u8d8a\u597d\u3002<\/p>\n<p><!--more--><\/p>\n<p style=\"color: #111111;\">B\u6811\u662f\u5bf9\u4e8c\u53c9\u67e5\u627e\u6811\u7684\u6539\u8fdb\u3002\u5b83\u7684\u8bbe\u8ba1\u601d\u60f3\u662f\uff0c\u5c06\u76f8\u5173\u6570\u636e\u5c3d\u91cf\u96c6\u4e2d\u5728\u4e00\u8d77\uff0c\u4ee5\u4fbf\u4e00\u6b21\u8bfb\u53d6\u591a\u4e2a\u6570\u636e\uff0c\u51cf\u5c11\u786c\u76d8\u64cd\u4f5c\u6b21\u6570\u3002<\/p>\n<p style=\"color: #111111;\"><img decoding=\"async\" title=\"\" src=\"https:\/\/www.icocean.com\/blog\/wp-content\/uploads\/2014\/07\/B\u6811.png\" alt=\"B-tree\" \/><\/p>\n<p style=\"color: #111111;\">B\u6811\u7684\u7279\u70b9\u4e5f\u6709\u4e09\u4e2a\u3002<\/p>\n<blockquote style=\"color: #111111;\"><p>\uff081\uff09\u4e00\u4e2a\u8282\u70b9\u53ef\u4ee5\u5bb9\u7eb3\u591a\u4e2a\u503c\u3002\u6bd4\u5982\u4e0a\u56fe\u4e2d\uff0c\u6700\u591a\u7684\u4e00\u4e2a\u8282\u70b9\u5bb9\u7eb3\u4e864\u4e2a\u503c\u3002<\/p>\n<p>\uff082\uff09\u9664\u975e\u6570\u636e\u5df2\u7ecf\u586b\u6ee1\uff0c\u5426\u5219\u4e0d\u4f1a\u589e\u52a0\u65b0\u7684\u5c42\u3002\u4e5f\u5c31\u662f\u8bf4\uff0cB\u6811\u8ffd\u6c42&#8221;\u5c42&#8221;\u8d8a\u5c11\u8d8a\u597d\u3002<\/p>\n<p>\uff083\uff09\u5b50\u8282\u70b9\u4e2d\u7684\u503c\uff0c\u4e0e\u7236\u8282\u70b9\u4e2d\u7684\u503c\uff0c\u6709\u4e25\u683c\u7684\u5927\u5c0f\u5bf9\u5e94\u5173\u7cfb\u3002\u4e00\u822c\u6765\u8bf4\uff0c\u5982\u679c\u7236\u8282\u70b9\u6709a\u4e2a\u503c\uff0c\u90a3\u4e48\u5c31\u6709a+1\u4e2a\u5b50\u8282\u70b9\u3002\u6bd4\u5982\u4e0a\u56fe\u4e2d\uff0c\u7236\u8282\u70b9\u6709\u4e24\u4e2a\u503c\uff087\u548c16\uff09\uff0c\u5c31\u5bf9\u5e94\u4e09\u4e2a\u5b50\u8282\u70b9\uff0c\u7b2c\u4e00\u4e2a\u5b50\u8282\u70b9\u90fd\u662f\u5c0f\u4e8e7\u7684\u503c\uff0c\u6700\u540e\u4e00\u4e2a\u5b50\u8282\u70b9\u90fd\u662f\u5927\u4e8e16\u7684\u503c\uff0c\u4e2d\u95f4\u7684\u5b50\u8282\u70b9\u5c31\u662f7\u548c16\u4e4b\u95f4\u7684\u503c\u3002<\/p><\/blockquote>\n<p style=\"color: #111111;\">\u8fd9\u79cd\u6570\u636e\u7ed3\u6784\uff0c\u975e\u5e38\u6709\u5229\u4e8e\u51cf\u5c11\u8bfb\u53d6\u786c\u76d8\u7684\u6b21\u6570\u3002\u5047\u5b9a\u4e00\u4e2a\u8282\u70b9\u53ef\u4ee5\u5bb9\u7eb3100\u4e2a\u503c\uff0c\u90a3\u4e483\u5c42\u7684B\u6811\u53ef\u4ee5\u5bb9\u7eb3100\u4e07\u4e2a\u6570\u636e\uff0c\u5982\u679c\u6362\u6210\u4e8c\u53c9\u67e5\u627e\u6811\uff0c\u5219\u9700\u898120\u5c42\uff01\u5047\u5b9a\u64cd\u4f5c\u7cfb\u7edf\u4e00\u6b21\u8bfb\u53d6\u4e00\u4e2a\u8282\u70b9\uff0c\u5e76\u4e14\u6839\u8282\u70b9\u4fdd\u7559\u5728\u5185\u5b58\u4e2d\uff0c\u90a3\u4e48B\u6811\u5728100\u4e07\u4e2a\u6570\u636e\u4e2d\u67e5\u627e\u76ee\u6807\u503c\uff0c\u53ea\u9700\u8981\u8bfb\u53d6\u4e24\u6b21\u786c\u76d8\u3002<\/p>\n<h2 style=\"color: #000000;\">\u4e09\u3001\u7d22\u5f15<\/h2>\n<p style=\"color: #111111;\">\u6570\u636e\u5e93\u4ee5B\u6811\u683c\u5f0f\u50a8\u5b58\uff0c\u53ea\u89e3\u51b3\u4e86\u6309\u7167&#8221;\u4e3b\u952e&#8221;\u67e5\u627e\u6570\u636e\u7684\u95ee\u9898\u3002\u5982\u679c\u60f3\u67e5\u627e\u5176\u4ed6\u5b57\u6bb5\uff0c\u5c31\u9700\u8981\u5efa\u7acb\u7d22\u5f15\uff08index\uff09\u3002<\/p>\n<p style=\"color: #111111;\">\u6240\u8c13\u7d22\u5f15\uff0c\u5c31\u662f\u4ee5\u67d0\u4e2a\u5b57\u6bb5\u4e3a\u5173\u952e\u5b57\u7684B\u6811\u6587\u4ef6\u3002\u5047\u5b9a\u6709\u4e00\u5f20&#8221;\u96c7\u5458\u8868&#8221;\uff0c\u5305\u542b\u4e86\u5458\u5de5\u53f7\uff08\u4e3b\u952e\uff09\u548c\u59d3\u540d\u4e24\u4e2a\u5b57\u6bb5\u3002\u53ef\u4ee5\u5bf9\u59d3\u540d\u5efa\u7acb\u7d22\u5f15\u6587\u4ef6\uff0c\u8be5\u6587\u4ef6\u4ee5B\u6811\u683c\u5f0f\u5bf9\u59d3\u540d\u8fdb\u884c\u50a8\u5b58\uff0c\u6bcf\u4e2a\u59d3\u540d\u540e\u9762\u662f\u5176\u5728\u6570\u636e\u5e93\u4e2d\u7684\u4f4d\u7f6e\uff08\u5373\u7b2c\u51e0\u6761\u8bb0\u5f55\uff09\u3002\u67e5\u627e\u59d3\u540d\u7684\u65f6\u5019\uff0c\u5148\u4ece\u7d22\u5f15\u4e2d\u627e\u5230\u5bf9\u5e94\u7b2c\u51e0\u6761\u8bb0\u5f55\uff0c\u7136\u540e\u518d\u4ece\u8868\u683c\u4e2d\u8bfb\u53d6\u3002<\/p>\n<p style=\"color: #111111;\">\u8fd9\u79cd\u7d22\u5f15\u67e5\u627e\u65b9\u6cd5\uff0c\u53eb\u505a<a style=\"color: #112233;\" href=\"http:\/\/en.wikipedia.org\/wiki\/ISAM\" target=\"_blank\">&#8220;\u7d22\u5f15\u987a\u5e8f\u5b58\u53d6\u65b9\u6cd5&#8221;<\/a>\uff08Indexed Sequential Access Method\uff09\uff0c\u7f29\u5199\u4e3aISAM\u3002\u5b83\u5df2\u7ecf\u6709\u591a\u79cd\u5b9e\u73b0\uff08\u6bd4\u5982C-ISAM\u5e93\u548cD-ISAM\u5e93\uff09\uff0c\u53ea\u8981\u4f7f\u7528\u8fd9\u4e9b\u4ee3\u7801\u5e93\uff0c\u5c31\u80fd\u81ea\u5df1\u5199\u4e00\u4e2a\u6700\u7b80\u5355\u7684\u6570\u636e\u5e93\u3002<\/p>\n<h2 style=\"color: #000000;\">\u56db\u3001\u9ad8\u7ea7\u529f\u80fd<\/h2>\n<p style=\"color: #111111;\">\u90e8\u7f72\u4e86\u6700\u57fa\u672c\u7684\u6570\u636e\u5b58\u53d6\uff08\u5305\u62ec\u7d22\u5f15\uff09\u4ee5\u540e\uff0c\u8fd8\u53ef\u4ee5\u5b9e\u73b0\u4e00\u4e9b\u9ad8\u7ea7\u529f\u80fd\u3002<\/p>\n<p style=\"color: #111111;\"><span style=\"font-weight: 800;\">\uff081\uff09SQL\u8bed\u8a00<\/span>\u662f\u6570\u636e\u5e93\u901a\u7528\u64cd\u4f5c\u8bed\u8a00\uff0c\u6240\u4ee5\u9700\u8981\u4e00\u4e2aSQL\u89e3\u6790\u5668\uff0c\u5c06SQL\u547d\u4ee4\u89e3\u6790\u4e3a\u5bf9\u5e94\u7684ISAM\u64cd\u4f5c\u3002<\/p>\n<p style=\"color: #111111;\"><span style=\"font-weight: 800;\">\uff082\uff09\u6570\u636e\u5e93\u8fde\u63a5\uff08join\uff09<\/span>\u662f\u6307\u6570\u636e\u5e93\u7684\u4e24\u5f20\u8868\u901a\u8fc7&#8221;\u5916\u952e&#8221;\uff0c\u5efa\u7acb\u8fde\u63a5\u5173\u7cfb\u3002\u4f60\u9700\u8981\u5bf9\u8fd9\u79cd\u64cd\u4f5c\u8fdb\u884c\u4f18\u5316\u3002<\/p>\n<p style=\"color: #111111;\"><span style=\"font-weight: 800;\">\uff083\uff09\u6570\u636e\u5e93\u4e8b\u52a1\uff08transaction\uff09<\/span>\u662f\u6307\u6279\u91cf\u8fdb\u884c\u4e00\u7cfb\u5217\u6570\u636e\u5e93\u64cd\u4f5c\uff0c\u53ea\u8981\u6709\u4e00\u6b65\u4e0d\u6210\u529f\uff0c\u6574\u4e2a\u64cd\u4f5c\u90fd\u4e0d\u6210\u529f\u3002\u6240\u4ee5\u9700\u8981\u6709\u4e00\u4e2a&#8221;\u64cd\u4f5c\u65e5\u5fd7&#8221;\uff0c\u4ee5\u4fbf\u5931\u8d25\u65f6\u5bf9\u64cd\u4f5c\u8fdb\u884c\u56de\u6eda\u3002<\/p>\n<p style=\"color: #111111;\"><span style=\"font-weight: 800;\">\uff084\uff09\u5907\u4efd\u673a\u5236<\/span>\uff1a\u4fdd\u5b58\u6570\u636e\u5e93\u7684\u526f\u672c\u3002<\/p>\n<p style=\"color: #111111;\"><span style=\"font-weight: 800;\">\uff085\uff09\u8fdc\u7a0b\u64cd\u4f5c<\/span>\uff1a\u4f7f\u5f97\u7528\u6237\u53ef\u4ee5\u5728\u4e0d\u540c\u7684\u673a\u5668\u4e0a\uff0c\u901a\u8fc7TCP\/IP\u534f\u8bae\u64cd\u4f5c\u6570\u636e\u5e93\u3002<\/p>\n<p style=\"color: #111111;\">\uff08\u5b8c\uff09<\/p>\n<p style=\"color: #111111;\">\u4f5c\u8005\uff1a\u962e\u4e00\u5cf0\u00a0http:\/\/www.ruanyifeng.com\/blog\/2014\/07\/database_implementation.html<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6240\u6709\u5e94\u7528\u8f6f\u4ef6\u4e4b\u4e2d\uff0c\u6570\u636e\u5e93\u53ef\u80fd\u662f\u6700\u590d\u6742\u7684\u3002 MySQL\u7684\u624b\u518c\u67093000\u591a\u9875\uff0cPostgreSQL\u7684\u624b\u518c\u67092000 <a href='https:\/\/www.icocean.com\/blog\/?p=4210' class='excerpt-more'>[&#8230;]<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[28],"tags":[3989,3988,370,3990],"class_list":["post-4210","post","type-post","status-publish","format-standard","hentry","category-28","tag-b","tag-3988","tag-370","tag-3990","category-28-id","post-seq-1","post-parity-odd","meta-position-corners","fix"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.icocean.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/4210","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.icocean.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.icocean.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.icocean.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.icocean.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4210"}],"version-history":[{"count":4,"href":"https:\/\/www.icocean.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/4210\/revisions"}],"predecessor-version":[{"id":4223,"href":"https:\/\/www.icocean.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/4210\/revisions\/4223"}],"wp:attachment":[{"href":"https:\/\/www.icocean.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4210"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.icocean.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4210"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.icocean.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4210"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}