{"id":4837,"date":"2024-08-01T22:47:58","date_gmt":"2024-08-01T14:47:58","guid":{"rendered":"https:\/\/xinchewhd.com.cn\/?p=4837"},"modified":"2024-08-02T15:55:34","modified_gmt":"2024-08-02T07:55:34","slug":"mysql%e5%88%86%e5%8c%ba%e6%8a%80%e6%9c%af%e6%b7%b1%e5%85%a5%e8%a7%a3%e6%9e%90%e4%b8%87%e5%ad%97%e9%95%bf%e6%96%87","status":"publish","type":"post","link":"https:\/\/xinchewhd.com.cn\/index.php\/spring-boot\/mysql%e5%88%86%e5%8c%ba%e6%8a%80%e6%9c%af%e6%b7%b1%e5%85%a5%e8%a7%a3%e6%9e%90%e4%b8%87%e5%ad%97%e9%95%bf%e6%96%87\/","title":{"rendered":"MySQL\u5206\u533a\u6280\u672f\u6df1\u5165\u89e3\u6790(\u4e07\u5b57\u957f\u6587)"},"content":{"rendered":"<div class=\"wxsyncmain\">\n<section style=\"font-size: 16px; color: black; padding: 25px 30px; line-height: 1.6; letter-spacing: 0px; word-break: break-word; font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, 'PingFang SC', Cambria, Cochin, Georgia, Times, 'Times New Roman', serif; margin-top: -10px;\" data-tool=\"markdown\u7f16\u8f91\u5668\" data-website=\"https:\/\/markdown.com.cn\/editor\">\n<blockquote style=\"font-size: 0.9em; overflow: auto; color: #6a737d; padding: 10px 10px 10px 20px; margin-bottom: 20px; margin-top: 20px; border-left-color: #ef7060; background: #fff9f9;\" data-tool=\"markdown.com.cn\u7f16\u8f91\u5668\">\n<p style=\"font-size: 16px; padding-top: 8px; padding-bottom: 8px; color: black; line-height: 26px;\">MySQL\u5206\u533a\u662f\u4e00\u79cd\u6570\u636e\u5e93\u4f18\u5316\u7684\u6280\u672f\uff0c\u5b83\u5141\u8bb8\u5c06\u4e00\u4e2a\u5927\u7684\u8868\u6216\u4e00\u4e2a\u7d22\u5f15\u5206\u5272\u6210\u591a\u4e2a\u8f83\u5c0f\u7684\u3001\u66f4\u6613\u4e8e\u7ba1\u7406\u7684\u7247\u6bb5\uff0c\u79f0\u4e3a\u5206\u533a\u3002\u8fd9\u79cd\u6280\u672f\u53ef\u4ee5\u663e\u8457\u63d0\u9ad8\u67e5\u8be2\u6027\u80fd\u3001\u7ef4\u62a4\u7684\u65b9\u4fbf\u6027\u4ee5\u53ca\u6570\u636e\u7ba1\u7406\u6548\u7387\u3002\u672c\u6587\u5c06\u8be6\u7ec6\u4ecb\u7ecdMySQL\u5206\u533a\u7684\u57fa\u672c\u6982\u5ff5\u3001\u5de5\u4f5c\u539f\u7406\u3001\u4f7f\u7528\u573a\u666f\u4ee5\u53ca\u64cd\u4f5c\u3002<\/p>\n<\/blockquote>\n<h2 style=\"margin-top: 30px; margin-bottom: 15px; font-weight: bold; border-bottom: 2px solid #ef7060; font-size: 1.3em;\" data-tool=\"markdown.com.cn\u7f16\u8f91\u5668\"><span style=\"display: inline-block; background: #ef7060; color: #ffffff; padding: 3px 10px 1px; border-top-right-radius: 3px; border-top-left-radius: 3px; margin-right: 3px;\">\u4e00\u3001\u5206\u533a\u7684\u57fa\u672c\u6982\u5ff5<\/span><\/h2>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\" data-tool=\"markdown.com.cn\u7f16\u8f91\u5668\">MySQL\u5206\u533a \u662f\u4e00\u79cd\u6570\u636e\u5e93\u4f18\u5316\u7684\u6280\u672f\uff0c\u5b83\u5141\u8bb8\u5c06\u4e00\u4e2a\u5927\u7684\u8868\u3001\u7d22\u5f15\u6216\u5176\u5b50\u96c6\u5206\u5272\u6210\u591a\u4e2a\u8f83\u5c0f\u7684\u3001\u66f4\u6613\u4e8e\u7ba1\u7406\u7684\u7247\u6bb5\uff0c\u8fd9\u4e9b\u7247\u6bb5\u79f0\u4e3a\u201c\u5206\u533a\u201d\u3002\u6bcf\u4e2a\u5206\u533a\u90fd\u53ef\u4ee5\u72ec\u7acb\u4e8e\u5176\u4ed6\u5206\u533a\u8fdb\u884c\u5b58\u50a8\u3001\u5907\u4efd\u3001\u7d22\u5f15\u548c\u5176\u4ed6\u64cd\u4f5c\u3002\u8fd9\u79cd\u6280\u672f\u4e3b\u8981\u662f\u4e3a\u4e86\u6539\u5584\u5927\u578b\u6570\u636e\u5e93\u8868\u7684\u67e5\u8be2\u6027\u80fd\u3001\u7ef4\u62a4\u7684\u65b9\u4fbf\u6027\u4ee5\u53ca\u6570\u636e\u7ba1\u7406\u6548\u7387\u3002<\/p>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\" data-tool=\"markdown.com.cn\u7f16\u8f91\u5668\"><strong>\u7269\u7406\u5b58\u50a8\u4e0e\u903b\u8f91\u5206\u5272<\/strong><\/p>\n<ul class=\"list-paddingleft-1\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px;\" data-tool=\"markdown.com.cn\u7f16\u8f91\u5668\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; text-align: left; color: #010101;\">\u7269\u7406\u4e0a\uff0c\u6bcf\u4e2a\u5206\u533a\u53ef\u4ee5\u5b58\u50a8\u5728\u4e0d\u540c\u7684\u6587\u4ef6\u6216\u76ee\u5f55\u4e2d\uff0c\u8fd9\u53d6\u51b3\u4e8e\u5206\u533a\u7c7b\u578b\u548c\u914d\u7f6e\u3002<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; text-align: left; color: #010101;\">\u903b\u8f91\u4e0a\uff0c\u8868\u6570\u636e\u6839\u636e\u5206\u533a\u952e\u7684\u503c\u88ab\u5206\u5272\u5230\u4e0d\u540c\u7684\u5206\u533a\u91cc\u3002<\/section>\n<\/li>\n<\/ul>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\" data-tool=\"markdown.com.cn\u7f16\u8f91\u5668\"><strong>\u67e5\u8be2\u6027\u80fd\u63d0\u5347<\/strong><\/p>\n<ul class=\"list-paddingleft-1\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px;\" data-tool=\"markdown.com.cn\u7f16\u8f91\u5668\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; text-align: left; color: #010101;\">\u5f53\u6267\u884c\u67e5\u8be2\u65f6\uff0cMySQL\u80fd\u591f\u786e\u5b9a\u54ea\u4e9b\u5206\u533a\u5305\u542b\u76f8\u5173\u6570\u636e\uff0c\u5e76\u53ea\u5728\u8fd9\u4e9b\u5206\u533a\u4e0a\u8fdb\u884c\u641c\u7d22\u3002\u8fd9\u51cf\u5c11\u4e86\u9700\u8981\u641c\u7d22\u7684\u6570\u636e\u91cf\uff0c\u4ece\u800c\u63d0\u9ad8\u4e86\u67e5\u8be2\u6027\u80fd\u3002<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; text-align: left; color: #010101;\">\u5bf9\u4e8e\u8303\u56f4\u67e5\u8be2\u6216\u7279\u5b9a\u503c\u7684\u67e5\u8be2\uff0c\u5206\u533a\u53ef\u4ee5\u663e\u8457\u51cf\u5c11\u626b\u63cf\u7684\u6570\u636e\u91cf\u3002<\/section>\n<\/li>\n<\/ul>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\" data-tool=\"markdown.com.cn\u7f16\u8f91\u5668\"><strong>\u6570\u636e\u7ba1\u7406\u4e0e\u7ef4\u62a4<\/strong><\/p>\n<ul class=\"list-paddingleft-1\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px;\" data-tool=\"markdown.com.cn\u7f16\u8f91\u5668\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; text-align: left; color: #010101;\">\u5206\u533a\u53ef\u4ee5\u4f7f\u5f97\u6570\u636e\u7ba1\u7406\u66f4\u52a0\u7075\u6d3b\u3002\u4f8b\u5982\uff0c\u53ef\u4ee5\u72ec\u7acb\u5730\u5907\u4efd\u3001\u6062\u590d\u6216\u4f18\u5316\u67d0\u4e2a\u5206\u533a\uff0c\u800c\u65e0\u9700\u5bf9\u6574\u4e2a\u8868\u8fdb\u884c\u64cd\u4f5c\u3002<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; text-align: left; color: #010101;\">\u5bf9\u4e8e\u5177\u6709\u65f6\u6548\u6027\u7684\u6570\u636e\uff0c\u53ef\u4ee5\u901a\u8fc7\u5220\u9664\u6216\u5f52\u6863\u67d0\u4e2a\u5206\u533a\u6765\u5feb\u901f\u91ca\u653e\u5b58\u50a8\u7a7a\u95f4\u3002<\/section>\n<\/li>\n<\/ul>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\" data-tool=\"markdown.com.cn\u7f16\u8f91\u5668\"><strong>\u6269\u5c55\u6027\u4e0e\u5e76\u884c\u5904\u7406<\/strong><\/p>\n<ul class=\"list-paddingleft-1\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px;\" data-tool=\"markdown.com.cn\u7f16\u8f91\u5668\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; text-align: left; color: #010101;\">\u5206\u533a\u6280\u672f\u4f7f\u5f97\u6570\u636e\u5e93\u8868\u66f4\u5bb9\u6613\u6269\u5c55\u5230\u66f4\u5927\u7684\u6570\u636e\u96c6\u3002\u5f53\u8868\u7684\u5927\u5c0f\u8d85\u8fc7\u5355\u4e2a\u5b58\u50a8\u8bbe\u5907\u7684\u5bb9\u91cf\u65f6\uff0c\u53ef\u4ee5\u4f7f\u7528\u5206\u533a\u5c06\u6570\u636e\u5206\u5e03\u5230\u591a\u4e2a\u5b58\u50a8\u8bbe\u5907\u4e0a\u3002<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; text-align: left; color: #010101;\">\u7531\u4e8e\u6bcf\u4e2a\u5206\u533a\u53ef\u4ee5\u72ec\u7acb\u5904\u7406\uff0c\u56e0\u6b64\u53ef\u4ee5\u5e76\u884c\u6267\u884c\u67e5\u8be2\u548c\u5176\u4ed6\u6570\u636e\u5e93\u64cd\u4f5c\uff0c\u4ece\u800c\u8fdb\u4e00\u6b65\u63d0\u9ad8\u6027\u80fd\u3002<\/section>\n<\/li>\n<\/ul>\n<h2 style=\"margin-top: 30px; margin-bottom: 15px; font-weight: bold; border-bottom: 2px solid #ef7060; font-size: 1.3em;\" data-tool=\"markdown.com.cn\u7f16\u8f91\u5668\"><span style=\"display: inline-block; background: #ef7060; color: #ffffff; padding: 3px 10px 1px; border-top-right-radius: 3px; border-top-left-radius: 3px; margin-right: 3px;\">\u4e8c\u3001\u5206\u533a\u7684\u539f\u7406\u548c\u7c7b\u578b<\/span><\/h2>\n<h4 style=\"margin-top: 30px; margin-bottom: 15px; font-weight: bold; font-size: 18px;\" data-tool=\"markdown.com.cn\u7f16\u8f91\u5668\">InnoDB\u903b\u8f91\u5b58\u50a8\u7ed3\u6784<\/h4>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\" data-tool=\"markdown.com.cn\u7f16\u8f91\u5668\">InnoDB\u5b58\u50a8\u5f15\u64ce\u7684\u903b\u8f91\u7ed3\u6784\u662f\u4e00\u4e2a\u5c42\u6b21\u5316\u7684\u4f53\u7cfb\uff0c\u4e3b\u8981\u7531\u8868\u7a7a\u95f4\u3001\u6bb5\u3001\u533a\u548c\u9875\u6784\u6210\u3002<\/p>\n<p style=\"text-align: center;\"><img decoding=\"async\" class=\"rich_pages wxw-img js_insertlocalimg lazyload\" style=\"height: auto !important;\" data-src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801213935332.jpeg\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@2.6\/load_svg\/inload.svg\" onerror=\"imgError(this)\" data-imgfileid=\"100000676\" data-ratio=\"0.5\" data-s=\"300,640\" data-type=\"jpeg\" data-w=\"1080\" \/><noscript><img decoding=\"async\" class=\"rich_pages wxw-img js_insertlocalimg\" style=\"height: auto !important;\" src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801213935332.jpeg\" data-imgfileid=\"100000676\" data-ratio=\"0.5\" data-s=\"300,640\" data-type=\"jpeg\" data-w=\"1080\" \/><\/noscript><\/p>\n<ol class=\"list-paddingleft-1\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px;\" data-tool=\"markdown.com.cn\u7f16\u8f91\u5668\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; text-align: left; color: #010101;\">\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: black;\"><strong>\u8868\u7a7a\u95f4<\/strong>\uff1a\u662fInnoDB\u6570\u636e\u7684\u6700\u9ad8\u5c42\u5bb9\u5668\uff0c\u6240\u6709\u6570\u636e\u90fd\u903b\u8f91\u5730\u5b58\u50a8\u5728\u8fd9\u91cc\u3002<\/p>\n<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; text-align: left; color: #010101;\">\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: black;\"><strong>\u6bb5\uff08Segment\uff09<\/strong>\uff1a\u662f\u8868\u7a7a\u95f4\u7684\u91cd\u8981\u7ec4\u6210\u90e8\u5206\uff0c\u6839\u636e\u7528\u9014\u53ef\u5206\u4e3a\u6570\u636e\u6bb5\u3001\u7d22\u5f15\u6bb5\u548c\u56de\u6eda\u6bb5\u7b49\u3002InnoDB\u5f15\u64ce\u8d1f\u8d23\u7ba1\u7406\u8fd9\u4e9b\u6bb5\uff0c\u786e\u4fdd\u6570\u636e\u7684\u5b8c\u6574\u6027\u548c\u9ad8\u6548\u8bbf\u95ee\u3002<\/p>\n<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; text-align: left; color: #010101;\">\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: black;\"><strong>\u533a\uff08Extent\uff09<\/strong>\uff1a\u7531\u8fde\u7eed\u7684\u9875\u7ec4\u6210\uff0c\u6bcf\u4e2a\u533a\u9ed8\u8ba4\u5927\u5c0f\u4e3a1MB\uff0c\u4e0d\u8bba\u9875\u7684\u5927\u5c0f\u5982\u4f55\u53d8\u5316\u3002\u4e3a\u4fdd\u8bc1\u9875\u7684\u8fde\u7eed\u6027\uff0cInnoDB\u4f1a\u4e00\u6b21\u6027\u4ece\u78c1\u76d8\u7533\u8bf7\u591a\u4e2a\u533a\u3002\u6bcf\u4e2a\u533a\u5305\u542b64\u4e2a\u8fde\u7eed\u7684\u9875\uff0c\u5f53\u9ed8\u8ba4\u9875\u5927\u5c0f\u4e3a16KB\u65f6\u3002\u5728\u6bb5\u5f00\u59cb\u65f6\uff0cInnoDB\u4f1a\u5148\u4f7f\u752832\u4e2a\u788e\u7247\u9875\u5b58\u50a8\u6570\u636e\uff0c\u4ee5\u4f18\u5316\u5c0f\u8868\u6216\u7279\u5b9a\u6bb5\u7684\u7a7a\u95f4\u5229\u7528\u7387\u3002<\/p>\n<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; text-align: left; color: #010101;\">\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: black;\"><strong>\u9875\uff08Page\uff09<\/strong>\uff1a\u662fInnoDB\u78c1\u76d8\u7ba1\u7406\u7684\u6700\u5c0f\u5355\u5143\uff0c\u4e5f\u88ab\u79f0\u4e3a\u5757\u3002\u5176\u9ed8\u8ba4\u5927\u5c0f\u4e3a16KB\uff0c\u4f46\u53ef\u901a\u8fc7\u914d\u7f6e\u53c2\u6570\u8fdb\u884c\u8c03\u6574\u3002\u9875\u7684\u7c7b\u578b\u591a\u6837\uff0c\u5305\u62ec\u6570\u636e\u9875\u3001undo\u9875\u3001\u7cfb\u7edf\u9875\u7b49\uff0c\u6bcf\u79cd\u9875\u90fd\u6709\u5176\u7279\u5b9a\u7684\u529f\u80fd\u548c\u7ed3\u6784\u3002<\/p>\n<\/section>\n<\/li>\n<\/ol>\n<h4 style=\"margin-top: 30px; margin-bottom: 15px; font-weight: bold; font-size: 18px;\" data-tool=\"markdown.com.cn\u7f16\u8f91\u5668\">\u5206\u533a\u7684\u539f\u7406<\/h4>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\" data-tool=\"markdown.com.cn\u7f16\u8f91\u5668\">\u5206\u533a\u6280\u672f\u662f\u5c06\u8868\u4e2d\u7684\u8bb0\u5f55\u5206\u6563\u5230\u4e0d\u540c\u7684\u7269\u7406\u6587\u4ef6\u4e2d\uff0c\u5373\u6bcf\u4e2a\u5206\u533a\u5bf9\u5e94\u4e00\u4e2a.idb\u6587\u4ef6\u3002\u8fd9\u662fMySQL 5.1\u53ca\u4ee5\u540e\u7248\u672c\u652f\u6301\u7684\u4e00\u9879\u9ad8\u7ea7\u529f\u80fd\uff0c\u65e8\u5728\u63d0\u9ad8\u5927\u6570\u636e\u8868\u7684\u7ba1\u7406\u6548\u7387\u548c\u67e5\u8be2\u6027\u80fd\u3002<\/p>\n<p style=\"text-align: center;\"><img decoding=\"async\" class=\"rich_pages wxw-img js_insertlocalimg lazyload\" style=\"height: auto !important;\" data-src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801213939381.jpeg\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@2.6\/load_svg\/inload.svg\" onerror=\"imgError(this)\" data-imgfileid=\"100000677\" data-ratio=\"1.0157407407407408\" data-s=\"300,640\" data-type=\"jpeg\" data-w=\"1080\" \/><noscript><img decoding=\"async\" class=\"rich_pages wxw-img js_insertlocalimg\" style=\"height: auto !important;\" src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801213939381.jpeg\" data-imgfileid=\"100000677\" data-ratio=\"1.0157407407407408\" data-s=\"300,640\" data-type=\"jpeg\" data-w=\"1080\" \/><\/noscript><\/p>\n<ol class=\"list-paddingleft-1\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px;\" data-tool=\"markdown.com.cn\u7f16\u8f91\u5668\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; text-align: left; color: #010101;\">\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: black;\"><strong>\u5206\u533a\u7c7b\u578b<\/strong>\uff1aMySQL\u652f\u6301\u6c34\u5e73\u5206\u533a\uff0c\u5373\u6839\u636e\u67d0\u4e9b\u6761\u4ef6\u5c06\u8868\u4e2d\u7684\u884c\u5206\u914d\u5230\u4e0d\u540c\u7684\u5206\u533a\u4e2d\u3002\u8fd9\u4e9b\u5206\u533a\u5728\u7269\u7406\u4e0a\u662f\u72ec\u7acb\u7684\uff0c\u53ef\u4ee5\u5355\u72ec\u5904\u7406\uff0c\u4e5f\u53ef\u4ee5\u4f5c\u4e3a\u6574\u4f53\u5904\u7406\u3002<\/p>\n<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; text-align: left; color: #010101;\">\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: black;\"><strong>\u6027\u80fd\u548c\u5f71\u54cd<\/strong>\uff1a\u867d\u7136\u5206\u533a\u53ef\u4ee5\u63d0\u9ad8\u67e5\u8be2\u6027\u80fd\u548c\u7ba1\u7406\u6548\u7387\uff0c\u4f46\u5982\u679c\u4e0d\u6070\u5f53\u4f7f\u7528\uff0c\u4e5f\u53ef\u80fd\u5bf9\u6027\u80fd\u4ea7\u751f\u8d1f\u9762\u5f71\u54cd\u3002\u56e0\u6b64\uff0c\u5728\u4f7f\u7528\u5206\u533a\u65f6\u5e94\u8c28\u614e\u8bc4\u4f30\u5176\u5f71\u54cd\u3002<\/p>\n<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; text-align: left; color: #010101;\">\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: black;\"><strong>\u7d22\u5f15\u4e0e\u5206\u533a<\/strong>\uff1a\u5728MySQL\u4e2d\uff0c\u5206\u533a\u662f\u5c40\u90e8\u7684\uff0c\u610f\u5473\u7740\u6570\u636e\u548c\u7d22\u5f15\u90fd\u5b58\u50a8\u5728\u5404\u81ea\u7684\u5206\u533a\u5185\u3002\u76ee\u524d\uff0cMySQL\u5c1a\u4e0d\u652f\u6301\u5168\u5c40\u5206\u533a\u7d22\u5f15\u3002<\/p>\n<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; text-align: left; color: #010101;\">\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: black;\"><strong>\u5206\u533a\u952e\u4e0e\u552f\u4e00\u7d22\u5f15<\/strong>\uff1a\u5f53\u8868\u5b58\u5728\u4e3b\u952e\u6216\u552f\u4e00\u7d22\u5f15\u65f6\uff0c\u5206\u533a\u5217\u5fc5\u987b\u662f\u8fd9\u4e9b\u7d22\u5f15\u7684\u4e00\u90e8\u5206\u3002\u8fd9\u662f\u4e3a\u4e86\u786e\u4fdd\u5206\u533a\u7684\u552f\u4e00\u6027\u548c\u67e5\u8be2\u6548\u7387\u3002<\/p>\n<\/section>\n<\/li>\n<\/ol>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\" data-tool=\"markdown.com.cn\u7f16\u8f91\u5668\">\u901a\u8fc7\u5408\u7406\u5229\u7528\u5206\u533a\u6280\u672f\uff0c\u53ef\u4ee5\u4f18\u5316\u6570\u636e\u5e93\u6027\u80fd\u3001\u63d0\u9ad8\u7ba1\u7406\u6548\u7387\uff0c\u5e76\u66f4\u597d\u5730\u9002\u5e94\u5927\u89c4\u6a21\u6570\u636e\u5904\u7406\u7684\u9700\u6c42\u3002\u7136\u800c\uff0c\u4e3a\u4e86\u5145\u5206\u5229\u7528\u8fd9\u4e00\u529f\u80fd\uff0c\u6570\u636e\u5e93\u7ba1\u7406\u5458\u548c\u5f00\u53d1\u8005\u9700\u8981\u6df1\u5165\u4e86\u89e3\u5176\u5de5\u4f5c\u539f\u7406\u548c\u6700\u4f73\u5b9e\u8df5\u3002<\/p>\n<h4 style=\"margin-top: 30px; margin-bottom: 15px; font-weight: bold; font-size: 18px;\" data-tool=\"markdown.com.cn\u7f16\u8f91\u5668\">\u5206\u533a\u7c7b\u578b<\/h4>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\" data-tool=\"markdown.com.cn\u7f16\u8f91\u5668\">MySQL\u652f\u6301\u51e0\u79cd\u4e0d\u540c\u7c7b\u578b\u7684\u5206\u533a\u65b9\u5f0f\uff0c\u5305\u62ecRANGE\u3001LIST\u3001HASH\u548cKEY\u3002\u4e0b\u9762\u7b80\u8981\u4ecb\u7ecd\u8fd9\u4e9b\u5206\u533a\u65b9\u5f0f\u7684\u5de5\u4f5c\u539f\u7406\uff1a<\/p>\n<ol class=\"list-paddingleft-1\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px;\" data-tool=\"markdown.com.cn\u7f16\u8f91\u5668\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; text-align: left; color: #010101;\"><strong style=\"color: black;\">RANGE\u5206\u533a<\/strong>\uff1a\u57fa\u4e8e\u5217\u7684\u503c\u8303\u56f4\u5c06\u6570\u636e\u5206\u914d\u5230\u4e0d\u540c\u7684\u5206\u533a\u3002\u4f8b\u5982\uff0c\u53ef\u4ee5\u6839\u636e\u65e5\u671f\u8303\u56f4\u5c06\u6570\u636e\u5206\u914d\u5230\u4e0d\u540c\u7684\u6708\u4efd\u6216\u5e74\u4efd\u7684\u5206\u533a\u4e2d\u3002<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; text-align: left; color: #010101;\"><strong style=\"color: black;\">LIST\u5206\u533a<\/strong>\uff1a\u7c7b\u4f3c\u4e8eRANGE\u5206\u533a\uff0c\u4f46LIST\u5206\u533a\u662f\u57fa\u4e8e\u5217\u7684\u79bb\u6563\u503c\u96c6\u5408\u6765\u5206\u914d\u6570\u636e\u7684\u3002\u53ef\u4ee5\u6307\u5b9a\u4e00\u4e2a\u679a\u4e3e\u5217\u8868\u6765\u5b9a\u4e49\u6bcf\u4e2a\u5206\u533a\u7684\u503c\u3002<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; text-align: left; color: #010101;\"><strong style=\"color: black;\">HASH\u5206\u533a<\/strong>\uff1a\u57fa\u4e8e\u7528\u6237\u5b9a\u4e49\u7684\u8868\u8fbe\u5f0f\u7684\u54c8\u5e0c\u503c\u6765\u5206\u914d\u6570\u636e\u5230\u4e0d\u540c\u7684\u5206\u533a\u3002\u8fd9\u79cd\u5206\u533a\u65b9\u5f0f\u9002\u7528\u4e8e\u786e\u4fdd\u6570\u636e\u5728\u5404\u4e2a\u5206\u533a\u4e4b\u95f4\u5747\u5300\u5206\u5e03\u3002<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; text-align: left; color: #010101;\"><strong style=\"color: black;\">KEY\u5206\u533a<\/strong>\uff1a\u7c7b\u4f3c\u4e8eHASH\u5206\u533a\uff0c\u4f46KEY\u5206\u533a\u652f\u6301\u8ba1\u7b97\u4e00\u5217\u6216\u591a\u5217\u7684\u54c8\u5e0c\u503c\u6765\u5206\u914d\u6570\u636e\u3002\u5b83\u652f\u6301\u591a\u5217\u4f5c\u4e3a\u5206\u533a\u952e\uff0c\u5e76\u4e14\u63d0\u4f9b\u4e86\u66f4\u597d\u7684\u6570\u636e\u5206\u5e03\u548c\u67e5\u8be2\u6027\u80fd\u3002<\/section>\n<\/li>\n<\/ol>\n<h2 style=\"margin-top: 30px; margin-bottom: 15px; font-weight: bold; border-bottom: 2px solid #ef7060; font-size: 1.3em;\" data-tool=\"markdown.com.cn\u7f16\u8f91\u5668\"><span style=\"display: inline-block; background: #ef7060; color: #ffffff; padding: 3px 10px 1px; border-top-right-radius: 3px; border-top-left-radius: 3px; margin-right: 3px;\">\u4e09\u3001\u5206\u533a\u7684\u4f18\u52bf\u548c\u4f7f\u7528\u573a\u666f<\/span><\/h2>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\" data-tool=\"markdown.com.cn\u7f16\u8f91\u5668\">MySQL\u5206\u533a\u5e26\u6765\u4e86\u8bb8\u591a\u4f18\u52bf\uff0c\u9002\u7528\u4e8e\u5404\u79cd\u4f7f\u7528\u573a\u666f\uff1a<\/p>\n<ol class=\"list-paddingleft-1\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px;\" data-tool=\"markdown.com.cn\u7f16\u8f91\u5668\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; text-align: left; color: #010101;\"><strong style=\"color: black;\">\u6027\u80fd\u63d0\u5347<\/strong>\uff1a\u901a\u8fc7\u5c06\u6570\u636e\u5206\u6563\u5230\u591a\u4e2a\u5206\u533a\u4e2d\uff0c\u53ef\u4ee5\u5e76\u884c\u5904\u7406\u67e5\u8be2\uff0c\u4ece\u800c\u63d0\u9ad8\u67e5\u8be2\u6027\u80fd\u3002\u540c\u65f6\uff0c\u5bf9\u4e8e\u6d89\u53ca\u5927\u91cf\u6570\u636e\u7684\u7ef4\u62a4\u64cd\u4f5c\uff08\u5982\u5907\u4efd\u548c\u6062\u590d\uff09\uff0c\u53ef\u4ee5\u5355\u72ec\u5904\u7406\u6bcf\u4e2a\u5206\u533a\uff0c\u51cf\u5c11\u4e86\u64cd\u4f5c\u7684\u590d\u6742\u6027\u548c\u65f6\u95f4\u6210\u672c\u3002<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; text-align: left; color: #010101;\"><strong style=\"color: black;\">\u7ba1\u7406\u7b80\u5316<\/strong>\uff1a\u5206\u533a\u53ef\u4ee5\u4f7f\u5f97\u6570\u636e\u7ba1\u7406\u66f4\u52a0\u7075\u6d3b\u3002\u4f8b\u5982\uff0c\u53ef\u4ee5\u72ec\u7acb\u5730\u5907\u4efd\u3001\u6062\u590d\u6216\u4f18\u5316\u67d0\u4e2a\u5206\u533a\uff0c\u800c\u65e0\u9700\u5bf9\u6574\u4e2a\u8868\u8fdb\u884c\u64cd\u4f5c\u3002\u8fd9\u5bf9\u4e8e\u5927\u578b\u6570\u636e\u5e93\u8868\u6765\u8bf4\u5c24\u4e3a\u91cd\u8981\uff0c\u56e0\u4e3a\u5b83\u53ef\u4ee5\u663e\u8457\u51cf\u5c11\u7ef4\u62a4\u65f6\u95f4\u548c\u8d44\u6e90\u6d88\u8017\u3002<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; text-align: left; color: #010101;\"><strong style=\"color: black;\">\u6570\u636e\u5f52\u6863\u548c\u6e05\u7406<\/strong>\uff1a\u5bf9\u4e8e\u5177\u6709\u65f6\u95f4\u5c5e\u6027\u7684\u6570\u636e\uff08\u5982\u65e5\u5fd7\u3001\u4ea4\u6613\u8bb0\u5f55\u7b49\uff09\uff0c\u53ef\u4ee5\u4f7f\u7528\u5206\u533a\u6765\u8f7b\u677e\u5f52\u6863\u65e7\u6570\u636e\u6216\u5220\u9664\u4e0d\u518d\u9700\u8981\u7684\u6570\u636e\u3002\u901a\u8fc7\u7b80\u5355\u5730\u5220\u9664\u6216\u5f52\u6863\u67d0\u4e2a\u5206\u533a\uff0c\u53ef\u4ee5\u5feb\u901f\u91ca\u653e\u5b58\u50a8\u7a7a\u95f4\u5e76\u63d0\u9ad8\u6027\u80fd\u3002<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; text-align: left; color: #010101;\"><strong style=\"color: black;\">\u53ef\u6269\u5c55\u6027<\/strong>\uff1a\u5206\u533a\u6280\u672f\u4f7f\u5f97\u6570\u636e\u5e93\u8868\u66f4\u5bb9\u6613\u6269\u5c55\u5230\u66f4\u5927\u7684\u6570\u636e\u96c6\u3002\u5f53\u8868\u7684\u5927\u5c0f\u8d85\u8fc7\u5355\u4e2a\u5b58\u50a8\u8bbe\u5907\u7684\u5bb9\u91cf\u65f6\uff0c\u53ef\u4ee5\u4f7f\u7528\u5206\u533a\u5c06\u6570\u636e\u5206\u5e03\u5230\u591a\u4e2a\u5b58\u50a8\u8bbe\u5907\u4e0a\uff0c\u4ece\u800c\u5b9e\u73b0\u6c34\u5e73\u6269\u5c55\u3002<\/section>\n<p style=\"text-align: center;\"><img decoding=\"async\" class=\"rich_pages wxw-img js_insertlocalimg lazyload\" style=\"height: auto !important;\" data-src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801213942532.jpeg\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@2.6\/load_svg\/inload.svg\" onerror=\"imgError(this)\" data-imgfileid=\"100000680\" data-ratio=\"0.7\" data-s=\"300,640\" data-type=\"jpeg\" data-w=\"1080\" \/><noscript><img decoding=\"async\" class=\"rich_pages wxw-img js_insertlocalimg\" style=\"height: auto !important;\" src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801213942532.jpeg\" data-imgfileid=\"100000680\" data-ratio=\"0.7\" data-s=\"300,640\" data-type=\"jpeg\" data-w=\"1080\" \/><\/noscript><\/p>\n<\/li>\n<\/ol>\n<h2 style=\"margin-top: 30px; margin-bottom: 15px; font-weight: bold; border-bottom: 2px solid #ef7060; font-size: 1.3em;\" data-tool=\"markdown.com.cn\u7f16\u8f91\u5668\"><span style=\"display: inline-block; background: #ef7060; color: #ffffff; padding: 3px 10px 1px; border-top-right-radius: 3px; border-top-left-radius: 3px; margin-right: 3px;\">\u56db\u3001\u5982\u4f55\u5b9e\u65bd\u5206\u533a<\/span><\/h2>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\" data-tool=\"markdown.com.cn\u7f16\u8f91\u5668\">\u5b9e\u65bdMySQL\u5206\u533a\u9700\u8981\u4ed4\u7ec6\u89c4\u5212\u548c\u8bbe\u8ba1\u3002\u4ee5\u4e0b\u662f\u4e00\u4e9b\u5efa\u8bae\u7684\u6b65\u9aa4\uff1a<\/p>\n<ol class=\"list-paddingleft-1\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px;\" data-tool=\"markdown.com.cn\u7f16\u8f91\u5668\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; text-align: left; color: #010101;\"><strong style=\"color: black;\">\u786e\u5b9a\u5206\u533a\u952e<\/strong>\uff1a\u9009\u62e9\u4e00\u4e2a\u5408\u9002\u7684\u5217\u4f5c\u4e3a\u5206\u533a\u952e\uff0c\u8be5\u5217\u7684\u503c\u5c06\u7528\u4e8e\u5c06\u6570\u636e\u5206\u914d\u5230\u4e0d\u540c\u7684\u5206\u533a\u4e2d\u3002\u901a\u5e38\u9009\u62e9\u5177\u6709\u8fde\u7eed\u503c\u6216\u79bb\u6563\u503c\u7684\u5217\u4f5c\u4e3a\u5206\u533a\u952e\u3002<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; text-align: left; color: #010101;\"><strong style=\"color: black;\">\u9009\u62e9\u5408\u9002\u7684\u5206\u533a\u7c7b\u578b<\/strong>\uff1a\u6839\u636e\u6570\u636e\u7684\u7279\u70b9\u548c\u67e5\u8be2\u9700\u6c42\u9009\u62e9\u5408\u9002\u7684\u5206\u533a\u7c7b\u578b\uff08RANGE\u3001LIST\u3001HASH\u6216KEY\uff09\u3002\u786e\u4fdd\u6240\u9009\u7684\u5206\u533a\u7c7b\u578b\u80fd\u591f\u5747\u5300\u5730\u5206\u5e03\u6570\u636e\u5e76\u63d0\u9ad8\u67e5\u8be2\u6027\u80fd\u3002<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; text-align: left; color: #010101;\"><strong style=\"color: black;\">\u521b\u5efa\u5206\u533a\u8868<\/strong>\uff1a\u4f7f\u7528<code style=\"font-size: 14px; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; background-color: rgba(27, 31, 35, 0.05); font-family: 'Operator Mono', Consolas, Monaco, Menlo, monospace; word-break: break-all; color: #ef7060;\">CREATE TABLE<\/code>\u8bed\u53e5\u521b\u5efa\u5206\u533a\u8868\uff0c\u5e76\u6307\u5b9a\u5206\u533a\u952e\u548c\u5206\u533a\u7c7b\u578b\u7b49\u53c2\u6570\u3002\u4f8b\u5982\uff0c\u4f7f\u7528RANGE\u5206\u533a\u7c7b\u578b\u521b\u5efa\u4e00\u4e2a\u6309\u6708\u5206\u533a\u7684\u9500\u552e\u6570\u636e\u8868\uff1a<\/section>\n<\/li>\n<\/ol>\n<section class=\"code-snippet__fix code-snippet__js\">\n<pre class=\"code-snippet__js\" data-lang=\"sql\"><code style=\"border-radius: 0px;\"><span class=\"code-snippet_outer\" style=\"line-height: 26px;\">CREATE TABLE sales (<\/span><\/code><code style=\"border-radius: 0px;\"><span class=\"code-snippet_outer\" style=\"line-height: 26px;\">\n    sale_id INT NOT NULL,<\/span><\/code><code style=\"border-radius: 0px;\"><span class=\"code-snippet_outer\" style=\"line-height: 26px;\">\n    sale_date DATE NOT NULL,<\/span><\/code><code style=\"border-radius: 0px;\"><span class=\"code-snippet_outer\" style=\"line-height: 26px;\">\n    amount DECIMAL(10, 2) NOT NULL,<\/span><\/code><code style=\"border-radius: 0px;\"><span class=\"code-snippet_outer\" style=\"line-height: 26px;\">\n    ...<\/span><\/code><code style=\"border-radius: 0px;\"><span class=\"code-snippet_outer\" style=\"line-height: 26px;\">\n) PARTITION BY RANGE (YEAR(sale_date)) (<\/span><\/code><code style=\"border-radius: 0px;\"><span class=\"code-snippet_outer\" style=\"line-height: 26px;\">\n    PARTITION p0 VALUES LESS THAN (2022),<\/span><\/code><code style=\"border-radius: 0px;\"><span class=\"code-snippet_outer\" style=\"line-height: 26px;\">\n    PARTITION p1 VALUES LESS THAN (2023),<\/span><\/code><code style=\"border-radius: 0px;\"><span class=\"code-snippet_outer\" style=\"line-height: 26px;\">\n    PARTITION p2 VALUES LESS THAN MAXVALUE<\/span><\/code><code style=\"border-radius: 0px;\"><span class=\"code-snippet_outer\" style=\"line-height: 26px;\">\n);<\/span><\/code><\/pre>\n<\/section>\n<ol class=\"list-paddingleft-1\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px;\" start=\"4\" data-tool=\"markdown.com.cn\u7f16\u8f91\u5668\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; text-align: left; color: #010101;\"><strong style=\"color: black;\">\u67e5\u8be2\u548c\u7ef4\u62a4<\/strong>\uff1a\u4e00\u65e6\u521b\u5efa\u4e86\u5206\u533a\u8868\uff0c\u5c31\u53ef\u4ee5\u50cf\u666e\u901a\u8868\u4e00\u6837\u6267\u884c\u67e5\u8be2\u64cd\u4f5c\u3002MySQL\u4f1a\u81ea\u52a8\u5b9a\u4f4d\u5230\u76f8\u5e94\u7684\u5206\u533a\u4e0a\u6267\u884c\u67e5\u8be2\u3002\u540c\u65f6\uff0c\u53ef\u4ee5\u72ec\u7acb\u5730\u5907\u4efd\u3001\u6062\u590d\u6216\u4f18\u5316\u6bcf\u4e2a\u5206\u533a\u3002<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; text-align: left; color: #010101;\"><strong style=\"color: black;\">\u76d1\u63a7\u548c\u8c03\u6574<\/strong>\uff1a\u5b9a\u671f\u76d1\u63a7\u5206\u533a\u7684\u6027\u80fd\u548c\u5b58\u50a8\u4f7f\u7528\u60c5\u51b5\uff0c\u5e76\u6839\u636e\u9700\u8981\u8fdb\u884c\u8c03\u6574\u3002\u4f8b\u5982\uff0c\u53ef\u4ee5\u6dfb\u52a0\u65b0\u7684\u5206\u533a\u6765\u5bb9\u7eb3\u65b0\u6570\u636e\uff0c\u6216\u8005\u5220\u9664\u65e7\u7684\u5206\u533a\u4ee5\u91ca\u653e\u5b58\u50a8\u7a7a\u95f4\u3002<\/section>\n<\/li>\n<\/ol>\n<h2 style=\"margin-top: 30px; margin-bottom: 15px; font-weight: bold; border-bottom: 2px solid #ef7060; font-size: 1.3em;\" data-tool=\"markdown.com.cn\u7f16\u8f91\u5668\"><span style=\"display: inline-block; background: #ef7060; color: #ffffff; padding: 3px 10px 1px; border-top-right-radius: 3px; border-top-left-radius: 3px; margin-right: 3px;\">\u4e94\u3001\u5206\u533a\u8868\u7684\u64cd\u4f5c<\/span><\/h2>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\" data-tool=\"markdown.com.cn\u7f16\u8f91\u5668\">\u5305\u62ec\u521b\u5efa\u5206\u533a\u8868\u3001\u4fee\u6539\u5206\u533a\u548c\u5220\u9664\u3001\u5408\u5e76\u3001\u62c6\u5206\u7b49\u3002<\/p>\n<h3 style=\"margin-top: 30px; margin-bottom: 15px; font-weight: bold; font-size: 20px;\" data-tool=\"markdown.com.cn\u7f16\u8f91\u5668\">5.1. \u521b\u5efa\u5e26\u6709\u5206\u533a\u7684\u8868<\/h3>\n<h4 style=\"margin-top: 30px; margin-bottom: 15px; font-weight: bold; font-size: 18px;\" data-tool=\"markdown.com.cn\u7f16\u8f91\u5668\">RANGE \u5206\u533a<\/h4>\n<section class=\"code-snippet__fix code-snippet__js\">\n<pre class=\"code-snippet__js\" data-lang=\"sql\"><code style=\"border-radius: 0px;\"><span class=\"code-snippet_outer\" style=\"line-height: 26px;\">CREATE TABLE sales_range (<\/span><\/code><code style=\"border-radius: 0px;\"><span class=\"code-snippet_outer\" style=\"line-height: 26px;\">\n    id INT NOT NULL,<\/span><\/code><code style=\"border-radius: 0px;\"><span class=\"code-snippet_outer\" style=\"line-height: 26px;\">\n    sale_date DATE NOT NULL,<\/span><\/code><code style=\"border-radius: 0px;\"><span class=\"code-snippet_outer\" style=\"line-height: 26px;\">\n    amount DECIMAL(10, 2) NOT NULL<\/span><\/code><code style=\"border-radius: 0px;\"><span class=\"code-snippet_outer\" style=\"line-height: 26px;\">\n) PARTITION BY RANGE (YEAR(sale_date)) (<\/span><\/code><code style=\"border-radius: 0px;\"><span class=\"code-snippet_outer\" style=\"line-height: 26px;\">\n    PARTITION p0 VALUES LESS THAN (2010),<\/span><\/code><code style=\"border-radius: 0px;\"><span class=\"code-snippet_outer\" style=\"line-height: 26px;\">\n    PARTITION p1 VALUES LESS THAN (2011),<\/span><\/code><code style=\"border-radius: 0px;\"><span class=\"code-snippet_outer\" style=\"line-height: 26px;\">\n    PARTITION p2 VALUES LESS THAN (2012),<\/span><\/code><code style=\"border-radius: 0px;\"><span class=\"code-snippet_outer\" style=\"line-height: 26px;\">\n    PARTITION p3 VALUES LESS THAN MAXVALUE<\/span><\/code><code style=\"border-radius: 0px;\"><span class=\"code-snippet_outer\" style=\"line-height: 26px;\">\n);<\/span><\/code><\/pre>\n<\/section>\n<h4 style=\"margin-top: 30px; margin-bottom: 15px; font-weight: bold; font-size: 18px;\" data-tool=\"markdown.com.cn\u7f16\u8f91\u5668\">LIST \u5206\u533a<\/h4>\n<section class=\"code-snippet__fix code-snippet__js\">\n<pre class=\"code-snippet__js\" data-lang=\"sql\"><code style=\"border-radius: 0px;\"><span class=\"code-snippet_outer\" style=\"line-height: 26px;\">CREATE TABLE sales_list (<\/span><\/code><code style=\"border-radius: 0px;\"><span class=\"code-snippet_outer\" style=\"line-height: 26px;\">\n    id INT NOT NULL,<\/span><\/code><code style=\"border-radius: 0px;\"><span class=\"code-snippet_outer\" style=\"line-height: 26px;\">\n    region ENUM('North', 'South', 'East', 'West') NOT NULL,<\/span><\/code><code style=\"border-radius: 0px;\"><span class=\"code-snippet_outer\" style=\"line-height: 26px;\">\n    amount DECIMAL(10, 2) NOT NULL<\/span><\/code><code style=\"border-radius: 0px;\"><span class=\"code-snippet_outer\" style=\"line-height: 26px;\">\n) PARTITION BY LIST COLUMNS(region) (<\/span><\/code><code style=\"border-radius: 0px;\"><span class=\"code-snippet_outer\" style=\"line-height: 26px;\">\n    PARTITION pNorth VALUES IN('North'),<\/span><\/code><code style=\"border-radius: 0px;\"><span class=\"code-snippet_outer\" style=\"line-height: 26px;\">\n    PARTITION pSouth VALUES IN('South'),<\/span><\/code><code style=\"border-radius: 0px;\"><span class=\"code-snippet_outer\" style=\"line-height: 26px;\">\n    PARTITION pEast VALUES IN('East'),<\/span><\/code>\n<code style=\"border-radius: 0px;\"><span class=\"code-snippet_outer\" style=\"line-height: 26px;\">    PARTITION pWest VALUES IN('West')<\/span><\/code><code style=\"border-radius: 0px;\"><span class=\"code-snippet_outer\" style=\"line-height: 26px;\">\n);<\/span><\/code><\/pre>\n<\/section>\n<h4 style=\"margin-top: 30px; margin-bottom: 15px; font-weight: bold; font-size: 18px;\" data-tool=\"markdown.com.cn\u7f16\u8f91\u5668\">HASH \u5206\u533a<\/h4>\n<section class=\"code-snippet__fix code-snippet__js\">\n<pre class=\"code-snippet__js\" data-lang=\"sql\"><code style=\"border-radius: 0px;\"><span class=\"code-snippet_outer\" style=\"line-height: 26px;\">CREATE TABLE sales_hash (<\/span><\/code><code style=\"border-radius: 0px;\"><span class=\"code-snippet_outer\" style=\"line-height: 26px;\">\n    id INT NOT NULL,<\/span><\/code><code style=\"border-radius: 0px;\"><span class=\"code-snippet_outer\" style=\"line-height: 26px;\">\n    sale_date DATE NOT NULL,<\/span><\/code><code style=\"border-radius: 0px;\"><span class=\"code-snippet_outer\" style=\"line-height: 26px;\">\n    amount DECIMAL(10, 2) NOT NULL<\/span><\/code><code style=\"border-radius: 0px;\"><span class=\"code-snippet_outer\" style=\"line-height: 26px;\">\n) PARTITION BY HASH(YEAR(sale_date)) PARTITIONS 4;<\/span><\/code><\/pre>\n<\/section>\n<h4 style=\"margin-top: 30px; margin-bottom: 15px; font-weight: bold; font-size: 18px;\" data-tool=\"markdown.com.cn\u7f16\u8f91\u5668\">KEY \u5206\u533a<\/h4>\n<section class=\"code-snippet__fix code-snippet__js\">\n<pre class=\"code-snippet__js\" data-lang=\"sql\"><code style=\"border-radius: 0px;\"><span class=\"code-snippet_outer\" style=\"line-height: 26px;\">CREATE TABLE sales_key (<\/span><\/code><code style=\"border-radius: 0px;\"><span class=\"code-snippet_outer\" style=\"line-height: 26px;\">\n    id INT NOT NULL,<\/span><\/code><code style=\"border-radius: 0px;\"><span class=\"code-snippet_outer\" style=\"line-height: 26px;\">\n    sale_date DATE NOT NULL,<\/span><\/code><code style=\"border-radius: 0px;\"><span class=\"code-snippet_outer\" style=\"line-height: 26px;\">\n    amount DECIMAL(10, 2) NOT NULL,<\/span><\/code><code style=\"border-radius: 0px;\"><span class=\"code-snippet_outer\" style=\"line-height: 26px;\">\n    PRIMARY KEY (id, sale_date)<\/span><\/code><code style=\"border-radius: 0px;\"><span class=\"code-snippet_outer\" style=\"line-height: 26px;\">\n) PARTITION BY KEY(id) PARTITIONS 4;<\/span><\/code><\/pre>\n<\/section>\n<h3 style=\"margin-top: 30px; margin-bottom: 15px; font-weight: bold; font-size: 20px;\" data-tool=\"markdown.com.cn\u7f16\u8f91\u5668\">5.2. \u4fee\u6539\u5206\u533a\u8868<\/h3>\n<h4 style=\"margin-top: 30px; margin-bottom: 15px; font-weight: bold; font-size: 18px;\" data-tool=\"markdown.com.cn\u7f16\u8f91\u5668\">\u6dfb\u52a0\u5206\u533a<\/h4>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\" data-tool=\"markdown.com.cn\u7f16\u8f91\u5668\">\u5bf9\u4e8e RANGE \u6216 LIST \u5206\u533a\uff0c\u53ef\u4ee5\u4f7f\u7528 <code style=\"font-size: 14px; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; background-color: rgba(27, 31, 35, 0.05); font-family: 'Operator Mono', Consolas, Monaco, Menlo, monospace; word-break: break-all; color: #ef7060;\">ALTER TABLE<\/code> \u8bed\u53e5\u6dfb\u52a0\u5206\u533a\uff1a<\/p>\n<section class=\"code-snippet__fix code-snippet__js\">\n<pre class=\"code-snippet__js\" data-lang=\"sql\"><code style=\"border-radius: 0px;\"><span class=\"code-snippet_outer\" style=\"line-height: 26px;\">ALTER TABLE sales_range ADD PARTITION (PARTITION p4 VALUES LESS THAN (2013));<\/span><\/code><\/pre>\n<\/section>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\" data-tool=\"markdown.com.cn\u7f16\u8f91\u5668\">\u5bf9\u4e8e HASH \u6216 KEY \u5206\u533a\uff0c\u7531\u4e8e\u5b83\u4eec\u662f\u57fa\u4e8e\u54c8\u5e0c\u51fd\u6570\u8fdb\u884c\u5206\u533a\u7684\uff0c\u56e0\u6b64\u4e0d\u80fd\u76f4\u63a5\u6dfb\u52a0\u5206\u533a\uff0c\u4f46\u53ef\u4ee5\u901a\u8fc7\u91cd\u65b0\u521b\u5efa\u8868\u6216\u8c03\u6574\u5206\u533a\u6570\u91cf\u6765\u95f4\u63a5\u5b9e\u73b0\u3002<\/p>\n<h4 style=\"margin-top: 30px; margin-bottom: 15px; font-weight: bold; font-size: 18px;\" data-tool=\"markdown.com.cn\u7f16\u8f91\u5668\">\u5220\u9664\u5206\u533a<\/h4>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\" data-tool=\"markdown.com.cn\u7f16\u8f91\u5668\">\u53ef\u4ee5\u4f7f\u7528 <code style=\"font-size: 14px; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; background-color: rgba(27, 31, 35, 0.05); font-family: 'Operator Mono', Consolas, Monaco, Menlo, monospace; word-break: break-all; color: #ef7060;\">ALTER TABLE<\/code> \u8bed\u53e5\u5220\u9664\u5206\u533a\uff1a<\/p>\n<section class=\"code-snippet__fix code-snippet__js\">\n<pre class=\"code-snippet__js\" data-lang=\"sql\"><code style=\"border-radius: 0px;\"><span class=\"code-snippet_outer\" style=\"line-height: 26px;\">ALTER TABLE sales_range DROP PARTITION p0;<\/span><\/code><\/pre>\n<\/section>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\" data-tool=\"markdown.com.cn\u7f16\u8f91\u5668\">\u8fd9\u5c06\u5220\u9664\u540d\u4e3a <code style=\"font-size: 14px; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; background-color: rgba(27, 31, 35, 0.05); font-family: 'Operator Mono', Consolas, Monaco, Menlo, monospace; word-break: break-all; color: #ef7060;\">p0<\/code> \u7684\u5206\u533a\u53ca\u5176\u5305\u542b\u7684\u6240\u6709\u6570\u636e\u3002<\/p>\n<h4 style=\"margin-top: 30px; margin-bottom: 15px; font-weight: bold; font-size: 18px;\" data-tool=\"markdown.com.cn\u7f16\u8f91\u5668\">\u5408\u5e76\u5206\u533a<\/h4>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\" data-tool=\"markdown.com.cn\u7f16\u8f91\u5668\">\u5bf9\u4e8e\u76f8\u90bb\u7684 RANGE \u6216 LIST \u5206\u533a\uff0c\u53ef\u4ee5\u4f7f\u7528 <code style=\"font-size: 14px; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; background-color: rgba(27, 31, 35, 0.05); font-family: 'Operator Mono', Consolas, Monaco, Menlo, monospace; word-break: break-all; color: #ef7060;\">ALTER TABLE<\/code> \u8bed\u53e5\u5c06\u5b83\u4eec\u5408\u5e76\u4e3a\u4e00\u4e2a\u5206\u533a\uff1a<\/p>\n<section class=\"code-snippet__fix code-snippet__js\">\n<pre class=\"code-snippet__js\" data-lang=\"sql\"><code style=\"border-radius: 0px;\"><span class=\"code-snippet_outer\" style=\"line-height: 26px;\">ALTER TABLE sales_range REORGANIZE PARTITION p1, p2 INTO (<\/span><\/code><code style=\"border-radius: 0px;\"><span class=\"code-snippet_outer\" style=\"line-height: 26px;\">\n    PARTITION p1_2 VALUES LESS THAN (2012)<\/span><\/code><code style=\"border-radius: 0px;\"><span class=\"code-snippet_outer\" style=\"line-height: 26px;\">\n);<\/span><\/code><\/pre>\n<\/section>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\" data-tool=\"markdown.com.cn\u7f16\u8f91\u5668\">\u628a <code style=\"font-size: 14px; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; background-color: rgba(27, 31, 35, 0.05); font-family: 'Operator Mono', Consolas, Monaco, Menlo, monospace; word-break: break-all; color: #ef7060;\">p1<\/code> \u548c <code style=\"font-size: 14px; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; background-color: rgba(27, 31, 35, 0.05); font-family: 'Operator Mono', Consolas, Monaco, Menlo, monospace; word-break: break-all; color: #ef7060;\">p2<\/code> \u5206\u533a\u5408\u5e76\u4e3a\u4e00\u4e2a\u540d\u4e3a <code style=\"font-size: 14px; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; background-color: rgba(27, 31, 35, 0.05); font-family: 'Operator Mono', Consolas, Monaco, Menlo, monospace; word-break: break-all; color: #ef7060;\">p1_2<\/code> \u7684\u65b0\u5206\u533a\u3002<\/p>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\" data-tool=\"markdown.com.cn\u7f16\u8f91\u5668\"><strong>\u5206\u533a\u62c6\u5206\u9650\u5236\uff1a<\/strong><\/p>\n<ol class=\"list-paddingleft-1\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px;\" data-tool=\"markdown.com.cn\u7f16\u8f91\u5668\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; text-align: left; color: #010101;\"><strong style=\"color: black;\">\u5206\u533a\u6570\u91cf\u9650\u5236<\/strong>\uff1aMySQL\u5bf9\u5355\u4e2a\u8868\u7684\u5206\u533a\u6570\u91cf\u6709\u9650\u5236\uff0c\u901a\u5e38\u6700\u5927\u5206\u533a\u6570\u76ee\u4e0d\u80fd\u8d85\u8fc71024\u4e2a\u3002\u8fd9\u610f\u5473\u7740\u5728\u8fdb\u884c\u62c6\u5206\u64cd\u4f5c\u65f6\uff0c\u9700\u8981\u6ce8\u610f\u65b0\u751f\u6210\u7684\u5206\u533a\u6570\u91cf\u662f\u5426\u4f1a\u8d85\u8fc7\u8fd9\u4e2a\u9650\u5236\u3002<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; text-align: left; color: #010101;\"><strong style=\"color: black;\">\u5206\u533a\u952e\u548c\u5206\u533a\u7c7b\u578b\u7684\u9650\u5236<\/strong>\uff1a\u62c6\u5206\u64cd\u4f5c\u901a\u5e38\u53d7\u5230\u5206\u533a\u952e\u548c\u5206\u533a\u7c7b\u578b\u7684\u7ea6\u675f\u3002\u4f8b\u5982\uff0c\u5728RANGE\u5206\u533a\u4e2d\uff0c\u62c6\u5206\u70b9\u5fc5\u987b\u57fa\u4e8e\u5206\u533a\u952e\u7684\u8fde\u7eed\u503c\u3002\u5bf9\u4e8eLIST\u5206\u533a\uff0c\u62c6\u5206\u9700\u8981\u57fa\u4e8e\u79bb\u6563\u7684\u679a\u4e3e\u503c\u3002HASH\u548cKEY\u5206\u533a\u7531\u4e8e\u5176\u57fa\u4e8e\u54c8\u5e0c\u51fd\u6570\u7684\u7279\u6027\uff0c\u4e0d\u76f4\u63a5\u652f\u6301\u62c6\u5206\u64cd\u4f5c\u3002<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; text-align: left; color: #010101;\"><strong style=\"color: black;\">\u6570\u636e\u5b8c\u6574\u6027<\/strong>\uff1a\u62c6\u5206\u5206\u533a\u65f6\uff0c\u9700\u8981\u786e\u4fdd\u6570\u636e\u7684\u5b8c\u6574\u6027\u3002\u5982\u679c\u62c6\u5206\u64cd\u4f5c\u5bfc\u81f4\u6570\u636e\u4e22\u5931\u6216\u635f\u574f\uff0c\u90a3\u4e48\u8fd9\u5c06\u662f\u4e00\u4e2a\u4e25\u91cd\u7684\u95ee\u9898\u3002\u56e0\u6b64\uff0c\u5728\u6267\u884c\u62c6\u5206\u64cd\u4f5c\u4e4b\u524d\uff0c\u6700\u597d\u8fdb\u884c\u6570\u636e\u5907\u4efd\u3002<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; text-align: left; color: #010101;\"><strong style=\"color: black;\">\u6027\u80fd\u8003\u8651<\/strong>\uff1a\u62c6\u5206\u5927\u5206\u533a\u53ef\u80fd\u4f1a\u5f71\u54cd\u6570\u636e\u5e93\u6027\u80fd\uff0c\u56e0\u4e3a\u9700\u8981\u91cd\u5efa\u7d22\u5f15\u548c\u79fb\u52a8\u5927\u91cf\u6570\u636e\u3002\u8fd9\u79cd\u64cd\u4f5c\u6700\u597d\u5728\u6570\u636e\u5e93\u8d1f\u8f7d\u8f83\u4f4e\u7684\u65f6\u5019\u8fdb\u884c\u3002<\/section>\n<\/li>\n<\/ol>\n<h4 style=\"margin-top: 30px; margin-bottom: 15px; font-weight: bold; font-size: 18px;\" data-tool=\"markdown.com.cn\u7f16\u8f91\u5668\">\u62c6\u5206\u5206\u533a<\/h4>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\" data-tool=\"markdown.com.cn\u7f16\u8f91\u5668\">\u4f7f\u7528ALTER TABLE\u8bed\u53e5\u6765\u62c6\u5206\u5206\u533a\u3002\u8bed\u6cd5\uff0c\u7528\u4e8eRANGE\u5206\u533a\uff1a<\/p>\n<section class=\"code-snippet__fix code-snippet__js\">\n<pre class=\"code-snippet__js\" data-lang=\"sql\"><code style=\"border-radius: 0px;\"><span class=\"code-snippet_outer\" style=\"line-height: 26px;\">ALTER TABLE table_name REORGANIZE PARTITION partition_name INTO (  <\/span><\/code><code style=\"border-radius: 0px;\"><span class=\"code-snippet_outer\" style=\"line-height: 26px;\">\n    PARTITION new_partition1 VALUES LESS THAN (value1),  <\/span><\/code><code style=\"border-radius: 0px;\"><span class=\"code-snippet_outer\" style=\"line-height: 26px;\">\n    PARTITION new_partition2 VALUES LESS THAN (value2)  <\/span><\/code><code style=\"border-radius: 0px;\"><span class=\"code-snippet_outer\" style=\"line-height: 26px;\">\n);<\/span><\/code><\/pre>\n<\/section>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\" data-tool=\"markdown.com.cn\u7f16\u8f91\u5668\">table_name\u662f\u4f60\u8981\u4fee\u6539\u7684\u8868\u540d\uff0cpartition_name\u662f\u8981\u62c6\u5206\u7684\u5206\u533a\u540d\uff0cnew_partition1\u548cnew_partition2\u662f\u65b0\u5206\u533a\u7684\u540d\u79f0\uff0c\u800cvalue1\u548cvalue2\u662f\u5b9a\u4e49\u65b0\u5206\u533a\u952e\u503c\u8303\u56f4\u7684\u503c\u3002<\/p>\n<section class=\"code-snippet__fix code-snippet__js\">\n<pre class=\"code-snippet__js\" data-lang=\"sql\"><code style=\"border-radius: 0px;\"><span class=\"code-snippet_outer\" style=\"line-height: 26px;\">ALTER TABLE sales_range REORGANIZE PARTITION p1_2 INTO (  <\/span><\/code><code style=\"border-radius: 0px;\"><span class=\"code-snippet_outer\" style=\"line-height: 26px;\">\n    PARTITION p1 VALUES LESS THAN (value1),  <\/span><\/code><code style=\"border-radius: 0px;\"><span class=\"code-snippet_outer\" style=\"line-height: 26px;\">\n    PARTITION p2 VALUES LESS THAN (value2)  <\/span><\/code><code style=\"border-radius: 0px;\"><span class=\"code-snippet_outer\" style=\"line-height: 26px;\">\n);<\/span><\/code><\/pre>\n<\/section>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\" data-tool=\"markdown.com.cn\u7f16\u8f91\u5668\">\u628a\u4e00\u4e2a\u540d\u4e3a <code style=\"font-size: 14px; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; background-color: rgba(27, 31, 35, 0.05); font-family: 'Operator Mono', Consolas, Monaco, Menlo, monospace; word-break: break-all; color: #ef7060;\">p1_2<\/code> \u7684\u5206\u533a\u62c6\u5206\u4e3a <code style=\"font-size: 14px; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; background-color: rgba(27, 31, 35, 0.05); font-family: 'Operator Mono', Consolas, Monaco, Menlo, monospace; word-break: break-all; color: #ef7060;\">p1<\/code> \u548c <code style=\"font-size: 14px; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; background-color: rgba(27, 31, 35, 0.05); font-family: 'Operator Mono', Consolas, Monaco, Menlo, monospace; word-break: break-all; color: #ef7060;\">p2<\/code> \u4e24\u4e2a\u5206\u533a\u3002<\/p>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\" data-tool=\"markdown.com.cn\u7f16\u8f91\u5668\"><strong>\u5206\u533a\u5408\u5e76\u9650\u5236\uff1a<\/strong><\/p>\n<ol class=\"list-paddingleft-1\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px;\" data-tool=\"markdown.com.cn\u7f16\u8f91\u5668\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; text-align: left; color: #010101;\"><strong style=\"color: black;\">\u76f8\u90bb\u5206\u533a\u5408\u5e76<\/strong>\uff1a\u5728MySQL\u4e2d\uff0c\u901a\u5e38\u53ea\u80fd\u5408\u5e76\u76f8\u90bb\u7684\u5206\u533a\u3002\u8fd9\u610f\u5473\u7740\u4f60\u4e0d\u80fd\u968f\u610f\u9009\u62e9\u4e24\u4e2a\u4e0d\u76f8\u90bb\u7684\u5206\u533a\u8fdb\u884c\u5408\u5e76\u3002<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; text-align: left; color: #010101;\"><strong style=\"color: black;\">\u5206\u533a\u7c7b\u578b\u548c\u952e\u7684\u9650\u5236<\/strong>\uff1a\u4e0e\u62c6\u5206\u64cd\u4f5c\u7c7b\u4f3c\uff0c\u5408\u5e76\u64cd\u4f5c\u4e5f\u53d7\u5230\u5206\u533a\u7c7b\u578b\u548c\u5206\u533a\u952e\u7684\u7ea6\u675f\u3002\u4e0d\u662f\u6240\u6709\u7c7b\u578b\u7684\u5206\u533a\u90fd\u53ef\u4ee5\u8f7b\u677e\u5408\u5e76\u3002<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; text-align: left; color: #010101;\"><strong style=\"color: black;\">\u6570\u636e\u8fc1\u79fb\u548c\u91cd\u5efa<\/strong>\uff1a\u5408\u5e76\u5206\u533a\u65f6\uff0c\u53ef\u80fd\u9700\u8981\u8fdb\u884c\u6570\u636e\u8fc1\u79fb\u548c\u7d22\u5f15\u91cd\u5efa\uff0c\u8fd9\u53ef\u80fd\u4f1a\u5f71\u54cd\u6570\u636e\u5e93\u7684\u6027\u80fd\u548c\u53ef\u7528\u6027\u3002<\/section>\n<\/li>\n<\/ol>\n<h4 style=\"margin-top: 30px; margin-bottom: 15px; font-weight: bold; font-size: 18px;\" data-tool=\"markdown.com.cn\u7f16\u8f91\u5668\">\u91cd\u5efa\u5206\u533a<\/h4>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\" data-tool=\"markdown.com.cn\u7f16\u8f91\u5668\">\u91cd\u5efa\u5206\u533a\u76f8\u5f53\u4e8e\u5148\u6e05\u9664\u5206\u533a\u5185\u7684\u6240\u6709\u6570\u636e\uff0c\u5e76\u968f\u540e\u91cd\u65b0\u63d2\u5165\uff0c\u8fd9\u6709\u52a9\u4e8e\u6574\u7406\u5206\u533a\u5185\u7684\u788e\u7247\u3002<\/p>\n<ul class=\"list-paddingleft-1\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px;\" data-tool=\"markdown.com.cn\u7f16\u8f91\u5668\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; text-align: left; color: #010101;\"><strong style=\"color: black;\">\u8bed\u6cd5<\/strong>:<\/section>\n<\/li>\n<\/ul>\n<section class=\"code-snippet__fix code-snippet__js\">\n<pre class=\"code-snippet__js\" data-lang=\"sql\"><code style=\"border-radius: 0px;\"><span class=\"code-snippet_outer\" style=\"line-height: 26px;\">ALTER TABLE tbl_name REBUILD PARTITION partition_name_list;<\/span><\/code><\/pre>\n<\/section>\n<ul class=\"list-paddingleft-1\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px;\" data-tool=\"markdown.com.cn\u7f16\u8f91\u5668\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; text-align: left; color: #010101;\"><strong style=\"color: black;\">\u793a\u4f8b<\/strong>:<\/section>\n<\/li>\n<\/ul>\n<section class=\"code-snippet__fix code-snippet__js\">\n<pre class=\"code-snippet__js\" data-lang=\"sql\"><code style=\"border-radius: 0px;\"><span class=\"code-snippet_outer\" style=\"line-height: 26px;\">ALTER TABLE tbl_users REBUILD PARTITION p2, p3;<\/span><\/code><\/pre>\n<\/section>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\" data-tool=\"markdown.com.cn\u7f16\u8f91\u5668\">\u901a\u8fc7\u8fd9\u4e00\u64cd\u4f5c\uff0c\u53ef\u4ee5\u9ad8\u6548\u5730\u6574\u7406<code style=\"font-size: 14px; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; background-color: rgba(27, 31, 35, 0.05); font-family: 'Operator Mono', Consolas, Monaco, Menlo, monospace; word-break: break-all; color: #ef7060;\">p2<\/code>\u548c<code style=\"font-size: 14px; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; background-color: rgba(27, 31, 35, 0.05); font-family: 'Operator Mono', Consolas, Monaco, Menlo, monospace; word-break: break-all; color: #ef7060;\">p3<\/code>\u8fd9\u4e24\u4e2a\u5206\u533a\u4e2d\u7684\u788e\u7247\u3002<\/p>\n<h4 style=\"margin-top: 30px; margin-bottom: 15px; font-weight: bold; font-size: 18px;\" data-tool=\"markdown.com.cn\u7f16\u8f91\u5668\">\u4f18\u5316\u5206\u533a<\/h4>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\" data-tool=\"markdown.com.cn\u7f16\u8f91\u5668\">\u5f53\u4ece\u5206\u533a\u4e2d\u5220\u9664\u4e86\u5927\u91cf\u6570\u636e\uff0c\u6216\u8005\u5bf9\u5305\u542b\u53ef\u53d8\u957f\u5ea6\u5b57\u6bb5\uff08\u5982VARCHAR\u6216TEXT\u7c7b\u578b\u5217\uff09\u7684\u5206\u533a\u8fdb\u884c\u4e86\u591a\u6b21\u4fee\u6539\u540e\uff0c\u4f18\u5316\u5206\u533a\u53ef\u4ee5\u56de\u6536\u672a\u4f7f\u7528\u7684\u7a7a\u95f4\u5e76\u6574\u7406\u6570\u636e\u788e\u7247\u3002<\/p>\n<ul class=\"list-paddingleft-1\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px;\" data-tool=\"markdown.com.cn\u7f16\u8f91\u5668\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; text-align: left; color: #010101;\"><strong style=\"color: black;\">\u8bed\u6cd5<\/strong>:<\/section>\n<\/li>\n<\/ul>\n<section class=\"code-snippet__fix code-snippet__js\">\n<pre class=\"code-snippet__js\" data-lang=\"sql\"><code style=\"border-radius: 0px;\"><span class=\"code-snippet_outer\" style=\"line-height: 26px;\">ALTER TABLE tbl_name OPTIMIZE PARTITION partition_name_list;<\/span><\/code><\/pre>\n<\/section>\n<ul class=\"list-paddingleft-1\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px;\" data-tool=\"markdown.com.cn\u7f16\u8f91\u5668\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; text-align: left; color: #010101;\"><strong style=\"color: black;\">\u793a\u4f8b<\/strong>:<\/section>\n<\/li>\n<\/ul>\n<section class=\"code-snippet__fix code-snippet__js\">\n<pre class=\"code-snippet__js\" data-lang=\"sql\"><code style=\"border-radius: 0px;\"><span class=\"code-snippet_outer\" style=\"line-height: 26px;\">ALTER TABLE tbl_users OPTIMIZE PARTITION p2, p3;<\/span><\/code><\/pre>\n<\/section>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\" data-tool=\"markdown.com.cn\u7f16\u8f91\u5668\">\u6267\u884c\u6b64\u64cd\u4f5c\u540e\uff0c<code style=\"font-size: 14px; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; background-color: rgba(27, 31, 35, 0.05); font-family: 'Operator Mono', Consolas, Monaco, Menlo, monospace; word-break: break-all; color: #ef7060;\">p2<\/code>\u548c<code style=\"font-size: 14px; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; background-color: rgba(27, 31, 35, 0.05); font-family: 'Operator Mono', Consolas, Monaco, Menlo, monospace; word-break: break-all; color: #ef7060;\">p3<\/code>\u5206\u533a\u5c06\u4f1a\u66f4\u52a0\u7d27\u51d1\uff0c\u672a\u4f7f\u7528\u7684\u7a7a\u95f4\u5c06\u88ab\u56de\u6536\u3002<\/p>\n<h4 style=\"margin-top: 30px; margin-bottom: 15px; font-weight: bold; font-size: 18px;\" data-tool=\"markdown.com.cn\u7f16\u8f91\u5668\">\u5206\u6790\u5206\u533a<\/h4>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\" data-tool=\"markdown.com.cn\u7f16\u8f91\u5668\">\u6b64\u64cd\u4f5c\u4f1a\u8bfb\u53d6\u5e76\u4fdd\u5b58\u5206\u533a\u7684\u952e\u5206\u5e03\u7edf\u8ba1\u4fe1\u606f\uff0c\u6709\u52a9\u4e8e\u67e5\u8be2\u4f18\u5316\u5668\u5236\u5b9a\u66f4\u6709\u6548\u7684\u67e5\u8be2\u8ba1\u5212\u3002<\/p>\n<ul class=\"list-paddingleft-1\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px;\" data-tool=\"markdown.com.cn\u7f16\u8f91\u5668\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; text-align: left; color: #010101;\"><strong style=\"color: black;\">\u8bed\u6cd5<\/strong>:<\/section>\n<\/li>\n<\/ul>\n<section class=\"code-snippet__fix code-snippet__js\">\n<pre class=\"code-snippet__js\" data-lang=\"sql\"><code style=\"border-radius: 0px;\"><span class=\"code-snippet_outer\" style=\"line-height: 26px;\">ALTER TABLE tbl_name ANALYZE PARTITION partition_name_list;<\/span><\/code><\/pre>\n<\/section>\n<ul class=\"list-paddingleft-1\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px;\" data-tool=\"markdown.com.cn\u7f16\u8f91\u5668\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; text-align: left; color: #010101;\"><strong style=\"color: black;\">\u793a\u4f8b<\/strong>:<\/section>\n<\/li>\n<\/ul>\n<section class=\"code-snippet__fix code-snippet__js\">\n<pre class=\"code-snippet__js\" data-lang=\"sql\"><code style=\"border-radius: 0px;\"><span class=\"code-snippet_outer\" style=\"line-height: 26px;\">ALTER TABLE tbl_users ANALYZE PARTITION p2, p3;<\/span><\/code><\/pre>\n<\/section>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\" data-tool=\"markdown.com.cn\u7f16\u8f91\u5668\">\u5bf9<code style=\"font-size: 14px; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; background-color: rgba(27, 31, 35, 0.05); font-family: 'Operator Mono', Consolas, Monaco, Menlo, monospace; word-break: break-all; color: #ef7060;\">p2<\/code>\u548c<code style=\"font-size: 14px; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; background-color: rgba(27, 31, 35, 0.05); font-family: 'Operator Mono', Consolas, Monaco, Menlo, monospace; word-break: break-all; color: #ef7060;\">p3<\/code>\u5206\u533a\u8fdb\u884c\u5206\u6790\u540e\uff0c\u6570\u636e\u5e93\u80fd\u66f4\u51c6\u786e\u5730\u4e3a\u8fd9\u4e24\u4e2a\u5206\u533a\u4e0a\u7684\u67e5\u8be2\u5236\u5b9a\u6267\u884c\u8ba1\u5212\u3002<\/p>\n<h4 style=\"margin-top: 30px; margin-bottom: 15px; font-weight: bold; font-size: 18px;\" data-tool=\"markdown.com.cn\u7f16\u8f91\u5668\">\u68c0\u67e5\u5206\u533a<\/h4>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\" data-tool=\"markdown.com.cn\u7f16\u8f91\u5668\">\u6b64\u64cd\u4f5c\u7528\u4e8e\u9a8c\u8bc1\u5206\u533a\u4e2d\u7684\u6570\u636e\u6216\u7d22\u5f15\u662f\u5426\u5b8c\u6574\u65e0\u635f\u3002<\/p>\n<ul class=\"list-paddingleft-1\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px;\" data-tool=\"markdown.com.cn\u7f16\u8f91\u5668\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; text-align: left; color: #010101;\"><strong style=\"color: black;\">\u8bed\u6cd5<\/strong> :<\/section>\n<\/li>\n<\/ul>\n<section class=\"code-snippet__fix code-snippet__js\">\n<pre class=\"code-snippet__js\" data-lang=\"sql\"><code style=\"border-radius: 0px;\"><span class=\"code-snippet_outer\" style=\"line-height: 26px;\">ALTER TABLE tbl_name CHECK PARTITION partition_name_list;<\/span><\/code><\/pre>\n<\/section>\n<ul class=\"list-paddingleft-1\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px;\" data-tool=\"markdown.com.cn\u7f16\u8f91\u5668\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; text-align: left; color: #010101;\"><strong style=\"color: black;\">\u793a\u4f8b<\/strong>:<\/section>\n<\/li>\n<\/ul>\n<section class=\"code-snippet__fix code-snippet__js\">\n<pre class=\"code-snippet__js\" data-lang=\"sql\"><code style=\"border-radius: 0px;\"><span class=\"code-snippet_outer\" style=\"line-height: 26px;\">ALTER TABLE tbl_users CHECK PARTITION p2, p3;<\/span><\/code><\/pre>\n<\/section>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\" data-tool=\"markdown.com.cn\u7f16\u8f91\u5668\">\u6267\u884c\u68c0\u67e5\u53ef\u4ee5\u786e\u4fdd<code style=\"font-size: 14px; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; background-color: rgba(27, 31, 35, 0.05); font-family: 'Operator Mono', Consolas, Monaco, Menlo, monospace; word-break: break-all; color: #ef7060;\">p2<\/code>\u548c<code style=\"font-size: 14px; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; background-color: rgba(27, 31, 35, 0.05); font-family: 'Operator Mono', Consolas, Monaco, Menlo, monospace; word-break: break-all; color: #ef7060;\">p3<\/code>\u5206\u533a\u7684\u6570\u636e\u548c\u7d22\u5f15\u7684\u5b8c\u6574\u6027\u3002<\/p>\n<h4 style=\"margin-top: 30px; margin-bottom: 15px; font-weight: bold; font-size: 18px;\" data-tool=\"markdown.com.cn\u7f16\u8f91\u5668\">\u4fee\u8865\u5206\u533a<\/h4>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\" data-tool=\"markdown.com.cn\u7f16\u8f91\u5668\">\u5982\u679c\u5206\u533a\u6570\u636e\u6216\u7d22\u5f15\u53d7\u635f\uff0c\u53ef\u4ee5\u4f7f\u7528\u6b64\u64cd\u4f5c\u8fdb\u884c\u4fee\u590d\u3002<\/p>\n<ul class=\"list-paddingleft-1\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px;\" data-tool=\"markdown.com.cn\u7f16\u8f91\u5668\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; text-align: left; color: #010101;\"><strong style=\"color: black;\">\u8bed\u6cd5<\/strong>:<\/section>\n<\/li>\n<\/ul>\n<section class=\"code-snippet__fix code-snippet__js\">\n<pre class=\"code-snippet__js\" data-lang=\"sql\"><code style=\"border-radius: 0px;\"><span class=\"code-snippet_outer\" style=\"line-height: 26px;\">ALTER TABLE tbl_name REPAIR PARTITION partition_name_list;<\/span><\/code><\/pre>\n<\/section>\n<ul class=\"list-paddingleft-1\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px;\" data-tool=\"markdown.com.cn\u7f16\u8f91\u5668\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; text-align: left; color: #010101;\"><strong style=\"color: black;\">\u793a\u4f8b<\/strong>:<\/section>\n<\/li>\n<\/ul>\n<section class=\"code-snippet__fix code-snippet__js\">\n<pre class=\"code-snippet__js\" data-lang=\"sql\"><code style=\"border-radius: 0px;\"><span class=\"code-snippet_outer\" style=\"line-height: 26px;\">ALTER TABLE tbl_users REPAIR PARTITION p2, p3;<\/span><\/code><\/pre>\n<\/section>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\" data-tool=\"markdown.com.cn\u7f16\u8f91\u5668\">\u6267\u884c\u4fee\u8865\u64cd\u4f5c\u540e\uff0c<code style=\"font-size: 14px; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; background-color: rgba(27, 31, 35, 0.05); font-family: 'Operator Mono', Consolas, Monaco, Menlo, monospace; word-break: break-all; color: #ef7060;\">p2<\/code>\u548c<code style=\"font-size: 14px; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; background-color: rgba(27, 31, 35, 0.05); font-family: 'Operator Mono', Consolas, Monaco, Menlo, monospace; word-break: break-all; color: #ef7060;\">p3<\/code>\u5206\u533a\u4e2d\u7684\u4efb\u4f55\u635f\u574f\u90fd\u5c06\u88ab\u4fee\u590d\u3002<\/p>\n<h3 style=\"margin-top: 30px; margin-bottom: 15px; font-weight: bold; font-size: 20px;\" data-tool=\"markdown.com.cn\u7f16\u8f91\u5668\">5.3. \u67e5\u770b\u5206\u533a\u4fe1\u606f<\/h3>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\" data-tool=\"markdown.com.cn\u7f16\u8f91\u5668\">\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u67e5\u8be2\u6765\u67e5\u770b\u8868\u7684\u5206\u533a\u4fe1\u606f\uff1a<\/p>\n<section class=\"code-snippet__fix code-snippet__js\">\n<pre class=\"code-snippet__js\" data-lang=\"sql\"><code style=\"border-radius: 0px;\"><span class=\"code-snippet_outer\" style=\"line-height: 26px;\">SELECT * FROM INFORMATION_SCHEMA.PARTITIONS WHERE TABLE_NAME = 'sales_range';<\/span><\/code><\/pre>\n<\/section>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\" data-tool=\"markdown.com.cn\u7f16\u8f91\u5668\">\u6216\u8005\u4f7f\u7528 <code style=\"font-size: 14px; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; background-color: rgba(27, 31, 35, 0.05); font-family: 'Operator Mono', Consolas, Monaco, Menlo, monospace; word-break: break-all; color: #ef7060;\">SHOW CREATE TABLE<\/code> \u8bed\u53e5\u6765\u67e5\u770b\u8868\u7684\u521b\u5efa\u8bed\u53e5\uff0c\u5305\u62ec\u5206\u533a\u5b9a\u4e49\uff1a<\/p>\n<section class=\"code-snippet__fix code-snippet__js\">\n<pre class=\"code-snippet__js\" data-lang=\"sql\"><code style=\"border-radius: 0px;\"><span class=\"code-snippet_outer\" style=\"line-height: 26px;\">SHOW CREATE TABLE sales_range;<\/span><\/code><\/pre>\n<\/section>\n<h2 style=\"margin-top: 30px; margin-bottom: 15px; font-weight: bold; border-bottom: 2px solid #ef7060; font-size: 1.3em;\" data-tool=\"markdown.com.cn\u7f16\u8f91\u5668\"><span style=\"display: inline-block; background: #ef7060; color: #ffffff; padding: 3px 10px 1px; border-top-right-radius: 3px; border-top-left-radius: 3px; margin-right: 3px;\">\u516d\u3001\u590d\u5408\u5206\u533a<\/span><\/h2>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\" data-tool=\"markdown.com.cn\u7f16\u8f91\u5668\">\u590d\u5408\u5206\u533a\u662f\u6307\u5728\u5206\u533a\u8868\u4e2d\u7684\u6bcf\u4e2a\u5206\u533a\u518d\u6b21\u8fdb\u884c\u5206\u5272\uff0c\u8fd9\u79cd\u518d\u6b21\u5206\u5272\u7684\u5b50\u5206\u533a\u65e2\u53ef\u4ee5\u4f7f\u7528HASH\u5206\u533a\uff0c\u4e5f\u53ef\u4ee5\u4f7f\u7528KEY\u5206\u533a\u3002\u8fd9\u79cd\u6280\u672f\u4e5f\u88ab\u79f0\u4e3a\u5b50\u5206\u533a\u3002<\/p>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\" data-tool=\"markdown.com.cn\u7f16\u8f91\u5668\"><strong>\u4f7f\u7528\u573a\u666f<\/strong><\/p>\n<ul class=\"list-paddingleft-1\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px;\" data-tool=\"markdown.com.cn\u7f16\u8f91\u5668\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; text-align: left; color: #010101;\"><strong style=\"color: black;\">\u6570\u636e\u91cf\u5de8\u5927<\/strong>\uff1a\u5f53\u8868\u4e2d\u7684\u6570\u636e\u91cf\u975e\u5e38\u5927\u65f6\uff0c\u5355\u4e00\u5206\u533a\u53ef\u80fd\u65e0\u6cd5\u6ee1\u8db3\u6027\u80fd\u9700\u6c42\u3002\u590d\u5408\u5206\u533a\u53ef\u4ee5\u5c06\u6570\u636e\u66f4\u7ec6\u81f4\u5730\u5212\u5206\uff0c\u4ece\u800c\u63d0\u9ad8\u67e5\u8be2\u6548\u7387\u3002<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; text-align: left; color: #010101;\"><strong style=\"color: black;\">\u591a\u7ef4\u5ea6\u67e5\u8be2\u4f18\u5316<\/strong>\uff1a\u5982\u679c\u67e5\u8be2\u7ecf\u5e38\u6d89\u53ca\u591a\u4e2a\u7ef4\u5ea6\uff08\u5982\u65f6\u95f4\u548c\u5730\u533a\uff09\uff0c\u590d\u5408\u5206\u533a\u53ef\u4ee5\u9488\u5bf9\u8fd9\u4e9b\u7ef4\u5ea6\u8fdb\u884c\u5206\u533a\uff0c\u4ece\u800c\u4f18\u5316\u67e5\u8be2\u6027\u80fd\u3002<\/section>\n<\/li>\n<\/ul>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\" data-tool=\"markdown.com.cn\u7f16\u8f91\u5668\"><strong>\u5728\u590d\u5408\u5206\u533a\u4e2d\uff0c\u5e38\u89c1\u7684\u7ec4\u5408\u662fRANGE\u6216LIST\u4e0eHASH\u6216KEY\u7684\u7ec4\u5408<\/strong><\/p>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\" data-tool=\"markdown.com.cn\u7f16\u8f91\u5668\">\u521b\u5efa\u4e00\u4e2a\u8bb0\u5f55\u7528\u6237\u884c\u4e3a\u65e5\u5fd7\u7684\u8868\uff0c\u9996\u5148\u6839\u636e\u65e5\u5fd7\u65e5\u671f\u8fdb\u884c<code style=\"font-size: 14px; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; background-color: rgba(27, 31, 35, 0.05); font-family: 'Operator Mono', Consolas, Monaco, Menlo, monospace; word-break: break-all; color: #ef7060;\">RANGE<\/code>\u5206\u533a\uff0c\u7136\u540e\u5728\u6bcf\u4e2a\u65e5\u671f\u8303\u56f4\u5185\u6839\u636e\u7528\u6237ID\u8fdb\u884c<code style=\"font-size: 14px; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; background-color: rgba(27, 31, 35, 0.05); font-family: 'Operator Mono', Consolas, Monaco, Menlo, monospace; word-break: break-all; color: #ef7060;\">HASH<\/code>\u5b50\u5206\u533a\u3002<\/p>\n<section class=\"code-snippet__fix code-snippet__js\">\n<pre class=\"code-snippet__js\" data-lang=\"sql\"><code style=\"border-radius: 0px;\"><span class=\"code-snippet_outer\" style=\"line-height: 26px;\">CREATE TABLE user_activity_logs (\nlog_id BIGINT NOT NULL AUTO_INCREMENT,\nuser_id INT NOT NULL,\nactivity_date DATE NOT NULL,\nactivity_description VARCHAR ( 255 ) NOT NULL,\nPRIMARY KEY ( log_id, user_id )) PARTITION BY RANGE COLUMNS ( activity_date ) (\nPARTITION p2022\nVALUES\nLESS THAN ( '2023-01-01' ) ( SUBPARTITION sp2022a HASH ( user_id ) PARTITIONS 4 ),\nPARTITION p2023\nVALUES\nLESS THAN ( '2024-01-01' ) ( SUBPARTITION sp2023 HASH ( user_id ) PARTITIONS 4 ),\n-- \u53ef\u4ee5\u6839\u636e\u9700\u8981\u7ee7\u7eed\u6dfb\u52a0\u66f4\u591a\u7684\u5e74\u4efd\u5206\u533a\u548cHASH\u5b50\u5206\u533a \nPARTITION pfuture VALUES LESS THAN (MAXVALUE) ( SUBPARTITION spfuture HASH(user_id) PARTITIONS 4 )););<\/span><\/code><\/pre>\n<\/section>\n<ul class=\"list-paddingleft-1\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px;\" data-tool=\"markdown.com.cn\u7f16\u8f91\u5668\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; text-align: left; color: #010101;\">\u5148\u6839\u636e<code style=\"font-size: 14px; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; background-color: rgba(27, 31, 35, 0.05); font-family: 'Operator Mono', Consolas, Monaco, Menlo, monospace; word-break: break-all; color: #ef7060;\">activity_date<\/code>\u8fdb\u884c\u8303\u56f4\u5206\u533a\u3002\u6bcf\u4e2a\u8303\u56f4\u5206\u533a\u5185\u90e8\uff0c\u53c8\u6839\u636e<code style=\"font-size: 14px; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; background-color: rgba(27, 31, 35, 0.05); font-family: 'Operator Mono', Consolas, Monaco, Menlo, monospace; word-break: break-all; color: #ef7060;\">user_id<\/code>\u8fdb\u884c\u4e86<code style=\"font-size: 14px; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; background-color: rgba(27, 31, 35, 0.05); font-family: 'Operator Mono', Consolas, Monaco, Menlo, monospace; word-break: break-all; color: #ef7060;\">HASH<\/code>\u5b50\u5206\u533a\u3002\u8fd9\u6837\u505a\u7684\u597d\u5904\u662f\u53ef\u4ee5\u66f4\u5747\u5300\u5730\u5206\u5e03\u6570\u636e\uff0c\u63d0\u9ad8\u67e5\u8be2\u6027\u80fd\uff0c\u7279\u522b\u662f\u5f53\u67e5\u8be2\u6761\u4ef6\u540c\u65f6\u5305\u542b\u65e5\u671f\u548c\u7528\u6237ID\u65f6\u3002<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; text-align: left; color: #010101;\">\u9884\u7559\u4e86\u4e00\u4e2a\u540d\u4e3a<code style=\"font-size: 14px; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; background-color: rgba(27, 31, 35, 0.05); font-family: 'Operator Mono', Consolas, Monaco, Menlo, monospace; word-break: break-all; color: #ef7060;\">pfuture<\/code>\u7684\u5206\u533a\uff0c\u5b83\u7684\u8303\u56f4\u662f\u5c0f\u4e8e\u6700\u5927\u503c\uff08<code style=\"font-size: 14px; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; background-color: rgba(27, 31, 35, 0.05); font-family: 'Operator Mono', Consolas, Monaco, Menlo, monospace; word-break: break-all; color: #ef7060;\">MAXVALUE<\/code>\uff09\uff0c\u8fd9\u6837\u53ef\u4ee5\u786e\u4fdd\u672a\u6765\u7684\u65e5\u5fd7\u4e5f\u80fd\u88ab\u6b63\u786e\u5730\u63d2\u5165\u5230\u8868\u4e2d\u3002<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; text-align: left; color: #010101;\"><code style=\"font-size: 14px; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; background-color: rgba(27, 31, 35, 0.05); font-family: 'Operator Mono', Consolas, Monaco, Menlo, monospace; word-break: break-all; color: #ef7060;\">PARTITIONS 4<\/code>\u8868\u793a\u5728\u6bcf\u4e2a\u8303\u56f4\u5206\u533a\u5185\u521b\u5efa4\u4e2a\u54c8\u5e0c\u5b50\u5206\u533a\u3002\u8fd9\u4e2a\u6570\u5b57\u53ef\u4ee5\u6839\u636e\u6570\u636e\u91cf\u7684\u5927\u5c0f\u548c\u67e5\u8be2\u6a21\u5f0f\u8fdb\u884c\u8c03\u6574\u3002<\/section>\n<\/li>\n<\/ul>\n<h2 style=\"margin-top: 30px; margin-bottom: 15px; font-weight: bold; border-bottom: 2px solid #ef7060; font-size: 1.3em;\" data-tool=\"markdown.com.cn\u7f16\u8f91\u5668\"><span style=\"display: inline-block; background: #ef7060; color: #ffffff; padding: 3px 10px 1px; border-top-right-radius: 3px; border-top-left-radius: 3px; margin-right: 3px;\">\u4e03\u3001\u6ce8\u610f\u4e8b\u9879\u548c\u9650\u5236<\/span><\/h2>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\" data-tool=\"markdown.com.cn\u7f16\u8f91\u5668\">\u5728\u5b9e\u65bdMySQL\u5206\u533a\u65f6\uff0c\u9700\u8981\u6ce8\u610f\u4ee5\u4e0b\u4e8b\u9879\u548c\u9650\u5236\uff1a<\/p>\n<ol class=\"list-paddingleft-1\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px;\" data-tool=\"markdown.com.cn\u7f16\u8f91\u5668\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; text-align: left; color: #010101;\"><strong style=\"color: black;\">\u5206\u533a\u952e\u9009\u62e9<\/strong>\uff1a\u9009\u62e9\u5408\u9002\u7684\u5206\u533a\u952e\u81f3\u5173\u91cd\u8981\u3002\u786e\u4fdd\u5206\u533a\u952e\u80fd\u591f\u5747\u5300\u5730\u5206\u5e03\u6570\u636e\uff0c\u5e76\u4e14\u4e0e\u67e5\u8be2\u6761\u4ef6\u76f8\u5339\u914d\uff0c\u4ee5\u63d0\u9ad8\u67e5\u8be2\u6027\u80fd\u3002<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; text-align: left; color: #010101;\"><strong style=\"color: black;\">\u5206\u533a\u6570\u91cf\u9650\u5236<\/strong>\uff1aMySQL\u5bf9\u5355\u4e2a\u8868\u7684\u5206\u533a\u6570\u91cf\u6709\u9650\u5236\uff08\u901a\u5e38\u4e3a1024\u4e2a\u5206\u533a\uff09\u3002\u5728\u8bbe\u8ba1\u5206\u533a\u7b56\u7565\u65f6\u8981\u8003\u8651\u8fd9\u4e2a\u9650\u5236\u3002<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; text-align: left; color: #010101;\"><strong style=\"color: black;\">\u5168\u5c40\u552f\u4e00\u7d22\u5f15\u9650\u5236<\/strong>\uff1a\u5728\u5206\u533a\u8868\u4e0a\u521b\u5efa\u5168\u5c40\u552f\u4e00\u7d22\u5f15\u65f6\u5b58\u5728\u9650\u5236\u3002\u786e\u4fdd\u4e86\u89e3\u8fd9\u4e9b\u9650\u5236\uff0c\u5e76\u6839\u636e\u9700\u8981\u8fdb\u884c\u8c03\u6574\u3002<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; text-align: left; color: #010101;\"><strong style=\"color: black;\">\u6027\u80fd\u548c\u8d44\u6e90\u6d88\u8017<\/strong>\uff1a\u867d\u7136\u5206\u533a\u53ef\u4ee5\u63d0\u9ad8\u6027\u80fd\uff0c\u4f46\u5728\u67d0\u4e9b\u60c5\u51b5\u4e0b\uff0c\u8fc7\u591a\u7684\u5206\u533a\u53ef\u80fd\u5bfc\u81f4\u989d\u5916\u7684\u6027\u80fd\u548c\u8d44\u6e90\u6d88\u8017\u3002\u56e0\u6b64\uff0c\u8981\u5408\u7406\u8bbe\u8ba1\u5206\u533a\u7b56\u7565\u4ee5\u5e73\u8861\u6027\u80fd\u548c\u8d44\u6e90\u6d88\u8017\u3002<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; text-align: left; color: #010101;\"><strong style=\"color: black;\">\u517c\u5bb9\u6027\u548c\u8fc1\u79fb<\/strong>\uff1a\u5728\u8fc1\u79fb\u73b0\u6709\u8868\u5230\u5206\u533a\u8868\u4e4b\u524d\uff0c\u8981\u786e\u4fdd\u5907\u4efd\u539f\u59cb\u6570\u636e\u5e76\u6d4b\u8bd5\u8fc1\u79fb\u8fc7\u7a0b\u7684\u6b63\u786e\u6027\u3002\u6b64\u5916\uff0c\u8981\u4e86\u89e3\u4e0d\u540cMySQL\u7248\u672c\u4e4b\u95f4\u5bf9\u5206\u533a\u529f\u80fd\u7684\u652f\u6301\u548c\u517c\u5bb9\u6027\u5dee\u5f02\u3002<\/section>\n<\/li>\n<\/ol>\n<h2 style=\"margin-top: 30px; margin-bottom: 15px; font-weight: bold; border-bottom: 2px solid #ef7060; font-size: 1.3em;\" data-tool=\"markdown.com.cn\u7f16\u8f91\u5668\"><span style=\"display: inline-block; background: #ef7060; color: #ffffff; padding: 3px 10px 1px; border-top-right-radius: 3px; border-top-left-radius: 3px; margin-right: 3px;\">\u516b\u3001\u89e3\u91ca\u51e0\u4e2a\u95ee\u9898<\/span><\/h2>\n<h4 style=\"margin-top: 30px; margin-bottom: 15px; font-weight: bold; font-size: 18px;\" data-tool=\"markdown.com.cn\u7f16\u8f91\u5668\">8.1 MySQL\u5206\u533a\u5904\u7406NULL\u503c\u7684\u65b9\u5f0f<\/h4>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\" data-tool=\"markdown.com.cn\u7f16\u8f91\u5668\">MySQL\u4e2d\uff0c\u5f53\u6d89\u53ca\u5230\u5206\u533a\u65f6\uff0c\u7cfb\u7edf\u5e76\u4e0d\u4f1a\u7279\u522b\u7981\u6b62NULL\u503c\u3002\u4e0d\u8bba\u662f\u5217\u7684\u5b9e\u9645\u503c\u8fd8\u662f\u7528\u6237\u81ea\u5b9a\u4e49\u7684\u8868\u8fbe\u5f0f\u7ed3\u679c\uff0cMySQL\u901a\u5e38\u4f1a\u5c06NULL\u503c\u89c6\u4e3a0\u8fdb\u884c\u5904\u7406\u3002\u7136\u800c\uff0c\u8fd9\u79cd\u884c\u4e3a\u53ef\u80fd\u5e76\u4e0d\u603b\u662f\u7b26\u5408\u6570\u636e\u5b8c\u6574\u6027\u548c\u51c6\u786e\u6027\u7684\u8981\u6c42\u3002\u4e3a\u4e86\u907f\u514d\u8fd9\u79cd\u9690\u5f0f\u7684NULL\u52300\u7684\u8f6c\u6362\uff0c\u6700\u4f73\u5b9e\u8df5\u662f\u5728\u8bbe\u8ba1\u6570\u636e\u5e93\u8868\u65f6\uff0c\u5bf9\u76f8\u5173\u5217\u660e\u786e\u58f0\u660e\u4e3a\u201cNOT NULL\u201d\u3002\u8fd9\u6837\u505a\u53ef\u4ee5\u786e\u4fdd\u6570\u636e\u7684\u51c6\u786e\u6027\u548c\u4e00\u81f4\u6027\uff0c\u540c\u65f6\u907f\u514d\u7531\u4e8eNULL\u503c\u88ab\u9519\u8bef\u5730\u89e3\u91ca\u4e3a0\u800c\u5bfc\u81f4\u7684\u6f5c\u5728\u95ee\u9898\u3002\u56e0\u6b64\uff0c\u5728\u8bbe\u8ba1\u5206\u533a\u8868\u65f6\uff0c\u5e94\u8be5\u8c28\u614e\u8003\u8651NULL\u503c\u7684\u5904\u7406\u65b9\u5f0f\uff0c\u5e76\u6839\u636e\u9700\u8981\u91c7\u53d6\u76f8\u5e94\u7684\u9884\u9632\u63aa\u65bd\u3002<\/p>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\" data-tool=\"markdown.com.cn\u7f16\u8f91\u5668\">\u6b64\u5916\uff0c\u5982\u679c\u786e\u5b9e\u9700\u8981\u5b58\u50a8NULL\u503c\uff0c\u5e76\u4e14\u4e0d\u5e0c\u671bMySQL\u5c06\u5176\u89c6\u4e3a0\uff0c\u53ef\u4ee5\u8003\u8651\u4f7f\u7528\u5176\u4ed6\u7279\u6b8a\u503c\uff08\u5982\u67d0\u4e2a\u4e0d\u53ef\u80fd\u5728\u5b9e\u9645\u4e1a\u52a1\u4e2d\u51fa\u73b0\u7684\u6807\u8bc6\u503c\uff09\u6765\u4ee3\u66ffNULL\uff0c\u6216\u8005\u5728\u8bbe\u8ba1\u5206\u533a\u7b56\u7565\u65f6\u660e\u786e\u8003\u8651NULL\u503c\u7684\u5904\u7406\u903b\u8f91\u3002\u8fd9\u6837\u53ef\u4ee5\u5728\u4fdd\u6301\u6570\u636e\u5b8c\u6574\u6027\u7684\u540c\u65f6\uff0c\u66f4\u597d\u5730\u6ee1\u8db3\u4e1a\u52a1\u9700\u6c42\u3002<\/p>\n<h4 style=\"margin-top: 30px; margin-bottom: 15px; font-weight: bold; font-size: 18px;\" data-tool=\"markdown.com.cn\u7f16\u8f91\u5668\">8.2 \u5206\u533a\u5217\u5fc5\u987b\u4e3b\u952e\u6216\u552f\u4e00\u952e\u7684\u4e00\u90e8\u5206<\/h4>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\" data-tool=\"markdown.com.cn\u7f16\u8f91\u5668\">\u5728MySQL\u4e2d\uff0c\u5f53\u8868\u5b58\u5728\u4e3b\u952e\uff08primary key\uff09\u6216\u552f\u4e00\u952e\uff08unique key\uff09\u65f6\uff0c\u5206\u533a\u7684\u5217\u5fc5\u987b\u662f\u8fd9\u4e9b\u952e\u7684\u4e00\u4e2a\u7ec4\u6210\u90e8\u5206\u7684\u539f\u56e0\u4e3b\u8981\u6d89\u53ca\u5230\u6570\u636e\u7684\u5b8c\u6574\u6027\u548c\u67e5\u8be2\u6027\u80fd\uff1a<\/p>\n<ol class=\"list-paddingleft-1\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px;\" data-tool=\"markdown.com.cn\u7f16\u8f91\u5668\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; text-align: left; color: #010101;\">\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: black;\"><strong>\u6570\u636e\u5b8c\u6574\u6027<\/strong>\uff1a<\/p>\n<\/section>\n<ul class=\"list-paddingleft-1\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px; color: black; list-style-type: disc;\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">\u4e3b\u952e\u548c\u552f\u4e00\u952e\u7528\u4e8e\u4fdd\u8bc1\u8868\u4e2d\u6570\u636e\u7684\u552f\u4e00\u6027\u3002\u5982\u679c\u5206\u533a\u5217\u4e0d\u662f\u8fd9\u4e9b\u952e\u7684\u4e00\u90e8\u5206\uff0c\u90a3\u4e48\u5728\u4e0d\u540c\u5206\u533a\u4e2d\u53ef\u80fd\u5b58\u5728\u5177\u6709\u76f8\u540c\u4e3b\u952e\u6216\u552f\u4e00\u952e\u503c\u7684\u6570\u636e\u884c\uff0c\u8fd9\u5c06\u7834\u574f\u6570\u636e\u7684\u552f\u4e00\u6027\u7ea6\u675f\u3002<\/section>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; text-align: left; color: #010101;\">\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: black;\"><strong>\u67e5\u8be2\u6027\u80fd<\/strong>\uff1a<\/p>\n<\/section>\n<ul class=\"list-paddingleft-1\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px; color: black; list-style-type: disc;\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">\u5206\u533a\u7684\u4e3b\u8981\u76ee\u7684\u662f\u4e3a\u4e86\u63d0\u9ad8\u67e5\u8be2\u6027\u80fd\uff0c\u7279\u522b\u662f\u9488\u5bf9\u5927\u6570\u636e\u91cf\u7684\u8868\u3002\u5982\u679c\u5206\u533a\u5217\u4e0d\u662f\u4e3b\u952e\u6216\u552f\u4e00\u952e\u7684\u4e00\u90e8\u5206\uff0c\u90a3\u4e48\u5728\u8fdb\u884c\u57fa\u4e8e\u4e3b\u952e\u6216\u552f\u4e00\u952e\u7684\u67e5\u8be2\u65f6\uff0cMySQL\u53ef\u80fd\u9700\u8981\u5728\u6240\u6709\u5206\u533a\u4e2d\u8fdb\u884c\u641c\u7d22\uff0c\u4ece\u800c\u964d\u4f4e\u4e86\u67e5\u8be2\u6027\u80fd\u3002<\/section>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; text-align: left; color: #010101;\">\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: black;\"><strong>\u6570\u636e\u4e00\u81f4\u6027<\/strong>\uff1a<\/p>\n<\/section>\n<ul class=\"list-paddingleft-1\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px; color: black; list-style-type: disc;\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">\u5f53\u8868\u88ab\u5206\u533a\u65f6\uff0c\u6bcf\u4e2a\u5206\u533a\u5b9e\u9645\u4e0a\u53ef\u4ee5\u770b\u4f5c\u662f\u4e00\u4e2a\u72ec\u7acb\u7684\u201c\u5b50\u8868\u201d\u3002\u5982\u679c\u5206\u533a\u5217\u4e0d\u662f\u4e3b\u952e\u6216\u552f\u4e00\u952e\u7684\u4e00\u90e8\u5206\uff0c\u90a3\u4e48\u5728\u6267\u884c\u66f4\u65b0\u6216\u5220\u9664\u64cd\u4f5c\u65f6\uff0cMySQL\u9700\u8981\u786e\u4fdd\u8de8\u6240\u6709\u5206\u533a\u7684\u6570\u636e\u4e00\u81f4\u6027\uff0c\u8fd9\u4f1a\u589e\u52a0\u64cd\u4f5c\u7684\u590d\u6742\u6027\u548c\u5f00\u9500\u3002<\/section>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; text-align: left; color: #010101;\">\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: black;\"><strong>\u5206\u533a\u7b56\u7565<\/strong>\uff1a<\/p>\n<\/section>\n<ul class=\"list-paddingleft-1\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px; color: black; list-style-type: disc;\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">MySQL\u7684\u5206\u533a\u7b56\u7565\u662f\u57fa\u4e8e\u5206\u533a\u5217\u7684\u503c\u6765\u5c06\u6570\u636e\u5206\u914d\u5230\u4e0d\u540c\u7684\u5206\u533a\u4e2d\u3002\u5982\u679c\u5206\u533a\u5217\u4e0d\u662f\u4e3b\u952e\u6216\u552f\u4e00\u952e\u7684\u4e00\u90e8\u5206\uff0c\u90a3\u4e48\u5206\u533a\u7b56\u7565\u53ef\u80fd\u4f1a\u53d8\u5f97\u590d\u6742\u4e14\u4f4e\u6548\uff0c\u56e0\u4e3a\u7cfb\u7edf\u9700\u8981\u989d\u5916\u5904\u7406\u4e3b\u952e\u6216\u552f\u4e00\u952e\u7684\u7ea6\u675f\u3002<\/section>\n<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<h4 style=\"margin-top: 30px; margin-bottom: 15px; font-weight: bold; font-size: 18px;\" data-tool=\"markdown.com.cn\u7f16\u8f91\u5668\">8.3 \u5206\u533a\u4e0e\u6027\u80fd\u8003\u91cf<\/h4>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\" data-tool=\"markdown.com.cn\u7f16\u8f91\u5668\">\u6280\u672f\u7684\u8fd0\u7528\u9700\u8981\u6070\u5230\u597d\u5904\u624d\u80fd\u53d1\u6325\u5176\u4f18\u52bf\u3002\u4ee5\u663e\u5f0f\u9501\u4e3a\u4f8b\uff0c\u867d\u7136\u529f\u80fd\u5f3a\u5927\uff0c\u4f46\u4f7f\u7528\u4e0d\u5f53\u53ef\u80fd\u5bfc\u81f4\u6027\u80fd\u4e0b\u964d\u6216\u5176\u4ed6\u4e0d\u826f\u540e\u679c\u3002\u540c\u6837\u5730\uff0c\u5206\u533a\u6280\u672f\u4e5f\u5e76\u975e\u4e07\u80fd\u7684\u6027\u80fd\u63d0\u5347\u5de5\u5177\u3002<\/p>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\" data-tool=\"markdown.com.cn\u7f16\u8f91\u5668\">\u5206\u533a\u786e\u5b9e\u53ef\u4ee5\u4e3a\u67d0\u4e9bSQL\u67e5\u8be2\u5e26\u6765\u6027\u80fd\u4e0a\u7684\u63d0\u5347\uff0c\u4f46\u5176\u4e3b\u8981\u4ef7\u503c\u5728\u4e8e\u63d0\u9ad8\u6570\u636e\u5e93\u7684\u9ad8\u53ef\u7528\u6027\u7ba1\u7406\u3002\u5728\u5e94\u7528\u5206\u533a\u6280\u672f\u65f6\uff0c\u6211\u4eec\u9700\u8981\u6839\u636e\u6570\u636e\u5e93\u7684\u4f7f\u7528\u573a\u666f\u6765\u8c28\u614e\u9009\u62e9\u3002<\/p>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\" data-tool=\"markdown.com.cn\u7f16\u8f91\u5668\">\u6570\u636e\u5e93\u5e94\u7528\u5927\u4f53\u4e0a\u53ef\u5206\u4e3aOLTP\uff08\u5728\u7ebf\u4e8b\u52a1\u5904\u7406\uff09\u548cOLAP\uff08\u5728\u7ebf\u5206\u6790\u5904\u7406\uff09\u4e24\u7c7b\u3002\u5bf9\u4e8eOLAP\u5e94\u7528\u6765\u8bf4\uff0c\u5206\u533a\u80fd\u591f\u663e\u8457\u63d0\u5347\u67e5\u8be2\u6027\u80fd\uff0c\u56e0\u4e3a\u5206\u6790\u7c7b\u67e5\u8be2\u5f80\u5f80\u9700\u8981\u5904\u7406\u5927\u91cf\u6570\u636e\u3002\u6309\u65f6\u95f4\u8fdb\u884c\u5206\u533a\uff0c\u4f8b\u5982\u6309\u6708\u5212\u5206\u7528\u6237\u884c\u4e3a\u6570\u636e\uff0c\u53ef\u4ee5\u4f7f\u5f97\u67e5\u8be2\u53ea\u9700\u626b\u63cf\u76f8\u5173\u5206\u533a\uff0c\u4ece\u800c\u63d0\u9ad8\u6548\u7387\u3002<\/p>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\" data-tool=\"markdown.com.cn\u7f16\u8f91\u5668\">\u7136\u800c\uff0c\u5728OLTP\u5e94\u7528\u4e2d\uff0c\u4f7f\u7528\u5206\u533a\u5219\u9700\u66f4\u4e3a\u8c28\u614e\u3002\u8fd9\u7c7b\u5e94\u7528\u901a\u5e38\u4e0d\u4f1a\u67e5\u8be2\u5927\u8868\u4e2d\u8d85\u8fc710%\u7684\u6570\u636e\uff0c\u800c\u662f\u901a\u8fc7\u7d22\u5f15\u5feb\u901f\u68c0\u7d22\u5c11\u91cf\u8bb0\u5f55\u3002\u4f8b\u5982\uff0c\u5bf9\u4e8e\u5305\u542b1000\u4e07\u6761\u8bb0\u5f55\u7684\u8868\uff0c\u5982\u679c\u67e5\u8be2\u4f7f\u7528\u4e86\u8f85\u52a9\u7d22\u5f15\u4f46\u672a\u6d89\u53ca\u5206\u533a\u952e\uff0c\u53ef\u80fd\u5bfc\u81f4\u6027\u80fd\u4e0b\u964d\u3002\u539f\u672c\u5728\u5355\u4e2aB+\u6811\u4e2d3\u6b21\u903b\u8f91IO\u5c31\u80fd\u5b8c\u6210\u7684\u64cd\u4f5c\uff0c\u572810\u4e2a\u5206\u533a\u7684\u60c5\u51b5\u4e0b\u53ef\u80fd\u9700\u8981(3+3)*10\u6b21\u903b\u8f91IO\uff08\u5206\u522b\u8bbf\u95ee\u805a\u96c6\u7d22\u5f15\u548c\u8f85\u52a9\u7d22\u5f15\uff09\u3002<\/p>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\" data-tool=\"markdown.com.cn\u7f16\u8f91\u5668\">\u56e0\u6b64\uff0c\u5728OLTP\u5e94\u7528\u4e2d\u91c7\u7528\u5206\u533a\u8868\u65f6\uff0c\u52a1\u5fc5\u8fdb\u884c\u5145\u5206\u7684\u6027\u80fd\u6d4b\u8bd5\u548c\u4f18\u5316\u3002<\/p>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\" data-tool=\"markdown.com.cn\u7f16\u8f91\u5668\">\u4e3a\u4e86\u4fbf\u4e8e\u5f00\u53d1\u8005\u89c2\u5bdfSQL\u67e5\u8be2\u5bf9\u5206\u533a\u7684\u5229\u7528\u60c5\u51b5\uff0c\u53ef\u4ee5\u4f7f\u7528<code style=\"font-size: 14px; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; background-color: rgba(27, 31, 35, 0.05); font-family: 'Operator Mono', Consolas, Monaco, Menlo, monospace; word-break: break-all; color: #ef7060;\">EXPLAIN PARTITIONS<\/code>\u8bed\u53e5\u4e0e<code style=\"font-size: 14px; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; background-color: rgba(27, 31, 35, 0.05); font-family: 'Operator Mono', Consolas, Monaco, Menlo, monospace; word-break: break-all; color: #ef7060;\">SELECT<\/code>\u67e5\u8be2\u7ed3\u5408\uff0c\u4ece\u800c\u6e05\u6670\u5730\u770b\u5230\u54ea\u4e9b\u5206\u533a\u88ab\u67e5\u8be2\u6d89\u53ca\u3002<\/p>\n<\/section>\n<hr style=\"border-style: solid; border-width: 1px 0 0; border-color: rgba(0,0,0,0.1); -webkit-transform-origin: 0 0; -webkit-transform: scale(1, 0.5); transform-origin: 0 0; transform: scale(1, 0.5);\" \/>\n<p style=\"margin-bottom: 0px;\">\n<p style=\"margin-bottom: 0px;\"><span style=\"color: #ffa900;\"><strong><span style=\"color: #ffa900; font-size: 15px;\">\u6700\u540e\u5171\u4eab\u4e00\u4e9b\u8d44\u6599\uff0c\u300a<strong style=\"color: #ffa900; letter-spacing: 0.578px; text-wrap: wrap;\"><span style=\"font-size: 15px;\">\u516c\u4f17\u53f7\u83dc\u5355\u680f<\/span><\/strong>\u300b\u53ef\u9886\u53d6<\/span><\/strong><\/span><\/p>\n<p style=\"margin-bottom: 0px;\">\n<p style=\"text-align: center; margin-bottom: 0px;\"><img decoding=\"async\" class=\"rich_pages wxw-img js_insertlocalimg lazyload\" style=\"height: auto !important;\" data-src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801213944914.png\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@2.6\/load_svg\/inload.svg\" onerror=\"imgError(this)\" data-imgfileid=\"100000681\" data-ratio=\"0.5425925925925926\" data-s=\"300,640\" data-type=\"png\" data-w=\"1080\" \/><noscript><img decoding=\"async\" class=\"rich_pages wxw-img js_insertlocalimg\" style=\"height: auto !important;\" src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801213944914.png\" data-imgfileid=\"100000681\" data-ratio=\"0.5425925925925926\" data-s=\"300,640\" data-type=\"png\" data-w=\"1080\" \/><\/noscript><\/p>\n<p style=\"margin-bottom: 0px;\">\n<hr style=\"border-style: solid; border-width: 1px 0 0; border-color: rgba(0,0,0,0.1); -webkit-transform-origin: 0 0; -webkit-transform: scale(1, 0.5); transform-origin: 0 0; transform: scale(1, 0.5);\" \/>\n<p style=\"margin-bottom: 0px;\">\n<section style=\"letter-spacing: 0.578px; text-wrap: wrap; text-align: center; margin-bottom: 0px;\"><span style=\"white-space: pre-wrap;\">\u672f\u56e0\u5206\u4eab\u800c\u65e5\u65b0\uff0c\u6bcf\u83b7\u65b0\u77e5\uff0c\u559c\u6ea2\u5fc3\u6249\u3002<\/span><\/section>\n<section style=\"letter-spacing: 0.578px; text-wrap: wrap; text-align: center; margin-bottom: 0px;\"><\/section>\n<section style=\"letter-spacing: 0.578px; text-wrap: wrap; text-align: center; margin-bottom: 0px;\">\u5173\u6ce8\u300e<strong><span style=\"color: #ffa900;\">\u7801\u5230\u4e09\u5341\u4e94<\/span><\/strong>\u300f\uff0c\u65e5\u6709\u6240\u83b7<\/section>\n<section style=\"letter-spacing: 0.578px; text-wrap: wrap; text-align: center; margin-bottom: 0px;\"><\/section>\n<section class=\"mp_profile_iframe_wrp\"><\/section>\n<p style=\"margin-bottom: 0px;\">\n<p style=\"text-align: right; margin-bottom: 0px;\"><span style=\"letter-spacing: 0.578px; text-align: right; text-wrap: wrap; font-size: 14px; color: #ffa900;\">\u70b9\u8d5e<\/span><span style=\"letter-spacing: 0.578px; text-align: right; text-wrap: wrap; font-size: 14px; color: #888888;\">\u548c<\/span><span style=\"letter-spacing: 0.578px; text-align: right; text-wrap: wrap; font-size: 14px; color: #ffa900;\">\u5728\u770b<\/span><span style=\"letter-spacing: 0.578px; text-align: right; text-wrap: wrap; font-size: 14px; color: #888888;\">\u5c31\u662f\u6700\u5927\u7684\u652f\u6301<img decoding=\"async\" class=\"lazyload\"style=\"display: inline-block; width: 20px; vertical-align: middle; background-size: cover; height: auto !important;\" data-src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801213950720.png\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@2.6\/load_svg\/inload.svg\" onerror=\"imgError(this)\" data-ratio=\"1\" data-w=\"128\" \/><noscript><img decoding=\"async\" style=\"display: inline-block; width: 20px; vertical-align: middle; background-size: cover; height: auto !important;\" src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801213950720.png\" data-ratio=\"1\" data-w=\"128\" \/><\/noscript><\/span><\/p>\n<p style=\"display: none;\">\n<blockquote><p>\u672c\u7bc7\u6587\u7ae0\u6765\u6e90\u4e8e\u5fae\u4fe1\u516c\u4f17\u53f7: \u7801\u5230\u4e09\u5341\u4e94<\/p><\/blockquote>\n<\/div>\n","raw":"","protected":false},"excerpt":{"rendered":"<p>MySQL\u5206\u533a\u662f\u4e00\u79cd\u6570\u636e\u5e93\u4f18\u5316\u7684\u6280\u672f\uff0c\u5b83\u5141\u8bb8\u5c06\u4e00\u4e2a\u5927\u7684\u8868\u6216\u4e00\u4e2a\u7d22\u5f15\u5206\u5272\u6210\u591a\u4e2a\u8f83\u5c0f\u7684\u3001\u66f4\u6613\u4e8e\u7ba1\u7406\u7684\u7247\u6bb5\uff0c\u79f0\u4e3a\u5206\u533a\u3002\u8fd9\u79cd\u6280\u672f\u53ef\u4ee5\u663e\u8457\u63d0 &#8230;<\/p>\n","protected":false},"author":1,"featured_media":4826,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"emotion":"","emotion_color":"","title_style":"","license":"","footnotes":""},"categories":[7],"tags":[],"class_list":["post-4837","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-spring-boot"],"post_thumbnail_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801213922553-150x150.jpeg","content_first_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801213935332.jpeg","post_medium_image_300":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801213922553-300x128.jpeg","post_thumbnail_image_624":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801213922553-1024x436.jpeg","post_frist_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801213935332.jpeg","post_medium_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801213922553-300x128.jpeg","post_large_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801213922553-1024x436.jpeg","post_full_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801213922553.jpeg","post_all_images":[{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801213935332.jpeg","id":"image0"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801213935332.jpeg","id":"image1"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801213939381.jpeg","id":"image2"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801213939381.jpeg","id":"image3"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801213942532.jpeg","id":"image4"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801213942532.jpeg","id":"image5"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801213944914.png","id":"image6"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801213944914.png","id":"image7"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801213950720.png","id":"image8"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801213950720.png","id":"image9"}],"videoAdId":"","listAd":"0","listAdId":"","listAdEvery":6,"total_comments":0,"category_name":"Spring Boot","post_date":"2024-08-01","like_count":"0","praiseWord":"\u9f13\u52b1","copyright_state":"","excitationAd":"0","rewardedVideoAdId":"","detailAdId":"","detailAd":"0","enterpriseMinapp":"0","audios":[],"postImageUrl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230519082947553.jpg","avatarurls":[],"related_posts":null,"pageviews":353,"next_post_id":5507,"next_post_title":"Spring Boot\uff1a\u5c06\u6587\u4ef6\u63a8\u9001\u5230 FTP \u670d\u52a1\u5668","previous_post_id":5158,"previous_post_title":"SpringBoot\u4e2d\u8fd95\u79cd\u9ad8\u5927\u4e0a\u7684yml\u6587\u4ef6\u8bfb\u53d6\u65b9\u5f0f\uff0c\u4f60\u77e5\u9053\u5417\uff1f","_links":{"self":[{"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/posts\/4837","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/comments?post=4837"}],"version-history":[{"count":2,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/posts\/4837\/revisions"}],"predecessor-version":[{"id":6431,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/posts\/4837\/revisions\/6431"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/media\/4826"}],"wp:attachment":[{"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/media?parent=4837"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/categories?post=4837"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/tags?post=4837"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}