{"id":2460,"date":"2026-10-15T11:47:32","date_gmt":"2026-10-15T03:47:32","guid":{"rendered":"http:\/\/www.spiceandwolf.com.cn\/?p=2460"},"modified":"2026-10-15T11:48:26","modified_gmt":"2026-10-15T03:48:26","slug":"mysql-book-zy-12","status":"publish","type":"post","link":"http:\/\/www.spiceandwolf.com.cn\/index.php\/mysql-book-zy-12\/","title":{"rendered":"\u300aMySQL\u600e\u8fd0&#8230;\u300b\u7b2c\u5341\u4e8c\u7ae0 MySQL\u57fa\u4e8e\u6210\u672c\u7684\u4f18\u5316\uff08\u6458\u8981\uff09"},"content":{"rendered":"\n<h3 class=\"wp-block-heading\">\u4ec0\u4e48\u662f\u6210\u672c<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">MySQL\u6267\u884c\u67e5\u8be2\u65f6\u4f1a\u6709\u4e0d\u540c\u7684\u6267\u884c\u65b9\u6848\uff0c\u5b83\u4f1a\u9009\u62e9\u4ee3\u4ef7\u6700\u4f4e\u7684\u65b9\u6848\u53bb\u771f\u6b63\u7684\u6267\u884c\u67e5\u8be2\uff0c\u90a3\u6211\u4eec\u9700\u8981\u77e5\u9053\u4ec0\u4e48\u662f\u6210\u672c\uff0c\u5b83\u7531\u4e24\u65b9\u9762\u7ec4\u6210\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>I\/O\u6210\u672c\u3002\u5bf9\u4e8e\u5c06\u6570\u636e\u548c\u7d22\u5f15\u5b58\u50a8\u5230\u78c1\u76d8\u4e0a\u7684\u5b58\u50a8\u5f15\u64ce\uff0c\u5f53\u9700\u8981\u67e5\u8be2\u8868\u4e2d\u8bb0\u5f55\u65f6\uff0c\u9700\u8981\u5c06\u6570\u636e\u6216\u7d22\u5f15\u52a0\u8f7d\u5230\u78c1\u76d8\u4e0a\u518d\u8fdb\u884c\u64cd\u4f5c\uff0c\u8fd9\u4e2a\u4ece\u78c1\u76d8\u5230\u5185\u5b58\u52a0\u8f7d\u7684\u8fc7\u7a0b\u635f\u8017\u7684\u65f6\u95f4\u79f0\u4e4b\u4e3a I\/O \u6210\u672c<\/li>\n\n\n\n<li>CPU\u6210\u672c\u3002\u8bfb\u53d6\u4ee5\u53ca\u68c0\u6d4b\u8bb0\u5f55\u662f\u5426\u6ee1\u8db3\u5bf9\u5e94\u7684\u641c\u7d22\u6761\u4ef6\u3001\u5bf9\u7ed3\u679c\u96c6\u8fdb\u884c\u6392\u5e8f\u7b49\u8fd9\u4e9b\u64cd\u4f5c\u635f\u8017\u7684\u65f6\u95f4\u79f0\u4e4b\u4e3a CPU \u6210\u672c<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">\u5177\u4f53\u6765\u8bf4\uff0c\u5bf9\u4e8eInnoDB\u5f15\u64ce\uff0cMySQL \u89c4\u5b9a\u8bfb\u53d6\u4e00\u4e2a\u9875\u9762\u82b1\u8d39\u7684\u6210\u672c\u9ed8\u8ba4\u662f 1.0 \uff0c\u8bfb\u53d6\u4ee5\u53ca\u68c0\u6d4b\u4e00\u6761\u8bb0\u5f55\u662f\u5426\u7b26\u5408\u641c\u7d22\u6761\u4ef6\u7684\u6210\u672c\u9ed8\u8ba4\u662f\uff0c\u5176\u4e2d0.2\uff0c1.0\u79f0\u4e3a\u6210\u672c\u5e38\u6570<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u5355\u8868\u67e5\u8be2\u6210\u672c<\/h3>\n\n\n\n<h5 class=\"wp-block-heading\">\u57fa\u4e8e\u6210\u672c\u7684\u4f18\u5316<\/h5>\n\n\n\n<p class=\"wp-block-paragraph\">\u5728\u4e00\u6761\u5355\u8868\u67e5\u8be2\u8bed\u53e5\u771f\u6b63\u6267\u884c\u4e4b\u524d\uff0c MySQL \u7684\u67e5\u8be2\u4f18\u5316\u5668\u4f1a\u627e\u51fa\u6267\u884c\u8be5\u8bed\u53e5\u6240\u6709\u53ef\u80fd\u4f7f\u7528\u7684\u65b9\u6848\uff0c\u5bf9\u6bd4\u4e4b\u540e\u627e\u51fa\u6210\u672c\u6700\u4f4e\u7684\u65b9\u6848\uff0c\u8fd9\u4e2a\u6210\u672c\u6700\u4f4e\u7684\u65b9\u6848\u5c31\u662f\u6240\u8c13\u7684 \u6267\u884c\u8ba1\u5212 \uff0c\u4e4b\u540e\u624d\u4f1a\u8c03\u7528\u5b58\u50a8\u5f15\u64ce\u63d0\u4f9b\u7684\u63a5\u53e3\u771f\u6b63\u7684\u6267\u884c\u67e5\u8be2\uff0c\u8fd9\u4e2a\u8fc7\u7a0b\u603b\u7ed3\u4e00\u4e0b\u5c31\u662f\u8fd9\u6837\uff1a<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u6839\u636e\u641c\u7d22\u6761\u4ef6\uff0c\u627e\u51fa\u6240\u6709\u53ef\u80fd\u4f7f\u7528\u7684\u7d22\u5f15<\/li>\n\n\n\n<li>\u8ba1\u7b97\u5168\u8868\u626b\u63cf\u7684\u4ee3\u4ef7<\/li>\n\n\n\n<li>\u8ba1\u7b97\u4f7f\u7528\u4e0d\u540c\u7d22\u5f15\u6267\u884c\u67e5\u8be2\u7684\u4ee3\u4ef7<\/li>\n\n\n\n<li>\u5bf9\u6bd4\u5404\u79cd\u6267\u884c\u65b9\u6848\u7684\u4ee3\u4ef7\uff0c\u627e\u51fa\u6210\u672c\u6700\u4f4e\u7684\u90a3\u4e00\u4e2a<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">\u4e3e\u4f8b\u5206\u6790\uff1a<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4e8b\u4f8b\u7528\u8868\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>CREATE TABLE single_table (\nid INT NOT NULL AUTO_INCREMENT,\nkey1 VARCHAR(100),\nkey2 INT,\nkey3 VARCHAR(100),\nkey_part1 VARCHAR(100),\nkey_part2 VARCHAR(100),\nkey_part3 VARCHAR(100),\ncommon_field VARCHAR(100),\nPRIMARY KEY (id),\nKEY idx_key1 (key1),\nUNIQUE KEY idx_key2 (key2),\nKEY idx_key3 (key3),\nKEY idx_key_part(key_part1, key_part2, key_part3)\n) Engine=InnoDB CHARSET=utf8;<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u67e5\u8be2\u8bed\u53e5\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>SELECT * FROM single_table WHERE\nkey1 IN ('a', 'b', 'c') AND\nkey2 > 10 AND key2 &lt; 1000 AND\nkey3 > key2 AND\nkey_part1 LIKE '%hello%' AND\ncommon_field = '123';<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u6839\u636e\u641c\u7d22\u6761\u4ef6\uff0c\u627e\u51fa\u6240\u6709\u53ef\u80fd\u4f7f\u7528\u7684\u7d22\u5f15<\/p>\n\n\n\n<ol class=\"wp-block-list\"><\/ol>\n\n\n\n<ul class=\"wp-block-list\">\n<li>key1 IN (&#8216;a&#8217;, &#8216;b&#8217;, &#8216;c&#8217;) \uff0c\u8fd9\u4e2a\u641c\u7d22\u6761\u4ef6\u53ef\u4ee5\u4f7f\u7528\u4e8c\u7ea7\u7d22\u5f15 idx_key1<\/li>\n\n\n\n<li>key2 > 10 AND key2 &lt; 1000 \uff0c\u8fd9\u4e2a\u641c\u7d22\u6761\u4ef6\u53ef\u4ee5\u4f7f\u7528\u4e8c\u7ea7\u7d22\u5f15 idx_key2<\/li>\n\n\n\n<li>key3 > key2 \uff0c\u8fd9\u4e2a\u641c\u7d22\u6761\u4ef6\u7684\u7d22\u5f15\u5217\u7531\u4e8e\u6ca1\u6709\u548c\u5e38\u6570\u6bd4\u8f83\uff0c\u6240\u4ee5\u5e76\u4e0d\u80fd\u4f7f\u7528\u5230\u7d22\u5f15<\/li>\n\n\n\n<li>key_part1 LIKE &#8216;%hello%&#8217; \uff0c key_part1 \u901a\u8fc7 LIKE \u64cd\u4f5c\u7b26\u548c\u4ee5\u901a\u914d\u7b26\u5f00\u5934\u7684\u5b57\u7b26\u4e32\u505a\u6bd4\u8f83\uff0c\u4e0d\u53ef\u4ee5\u9002\u7528\u7d22\u5f15<\/li>\n\n\n\n<li>common_field = &#8216;123&#8217; \uff0c\u7531\u4e8e\u8be5\u5217\u4e0a\u538b\u6839\u513f\u6ca1\u6709\u7d22\u5f15\uff0c\u6240\u4ee5\u4e0d\u4f1a\u7528\u5230\u7d22\u5f15<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">\u8ba1\u7b97\u5168\u8868\u626b\u63cf\u7684\u4ee3\u4ef7\u3002\u5bf9\u4e8e InnoDB \u5b58\u50a8\u5f15\u64ce\u6765\u8bf4\uff0c\u5168\u8868\u626b\u63cf\u7684\u610f\u601d\u5c31\u662f\u628a\u805a\u7c07\u7d22\u5f15\u4e2d\u7684\u8bb0\u5f55\u90fd\u4f9d\u6b21\u548c\u7ed9\u5b9a\u7684\u641c\u7d22\u6761\u4ef6\u505a\u4e00\u4e0b\u6bd4\u8f83\uff0c\u628a\u7b26\u5408\u641c\u7d22\u6761\u4ef6\u7684\u8bb0\u5f55\u52a0\u5165\u5230\u7ed3\u679c\u96c6\uff0c\u6240\u4ee5\u9700\u8981\u5c06\u805a\u7c07\u7d22\u5f15\u5bf9\u5e94\u7684\u9875\u9762\u52a0\u8f7d\u5230\u5185\u5b58\u4e2d\uff0c\u7136\u540e\u518d\u68c0\u6d4b\u8bb0\u5f55\u662f\u5426\u7b26\u5408\u641c\u7d22\u6761\u4ef6\u7531\u4e8e\u67e5\u8be2\u6210\u672c=\u00a0I\/O \u6210\u672c+\u00a0CPU \u6210\u672c\uff0c\u6240\u4ee5\u8ba1\u7b97\u5168\u8868\u626b\u63cf\u7684\u4ee3\u4ef7\u9700\u8981\u4e24\u4e2a\u4fe1\u606f\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u805a\u7c07\u7d22\u5f15\u5360\u7528\u7684\u9875\u9762\u6570<\/li>\n\n\n\n<li>\u8be5\u8868\u4e2d\u7684\u8bb0\u5f55\u6570<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">MySQL\u4e3a\u6bcf\u4e2a\u8868\u7ef4\u62a4\u4e86\u4e00\u7cfb\u5217\u7684<strong><em>\u7edf\u8ba1\u4fe1\u606f<\/em><\/strong>\uff0c\u4e0a\u9762\u4e24\u4e2a\u4fe1\u606f\u9700\u8981\u4ece\u7edf\u8ba1\u4fe1\u606f\u4e2d\u83b7\u53d6\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mysql> SHOW TABLE STATUS LIKE 'single_table'\\G\n*************************** 1. row ***************************\nName: single_table\nEngine: InnoDB\nVersion: 10\nRow_format: Dynamic\nRows: 9693\nAvg_row_length: 163\nData_length: 1589248\nMax_data_length: 0\nIndex_length: 2752512\nData_free: 4194304\nAuto_increment: 10001\nCreate_time: 2018-12-10 13:37:23\nUpdate_time: 2018-12-10 13:38:03\nCheck_time: NULL\nCollation: utf8_general_ci\nChecksum: NULL\nCreate_options:\nComment:\n1 row in set (0.01 sec)<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Rows\u5373MySQL\u4f30\u7b97\u7684\u8bb0\u5f55\u6570\uff1bData_length\u8868\u793a\u8868\u5360\u7528\u7684\u5b58\u50a8\u7a7a\u95f4\u5b57\u8282\u6570\uff0c\u5bf9\u4e8e InnoDB \u5b58\u50a8\u5f15\u64ce\u7684\u8868\u6765\u8bf4\uff0c\u8be5\u503c\u5c31\u76f8\u5f53\u4e8e\u805a\u7c07\u7d22\u5f15\u5360\u7528\u7684\u5b58\u50a8\u7a7a\u95f4\u5927\u5c0f\uff0c\u6211\u4eec\u7684 single_table \u4f7f\u7528\u9ed8\u8ba4 16KB \u7684\u9875\u9762\u5927\u5c0f\uff0c\u800c\u4e0a\u8fb9\u67e5\u8be2\u7ed3\u679c\u663e\u793a Data_length \u7684\u503c\u662f 1589248 \uff0c\u6240\u4ee5\u6211\u4eec\u53ef\u4ee5\u53cd\u5411\u6765\u63a8\u5bfc\u51fa<strong><em>\u805a\u7c07\u7d22\u5f15<\/em><\/strong>\u7684\u9875\u9762\u6570\u91cf \uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\u805a\u7c07\u7d22\u5f15\u7684\u9875\u9762\u6570\u91cf = 1589248 \u00f7 16 \u00f7 1024 = 97<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u901a\u8fc7\u4ee5\u4e0a\u6570\u636e\u8ba1\u7b97\u5168\u8868\u626b\u63cf\u7684\u6210\u672c\uff1a<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">I\/O\u6210\u672c\uff0c\u5176\u4e2d1.1\u662f\u5fae\u8c03\u503c\uff0c\u4e0d\u7528\u5728\u610f\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>97 x 1.0 + 1.1 = 98.1<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">CPU\u6210\u672c\uff0c1.0\u662f\u5fae\u8c03\u503c\uff0c\u4e5f\u4e0d\u7528\u7ba1\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>9693 x 0.2 + 1.0 = 1939.6<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u6240\u4ee5\u5168\u8868\u626b\u63cf\u7684\u603b\u6210\u672c\u4e3a\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>98.1 + 1939.6 = 2037.7<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u8ba1\u7b97\u4f7f\u7528\u4e0d\u540c\u7d22\u5f15\u6267\u884c\u67e5\u8be2\u7684\u4ee3\u4ef7\uff1a<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4e0a\u8ff0\u67e5\u8be2\u53ef\u80fd\u4f7f\u7528\u5230 idx_key1 \u548c idx_key2 \u8fd9\u4e24\u4e2a\u7d22\u5f15\uff0c\u6211\u4eec\u9700\u8981\u5206\u522b\u5206\u6790\u5355\u72ec\u4f7f\u7528\u8fd9\u4e9b\u7d22\u5f15\u6267\u884c\u67e5\u8be2\u7684\u6210\u672c\uff0c\u6700\u540e\u8fd8\u8981\u5206\u6790\u662f\u5426\u53ef\u80fd\u4f7f\u7528\u5230\u7d22\u5f15\u5408\u5e76<\/p>\n\n\n\n<details class=\"wp-block-details is-layout-flow wp-block-details-is-layout-flow\"><summary>\u4f7f\u7528<em>idx_key2<\/em>\u6267\u884c\u67e5\u8be2\u7684\u6210\u672c\u5206\u6790<\/summary>\n<p class=\"wp-block-paragraph\">\u91c7\u7528 \u4e8c\u7ea7\u7d22\u5f15 + \u56de\u8868 \u7684\u65b9\u5f0f \u67e5\u8be2\uff0cMySQL\u8ba1\u7b97\u8fd9\u79cd\u67e5\u8be2\u7684\u6210\u672c\u4f9d\u8d56\u4e24\u4e2a\u65b9\u9762\u7684\u6570\u636e<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u8303\u56f4\u533a\u95f4\u6570\u91cf\u3002\u4e0d\u8bba\u67d0\u4e2a\u8303\u56f4\u533a\u95f4\u7684\u4e8c\u7ea7\u7d22\u5f15\u5230\u5e95\u5360\u7528\u4e86\u591a\u5c11\u9875\u9762\uff0c\u67e5\u8be2\u4f18\u5316\u5668\u7c97\u66b4\u7684\u8ba4\u4e3a\u8bfb\u53d6\u7d22\u5f15\u7684\u4e00\u4e2a\u8303\u56f4\u533a\u95f4\u7684 I\/O \u6210\u672c\u548c\u8bfb\u53d6\u4e00\u4e2a\u9875\u9762\u662f\u76f8\u540c\u7684\u3002\u6240\u4ee5\u6210\u672c\u662f1 x 1.0 = 1.0<\/li>\n\n\n\n<li>\u9700\u8981\u56de\u8868\u7684\u8bb0\u5f55\u6570\u3002\u4f18\u5316\u5668\u9700\u8981\u8ba1\u7b97\u4e8c\u7ea7\u7d22\u5f15\u7684\u67d0\u4e2a\u8303\u56f4\u533a\u95f4\u5230\u5e95\u5305\u542b\u591a\u5c11\u6761\u8bb0\u5f55\uff0c\u5bf9\u4e8e\u672c\u4f8b\u6765\u8bf4\u5c31\u662f\u8981\u8ba1\u7b97 idx_key2 \u5728 (10,1000) \u8fd9\u4e2a\u8303\u56f4\u533a\u95f4\u4e2d\u5305\u542b\u591a\u5c11\u4e8c\u7ea7\u7d22\u5f15\u8bb0\u5f55\uff0c\u8ba1\u7b97\u8fc7\u7a0b\u662f\u8fd9\u6837\uff1a\n<ol class=\"wp-block-list\">\n<li>\u6b65\u9aa41\uff1a\u5148\u6839\u636e key2 &gt; 10 \u8fd9\u4e2a\u6761\u4ef6\u8bbf\u95ee\u4e00\u4e0b idx_key2 \u5bf9\u5e94\u7684 B+ \u6811\u7d22\u5f15\uff0c\u627e\u5230\u6ee1\u8db3 key2 &gt; 10 \u8fd9\u4e2a\u6761\u4ef6\u7684\u7b2c\u4e00\u6761\u8bb0\u5f55\uff0c\u6211\u4eec\u628a\u8fd9\u6761\u8bb0\u5f55\u79f0\u4e4b\u4e3a \u533a\u95f4\u6700\u5de6\u8bb0\u5f55 \u3002\u6211\u4eec\u524d\u5934\u8bf4\u8fc7\u5728 B+ \u6570\u6811\u4e2d\u5b9a\u4f4d\u4e00\u6761\u8bb0\u5f55\u7684\u8fc7\u7a0b\u662f\u8d3c\u5feb\u7684\uff0c\u662f\u5e38\u6570\u7ea7\u522b\u7684\uff0c\u6240\u4ee5\u8fd9\u4e2a\u8fc7\u7a0b\u7684\u6027\u80fd\u6d88\u8017\u662f\u53ef\u4ee5\u5ffd\u7565\u4e0d\u8ba1\u7684\u3002<\/li>\n\n\n\n<li>\u6b65\u9aa42\uff1a\u7136\u540e\u518d\u6839\u636e key2 &lt; 1000 \u8fd9\u4e2a\u6761\u4ef6\u7ee7\u7eed\u4ece idx_key2 \u5bf9\u5e94\u7684 B+ \u6811\u7d22\u5f15\u4e2d\u627e\u51fa\u7b2c\u4e00\u6761\u6ee1\u8db3\u8fd9\u4e2a\u6761\u4ef6\u7684\u8bb0\u5f55\uff0c\u6211\u4eec\u628a\u8fd9\u6761\u8bb0\u5f55\u79f0\u4e4b\u4e3a \u533a\u95f4\u6700\u53f3\u8bb0\u5f55 \uff0c\u8fd9\u4e2a\u8fc7\u7a0b\u7684\u6027\u80fd\u6d88\u8017\u4e5f\u53ef\u4ee5\u5ffd\u7565\u4e0d\u8ba1\u7684\u3002<\/li>\n\n\n\n<li>\u6b65\u9aa43\uff1a\u5982\u679c \u533a\u95f4\u6700\u5de6\u8bb0\u5f55 \u548c \u533a\u95f4\u6700\u53f3\u8bb0\u5f55 \u76f8\u9694\u4e0d\u592a\u8fdc\uff08\u5728 MySQL 5.7.21 \u8fd9\u4e2a\u7248\u672c\u91cc\uff0c\u53ea\u8981\u76f8\u9694\u4e0d\u5927\u4e8e10\u4e2a\u9875\u9762\u5373\u53ef\uff09\uff0c\u90a3\u5c31\u53ef\u4ee5\u7cbe\u786e\u7edf\u8ba1\u51fa\u6ee1\u8db3 key2 &gt; 10 AND key2 &lt; 1000 \u6761\u4ef6\u7684\u4e8c\u7ea7\u7d22\u5f15\u8bb0\u5f55\u6761\u6570\u3002\u5426\u5219\u53ea\u6cbf\u7740 \u533a\u95f4\u6700\u5de6\u8bb0\u5f55 \u5411\u53f3\u8bfb10\u4e2a\u9875\u9762\uff0c\u8ba1\u7b97\u5e73\u5747\u6bcf\u4e2a\u9875\u9762\u4e2d\u5305\u542b\u591a\u5c11\u8bb0\u5f55\uff0c\u7136\u540e\u7528\u8fd9\u4e2a\u5e73\u5747\u503c\u4e58\u4ee5 \u533a\u95f4\u6700\u5de6\u8bb0\u5f55 \u548c \u533a\u95f4\u6700\u53f3\u8bb0\u5f55 \u4e4b\u95f4\u7684\u9875\u9762\u6570\u91cf\u5c31\u53ef\u4ee5\u4e86\u3002\u90a3\u4e48\u95ee\u9898\u53c8\u6765\u4e86\uff0c\u600e\u4e48\u4f30\u8ba1 \u533a\u95f4\u6700\u5de6\u8bb0\u5f55 \u548c \u533a\u95f4\u6700\u53f3\u8bb0\u5f55 \u4e4b\u95f4\u6709\u591a\u5c11\u4e2a\u9875\u9762\u5462\uff1f\u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898\u8fd8\u5f97\u56de\u5230 B+ \u6811\u7d22\u5f15\u7684\u7ed3\u6784\u4e2d\u6765\uff1a\u5982\u56fe\uff0c\u6211\u4eec\u5047\u8bbe \u533a\u95f4\u6700\u5de6\u8bb0\u5f55 \u5728 \u9875b \u4e2d\uff0c \u533a\u95f4\u6700\u53f3\u8bb0\u5f55 \u5728 \u9875c \u4e2d\uff0c\u90a3\u4e48\u6211\u4eec\u60f3\u8ba1\u7b97 \u533a\u95f4\u6700\u5de6\u8bb0\u5f55 \u548c \u533a\u95f4\u6700\u53f3\u8bb0\u5f55 \u4e4b\u95f4\u7684\u9875\u9762\u6570\u91cf\u5c31\u76f8\u5f53\u4e8e\u8ba1\u7b97 \u9875b \u548c \u9875c \u4e4b\u95f4\u6709\u591a\u5c11\u9875\u9762\uff0c\u800c\u6bcf\u4e00\u6761 \u76ee\u5f55\u9879\u8bb0\u5f55 \u90fd\u5bf9\u5e94\u4e00\u4e2a\u6570\u636e\u9875\uff0c\u6240\u4ee5\u8ba1\u7b97 \u9875b \u548c \u9875c \u4e4b\u95f4\u6709\u591a\u5c11\u9875\u9762\u5c31\u76f8\u5f53\u4e8e\u8ba1\u7b97\u5b83\u4eec\u7236\u8282\u70b9\uff08\u4e5f\u5c31\u662f\u9875a\uff09\u4e2d\u5bf9\u5e94\u7684\u76ee\u5f55\u9879\u8bb0\u5f55\u4e4b\u95f4\u9694\u7740\u51e0\u6761\u8bb0\u5f55\u3002\u5728\u4e00\u4e2a\u9875\u9762\u4e2d\u7edf\u8ba1\u4e24\u6761\u8bb0\u5f55\u4e4b\u95f4\u6709\u51e0\u6761\u8bb0\u5f55\u7684\u6210\u672c\u5c31\u8d3c\u5c0f\u4e86\u3002\u4e0d\u8fc7\u8fd8\u6709\u95ee\u9898\uff0c\u5982\u679c \u9875b \u548c \u9875c \u4e4b\u95f4\u7684\u9875\u9762\u5b9e\u5728\u592a\u591a\uff0c\u4ee5\u81f3\u4e8e \u9875b \u548c \u9875c \u5bf9\u5e94\u7684\u76ee\u5f55\u9879\u8bb0\u5f55\u90fd\u4e0d\u5728\u4e00\u4e2a\u9875\u9762\u4e2d\u8be5\u548b\u529e\uff1f\u7ee7\u7eed\u9012\u5f52\u554a\uff0c\u4e5f\u5c31\u662f\u518d\u7edf\u8ba1 \u9875b \u548c \u9875c \u5bf9\u5e94\u7684\u76ee\u5f55\u9879\u8bb0\u5f55\u6240\u5728\u9875\u4e4b\u95f4\u6709\u591a\u5c11\u4e2a\u9875\u9762\u3002\u4e4b\u524d\u6211\u4eec\u8bf4\u8fc7\u4e00\u4e2a B+ \u6811\u67094\u5c42\u9ad8\u5df2\u7ecf\u5f88\u4e86\u4e0d\u5f97\u4e86\uff0c\u6240\u4ee5\u8fd9\u4e2a\u7edf\u8ba1\u8fc7\u7a0b\u4e5f\u4e0d\u662f\u5f88\u8017\u8d39\u6027\u80fd\u3002<\/li>\n<\/ol>\n<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"584\" fetchpriority=\"low\" src=\"http:\/\/www.spiceandwolf.com.cn\/wp-content\/uploads\/2026\/10\/image-10-1024x584.png\" alt=\"\" class=\"wp-image-2462\" srcset=\"http:\/\/www.spiceandwolf.com.cn\/wp-content\/uploads\/2026\/10\/image-10-1024x584.png 1024w, http:\/\/www.spiceandwolf.com.cn\/wp-content\/uploads\/2026\/10\/image-10-300x171.png 300w, http:\/\/www.spiceandwolf.com.cn\/wp-content\/uploads\/2026\/10\/image-10-768x438.png 768w, http:\/\/www.spiceandwolf.com.cn\/wp-content\/uploads\/2026\/10\/image-10-1536x877.png 1536w, http:\/\/www.spiceandwolf.com.cn\/wp-content\/uploads\/2026\/10\/image-10.png 1556w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\u77e5\u9053\u4e86\u5982\u4f55\u7edf\u8ba1\u4e8c\u7ea7\u7d22\u5f15\u67d0\u4e2a\u8303\u56f4\u533a\u95f4\u7684\u8bb0\u5f55\u6570\u4e4b\u540e\uff0c\u5c31\u9700\u8981\u56de\u5230\u73b0\u5b9e\u95ee\u9898\u4e2d\u6765\uff0c\u6839\u636e\u4e0a\u8ff0\u7b97\u6cd5\u6d4b\u5f97idx_key2 \u5728\u533a\u95f4 (10, 1000) \u4e4b\u95f4\u5927\u7ea6\u6709 95 \u6761\u8bb0\u5f55\u3002\u8bfb\u53d6\u8fd9 95 \u6761\u4e8c\u7ea7\u7d22\u5f15\u8bb0\u5f55\u9700\u8981\u4ed8\u51fa\u7684 CPU \u6210\u672c\u5c31\u662f\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>95 x 0.2 + 0.01 = 19.01<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u67e5\u8be2\u5230\u4e8c\u7ea7\u7d22\u5f15\u6570\u636e\u96c6\u540e\u8fd8\u9700\u8981\u5e72\u4e24\u4ef6\u4e8b\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u6839\u636e\u8fd9\u4e9b\u8bb0\u5f55\u91cc\u7684\u4e3b\u952e\u503c\u5230\u805a\u7c07\u7d22\u5f15\u4e2d\u505a\u56de\u8868\u64cd\u4f5c\u3002MySQL\u8ba4\u4e3a\u6bcf\u6b21\u56de\u8868\u5c31\u76f8\u5f53\u4e8e\u4e00\u4e2a\u9875\u9762\uff0c\u4e5f\u5c31\u662f\u8bf4\u4e8c\u7ea7\u7d22\u5f15\u8303\u56f4\u533a\u95f4\u6709\u591a\u5c11\u8bb0\u5f55\uff0c\u5c31\u9700\u8981\u8fdb\u884c\u591a\u5c11\u6b21\u56de\u8868\u64cd\u4f5c\uff0c\u4e5f\u5c31\u662f\u9700\u8981\u8fdb\u884c\u591a\u5c11\u6b21\u9875\u9762 I\/O\u6240\u4ee5\u56de\u8868\u67e5\u8be2\u7684\u6210\u672c\u4e3a\uff1a95 x 1.0 = 95.0<\/li>\n\n\n\n<li>\u56de\u8868\u64cd\u4f5c\u540e\u5f97\u5230\u7684\u5b8c\u6574\u7528\u6237\u8bb0\u5f55\uff0c\u7136\u540e\u518d\u68c0\u6d4b\u5176\u4ed6\u641c\u7d22\u6761\u4ef6\u662f\u5426\u6210\u7acb\u3002\u8fd9\u4e2a\u6bd4\u8f83\u8fc7\u7a0b\u82b1\u8d39\u7684`CPU`\u6210\u672c\u662f\uff1a95 x 0.2 = 19.0<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n<\/details>\n\n\n\n<p class=\"wp-block-paragraph\">\u7efc\u4e0a\u6240\u8ff0\uff0c\u4f7f\u7528 idx_key2 \u6267\u884c\u67e5\u8be2\u7684\u6210\u672c\uff1a<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">I\/O \u6210\u672c\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>1.0 + 95 x 1.0 = 96.0 (\u8303\u56f4\u533a\u95f4\u7684\u6570\u91cf + \u9884\u4f30\u7684\u4e8c\u7ea7\u7d22\u5f15\u8bb0\u5f55\u6761\u6570)<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">CPU \u6210\u672c\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>95 x 0.2 + 0.01 + 95 x 0.2 = 38.01 \uff08\u8bfb\u53d6\u4e8c\u7ea7\u7d22\u5f15\u8bb0\u5f55\u7684\u6210\u672c + \u8bfb\u53d6\u5e76\u68c0\u6d4b\u56de\u8868\u540e\u805a\u7c07\u7d22\n\u5f15\u8bb0\u5f55\u7684\u6210\u672c\uff09<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u603b\u6210\u672c\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>96.0 + 38.01 = 134.01<\/code><\/pre>\n\n\n\n<details class=\"wp-block-details is-layout-flow wp-block-details-is-layout-flow\"><summary>\u7528<em>idx_key1<\/em>\u6267\u884c\u67e5\u8be2\u7684\u6210\u672c\u5206\u6790<\/summary>\n<p class=\"wp-block-paragraph\">\u8303\u56f4\u533a\u95f4\u6570\u91cf\uff1a\u4e09\u4e2a\u5355\u70b9\u533a\u95f4\uff0c\u8bbf\u95ee\u8fd93\u4e2a\u8303\u56f4\u533a\u95f4\u7684\u4e8c\u7ea7\u7d22\u5f15\u4ed8\u51fa\u7684I\/O\u6210\u672c\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>3 x 1.0 = 3.0<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u9700\u8981\u56de\u8868\u7684\u8bb0\u5f55\u6570\uff0c\u5355\u70b9\u533a\u95f4 [&#8216;a&#8217;, &#8216;a&#8217;] \u5bf9\u5e94\u7684\u4e8c\u7ea7\u7d22\u5f15\u8bb0\u5f55\u6570\u4e3a35\uff0c\u5355\u70b9\u533a\u95f4 [&#8216;b&#8217;, &#8216;b&#8217;] \u5bf9\u5e94\u7684\u4e8c\u7ea7\u7d22\u5f15\u8bb0\u5f55\u6570\u4e3a44\uff0c\u5355\u70b9\u533a\u95f4 [&#8216;c&#8217;, &#8216;c&#8217;] \u5bf9\u5e94\u7684\u4e8c\u7ea7\u7d22\u5f15\u8bb0\u5f55\u6570\u4e3a39\uff0c\u8bfb\u53d6\u8fd9\u4e9b\u4e8c\u7ea7\u7d22\u5f15\u8bb0\u5f55\u7684 CPU \u6210\u672c\u5c31\u662f\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>118 x 0.2 + 0.01 = 23.61<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u6839\u636e\u8fd9\u4e9b\u8bb0\u5f55\u91cc\u7684\u4e3b\u952e\u503c\u5230\u805a\u7c07\u7d22\u5f15\u4e2d\u505a\u56de\u8868\u64cd\u4f5c\u6210\u672c\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>118 x 1.0 = 118.0<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u56de\u8868\u67e5\u8be2\u5f97\u5230\u5b8c\u6574\u7528\u6237\u8bb0\u5f55\u5e76\u5e94\u7528\u5176\u5b83\u641c\u7d22\u6761\u4ef6\u7684\u6210\u672c\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>118 x 0.2 = 23.6<\/code><\/pre>\n<\/details>\n\n\n\n<p class=\"wp-block-paragraph\">\u7efc\u4e0a\uff0c\u4f7f\u7528 idx_key1 \u6267\u884c\u67e5\u8be2\u7684\u6210\u672c\uff1a<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">I\/O\u6210\u672c\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>3.0 + 118 x 1.0 = 121.0 (\u8303\u56f4\u533a\u95f4\u7684\u6570\u91cf + \u9884\u4f30\u7684\u4e8c\u7ea7\u7d22\u5f15\u8bb0\u5f55\u6761\u6570)<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">CPU\u6210\u672c\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>118 x 0.2 + 0.01 + 118 x 0.2 = 47.21 \uff08\u8bfb\u53d6\u4e8c\u7ea7\u7d22\u5f15\u8bb0\u5f55\u7684\u6210\u672c + \u8bfb\u53d6\u5e76\u68c0\u6d4b\u56de\u8868\u540e\u805a\u7c07\n\u7d22\u5f15\u8bb0\u5f55\u7684\u6210\u672c\uff09<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u603b\u6210\u672c\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>121.0 + 47.21 = 168.21<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u662f\u5426\u6709\u53ef\u80fd\u4f7f\u7528\u7d22\u5f15\u5408\u5e76\uff1akey1 \u548c key2 \u7684\u641c\u7d22\u6761\u4ef6\u662f\u4f7f\u7528 AND \u8fde\u63a5\u8d77\u6765\u7684\uff0c\u6211\u4eec\u5f80<strong>Intersection<\/strong>\u5408\u5e76\u9760\uff0c\u5bf9\u4e8e idx_key1 \u548c idx_key2 \u90fd\u662f\u8303\u56f4\u67e5\u8be2\uff0c\u4e5f\u5c31\u662f\u8bf4\u67e5\u627e\u5230\u7684\u4e8c\u7ea7\u7d22\u5f15\u8bb0\u5f55\u5e76\u4e0d\u662f\u6309\u7167\u4e3b\u952e\u503c\u8fdb\u884c\u6392\u5e8f\u7684\uff0c\u5e76\u4e0d\u6ee1\u8db3\u4f7f\u7528 Intersection \u7d22\u5f15\u5408\u5e76\u7684\u6761\u4ef6\uff0c\u6240\u4ee5\u5e76\u4e0d\u4f1a\u4f7f\u7528\u7d22\u5f15\u5408\u5e76<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u6700\u540e\u4e09\u79cd\u53ef\u6267\u884c\u65b9\u6848\u7684\u6210\u672c\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u5168\u8868\u626b\u63cf\u7684\u6210\u672c\uff1a 2037.7<\/li>\n\n\n\n<li>\u4f7f\u7528 idx_key2 \u7684\u6210\u672c\uff1a 134.01<\/li>\n\n\n\n<li>\u4f7f\u7528 idx_key1 \u7684\u6210\u672c\uff1a 168.21<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">\u4f7f\u7528 idx_key2 \u7684\u6210\u672c\u6700\u4f4e\uff0c\u6240\u4ee5MySQL\u6700\u540e\u4f1a\u9009\u62e9 idx_key2 \u6765\u6267\u884c\u67e5\u8be2<\/p>\n\n\n\n<h5 class=\"wp-block-heading\">\u57fa\u4e8e\u7d22\u5f15\u7edf\u8ba1\u6570\u636e\u7684\u6210\u672c\u8ba1\u7b97<\/h5>\n\n\n\n<p class=\"wp-block-paragraph\">\u4e8c\u7ea7\u7d22\u5f15\u7684\u8303\u56f4\u533a\u95f4\u67e5\u627e\u65f6\u53ef\u80fd\u51fa\u73b0\u591a\u4e2a\u8303\u56f4\u533a\u95f4\uff0c\u5178\u578b\u7684\u5c31\u662f\u975e\u5e38\u591a\u7684\u5355\u70b9\u533a\u95f4\uff0c\u4f8b\u5982\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>SELECT * FROM single_table WHERE key1 IN ('aa1', 'aa2', 'aa3', ... , 'zzz');<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u8fd9\u4e2a\u67e5\u8be2\u53ef\u80fd\u4f1a\u4f7f\u7528idx_key1\uff0c\u7531\u4e8e\u8fd9\u4e2a\u7d22\u5f15\u5e76\u4e0d\u662f\u552f\u4e00\u4e8c\u7ea7\u7d22\u5f15\uff0c\u6240\u4ee5\u9700\u8981\u8ba1\u7b97\u6bcf\u4e2a\u533a\u95f4\u7684\u8bb0\u5f55\u6761\u6570\uff0c\u8ba1\u7b97\u65b9\u5f0f\u5c31\u662f\u5148\u83b7\u53d6\u7d22\u5f15\u5bf9\u5e94\u7684 B+ \u6811\u7684 \u533a\u95f4\u6700\u5de6\u8bb0\u5f55 \u548c \u533a\u95f4\u6700\u53f3\u8bb0\u5f55 \uff0c\u7136\u540e\u518d\u8ba1\u7b97\u8fd9\u4e24\u6761\u8bb0\u5f55\u4e4b\u95f4\u6709\u591a\u5c11\u8bb0\u5f55\uff0cMySQL \u628a\u8fd9\u79cd\u901a\u8fc7\u76f4\u63a5\u8bbf\u95ee\u7d22\u5f15\u5bf9\u5e94\u7684 B+ \u6811\u6765\u8ba1\u7b97\u67d0\u4e2a\u8303\u56f4\u533a\u95f4\u5bf9\u5e94\u7684\u7d22\u5f15\u8bb0\u5f55\u6761\u6570\u7684\u65b9\u5f0f\u79f0\u4e4b\u4e3a index dive\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u95ee\u9898\u5728\u4e8eIN\u8bed\u53e5\u4e2d\u7684\u53c2\u6570\u8fc7\u591a\u65f6\uff0c\u8ba1\u7b97\u8bb0\u5f55\u6761\u6570\u7684\u5f00\u9500\u53ef\u80fd\u6bd4\u5168\u8868\u626b\u63cf\u7684\u6210\u672c\u8fd8\u5927\uff0c\u6240\u4ee5MySQL\u63d0\u4f9b\u4e86\u4e00\u4e2a\u7cfb\u7edf\u53d8\u91cfeq_range_index_dive_limit\uff0c\u5982\u679cIN\u4e2d\u7684\u53c2\u6570\u5c0f\u4e8eeq_range_index_dive_limit\uff0c\u5219\u4f1a\u901a\u8fc7index dive\u8ba1\u7b97\u8bb0\u5f55\u6761\u6570\uff0c\u5982\u679c\u5927\u4e8eeq_range_index_dive_limit\uff0c\u5219\u4f7f\u7528\u6240\u8c13\u7684\u7d22\u5f15\u7edf\u8ba1\u6570\u636e\u6765\u8fdb\u884c\u4f30\u7b97\u8bb0\u5f55\u6761\u6570\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u50cf\u4f1a\u4e3a\u6bcf\u4e2a\u8868\u7ef4\u62a4\u4e00\u4efd\u7edf\u8ba1\u6570\u636e\u4e00\u6837\uff0c MySQL \u4e5f\u4f1a\u4e3a\u8868\u4e2d\u7684\u6bcf\u4e00\u4e2a\u7d22\u5f15\u7ef4\u62a4\u4e00\u4efd\u7edf\u8ba1\u6570\u636e\uff0c\u67e5\u770b\u67d0\u4e2a\u8868\u4e2d\u7d22\u5f15\u7684\u7edf\u8ba1\u6570\u636e\u53ef\u4ee5\u4f7f\u7528 SHOW INDEX FROM \u8868\u540d \u7684\u8bed\u6cd5\uff0c\u5176\u4e2d Cardinality\u00a0\u5c5e\u6027\u8868\u793a<em>\u7d22\u5f15\u5217\u4e2d\u4e0d\u91cd\u590d\u503c\u7684\u6570\u91cf<\/em>\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u7ed3\u5408\u4e0a\u4e00\u4e2a Rows \u7edf\u8ba1\u6570\u636e\uff0c\u6211\u4eec\u53ef\u4ee5\u9488\u5bf9\u7d22\u5f15\u5217\uff0c\u8ba1\u7b97\u51fa\u5e73\u5747\u4e00\u4e2a\u503c\u91cd\u590d\u591a\u5c11\u6b21\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\u4e00\u4e2a\u503c\u7684\u91cd\u590d\u6b21\u6570 \u2248 Rows \u00f7 Cardinality<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u518d\u770b\u4e0a\u9762\u7684\u67e5\u8be2\u8bed\u53e5\uff0c\u5982\u679cIN\u7684\u53c2\u6570\u670920000\u4e2a\u7684\uff0c\u6bcf\u4e00\u4e2a\u53c2\u6570\u5927\u7ea6\u5bf9\u5e9410\u6761\u6570\u636e\uff0c\u90a3\u53ef\u4ee5\u4f30\u7b97\u51fa\u9700\u8981\u56de\u8868\u7684\u8bb0\u5f55\u6570\u5927\u6982\u4e3a\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>20000 x 10 = 200000<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u867d\u7136\u4f7f\u7528\u7d22\u5f15\u7edf\u8ba1\u6570\u636e\u6765\u8ba1\u7b97\u533a\u95f4\u5bf9\u5e94\u7684\u7d22\u5f15\u8bb0\u5f55\u6570\u6bd4index dive\u7b80\u5355\uff0c\u4f46\u662f\u5b83\u7684\u7f3a\u70b9\u662f\uff1a\u4e0d\u7cbe\u786e\uff0c\u5b9e\u9645\u7684\u67e5\u8be2\u6210\u672c\u53ef\u80fd\u548c\u7edf\u8ba1\u6570\u636e\u8ba1\u7b97\u7684\u67e5\u8be2\u6210\u672c\u76f8\u5dee\u751a\u8fdc\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u8fde\u63a5\u67e5\u8be2\u7684\u6210\u672c<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">MySQL \u4e2d\u8fde\u63a5\u67e5\u8be2\u91c7\u7528\u7684\u662f\u5d4c\u5957\u5faa\u73af\u8fde\u63a5\u7b97\u6cd5\uff0c\u9a71\u52a8\u8868\u4f1a\u88ab\u8bbf\u95ee\u4e00\u6b21\uff0c\u88ab\u9a71\u52a8\u8868\u53ef\u80fd\u4f1a\u88ab\u8bbf\u95ee\u591a\u6b21\uff0c\u6240\u4ee5\u5bf9\u4e8e\u4e24\u8868\u8fde\u63a5\u67e5\u8be2\u6765\u8bf4\uff0c\u5b83\u7684\u67e5\u8be2\u6210\u672c\u7531\u4e0b\u8fb9\u4e24\u4e2a\u90e8\u5206\u6784\u6210\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u5355\u6b21\u67e5\u8be2\u9a71\u52a8\u8868\u7684\u6210\u672c<\/li>\n\n\n\n<li>\u88ab\u9a71\u52a8\u8868\u7684\u67e5\u8be2\u6210\u672c\u3002\u88ab\u9a71\u52a8\u8868\u7684\u67e5\u8be2\u6210\u672c\u53d6\u51b3\u4e8e\u88ab\u9a71\u52a8\u8868\u67e5\u8be2\u6b21\u6570\u548c\u5355\u6b21\u67e5\u8be2\u88ab\u9a71\u52a8\u8868\u9700\u8981\u7684\u6210\u672c<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">\u6211\u4eec\u628a\u5bf9\u9a71\u52a8\u8868\u8fdb\u884c\u67e5\u8be2\u540e\u5f97\u5230\u7684\u8bb0\u5f55\u6761\u6570\u79f0\u4e4b\u4e3a\u9a71\u52a8\u8868\u7684 \u6247\u51fa\uff0c\u5f53\u67e5\u8be2\u4f18\u5316\u5668\u60f3\u8ba1\u7b97\u6574\u4e2a\u8fde\u63a5\u67e5\u8be2\u6240\u4f7f\u7528\u7684\u6210\u672c\u65f6\uff0c\u5c31\u9700\u8981\u8ba1\u7b97\u51fa\u9a71\u52a8\u8868\u7684\u6247\u51fa\u503c\uff0c\u6709\u7684\u65f6\u5019\u6247\u51fa\u503c\u7684\u8ba1\u7b97\u662f\u5f88\u5bb9\u6613\u7684\uff0c\u5982\uff1a<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u67e5\u8be2\u4e00\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>SELECT * FROM single_table AS s1 INNER JOIN single_table2 AS s2;<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u5047\u5982\u628as1\u4f5c\u4e3a\u9a71\u52a8\u8868\uff0c\u663e\u7136\u9a71\u52a8\u8868\u7684\u67e5\u8be2\u53ea\u80fd\u4f7f\u7528\u5168\u8868\u626b\u63cf\uff0c\u6240\u4ee5\u9a71\u52a8\u8868\u7684\u6247\u51fa\u503c\u5c31\u662f\u9a71\u52a8\u8868\u7684\u8bb0\u5f55\u65709693<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u67e5\u8be2\u4e8c\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>SELECT * FROM single_table AS s1 INNER JOIN single_table2 AS s2 WHERE s1.key2 >10 AND s1.key2 &lt; 1000;<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u5047\u5982\u628as1\u4f5c\u4e3a\u9a71\u52a8\u8868\uff0c\u5355\u8868\u67e5\u8be2\u53ef\u4ee5\u4f7f\u7528idx_key\u7d22\u5f15\uff0cidx_key2 \u7684\u8303\u56f4\u533a\u95f4 (10, 1000)\u7684\u8bb0\u5f55\u6570\u4e0a\u9762\u6709\u8bf4\u670995\u6761\uff0c\u6240\u4ee5\u4f18\u5316\u5668\u5c31\u4f1a\u628a95\u4f5c\u4e3a\u9a71\u52a8\u8868\u7684\u6247\u51fa\u503c<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u67e5\u8be2\u4e09\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>SELECT * FROM single_table AS s1 INNER JOIN single_table2 AS s2 WHERE s1.common_field > 'xyz';<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u76f8\u5bf9\u67e5\u8be2\u4e00\u591a\u4e86\u4e00\u4e2a\u6761\u4ef6common_field > &#8216;xyz&#8217;\uff0c\u67e5\u8be2\u4f18\u5316\u5668\u53c8\u4e0d\u4f1a\u771f\u6b63\u7684\u53bb\u6267\u884c\u67e5\u8be2\uff0c\u6240\u4ee5\u5b83\u53ea\u80fd <strong><em>\u731c<\/em><\/strong> \u8fd9 9693 \u8bb0\u5f55\u91cc\u6709\u591a\u5c11\u6761\u8bb0\u5f55\u6ee1\u8db3 common_field > &#8216;xyz&#8217; \u6761\u4ef6<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u67e5\u8be2\u56db\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>SELECT * FROM single_table AS s1 INNER JOIN single_table2 AS s2 WHERE s1.key2 > 10 AND s1.key2 &lt; 1000 AND s1.common_field > 'xyz';<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u76f8\u5bf9\u4e8e\u67e5\u8be2\u4e8c\u9a71\u52a8\u8868s1\u591a\u4e86\u4e00\u4e2a\u67e5\u8be2\u6761\u4ef6common_field > &#8216;xyz&#8217;\uff0c\u4e0d\u8fc7\u56e0\u4e3a\u672c\u67e5\u8be2\u53ef\u4ee5\u4f7f\u7528 idx_key2 \u7d22\u5f15\uff0c\u6240\u4ee5\u53ea\u9700\u8981\u4ece\u7b26\u5408\u4e8c\u7ea7\u7d22\u5f15\u8303\u56f4\u533a\u95f4\u7684\u8bb0\u5f55\u4e2d\u731c\u6709\u591a\u5c11\u6761\u8bb0\u5f55\u7b26\u5408common_field > &#8216;xyz&#8217; \u6761\u4ef6\uff0c\u4e5f\u5c31\u662f\u53ea\u9700\u8981\u731c\u5728 95 \u6761\u8bb0\u5f55\u4e2d\u6709\u591a\u5c11\u7b26\u5408 common_field > &#8216;xyz&#8217; \u6761\u4ef6<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u67e5\u8be2\u4e94\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>SELECT * FROM single_table AS s1 INNER JOIN single_table2 AS s2 WHERE s1.key2 > 10 AND s1.key2 &lt; 1000 AND s1.key1 IN ('a', 'b', 'c') AND s1.common_field > 'xyz';<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u8ddf\u67e5\u8be2\u4e8c\u7c7b\u4f3c\uff0c\u5982\u679c\u4f7f\u7528idx_key2 \u7d22\u5f15\u6267\u884c\u67e5\u8be2\uff0c\u5219\u9700\u8981 \u731c \u591a\u5c11\u6761\u8bb0\u5f55\u540c\u65f6\u6ee1\u8db3\u4e0b\u9762\u7684\u6761\u4ef6\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>key1 IN (&#8216;a&#8217;, &#8216;b&#8217;, &#8216;c&#8217;)<\/li>\n\n\n\n<li>common_field > &#8216;xyz&#8217;<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">\u9664\u4e86\u67e5\u8be2\u4e00\u548c\u67e5\u8be2\u4e8c\uff0c\u540e\u9762\u51e0\u79cd\u67e5\u8be2\u90fd\u4e0d\u80fd\u5f97\u5230\u7cbe\u786e\u7684\u6570\u636e\uff0c\u5728\u8fd9\u4e24\u79cd\u60c5\u51b5\u4e0b\u8ba1\u7b97\u9a71\u52a8\u8868\u6247\u51fa\u503c\u65f6\u9700\u8981\u9760 \u731c\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u5982\u679c\u4f7f\u7528\u7684\u662f\u5168\u8868\u626b\u63cf\u7684\u65b9\u5f0f\u6267\u884c\u7684\u5355\u8868\u67e5\u8be2\uff0c\u90a3\u4e48\u8ba1\u7b97\u9a71\u52a8\u8868\u6247\u51fa\u65f6\u9700\u8981\u731c\u6ee1\u8db3\u641c\u7d22\u6761\u4ef6\u7684\u8bb0\u5f55\u5230\u5e95\u6709\u591a\u5c11\u6761<\/li>\n\n\n\n<li>\u5982\u679c\u4f7f\u7528\u7684\u662f\u7d22\u5f15\u6267\u884c\u7684\u5355\u8868\u626b\u63cf\uff0c\u90a3\u4e48\u8ba1\u7b97\u9a71\u52a8\u8868\u6247\u51fa\u7684\u65f6\u5019\u9700\u8981\u731c\u6ee1\u8db3\u9664\u4f7f\u7528\u5230\u5bf9\u5e94\u7d22\u5f15\u7684\u641c\u7d22\u6761\u4ef6\u5916\u7684\u5176\u4ed6\u641c\u7d22\u6761\u4ef6\u7684\u8bb0\u5f55\u6709\u591a\u5c11\u6761<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">MySQL\u628a\u8fd9\u4e2a\u731c\u7684\u8fc7\u7a0b\u79f0\u4e3a<em><strong>condition filtering<\/strong><\/em>\uff0c\u8fd9\u4e2a\u8fc7\u7a0b\u4e2d\u53ef\u80fd\u4f1a\u4f7f\u7528\u5230\u7d22\u5f15\uff0c\u4e5f\u53ef\u80fd\u4f7f\u7528\u5230\u7edf\u8ba1\u6570\u636e\uff0c\u6574\u4e2a\u8bc4\u4f30\u8fc7\u7a0b\u633a\u590d\u6742\u7684\uff0c\u5c31\u4e0d\u4ed4\u7ec6\u53d9\u8ff0\u4e86\u3002<\/p>\n\n\n\n<h5 class=\"wp-block-heading\">\u4e24\u8868\u67e5\u8be2\u7684\u6210\u672c\u5206\u6790<\/h5>\n\n\n\n<p class=\"wp-block-paragraph\">\u6240\u4ee5\u8fde\u63a5\u67e5\u8be2\u7684\u6210\u672c\u8ba1\u7b97\u516c\u5f0f\u4e3a\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\u8fde\u63a5\u67e5\u8be2\u603b\u6210\u672c = \u5355\u6b21\u8bbf\u95ee\u9a71\u52a8\u8868\u7684\u6210\u672c + \u9a71\u52a8\u8868\u6247\u51fa\u6570 x \u5355\u6b21\u8bbf\u95ee\u88ab\u9a71\u52a8\u8868\u7684\u6210\u672c<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u5bf9\u4e8e\u5de6\u8fde\u63a5\u548c\u53f3\u8fde\u63a5\u6765\u8bf4\uff0c\u9a71\u52a8\u8868\u548c\u88ab\u9a71\u52a8\u8868\u662f\u56fa\u5b9a\u7684\uff0c\u6240\u4ee5\u53ea\u9700\u8981\u8ba1\u7b97\u4e24\u8005\u4e4b\u548c\u7684\u6700\u4f4e\u6210\u672c\u5c31\u884c\u4e86\uff0c\u800c\u5bf9\u4e8e\u5168\u8fde\u63a5\u6765\u8bf4\uff0c\u5219\u9700\u8981\u8003\u8651\u4e24\u65b9\u9762\u7684\u6210\u672c\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u4e0d\u540c\u7684\u8868\u4f5c\u4e3a\u9a71\u52a8\u8868\u6700\u7ec8\u7684\u67e5\u8be2\u6210\u672c\u53ef\u80fd\u662f\u4e0d\u540c\u7684\uff0c\u4e5f\u5c31\u662f\u9700\u8981\u8003\u8651\u6700\u4f18\u7684\u8868\u8fde\u63a5\u987a\u5e8f<\/li>\n\n\n\n<li>\u7136\u540e\u5206\u522b\u4e3a\u9a71\u52a8\u8868\u548c\u88ab\u9a71\u52a8\u8868\u9009\u62e9\u6210\u672c\u6700\u4f4e\u7684\u8bbf\u95ee\u65b9\u6cd5<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">\u8fde\u63a5\u67e5\u8be2\u6210\u672c\u5360\u5927\u5934\u7684\u662f \u9a71\u52a8\u8868\u6247\u51fa\u6570 x \u5355\u6b21\u8bbf\u95ee\u88ab\u9a71\u52a8\u8868 \u7684\u6210\u672c \uff0c\u6240\u4ee5\u6211\u4eec\u7684\u4f18\u5316\u91cd\u70b9\u662f\u4e0b\u8fb9\u8fd9\u4e24\u4e2a\u90e8\u5206\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u5c3d\u91cf\u51cf\u5c11\u9a71\u52a8\u8868\u7684\u6247\u51fa<\/li>\n\n\n\n<li>\u5bf9\u88ab\u9a71\u52a8\u8868\u7684\u8bbf\u95ee\u6210\u672c\u5c3d\u91cf\u4f4e<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">\u6211\u4eec\u9700\u8981\u5c3d\u91cf\u5728\u88ab\u9a71\u52a8\u8868\u7684\u8fde\u63a5\u5217\u4e0a\u5efa\u7acb\u7d22\u5f15\uff0c\u8fd9\u6837\u5c31\u53ef\u4ee5\u4f7f\u7528 ref \u8bbf\u95ee\u65b9\u6cd5\u6765\u964d\u4f4e\u8bbf\u95ee\u88ab\u9a71\u52a8\u8868\u7684\u6210\u672c\u4e86<\/p>\n\n\n\n<h5 class=\"wp-block-heading\">\u591a\u8868\u8fde\u63a5\u7684\u6210\u672c\u5206\u6790<\/h5>\n\n\n\n<p class=\"wp-block-paragraph\">\u591a\u8868\u8fde\u63a5\u7684\u65b9\u5f0f\u6709\u5f88\u591a\u79cd\uff0c\u6bd4\u5982ABC\u4e09\u8868\u5185\u8fde\u63a5\uff0c\u8fde\u63a5\u65b9\u5f0f\u5c31\u67093!\u79cd\uff0cn\u8868\u5185\u8fde\u63a5\u7684\u65b9\u5f0f\u5c31\u6709n!\u79cd\uff0c\u5bf9\u4e8e\u8fd9\u4e9b\u8fde\u63a5\u65b9\u5f0f\uff0cMySQL\u5b9e\u9645\u662f\u6bcf\u79cd\u65b9\u5f0f\u90fd\u8981\u8ba1\u7b97\u4e00\u904d\u7684\uff0c\u4f46\u662fMySQL\u4e2d\u4e5f\u6709\u975e\u5e38\u591a\u7684\u65b9\u6cd5\u6765\u51cf\u5c11\u6210\u672c\u8ba1\u7b97\u7684\u6210\u672c\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u63d0\u524d\u7ed3\u675f\u67d0\u79cd\u987a\u5e8f\u7684\u6210\u672c\u8bc4\u4f30\u3002MySQL\u5728\u8ba1\u7b97\u8fde\u63a5\u6210\u672c\u65f6\u4f1a\u7ef4\u62a4\u4e00\u4e2a\u5168\u5c40\u53d8\u91cf\u5b58\u50a8\u6700\u5c0f\u7684\u8fde\u63a5\u6210\u672c\uff0c\u8ba1\u7b97\u6bcf\u4e2a\u8fde\u63a5\u6210\u672c\u65f6\uff0c\u5f53\u5f53\u524d\u8ba1\u7b97\u7684\u6210\u672c\u5df2\u7ecf\u8d85\u8fc7\u6700\u5c0f\u8fde\u63a5\u6210\u672c\uff0c\u5c31\u4e0d\u4f1a\u5f80\u540e\u7ee7\u7eed\u5206\u6790\u5f53\u524d\u7684\u8fde\u63a5\u6210\u672c\u4e86<\/li>\n\n\n\n<li>\u7cfb\u7edf\u53d8\u91cf optimizer_search_depth\u3002\u4e3a\u4e86\u9632\u6b62\u65e0\u7a77\u65e0\u5c3d\u7684\u5206\u6790\u5404\u79cd\u8fde\u63a5\u987a\u5e8f\u7684\u6210\u672c\uff0c\u8bbe\u8ba1 MySQL \u7684\u5927\u53d4\u4eec\u63d0\u51fa\u4e86 optimizer_search_depth \u7cfb\u7edf\u53d8\u91cf\uff0c\u5982\u679c\u8fde\u63a5\u8868\u7684\u4e2a\u6570\u5c0f\u4e8e\u8be5\u503c\uff0c\u90a3\u4e48\u5c31\u7ee7\u7eed\u7a77\u4e3e\u5206\u6790\u6bcf\u4e00\u79cd\u8fde\u63a5\u987a\u5e8f\u7684\u6210\u672c\uff0c\u5426\u5219\u53ea\u5bf9\u4e0eoptimizer_search_depth \u503c\u76f8\u540c\u6570\u91cf\u7684\u8868\u8fdb\u884c\u7a77\u4e3e\u5206\u6790<\/li>\n\n\n\n<li>\u6839\u636e\u67d0\u4e9b\u89c4\u5219\u538b\u6839\u513f\u5c31\u4e0d\u8003\u8651\u67d0\u4e9b\u8fde\u63a5\u987a\u5e8f\u3002\u5373\u4f7f\u662f\u6709\u4e0a\u8fb9\u4e24\u6761\u89c4\u5219\u7684\u9650\u5236\uff0c\u4f46\u662f\u5206\u6790\u591a\u4e2a\u8868\u4e0d\u540c\u8fde\u63a5\u987a\u5e8f\u6210\u672c\u82b1\u8d39\u7684\u65f6\u95f4\u8fd8\u662f\u4f1a\u5f88\u957f\uff0c\u6240\u4ee5\u8bbe\u8ba1 MySQL<\/li>\n\n\n\n<li>\u7684\u5927\u53d4\u5e72\u8106\u63d0\u51fa\u4e86\u4e00\u4e9b\u6240\u8c13\u7684 \u542f\u53d1\u5f0f\u89c4\u5219 \uff08\u5c31\u662f\u6839\u636e\u4ee5\u5f80\u7ecf\u9a8c\u6307\u5b9a\u7684\u4e00\u4e9b\u89c4\u5219\uff09\uff0c\u51e1\u662f\u4e0d\u6ee1\u8db3\u8fd9\u4e9b\u89c4\u5219\u7684\u8fde\u63a5\u987a\u5e8f\u538b\u6839\u513f\u5c31\u4e0d\u5206\u6790<\/li>\n<\/ul>\n\n\n\n<h5 class=\"wp-block-heading\">\u8c03\u8282\u6210\u672c\u5e38\u6570<\/h5>\n\n\n\n<p class=\"wp-block-paragraph\">\u67e5\u8be2\u4f18\u5316\u5668\u4f1a\u57fa\u4e8e\u6210\u672c\u5e38\u6570\u5bf9\u67e5\u8be2\u6210\u672c\u505a\u8ba1\u7b97\uff0c\u5f53\u4fee\u6539\u6210\u672c\u5e38\u6570\u65f6\u4f1a\u5f71\u54cd\u67e5\u8be2\u4f18\u5316\u5668\u67e5\u8be2\u65f6\u7684\u6210\u672c\u8ba1\u7b97\uff0cMySQL\u7684\u6210\u672c\u5e38\u6570\u88ab\u5b58\u5728\u4e86\u4e24\u4e2a\u8868\u4e2d\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mysql> SHOW TABLES FROM mysql LIKE '%cost%';\n+--------------------------+\n| Tables_in_mysql (%cost%) |\n+--------------------------+\n| engine_cost |\n| server_cost |\n+--------------------------+\n2 rows in set (0.00 sec)<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u4e00\u6761\u8bed\u53e5\u7684\u6267\u884c\u5176\u5b9e\u662f\u5206\u4e3a\u4e24\u5c42\u7684\uff0c\u5728 server \u5c42\u8fdb\u884c\u8fde\u63a5\u7ba1\u7406\u3001\u67e5\u8be2\u7f13\u5b58\u3001\u8bed\u6cd5\u89e3\u6790\u3001\u67e5\u8be2\u4f18\u5316\u7b49\u64cd\u4f5c\uff0c\u5728\u5b58\u50a8\u5f15\u64ce\u5c42\u6267\u884c\u5177\u4f53\u7684\u6570\u636e\u5b58\u53d6\u64cd\u4f5c\u3002\u4e5f\u5c31\u662f\u8bf4\u4e00\u6761\u8bed\u53e5\u5728 server \u5c42\u4e2d\u6267\u884c\u7684\u6210\u672c\u662f\u548c\u5b83\u64cd\u4f5c\u7684\u8868\u4f7f\u7528\u7684\u5b58\u50a8\u5f15\u64ce\u662f\u6ca1\u5173\u7cfb\u7684\uff0c\u6240\u4ee5\u5173\u4e8e\u8fd9\u4e9b\u64cd\u4f5c\u5bf9\u5e94\u7684 \u6210\u672c\u5e38\u6570 \u5c31\u5b58\u50a8\u5728\u4e86 server_cost \u8868\u4e2d\uff0c\u800c\u4f9d\u8d56\u4e8e\u5b58\u50a8\u5f15\u64ce\u7684\u4e00\u4e9b\u64cd\u4f5c\u5bf9\u5e94\u7684 \u6210\u672c\u5e38\u6570 \u5c31\u5b58\u50a8\u5728\u4e86engine_cost \u8868\u4e2d\u3002\u8be6\u7ec6\u53c2\u6570\u53ca\u4f5c\u7528\u7565\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4ec0\u4e48\u662f\u6210\u672c MySQL\u6267\u884c\u67e5\u8be2\u65f6\u4f1a\u6709\u4e0d\u540c\u7684\u6267\u884c\u65b9\u6848\uff0c\u5b83\u4f1a\u9009\u62e9\u4ee3\u4ef7\u6700\u4f4e\u7684\u65b9\u6848\u53bb\u771f\u6b63\u7684\u6267\u884c\u67e5\u8be2\uff0c\u90a3\u6211\u4eec\u9700\u8981\u77e5\u9053\u4ec0\u4e48 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[25,88],"tags":[],"class_list":["post-2460","post","type-post","status-publish","format-standard","hentry","category-code","category-mysql"],"_links":{"self":[{"href":"http:\/\/www.spiceandwolf.com.cn\/index.php\/wp-json\/wp\/v2\/posts\/2460","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.spiceandwolf.com.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.spiceandwolf.com.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.spiceandwolf.com.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.spiceandwolf.com.cn\/index.php\/wp-json\/wp\/v2\/comments?post=2460"}],"version-history":[{"count":21,"href":"http:\/\/www.spiceandwolf.com.cn\/index.php\/wp-json\/wp\/v2\/posts\/2460\/revisions"}],"predecessor-version":[{"id":2482,"href":"http:\/\/www.spiceandwolf.com.cn\/index.php\/wp-json\/wp\/v2\/posts\/2460\/revisions\/2482"}],"wp:attachment":[{"href":"http:\/\/www.spiceandwolf.com.cn\/index.php\/wp-json\/wp\/v2\/media?parent=2460"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.spiceandwolf.com.cn\/index.php\/wp-json\/wp\/v2\/categories?post=2460"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.spiceandwolf.com.cn\/index.php\/wp-json\/wp\/v2\/tags?post=2460"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}