{"id":10007096,"date":"2023-01-18T14:18:59","date_gmt":"2023-01-18T06:18:59","guid":{"rendered":"https:\/\/ityet.com\/?p=10007096"},"modified":"2023-01-18T14:18:59","modified_gmt":"2023-01-18T06:18:59","slug":"mysql%e6%80%a7%e8%83%bd%e4%bc%98%e5%8c%96%e6%b5%85%e6%9e%90%e5%8f%8a%e7%ba%bf%e4%b8%8a%e6%a1%88%e4%be%8b","status":"publish","type":"post","link":"https:\/\/itmax.cn\/?p=10007096","title":{"rendered":"MySQL\u6027\u80fd\u4f18\u5316\u6d45\u6790\u53ca\u7ebf\u4e0a\u6848\u4f8b"},"content":{"rendered":"<h3>\u4f5c\u8005\uff1a\u4eac\u4e1c\u5065\u5eb7 \u5b5f\u98de<\/h3>\n<h3><strong>1\u3001 \u6570\u636e\u5e93\u6027\u80fd\u4f18\u5316\u7684\u610f\u4e49<\/strong><\/h3>\n<p>\u4e1a\u52a1\u53d1\u5c55\u521d\u671f\uff0c\u6570\u636e\u5e93\u4e2d\u91cf\u4e00\u822c\u90fd\u4e0d\u9ad8\uff0c\u4e5f\u4e0d\u592a\u5bb9\u6613\u51fa\u4e00\u4e9b\u6027\u80fd\u95ee\u9898\u6216\u8005\u51fa\u7684\u95ee\u9898\u4e5f\u4e0d\u5927\uff0c\u4f46\u662f\u5f53\u6570\u636e\u5e93\u7684\u91cf\u7ea7\u8fbe\u5230\u4e00\u5b9a\u89c4\u6a21\u4e4b\u540e\uff0c\u5982\u679c\u7f3a\u5931\u6709\u6548\u7684\u9884\u8b66\u3001\u76d1\u63a7\u3001\u5904\u7406\u7b49\u624b\u6bb5\u5219\u4f1a\u5bf9\u7528\u6237\u7684\u4f7f\u7528\u4f53\u9a8c\u9020\u6210\u5f71\u54cd\uff0c\u4e25\u91cd\u7684\u5219\u4f1a\u76f4\u63a5\u5bfc\u81f4\u8ba2\u5355\u3001\u91d1\u989d\u76f4\u63a5\u53d7\u635f\uff0c\u56e0\u800c\u5c31\u9700\u8981\u65f6\u523b\u5173\u6ce8\u6570\u636e\u5e93\u7684\u6027\u80fd\u95ee\u9898\u3002<\/p>\n<h3><strong>2\u3001 \u6027\u80fd\u4f18\u5316\u7684\u51e0\u4e2a\u5e38\u89c1\u63aa\u65bd<\/strong><\/h3>\n<p>\u6570\u636e\u5e93\u6027\u80fd\u4f18\u5316\u7684\u5e38\u89c1\u624b\u6bb5\u6709\u5f88\u591a\uff0c\u6bd4\u5982\u6dfb\u52a0\u7d22\u5f15\u3001\u5206\u5e93\u5206\u8868\u3001\u4f18\u5316\u8fde\u63a5\u6c60\u7b49\uff0c\u5177\u4f53\u5982\u4e0b\uff1a<\/p>\n<table>\n<thead>\n<tr>\n<th><strong>\u5e8f\u53f7<\/strong><\/th>\n<th><strong>\u7c7b\u578b<\/strong><\/th>\n<th><strong>\u63aa\u65bd<\/strong><\/th>\n<th><strong>\u8bf4\u660e<\/strong><\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>1<\/td>\n<td>\u7269\u7406\u7ea7\u522b<\/td>\n<td>\u63d0\u5347\u786c\u4ef6\u6027\u80fd<\/td>\n<td>\u5c06\u6570\u636e\u5e93\u5b89\u88c5\u5230\u66f4\u9ad8\u914d\u7f6e\u7684\u670d\u52a1\u5668\u4e0a\u4f1a\u6709\u7acb\u7aff\u89c1\u5f71\u7684\u6548\u679c\uff0c\u4f8b\u5982\u63d0\u9ad8CPU\u914d\u7f6e\u3001\u589e\u52a0\u5185\u5b58\u5bb9\u91cf\u3001\u91c7\u7528\u56fa\u6001\u786c\u76d8\u7b49\u624b\u6bb5\uff0c\u5728\u7ecf\u8d39\u5141\u8bb8\u7684\u8303\u56f4\u53ef\u4ee5\u5c1d\u8bd5\u3002<\/td>\n<\/tr>\n<tr>\n<td>2<\/td>\n<td>\u5e94\u7528\u7ea7\u522b<\/td>\n<td>\u8fde\u63a5\u6c60\u53c2\u6570\u4f18\u5316<\/td>\n<td>\u6211\u4eec\u5927\u90e8\u5206\u7684\u5e94\u7528\u90fd\u662f\u4f7f\u7528\u8fde\u63a5\u6c60\u6765\u6258\u7ba1\u6570\u636e\u5e93\u7684\u8fde\u63a5\uff0c\u4f46\u662f\u5927\u90e8\u5206\u90fd\u662f\u9ed8\u8ba4\u7684\u914d\u7f6e\uff0c\u56e0\u800c\u914d\u7f6e\u597d\u8d85\u65f6\u65f6\u957f\u3001\u8fde\u63a5\u6c60\u5bb9\u91cf\u7b49\u53c2\u6570\u5c31\u663e\u5f97\u5c24\u4e3a\u91cd\u8981\u3002 1\u3001 \u5982\u679c\u94fe\u63a5\u957f\u65f6\u95f4\u88ab\u5360\u7528\uff0c\u65b0\u7684\u8bf7\u6c42\u65e0\u6cd5\u83b7\u53d6\u5230\u65b0\u7684\u8fde\u63a5\uff0c\u5c31\u4f1a\u5f71\u54cd\u5230\u4e1a\u52a1\u3002 2\u3001 \u5982\u679c\u8fde\u63a5\u6570\u8bbe\u7f6e\u7684\u8fc7\u5c0f\uff0c\u90a3\u4e48\u5373\u4f7f\u786c\u4ef6\u8d44\u6e90\u6ca1\u95ee\u9898\uff0c\u4e5f\u65e0\u6cd5\u53d1\u6325\u5176\u529f\u6548\u3002\u4e4b\u524d\u516c\u53f8\u505a\u8fc7\u4e00\u4e9b\u538b\u6d4b\uff0c\u4f46\u5c31\u662f\u6b7b\u6d3b\u4e0d\u8fbe\u6807\uff0c\u6700\u540e\u53d1\u73b0\u662f\u7531\u4e8e\u8fde\u63a5\u6570\u592a\u5c0f\u3002<\/td>\n<\/tr>\n<tr>\n<td>3<\/td>\n<td>\u5355\u8868\u7ea7\u522b<\/td>\n<td>\u5408\u7406\u8fd0\u7528\u7d22\u5f15<\/td>\n<td>\u5982\u679c\u6570\u636e\u91cf\u8f83\u5927\uff0c\u4f46\u662f\u53c8\u6ca1\u6709\u5408\u9002\u7684\u7d22\u5f15\uff0c\u5c31\u4f1a\u62d6\u57ae\u6574\u4e2a\u6027\u80fd\uff0c\u4f46\u662f\u7d22\u5f15\u662f\u628a\u53cc\u5203\u5251\uff0c\u5e76\u4e0d\u662f\u8bf4\u7d22\u5f15\u8d8a\u591a\u8d8a\u597d\uff0c\u800c\u662f\u8981\u6839\u636e\u4e1a\u52a1\u7684\u9700\u8981\u8fdb\u884c\u9002\u5f53\u7684\u6dfb\u52a0\u548c\u4f7f\u7528\u3002 \u7f3a\u5931\u7d22\u5f15\u3001\u91cd\u590d\u7d22\u5f15\u3001\u5197\u4f59\u7d22\u5f15\u3001\u5931\u63a7\u7d22\u5f15\u8fd9\u51e0\u7c7b\u60c5\u51b5\u5176\u5b9e\u90fd\u662f\u5bf9\u7cfb\u7edf\u5f88\u5927\u7684\u5371\u5bb3\u3002<\/td>\n<\/tr>\n<tr>\n<td>4<\/td>\n<td>\u5e93\u8868\u7ea7\u522b<\/td>\n<td>\u5206\u5e93\u5206\u8868<\/td>\n<td>\u5f53\u6570\u636e\u91cf\u8f83\u5927\u7684\u65f6\u5019\uff0c\u53ea\u4f7f\u7528\u7d22\u5f15\u5c31\u610f\u4e49\u4e0d\u5927\u4e86\uff0c\u9700\u8981\u505a\u597d\u5206\u5e93\u5206\u8868\u7684\u64cd\u4f5c\uff0c\u5408\u7406\u7684\u5229\u7528\u597d\u5206\u533a\u952e\uff0c\u4f8b\u5982\u6309\u7167\u7528\u6237ID\u3001\u8ba2\u5355ID\u3001\u65e5\u671f\u7b49\u7ef4\u5ea6\u8fdb\u884c\u5206\u533a\uff0c\u53ef\u4ee5\u51cf\u5c11\u626b\u63cf\u8303\u56f4\u3002<\/td>\n<\/tr>\n<tr>\n<td>5<\/td>\n<td>\u76d1\u63a7\u7ea7\u522b<\/td>\n<td>\u52a0\u5f3a\u8fd0\u7ef4<\/td>\n<td>\u9488\u5bf9\u7ebf\u4e0a\u7684\u4e00\u4e9b\u7cfb\u7edf\u8fd8\u9700\u8981\u8fdb\u4e00\u6b65\u7684\u52a0\u5f3a\u76d1\u63a7\uff0c\u6bd4\u5982\u8ba2\u9605\u4e00\u4e9b\u6162SQL\u65e5\u5fd7\uff0c\u627e\u5230\u6bd4\u8f83\u7cdf\u7cd5\u7684\u4e00\u4e9bSQL\uff0c\u4e5f\u53ef\u4ee5\u5229\u7528\u4e1a\u52a1\u5185\u4e00\u4e9b\u901a\u7528\u7684\u5de5\u5177\uff0c\u4f8b\u5982druid\u7ec4\u4ef6\u7b49\u3002<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3><strong>3\u3001 MySQL\u5e95\u5c42\u67b6\u6784<\/strong><\/h3>\n<p>\u9996\u5148\u4e86\u89e3\u4e00\u4e0b\u6570\u636e\u7684\u5e95\u5c42\u67b6\u6784\uff0c\u4e5f\u6709\u52a9\u4e8e\u6211\u4eec\u505a\u66f4\u597d\u4f18\u5316\u3002<\/p>\n<p><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000043345389\" alt=\"\" title=\"\" loading=\"lazy\"><\/p>\n<p><strong>\u4e00\u6b21\u67e5\u8be2\u8bf7\u6c42\u7684\u6267\u884c\u8fc7\u7a0b<\/strong><\/p>\n<p>\u6211\u4eec\u91cd\u70b9\u5173\u6ce8\u7b2c\u4e8c\u90e8\u5206\u548c\u7b2c\u4e09\u90e8\u5206\uff0c\u7b2c\u4e8c\u90e8\u5206\u5176\u5b9e\u5c31\u662fServer\u5c42\uff0c\u8fd9\u5c42\u4e3b\u8981\u5c31\u662f\u8d1f\u8d23\u67e5\u8be2\u4f18\u5316\uff0c\u5236\u5b9a\u51fa\u4e00\u4e9b\u6267\u884c\u8ba1\u5212\uff0c\u7136\u540e\u8c03\u7528\u5b58\u50a8\u5f15\u64ce\u7ed9\u6211\u4eec\u63d0\u4f9b\u7684\u5404\u79cd\u5e95\u5c42\u57fa\u7840API\uff0c\u6700\u7ec8\u5c06\u6570\u636e\u8fd4\u56de\u7ed9\u5ba2\u6237\u7aef\u3002<\/p>\n<h3><strong>4\u3001MySQL\u7d22\u5f15\u6784\u5efa\u8fc7\u7a0b<\/strong><\/h3>\n<p>\u76ee\u524d\u6bd4\u8f83\u5e38\u7528\u7684\u662fInnoDB\u5b58\u50a8\u5f15\u64ce\uff0c\u672c\u6587\u8ba8\u8bba\u4e5f\u662f\u57fa\u4e8eInnoDB\u5f15\u64ce\u3002\u6211\u4eec\u4e00\u76f4\u8bf4\u7684\u52a0\u7d22\u5f15\uff0c\u90a3\u5230\u5e95\u4ec0\u4e48\u662f\u7d22\u5f15\u3001\u7d22\u5f15\u53c8\u662f\u5982\u4f55\u5f62\u6210\u7684\u5462\u3001\u7d22\u5f15\u53c8\u5982\u4f55\u5e94\u7528\u5462\uff1f\u8fd9\u4e2a\u8bdd\u9898\u5176\u5b9e\u5f88\u5927\u4e5f\u5f88\u5c0f\uff0c\u8bf4\u5927\u662f\u56e0\u4e3a\u4ed6\u5e95\u5c42\u786e\u5b9e\u5f88\u590d\u6742\uff0c\u8bf4\u5c0f\u662f\u56e0\u4e3a\u5728\u5927\u90e8\u5206\u573a\u666f\u4e0b\u7a0b\u5e8f\u5458\u53ea\u9700\u8981\u6dfb\u52a0\u7d22\u5f15\u5c31\u597d\uff0c\u4e0d\u592a\u9700\u8981\u4e86\u89e3\u592a\u5e95\u5c42\u539f\u7406\uff0c\u4f46\u662f\u5982\u679c\u4e86\u89e3\u4e0d\u900f\u5f7b\u5c31\u4f1a\u5f15\u53d1\u7ebf\u4e0a\u95ee\u9898\uff0c\u56e0\u800c\u672c\u6587\u5e73\u8861\u4e86\u5927\u5bb6\u7684\u7406\u89e3\u6210\u672c\u548c\u77e5\u8bc6\u6df1\u5ea6\uff0c\u6709\u4e00\u5b9a\u5e95\u5c42\u539f\u7406\u4ecb\u7ecd\uff0c\u4f46\u662f\u53c8\u4e0d\u4f1a\u592a\u8fc7\u6df1\u5165\u5bfc\u81f4\u96be\u4ee5\u7406\u89e3\u3002<\/p>\n<p>\u9996\u5148\u6765\u505a\u4e2a\u5b9e\u9a8c\uff1a<\/p>\n<p>\u521b\u5efa\u4e00\u4e2a\u8868\uff0c\u76ee\u524d\u662f\u53ea\u6709\u4e00\u4e2a\u4e3b\u952e\u7d22\u5f15<\/p>\n<p>CREATE TABLE <code>t1<\/code>(<\/p>\n<p>a int NOT NULL,<\/p>\n<p>b int DEFAULT NULL,<\/p>\n<p>c int DEFAULT NULL,<\/p>\n<p>d int DEFAULT NULL,<\/p>\n<p>e varchar(20) DEFAULT NULL,<\/p>\n<p>PRIMARYKEY(a)<\/p>\n<p>)ENGINE=InnoDB<\/p>\n<p>\u63d2\u5165\u4e00\u4e9b\u6570\u636e\uff1a<\/p>\n<p>insert into test.t1 values(4,3,1,1,&#8217;d&#8217;);<\/p>\n<p>insert into test.t1 values(1,1,1,1,&#8217;a&#8217;);<\/p>\n<p>insert into test.t1 values(8,8,8,8,&#8217;h&#8217;);<\/p>\n<p>insert into test.t1 values(2,2,2,2,&#8217;b&#8217;);<\/p>\n<p>insert into test.t1 values(5,2,3,5,&#8217;e&#8217;);<\/p>\n<p>insert into test.t1 values(3,3,2,2,&#8217;c&#8217;);<\/p>\n<p>insert into test.t1 values(7,4,5,5,&#8217;g&#8217;);<\/p>\n<p>insert into test.t1 values(6,6,4,4,&#8217;f&#8217;);<\/p>\n<p>MYSQL\u4ece\u78c1\u76d8\u8bfb\u53d6\u6570\u636e\u5230\u5185\u5b58\u662f\u6309\u7167\u4e00\u9875\u8bfb\u53d6\u7684\uff0c\u4e00\u9875\u9ed8\u8ba4\u662f16K\uff0c\u800c\u4e00\u9875\u7684\u683c\u5f0f\u5927\u6982\u5982\u4e0b\u3002<\/p>\n<p><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000043345390\" alt=\"\" title=\"\" loading=\"lazy\"><\/p>\n<p>\u6bcf\u4e00\u9875\u90fd\u5305\u62ec\u4e86\u8fd9\u4e48\u51e0\u4e2a\u5185\u5bb9\uff0c\u9996\u5148\u662f\u9875\u5934\u3001\u5176\u6b21\u662f\u9875\u76ee\u5f55\u3001\u8fd8\u6709\u7528\u6237\u6570\u636e\u533a\u57df\u3002<\/p>\n<p>1\uff09\u521a\u624d\u63d2\u5165\u7684\u51e0\u6761\u6570\u636e\u5c31\u662f\u653e\u5230\u8fd9\u4e2a\u7528\u6237\u6570\u636e\u533a\u57df\u7684\uff0c\u8fd9\u4e2a\u662f\u6309\u7167\u4e3b\u952e\u4f9d\u6b21\u9012\u589e\u7684\u5355\u5411\u94fe\u8868\u3002<\/p>\n<p>2\uff09\u9875\u76ee\u5f55\u8fd9\u4e2a\u662f\u7528\u6765\u6307\u5411\u5177\u4f53\u7684\u7528\u6237\u6570\u636e\u533a\u57df\uff0c\u56e0\u4e3a\u5f53\u7528\u6237\u6570\u636e\u533a\u57df\u7684\u6570\u636e\u53d8\u591a\u7684\u65f6\u5019\u4e5f\u5c31\u4f1a\u5f62\u6210\u5206\u7ec4\uff0c\u800c\u9875\u76ee\u5f55\u5c31\u4f1a\u6307\u5411\u4e0d\u540c\u7684\u5206\u7ec4\uff0c\u5229\u7528\u4e8c\u5206\u67e5\u627e\u53ef\u4ee5\u5feb\u901f\u7684\u5b9a\u4f4d\u6570\u636e\u3002<\/p>\n<p><strong>\u5f53\u6570\u636e\u91cf\u53d8\u591a\u7684\u65f6\u5019\uff0c\u90a3\u4e48\u8fd9\u4e00\u9875\u5c31\u88c5\u4e0d\u4e0b\u8fd9\u4e48\u591a\u6570\u636e\uff0c\u5c31\u8981\u5206\u88c2\u9875\uff0c\u800c\u6bcf\u9875\u4e4b\u95f4\u90fd\u4f1a\u53cc\u5411\u94fe\u63a5\uff0c\u6700\u7ec8\u5f62\u6210\u4e00\u4e2a\u53cc\u5411\u94fe\u8868\u3002<\/strong><\/p>\n<p>\u9875\u5185\u7684\u5355\u5411\u94fe\u8868\u662f\u4e3a\u4e86\u67e5\u627e\u5feb\u6377\uff0c\u800c\u9875\u95f4\u7684\u53cc\u5411\u94fe\u8868\u662f\u4e3a\u4e86\u5728\u505a\u8303\u56f4\u67e5\u8be2\u7684\u65f6\u5019\u63d0\u6548\uff0c\u4e0b\u56fe\u4e3a\u793a\u610f\u56fe\uff0c\u5176\u4e2d\u5176\u4e8c\u9875\u548c\u7b2c\u4e09\u9875\u662f\u590d\u5236\u7684\u7b2c\u4e00\u9875\uff0c\u5e76\u4e0d\u771f\u5b9e\u3002<\/p>\n<p><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000043345391\" alt=\"\" title=\"\" loading=\"lazy\"><\/p>\n<p>\u800c\u5982\u679c\u6570\u636e\u8fd8\u7ee7\u7eed\u7d2f\u52a0\uff0c\u5149\u8fd9\u51e0\u4e2a\u9875\u4e5f\u4e0d\u591f\u4e86\uff0c\u90a3\u5c31\u9010\u6b65\u7684\u5f62\u6210\u4e86\u4e00\u68f5\u6811\uff0c\u4e5f\u5c31\u662f\u8bf4\u7d22\u5f15B-Tree\u662f\u968f\u7740\u6570\u636e\u7684\u79ef\u7d2f\u9010\u6b65\u6784\u5efa\u51fa\u6765\u7684\u3002<\/p>\n<p><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000043345392\" alt=\"\" title=\"\" loading=\"lazy\"><\/p>\n<p>\u6700\u4e0b\u8fb9\u7684\u4e00\u5c42\u53eb\u505a\u53f6\u5b50\u8282\u70b9\uff0c\u4e0a\u8fb9\u7684\u53eb\u505a\u5185\u8282\u70b9\uff0c\u800c\u53f6\u5b50\u8282\u70b9\u4e2d\u5b58\u50a8\u7684\u662f\u5168\u91cf\u6570\u636e\uff0c\u8fd9\u6837\u7684\u6811\u5c31\u662f<strong>\u805a\u7c07\u7d22\u5f15<\/strong>\u3002\u4e00\u76f4\u6709\u540c\u5b66\u7684\u7406\u89e3\u662f\u8bf4\u7d22\u5f15\u662f\u5355\u72ec\u4e00\u4efd\u800c\u6570\u636e\u662f\u4e00\u4efd\uff0c\u5176\u5b9eMySQL\u4e2d\u6709\u4e00\u4e2a\u539f\u5219\u5c31\u662f<strong>\u6570\u636e\u5373\u7d22\u5f15\u3001\u7d22\u5f15\u5373\u6570\u636e<\/strong>\uff0c\u771f\u5b9e\u7684\u6570\u636e\u672c\u8eab\u5c31\u662f\u5b58\u50a8\u5728\u805a\u7c07\u7d22\u5f15\u4e2d\u7684\uff0c\u6240\u8c13\u7684<strong>\u56de\u8868\u5c31\u662f\u56de\u7684\u805a\u7c07\u7d22\u5f15<\/strong>\u3002<\/p>\n<p>\u4f46\u662f\u6211\u4eec\u4e5f\u4e0d\u4e00\u5b9a\u6bcf\u6b21\u90fd\u6309\u7167\u4e3b\u952e\u6765\u6267\u884cSQL\u8bed\u53e5\uff0c\u5927\u90e8\u5206\u60c5\u51b5\u4e0b\u90fd\u662f\u6309\u7167\u4e00\u4e9b\u4e1a\u52a1\u5b57\u6bb5\u6765\uff0c\u90a3\u5c31\u4f1a\u5f62\u6210\u522b\u7684\u7d22\u5f15\u6811\uff0c\u4f8b\u5982\uff0c\u5982\u679c\u6309\u7167b,c,d\u6765\u521b\u5efa\u7684\u7d22\u5f15\u5c31\u4f1a\u957f\u8fd9\u6837\u3002<\/p>\n<p><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000043345393\" alt=\"\" title=\"\" loading=\"lazy\"><\/p>\n<p>\u63a8\u83501\u4e2a\u7f51\u7ad9\uff0c\u53ef\u4ee5\u53ef\u89c6\u5316\u7684\u67e5\u770b\u4e00\u4e9b\u7b97\u6cd5\u539f\u578b\uff1a<\/p>\n<p>\u76ee\u5f55\uff1a<\/p>\n<p><a href=\"https:\/\/link.segmentfault.com\/?enc=mPEFOIN65NlZeMNKvC41zg%3D%3D.d2IX5GjNC0S1XNi1aO1WEgcLKu840JaR0eYGiqNNfKzepx2IMc9WADNMPITm7giNLg4TMIwGrHnGYmHhStvE4w%3D%3D\" rel=\"nofollow\">https:\/\/www.cs.usfca.edu\/~gal&#8230;<\/a><\/p>\n<p>B+\u6811<\/p>\n<p><a href=\"https:\/\/link.segmentfault.com\/?enc=hQOTAncAtBZjVu0Dn8xGwQ%3D%3D.Fy%2Bj3VOjjWZvg3zl7UjndPfmlKXdtMYKgX2WXZKp8Urnb5ZfcOU1UFxMeDTStmN0QIbUaoDA97R8K3nfoyI%2BcA%3D%3D\" rel=\"nofollow\">https:\/\/www.cs.usfca.edu\/~gal&#8230;<\/a><\/p>\n<p>\u800c\u5728MySQL\u5b98\u7f51\u4e0a\u4ecb\u7ecd\u7684\u7d22\u5f15\u7684\u53f6\u5b50\u8282\u70b9\u662f\u53cc\u5411\u94fe\u8868\u3002<\/p>\n<p><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000043345394\" alt=\"\" title=\"\" loading=\"lazy\"><\/p>\n<p><strong>\u5173\u4e8e\u7d22\u5f15\u7ed3\u6784\u7684\u5c0f\u7ed3\uff1a<\/strong><\/p>\n<p>\u5bf9\u4e8eB-Tree\u800c\u8a00\uff0c\u53f6\u5b50\u8282\u70b9\u662f\u6ca1\u6709\u94fe\u63a5\u7684\uff0c\u800cB+Tree\u7d22\u5f15\u662f\u5355\u5411\u94fe\u8868\uff0c\u4f46\u662fMySQL\u5728B+Tree\u7684\u57fa\u7840\u4e4b\u4e0a\u52a0\u4ee5\u6539\u8fdb\uff0c\u5f62\u6210\u4e86\u53cc\u5411\u94fe\u8868\uff0c\u53cc\u5411\u7684\u597d\u5904\u662f\u5728\u5904\u7406&gt; &lt;\uff0cbetween and\u7b49&#8217;\u8303\u56f4\u67e5\u8be2&#8217;\u8bed\u6cd5\u65f6\u53ef\u4ee5\u5f97\u5fc3\u5e94\u624b\u3002<\/p>\n<h3><strong>5\u3001MySQL\u7d22\u5f15\u7684\u4e00\u4e9b\u4f7f\u7528\u89c4\u8303<\/strong><\/h3>\n<p>1\u3001 \u53ea\u4e3a\u7528\u4e8e\u641c\u7d22\u3001\u6392\u5e8f\u6216\u5206\u7ec4\u7684\u5217\u521b\u5efa\u7d22\u5f15\u3002<\/p>\n<p>\u91cd\u70b9\u5173\u6ce8where\u8bed\u53e5\u540e\u8fb9\u7684\u60c5\u51b5<\/p>\n<p>2\u3001 \u5f53\u5217\u4e2d\u4e0d\u91cd\u590d\u503c\u7684\u4e2a\u6570\u5728\u603b\u8bb0\u5f55\u6761\u6570\u4e2d\u7684\u5360\u6bd4\u5f88\u5927\u65f6\uff0c\u624d\u4e3a\u5217\u5efa\u7acb\u7d22\u5f15\u3002<\/p>\n<p>\u4f8b\u5982\u624b\u673a\u53f7\u3001\u7528\u6237ID\u3001\u73ed\u7ea7\u7b49\uff0c\u4f46\u662f\u6bd4\u5982\u4e00\u5f20\u5168\u6821\u5b66\u751f\u8868\uff0c\u6bcf\u6761\u8bb0\u5f55\u662f\u4e00\u540d\u5b66\u751f\uff0cwhere\u8bed\u53e5\u662f\u67e5\u8be2\u6240\u6709\u2019\u67d0\u5b66\u6821\u2018\u7684\u5b66\u751f\uff0c\u90a3\u4e48\u5176\u5b9e\u4e5f\u4e0d\u4f1a\u63d0\u9ad8\u6027\u80fd\u3002<\/p>\n<p>3\u3001 \u7d22\u5f15\u5217\u7684\u7c7b\u578b\u5c3d\u91cf\u5c0f\u3002<\/p>\n<p>\u65e0\u8bba\u662f\u4e3b\u952e\u8fd8\u662f\u7d22\u5f15\u5217\u90fd\u5c3d\u91cf\u9009\u62e9\u5c0f\u7684\uff0c\u5982\u679c\u5f88\u5927\u5219\u4f1a\u5360\u636e\u5f88\u5927\u7684\u7d22\u5f15\u7a7a\u95f4\u3002<\/p>\n<p>4\u3001 \u53ef\u4ee5\u53ea\u4e3a\u7d22\u5f15\u5217\u524d\u7f00\u521b\u5efa\u7d22\u5f15\uff0c\u51cf\u5c11\u7d22\u5f15\u5360\u7528\u7684\u5b58\u50a8\u7a7a\u95f4\u3002<\/p>\n<p>alter table single_table add index idx_key1(key1(10))<\/p>\n<p>5\u3001 \u5c3d\u91cf\u4f7f\u7528\u8986\u76d6\u7d22\u5f15\u8fdb\u884c\u67e5\u8be2\uff0c\u4ee5\u907f\u514d\u56de\u8868\u64cd\u4f5c\u5e26\u6765\u7684\u6027\u80fd\u635f\u8017\u3002<\/p>\n<p>select key1 from single_table order by key1<\/p>\n<p>6\u3001 \u4e3a\u4e86\u5c3d\u53ef\u80fd\u7684\u5c11\u7684\u8ba9\u805a\u7c07\u7d22\u5f15\u53d1\u751f\u9875\u9762\u5206\u88c2\u7684\u60c5\u51b5\uff0c\u5efa\u8bae\u8ba9\u4e3b\u952e\u81ea\u589e\u3002<\/p>\n<p>7\u3001 \u5b9a\u4f4d\u5e76\u5220\u9664\u8868\u4e2d\u7684\u5197\u4f59\u548c\u91cd\u590d\u7d22\u5f15\u3002<\/p>\n<p>\u5197\u4f59\u7d22\u5f15\uff1a<\/p>\n<p>\u5355\u5217\u7d22\u5f15\uff1a\uff08\u5b57\u6bb51\uff09<\/p>\n<p>\u8054\u5408\u7d22\u5f15\uff1a\uff08\u5b57\u6bb51 \u5b57\u6bb52\uff09<\/p>\n<p>\u91cd\u590d\u7d22\u5f15\uff1a<\/p>\n<p>\u5728\u4e00\u4e2a\u5b57\u6bb5\u4e0a\u6dfb\u52a0\u4e86\u666e\u901a\u7d22\u5f15\u3001\u552f\u4e00\u7d22\u5f15\u3001\u4e3b\u952e\u7b49\u591a\u4e2a\u7d22\u5f15<\/p>\n<h3><strong>6\u3001 \u6267\u884c\u8ba1\u5212<\/strong><\/h3>\n<p><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000043345395\" alt=\"\" title=\"\" loading=\"lazy\"><\/p>\n<p>\u5176\u4e2d\u5e38\u7528\u7684\u662f\uff1a<\/p>\n<p>possible_keys: \u53ef\u80fd\u7528\u5230\u7684\u7d22\u5f15<\/p>\n<p>key: \u5b9e\u9645\u4f7f\u7528\u7684\u7d22\u5f15<\/p>\n<p>rows\uff1a\u9884\u4f30\u7684\u9700\u8981\u8bfb\u53d6\u7684\u8bb0\u5f55\u6761\u6570<\/p>\n<h3><strong>7\u3001 \u7ebf\u4e0a\u6848\u4f8b<\/strong><\/h3>\n<p><strong>\u6848\u4f8b1\uff1a<\/strong><\/p>\n<p>\u5728\u5efa\u8bbe\u4e92\u8054\u7f51\u533b\u9662\u7cfb\u7edf\u4e2d\uff0c\u95ee\u8bca\u5355\u8868\u5f53\u65f6\u91cf\u7ea723\u4e07\u5de6\u53f3\uff0c\u5176\u4e2d\u6709\u4e00\u4e2abusiness_id\u5b57\u7b26\u4e32\u5b57\u6bb5\uff0c\u8fd9\u4e2a\u5b57\u6bb5\u7528\u6765\u8bb0\u5f55\u5916\u90e8\u8ba2\u5355\u7684ID\uff0c\u5e76\u4e14\u5728\u8be5\u5b57\u6bb5\u4e0a\u4e5f\u52a0\u4e86\u7d22\u5f15\uff0c\u4f46\u662f&#8217;\u6839\u636e\u8be5ID\u67e5\u8be2\u8be6\u60c5&#8217;\u7684SQL\u8bed\u53e5\u5374\u603b\u662f\u65f6\u597d\u65f6\u574f\uff0c\u6027\u80fd\u4e0d\u7a33\u5b9a\uff0c\u5feb\u521910ms\uff0c\u6162\u52192\u79d2\u5de6\u53f3\uff0cSQL\u5927\u4f53\u5982\u4e0b\uff1a<\/p>\n<p><strong>select \u5b57\u6bb51\u3001\u5b57\u6bb52\u3001\u5b57\u6bb53 from nethp_diag where business_Id = ?<\/strong><\/p>\n<p>\u56e0\u4e3abusiness_id\u662f\u8bb0\u5f55\u7b2c\u4e09\u65b9\u7cfb\u7edf\u7684\u8ba2\u5355ID\uff0c\u4e3a\u4e86\u517c\u5bb9\u4e0d\u540c\u7684\u7b2c\u4e09\u65b9\u7cfb\u7edf\uff0c\u56e0\u800c\u8bbe\u8ba1\u6210\u4e86<strong>\u5b57\u7b26\u4e32\u7c7b\u578b<\/strong>\uff0c\u4f46\u5982\u679c\u4f20\u5165\u7684\u662f\u4e00\u4e2a\u6570\u5b57\u7c7b\u578b\u662f\u65e0\u6cd5\u4f7f\u7528\u7d22\u5f15\u7684\uff0c\u56e0\u4e3aMySQL\u53ea\u80fd\u5c06<strong>\u5b57\u7b26\u4e32\u8f6c\u6570\u5b57\uff0c\u800c\u4e0d\u80fd\u5c06\u6570\u5b57\u8f6c\u5b57\u7b26\u4e32<\/strong>\uff0c\u7531\u4e8e\u5916\u90e8\u7684ID\u6709\u7684\u662f\u6570\u5b57\u6709\u7684\u662f\u5b57\u7b26\u4e32\uff0c\u56e0\u800c\u5bfc\u81f4\u7d22\u5f15\u4e00\u4f1a\u53ef\u4ee5\u8d70\u5230\uff0c\u4e00\u4f1a\u8d70\u4e0d\u5230\uff0c\u6700\u7ec8\u5bfc\u81f4\u4e86\u6027\u80fd\u7684\u4e0d\u7a33\u5b9a\u3002<\/p>\n<p><strong>\u6848\u4f8b2\uff1a<\/strong><\/p>\n<p>\u5728\u67d0\u6b21\u5927\u4fc3\u7684\u5f53\u5929\uff0c\u7a81\u7136\u63a5\u5230DBA\u8fd0\u7ef4\u7684\u62a5\u8b66\uff0c\u8bf4\u6570\u636e\u5e93\u7a81\u7136\u6d41\u91cf\u6fc0\u589e\uff0cCPU\u4e5f\u6253\u5230100%\u4e86\uff0c\u5f71\u54cd\u4e86\u90e8\u5206\u7ebf\u4e0a\u529f\u80fd\u548c\u4f53\u9a8c\uff0c\u9047\u5230\u8fd9\u79cd\u60c5\u51b5\u5f53\u65f6\u5927\u90e8\u5206\u4eba\u90fd\u6bd4\u8f83\u7d27\u5f20\uff0c\u4e0b\u56fe\u4e3a\u5f53\u65f6\u7684\u6570\u636e\u5e93\u6d41\u91cf\u60c5\u51b5\uff1a<\/p>\n<p><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000043345396\" alt=\"\" title=\"\" loading=\"lazy\"><\/p>\n<p><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000043345397\" alt=\"\" title=\"\" loading=\"lazy\"><\/p>\n<p>\u76f8\u5173SQL\u8bed\u53e5\uff1a<\/p>\n<p>&lt;!&#8211;\u7edf\u8ba1\u533b\u60a3\u4e0b\u8fc7\u53bb24\u5c0f\u65f6\u5185\u5f00\u7684\u7535\u5b50\u75c5\u5386\u603b\u6570&#8211;&gt;<\/p>\n<p>&lt;select id=&quot;getCountByDPAndTime&quot; resultType=&quot;integer&quot;&gt;<\/p>\n<p>select count(1)<\/p>\n<p>from jdhe_medical_record<\/p>\n<p>where status = 1 and is_test = #{isTest,jdbcType=INTEGER} and electric_medical_record_status in (2,3)<\/p>\n<p><strong>&lt;if test=&quot;patientId != null&quot;&gt;<\/strong><\/p>\n<p>and patient_id = #{patientId,jdbcType=BIGINT}<\/p>\n<p><strong>&lt;\/if&gt;<\/strong><\/p>\n<p><strong>&lt;if test=&quot;doctorPin != null&quot;&gt;<\/strong><\/p>\n<p>and doctor_pin = #{doctorPin,jdbcType=VARCHAR}<\/p>\n<p><strong>&lt;\/if&gt;<\/strong><\/p>\n<p>and created &gt;#{dateStart,jdbcType=TIMESTAMP};<\/p>\n<p>&lt;\/select&gt;<\/p>\n<p><strong>\u5f53\u65f6\u7684\u7d22\u5f15\u60c5\u51b5<\/strong><\/p>\n<p><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000043345398\" alt=\"\" title=\"\" loading=\"lazy\"><\/p>\n<p><strong>\u5f53\u65f6\u7684\u6267\u884c\u8ba1\u5212<\/strong><\/p>\n<p><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000043345399\" alt=\"\" title=\"\" loading=\"lazy\"><\/p>\n<p>\u5176\u5b9e\u5728patientId\u548cdoctor_pin\u4e24\u4e2a\u5b57\u6bb5\u4e0a\u662f\u6709\u7d22\u5f15\u7684\uff0c\u4f46\u662f\u7531\u4e8e\u7ebf\u4e0a\u60c5\u51b5\u7684\u6539\u53d8\uff0c\u5bfc\u81f4test\u5224\u65ad\u6ca1\u6709\u8fdb\u5165\uff0c\u8fd9\u6837\u7684\u901a\u7528\u67e5\u8be2\u5bfc\u81f4\u8fd9\u4e24\u4e2a\u5b57\u6bb5\u6ca1\u6709\u8bbe\u7f6e\u4e0a\uff0c\u8fdb\u800c\u5bfc\u81f4\u4e86\u6570\u636e\u5e93\u626b\u63cf\u7684\u91cf\u6fc0\u589e\uff0c\u5bf9\u6570\u636e\u5e93\u4ea7\u751f\u4e86\u5f88\u5927\u538b\u529b\u3002<\/p>\n<p><strong>\u6848\u4f8b3\uff1a<\/strong><\/p>\n<p>2020\u5e74\u67d0\u65e5\u4e0a\u5348\u6536\u5230\u6570\u636e\u5e93CPU\u5f02\u5e38\u62a5\u8b66\uff0c\u5bf9\u7ebf\u4e0a\u6709\u4e00\u5b9a\u7684\u5f71\u54cd\uff0c\u540e\u7eed\u68c0\u67e5\u6570\u636e\u5e93CPU\u60c5\u51b5\u5982\u4e0b\uff0c\u4ece7\u70b951\u5206\u5f00\u59cb\uff0cCPU\u4ece8%\u77ac\u95f4\u8fbe\u523099.92%\uff0c\u4e1d\u6beb\u6ca1\u6709\u7ed9\u7a0b\u5e8f\u5458\u7559\u4efb\u4f55\u60c5\u9762\u3002<\/p>\n<p><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000043345400\" alt=\"\" title=\"\" loading=\"lazy\"><\/p>\n<p>\u5f53\u65f6\u7684SQL\u8bed\u53e5\uff1a<\/p>\n<p>select rx_id, rx_create_time from nethp_rx_info where rx_status = 5 and status = 1 and rx_product_type = 0 and (parent_rx_id = 0 or parent_rx_id is null) and business_type != 7 and vender_id = 8888 order by rx_create_time asc limit 1;<\/p>\n<p>\u5f53\u65f6\u7684\u7d22\u5f15\u60c5\u51b5:<\/p>\n<p>PRIMARY KEY (<code>id<\/code>), UNIQUE KEY <code>uniq_rx_id<\/code> (<code>rx_id<\/code>), KEY <code>idx_diag_id<\/code> (<code>diag_id<\/code>), KEY <code>idx_doctor_pin<\/code> (<code>doctor_pin<\/code>) USING BTREE, KEY <code>idx_rx_storeId<\/code> (<code>store_id<\/code>), KEY <code>idx_parent_rx_id<\/code> (<code>parent_rx_id<\/code>) USING BTREE, KEY <code>idx_rx_status<\/code> (<code>rx_status<\/code>) USING BTREE, KEY <code>idx_doctor_status_type<\/code> (<code>doctor_pin<\/code>, <code>rx_status<\/code>, <code>rx_type<\/code>), KEY <code>idx_business_store<\/code> (<code>business_type<\/code>, <code>store_id<\/code>), KEY <code>idx_doctor_pin_patientid<\/code> (<code>patient_id<\/code>, <code>doctor_pin<\/code>) USING BTREE, KEY <code>idx_rx_create_time<\/code> (<code>rx_create_time<\/code>)<\/p>\n<p>\u5f53\u65f6\u8fd9\u5f20\u8868\u91cf\u7ea72000\u591a\u4e07\uff0c\u800c\u5f53\u8fd9\u6761\u6162SQL\u6267\u884c\u8f83\u5c11\u7684\u65f6\u5019\uff0c\u6570\u636e\u5e93\u7684CPU\u4e5f\u5c31\u4e0b\u6765\u4e86\uff0c\u6062\u590d\u5230\u4e8649.91%\uff0c\u57fa\u672c\u53ef\u4ee5\u6062\u590d\u7ebf\u4e0a\u4e1a\u52a1\uff0c\u4ece\u800c\u8868\u8c61\u5c31\u662f\u7ebf\u4e0a\u95f4\u6b47\u6027\u7684\u4e00\u4f1a\u53ef\u4ee5\u5f00\u65b9\u4e00\u4f1a\u4e0d\u53ef\u4ee5\uff0c\u8fd9\u6761SQL\u5f53\u65f6\u603b\u5171\u6267\u884c\u4e86230\u6b21\uff0c\u5f53\u65f6\u7684CPU\u60c5\u51b5\u4e5f\u662f\u5ffd\u9ad8\u5ffd\u4f4e\uff0c\u4f34\u968f\u8fd9\u6761SQL\u8bed\u53e5\u7684\u6267\u884c\u60c5\u51b5\uff0c\u4ece\u800c\u6700\u7ec8\u8bc1\u660eCPU\u7684\u98d9\u5347\u662f\u7531\u4e8e\u8fd9\u6761\u6162SQL\u3002\u5f53\u7ebf\u4e0a\u4e1a\u52a1\u903b\u8f91\u590d\u6742\u7684\u65f6\u5019\uff0c\u4f60\u5f88\u96be\u7b2c\u4e00\u65f6\u95f4\u77e5\u9053\u5230\u5e95\u662f\u7531\u4e8e\u90a3\u6761SQL\u5f15\u8d77\u7684\uff0c\u8fd9\u4e2a\u5c31\u9700\u8981\u5bf9\u4e1a\u52a1\u975e\u5e38\u719f\u6089\uff0c\u5bf9SQL\u5f88\u719f\u6089\uff0c\u5426\u5219\u5c31\u4f1a\u767d\u767d\u6d6a\u8d39\u5927\u91cf\u7684\u6392\u67e5\u65f6\u95f4\u3002<\/p>\n<p>\u6700\u540e\u7684\u6392\u67e5\u7ed3\u679c\uff1a<\/p>\n<p>\u5728\u5934\u5929\u665a\u4e0a\u7684\u65f6\u5019<strong>\u6dfb\u52a0\u4e86\u4e00\u6761\u7d22\u5f15rx_create_time<\/strong>\uff0c\u5f53\u65f6\u6ca1\u4e8b\uff0c\u4f46\u662f\u7b2c\u4e8c\u5929\u5374\u51fa\u4e86\u4e8b\u6545\u3002<\/p>\n<p><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000043345401\" alt=\"\" title=\"\" loading=\"lazy\"><\/p>\n<p>\u52a0\u7d22\u5f15\u524d\u540e\u8d70\u7684\u7d22\u5f15\u4e0d\u540c\uff0c\u4e00\u4e2a\u662f\u8d70\u7684rx_status\uff08\u5904\u65b9\u5ba1\u6838\u72b6\u6001\uff09\u5355\u5217\u7d22\u5f15\uff0c\u4e00\u4e2a\u662f\u8d70\u7684rx_create_time(\u5904\u65b9\u63d0\u4ea4\u4e8b\u4ef6)\u5355\u5217\u7d22\u5f15\uff0c\u8fd9\u4e2a\u5c31\u8981\u56de\u5230\u4e1a\u52a1\uff0c\u56e0\u4e3a\u5904\u65b9\u72b6\u6001\u662f\u4e2a\u679a\u4e3e\uff0c\u4e14\u679a\u4e3e\u8303\u56f4\u4e0d\u523010\u4e2a\uff0c\u4e5f\u5c31\u8bf4\u7ebf\u4e0a29,000,000\u7684\u6570\u636e\u91cf\u4e5f\u5c31\u662f\u88ab\u5206\u6210\u4e86\u4e0d\u523010\u4efd\uff0crx_status=5\u7684\u503c\u662f\u5176\u4e2d\u4e00\u4efd\uff0c\u56e0\u800c\u901a\u8fc7\u8fd9\u4e2a\u7d22\u5f15\u5c31\u53ef\u4ee5\u547d\u4e2d\u5f88\u591a\u884c\uff0c\u8fd9\u662f\u4e1a\u52a1\u89c4\u5219\uff0c\u518d\u5957\u7528MySQL\u7684\u7279\u6027\uff0c\u4e3b\u8981\u662f\u4ee5\u4e0b\u51e0\u6761\uff1a<\/p>\n<p><strong>1\u3001\u6ca1\u52a0\u65b0\u7d22\u5f15rx_create_time\u7684\u65f6\u5019<\/strong>\uff0c\u7531\u4e8eorder by\u540e\u8fb9\u6ca1\u6709\u7d22\u5f15\uff0c\u5c31\u770bwhere\u6761\u4ef6\u4e2d\u662f\u5426\u6709\u5408\u9002\u7684\u7d22\u5f15\uff0c\u67e5\u8be2\u9009\u62e9\u5668\u9009\u5b9arx_status\u8fd9\u4e2a\u5355\u5217\u7d22\u5f15\uff0c\u800crx_status=5\u8fd9\u4e2a\u6761\u4ef6\u4e0b\u9650\u5236\u7684\u6570\u636e\u884c\u5728\u7d22\u5f15\u4e2d\u662f\u8fde\u7eed\uff0c\u5373\u4f7f\u9700\u8981\u7684rx_id\u4e0d\u5728\u7d22\u5f15\u4e2d\uff0c\u518d\u56de\u4e3b\u952e\u805a\u7c07\u7d22\u5f15\u4e5f\u6765\u5f97\u53ca\uff0c\u7531\u4e8eorder by\u540e\u8fb9\u6ca1\u6709\u7d22\u5f15\uff0c\u6240\u4ee5\u8d70\u78c1\u76d8\u7ea7\u522b\u7684\u6392\u5e8ffilesort\uff0c\u9ad8\u5cf0\u79ef\u538b\u7684\u65f6\u5019\u5904\u65b9\u5c311\u4e07\u52302\u4e07\uff0c\u8dd1\u5230\u4e86100ms,\u767d\u5929\u4f4e\u8c37\u7684\u65f6\u5019\u51e0\u767e\u5355\u4e5f\u5c3120ms\u3002<\/p>\n<p><strong>2\u3001\u65b0\u52a0\u7d22\u5f15\u4e4b\u540e\uff0c\u5c31\u5206\u4e24\u79cd\u60c5\u51b5\uff1a<\/strong><\/p>\n<p>2.1\u3001\u52a0\u7d22\u5f15\u662f\u5728\u665a\u4e0a\uff0c\u5f53\u524d\u547d\u4e2d\u7684\u884c\u6570\u6bd4\u8f83\u5c11\uff0c\u7531\u4e8e\u5f53\u5929\u665a\u4e0a\u7684\u65f6\u5019\u5f85\u5ba1\u6838\u7684\u5904\u65b9\u786e\u5b9e\u5f88\u5c11\uff0c\u4e5f\u5c31\u662frx_status=5\u7684\u786e\u5b9e\u5f88\u5c11\uff0c\u67e5\u8be2\u4f18\u5316\u5668\u611f\u89c9\u53cd\u6b63\u6ca1\u591a\u5c11\u884c\uff0c\u6392\u5e8f\u4e0d\u91cd\u8981\uff0c\u56e0\u800c\u5c31\u8fd8\u662f\u9009\u62e9rx_status\u7d22\u5f15\u3002<\/p>\n<p>2.2\u3001\u7b2c\u4e8c\u5929\u767d\u5929\uff0c\u5f85\u5ba1\u6838\u7684\u5904\u65b9\u6570\u91cf\u5f88\u591a\u4e86\uff08rx_status=5\u7684\u6570\u636e\u91cf\u591a\u4e86\uff09\uff0c\u5f53\u65f6\u53ef\u4ee5\u547d\u4e2d\u51e0\u4e07\u6570\u636e\uff0c\u5982\u679c\u5f53\u524d\u547d\u4e2d\u7684\u884c\u6570\u6bd4\u8f83\u591a\uff0c\u67e5\u8be2\u4f18\u5316\u5668\u5c31\u5f00\u59cb\u7b97\u6210\u672c\uff0c\u611f\u89c9\u6392\u5e8f\u7684\u6210\u672c\u4f1a\u66f4\u9ad8\uff0c\u90a3\u5c31\u4f18\u5148\u4fdd\u6392\u5e8f\u5427\uff0c\u6240\u4ee5\u5c31\u9009\u62e9rx_create_time\u8fd9\u4e2a\u5b57\u6bb5\uff0c\u4f46\u662f\u8fd9\u4e2a\u7d22\u5f15\u6811\u4e0a\u6ca1\u6709\u522b\u7684\u7d22\u5f15\u5b57\u6bb5\u7684\u4fe1\u606f\uff0c\u6ca1\u529e\u6cd5\uff0c\u51e0\u4e4e\u6bcf\u6761\u6570\u636e\u90fd\u8981\u56de\u8868\uff0c\u8fdb\u800c\u5f15\u53d1\u4e86\u707e\u96be\u3002<\/p>\n<h3><strong>8\u3001 \u63a8\u8350\u7528\u4e66<\/strong><\/h3>\n<p>\u8fd9\u672c\u4e66\u4ee5\u4e00\u79cd\u8bd9\u8c10\u5e7d\u9ed8\u7684\u98ce\u683c\u5199\u4e86MySQL\u7684\u4e00\u4e9b\u8fd0\u884c\u673a\u5236\uff0c\u975e\u5e38\u9002\u5408\u9605\u8bfb\uff0c\u7406\u89e3\u6210\u672c\u5927\u5e45\u964d\u4f4e\u3002<\/p>\n<p><a href=\"https:\/\/link.segmentfault.com\/?enc=w%2Ff3619LG03q1uxjrzyoMA%3D%3D.biNO2E7OAtgxbDZAnQsb7ZCabDAi%2F9eBsOG0eM9A4lm6SF8FhyvitAKEBeWXDed9\" rel=\"nofollow\">https:\/\/item.jd.com\/13009316&#8230;.<\/a><\/p>\n<p><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000043345402\" alt=\"\" title=\"\" loading=\"lazy\"><\/p>\n<p><a href=\"https:\/\/link.segmentfault.com\/?enc=XaTfHEke1b6Z8wvU7%2Bo6UQ%3D%3D.9313OL3aTE2xrsq8hr7B%2FMM4tgkiVne5ovvotDBVe%2BRBNRvDsSECSSd%2F9wHve%2Foh\" rel=\"nofollow\">https:\/\/item.jd.com\/100661819&#8230;<\/a><\/p>\n<p><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000043345403\" alt=\"\" title=\"\" loading=\"lazy\"><\/p>\n<h3><strong>9\u3001\u4e00\u4e9b\u611f\u609f<\/strong><\/h3>\n<p>\u5173\u4e8e\u6570\u636e\u5e93\u7684\u6027\u80fd\u4f18\u5316\u5176\u5b9e\u662f\u4e00\u4e2a\u5f88\u590d\u6742\u7684\u5927\u8bfe\u9898\uff0c\u5f88\u96be\u901a\u8fc7\u4e00\u7bc7\u5e16\u5b50\u8bb2\u7684\u5f88\u5168\u9762\u548c\u6df1\u523b\uff0c\u8fd9\u4e5f\u5c31\u662f\u4e3a\u4ec0\u4e48\u6211\u7684\u6807\u9898\u662f\u2018\u6d45\u6790\u2019\uff0c\u7a0b\u5e8f\u5458\u7684\u6210\u957f\u4e00\u5b9a\u662f\u8981\u4ed8\u51fa\u4ee3\u4ef7\u548c\u6210\u672c\uff0c\u56e0\u4e3a\u53ea\u6709\u771f\u7684\u5728\u4e00\u7ebf\u5207\u8eab\u4f53\u4f1a\u5230\u5f53\u65f6\u7684\u7d27\u5f20\u548c\u538b\u529b\uff0c\u5bf9\u4e8e\u4e00\u4ef6\u4e8b\u60c5\u624d\u80fd\u5370\u8c61\u6df1\u523b\uff0c\u4f46\u53cd\u4e4b\u4e5f\u4e0d\u80fd\u592a\u8fc7\u4e8e\u5f3a\u8c03\u4ee3\u4ef7\uff0c\u5982\u679c\u53ef\u4ee5\u901a\u8fc7\u4e00\u4e9b\u522b\u4eba\u7684\u5206\u4eab\u5c31\u53ef\u4ee5\u89c4\u907f\u4e00\u4e9b\u81ea\u5df1\u4e1a\u52a1\u7684\u95ee\u9898\u548c\u9519\u8bef\u7684\u4ee3\u4ef7\u4e5f\u662f\u597d\u7684\u3002<\/p>\n<p><a href=\"https:\/\/segmentfault.com\/a\/1190000043345387\">https:\/\/segmentfault.com\/a\/1190000043345387<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4f5c\u8005\uff1a\u4eac\u4e1c\u5065\u5eb7 \u5b5f\u98de 1\u3001 \u6570\u636e\u5e93\u6027\u80fd\u4f18\u5316\u7684\u610f\u4e49 \u4e1a\u52a1\u53d1\u5c55\u521d\u671f\uff0c\u6570\u636e\u5e93\u4e2d\u91cf\u4e00\u822c\u90fd\u4e0d\u9ad8\uff0c\u4e5f\u4e0d\u592a\u5bb9\u6613\u51fa\u4e00\u4e9b\u6027\u80fd\u95ee\u9898 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[4],"tags":[],"class_list":["post-10007096","post","type-post","status-publish","format-standard","hentry","category-share"],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/itmax.cn\/index.php?rest_route=\/wp\/v2\/posts\/10007096","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/itmax.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/itmax.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/itmax.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/itmax.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=10007096"}],"version-history":[{"count":0,"href":"https:\/\/itmax.cn\/index.php?rest_route=\/wp\/v2\/posts\/10007096\/revisions"}],"wp:attachment":[{"href":"https:\/\/itmax.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=10007096"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/itmax.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=10007096"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/itmax.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=10007096"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}