{"id":18678,"date":"2020-10-03T17:14:00","date_gmt":"2020-10-03T09:14:00","guid":{"rendered":"https:\/\/www.orczhou.com\/?p=18678"},"modified":"2026-08-01T17:15:38","modified_gmt":"2026-08-01T09:15:38","slug":"innodb-record-row-format","status":"publish","type":"post","link":"https:\/\/www.orczhou.com\/index.php\/2020\/10\/innodb-record-row-format\/","title":{"rendered":"InnoDB \u7684\u201c\u8bb0\u5f55\u201d\u5b58\u50a8"},"content":{"rendered":"\n\n\n\n<p style=\"margin-top:4px;padding-top:4px\">\u4e86\u89e3<code>InnoDB<\/code>\u7684\u7269\u7406\u5b58\u50a8\u53ef\u4ee5\u4e3a\u540e\u7eed\u8fdb\u4e00\u6b65\u4e86\u89e3\u5176\u65e5\u5fd7\u5b58\u50a8\u6253\u4e0b\u57fa\u7840\u3002\u5728\u524d\u8ff0\u7684\u5185\u5bb9\uff0c\u8f83\u4e3a\u8be6\u7ec6\u7684\u4ecb\u7ecd\u4e86<code>InnoDB<\/code>\u5185\u90e8\u7684<code>B<sup>+<\/sup>-Tree<\/code>\u5b58\u50a8\uff0c\u672c\u6587\u5728\u6b64\u57fa\u7840\u4e0a\uff0c\u7ee7\u7eed\u4ecb\u7ecd\uff0c\u4e00\u4e2a<code>B<sup>+<\/sup>-Tree<\/code>\u7684\u8282\u70b9\uff08\u7ecf\u5e38\u79f0\u4f5c\u201c\u9875\u9762\u201d\uff09\u4e2d\uff0c\u5982\u4f55\u5b58\u50a8\u5355\u6761\u8bb0\u5f55\u7684\u3002\u672c\u6587\uff0c\u4ec5\u4ecb\u7ecd\u5176\u4e00\u822c\u5b9e\u73b0\uff0c\u5e76\u4e0d\u5bf9<code>InnoDB<\/code>\u8bb0\u5f55\u683c\u5f0f\u7684\u5404\u79cd\u7c7b\u578b\u3001\u573a\u666f\u505a\u8be6\u7ec6\u4ecb\u7ecd\u3002<\/p>\n\n\n\n<p>\u8fd9\u90e8\u5206\u5012\u6ca1\u6709\u4ec0\u4e48\u590d\u6742\u7684\u7406\u8bba\u7684\uff0c\u66f4\u591a\u7684\u662f\u4e00\u4e9b\u5b9e\u8df5\u7ecf\u9a8c\u4ee5\u53ca\u5b9e\u9645\u5e94\u7528\u573a\u666f\u4e2d\u5404\u79cd\u60c5\u51b5\u7684\u8003\u8651\u4e0e\u9002\u914d\u3002<\/p>\n\n\n\n<p>\u6700\u4e3a\u76f4\u63a5\u7684\uff0c\u5219\u662f\u6309\u7167\u201c\u6570\u636e\u8868\u201d\u5404\u4e2a\u5217\u7684\u5143\u6570\u636e\u987a\u5e8f\u6392\u5217\u5373\u53ef\u3002\u800c\u4e8b\u5b9e\u4e0a\uff0c\u8fd9\u4e5f\u662f<code>InnoDB<\/code>\u5b9e\u73b0\u7684\u57fa\u672c\u539f\u5219\u3002\u4f46\u5728\u5b9e\u8df5\u4e2d\uff0c\u8fd8\u6709\u5f88\u591a\u7684\u95ee\u9898\u8981\u53bb\u89e3\u51b3\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u603b\u662f\u8981\u8003\u8651\u5b58\u50a8\u4e0e\u8bfb\u53d6\u6548\u7387\uff1a\u5b58\u50a8\u7a7a\u95f4\u5c3d\u91cf\u4e0d\u8981\u6709\u6d6a\u8d39\uff0c\u8fd9\u6837\u53ef\u4ee5\u4fdd\u6301\u5355\u4e2a\u9875\u9762\u5b58\u50a8\u66f4\u591a\u7684\u6570\u636e\uff0c\u5219\u6709\u66f4\u9ad8\u7684\u78c1\u76d8\u548c\u5185\u5b58\u7684\u5229\u7528\u7387\u3002\u4f8b\u5982\uff0c\u9700\u8981\u8003\u8651<code>Default<\/code>\u503c\u5982\u4f55\u5b58\u50a8\uff1f<code>NULL<\/code>\u503c\u5982\u4f55\u5b58\u50a8\uff1f\u53d8\u957f\u5b57\u6bb5\u5982\u4f55\u5b58\u50a8\uff1f\u8d85\u5927\u7684\u5b57\u6bb5\u5982\u4f55\u5b58\u50a8\u7b49\u3002<\/li>\n\n\n\n<li>\u5982\u4f55\u8f83\u4e3a\u4fbf\u6377\u7684\u5b9e\u73b0\u5404\u79cd\u7c7b\u578b\u7684<code>DDL<\/code>\uff0c\u4f8b\u5982\u65b0\u589e\u4e00\u4e2a\u5b57\u6bb5\u3001\u5220\u9664\u4e00\u4e2a\u5b57\u6bb5\u7b49<\/li>\n<\/ul>\n\n\n\n<p><\/p>\n\n\n\n<p>\u4e00\u6761\u8bb0\u5f55\u5206\u4e3a\u4e24\u4e2a\u90e8\u5206\uff0cRecord Header<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">1. \u51c6\u5907\u6d4b\u8bd5\u6570\u636e<\/h3>\n\n\n\n<p>\u8fd9\u91cc\u65b0\u5efa\u8868\uff0c\u5e76\u5199\u5165\u4e24\u6761\u65b0\u7684\u6570\u636e\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"sql\" class=\"language-sql\">DROP TABLE IF EXISTS t_r; \nCREATE TABLE t_r (\n  id int auto_increment primary key ,\n  nick varchar(32),\n  birthday date,\n  password_hash char(32),\n  email varchar(32)\n);\n\nINSERT INTO t_r VALUES \n  (1,\"zzx\",\"1989-02-11\",\"a76e5fc27899ada11b4eafd0b1a7a4fc\",'zzx@example.com'),\n  (2,\"yhq\",\"2012-05-18\",\"b6bdc8dcddeacece09d5697145d373d9\",'yhq@example.com')\n;<\/code><\/pre>\n\n\n\n<p>\uff08\u6ce8\uff1a\u6700\u597d\u4e0d\u8981\u8fd9\u6837\u5b58\u50a8<code>hash<\/code>\u503c\uff09<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">2. \u627e\u5230\u6570\u636e\u9875<\/h3>\n\n\n\n<p>\u8fd9\u9700\u8981\u4e00\u4e9b\u80cc\u666f\u77e5\u8bc6\uff0c\u4f46\u5e76\u4e0d\u662f\u672c\u6587\u4ecb\u7ecd\u7684\u91cd\u70b9\u3002\u5728\u72ec\u7acb\u8868\u7a7a\u95f4\uff08\u5f53\u524dMySQL\u7684\u9ed8\u8ba4\u884c\u4e3a\uff09\u7684\u60c5\u51b5\u4e0b\uff0c\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u5728\u6570\u636e\u76ee\u5f55\u4e0b\u627e\u5230\u8868\u6570\u636e\u6587\u4ef6\uff1a<code>db.t_r.ibd<\/code><\/li>\n\n\n\n<li>\u67e5\u770b\u8be5\u9875\u9762\u7684\u7b2c\u56db\u4e2a<code>Page<\/code>\u5373\u4e3a\u7b2c\u4e00\u4e2a\u6570\u636e\u9875\u9762\uff0c\u56e0\u4e3a\u8fd9\u91cc\u5199\u5165\u7684\u6570\u636e\u8f83\u5c11\uff0c\u6240\u4ee5\uff0c\u4e00\u822c\u5c31\u5b58\u50a8\u5728\u8be5\u9875\u9762<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">2.1 \u4e3a\u4ec0\u4e48\u662f\u7b2c\u56db\u4e2a\u9875\u9762<\/h4>\n\n\n\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-28f84493 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<p>\u5982\u679c\u5bf9\u4e8e\u8fd9\u4e2a\u95ee\u9898\u611f\u5174\u8da3\u7684\u8bdd\uff0c\u53ef\u4ee5\u53c2\u8003 <a href=\"https:\/\/blog.jcole.us\/2013\/01\/03\/the-basics-of-innodb-space-file-layout\/\">The basics of InnoDB space file layout<\/a> \u4e2d\u5173\u4e8e\u201cPer-table space files\u201d\u7684\u63cf\u8ff0\u3002\u53ef\u4ee5\u770b\u5230\uff0c\u7b2c\u56db\u4e2a\u9875\u9762\u5373\u4e3a<code>INDEX: Root page of first index<\/code>\u3002<\/p>\n\n\n\n<p>\u4f7f\u7528<code>vim<\/code>\uff08<code>:%!xxd<\/code>)\u67e5\u770b\u65f6\uff0c\u6bcf\u884c<code>16 Bytes<\/code>\uff0c\u4e00\u4e2a\u9875\u9762\u5c31\u662f<code>1024<\/code>\u884c\uff0c\u7b2c\u56db\u4e2a\u9875\u9762\uff0c\u5373\u4ece<code>3073<\/code>\u884c\u5f00\u59cb\uff0c\u5230<code>4096<\/code>\u884c\u7ed3\u675f\u3002<\/p>\n<\/div>\n\n\n\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"474\" height=\"299\" src=\"https:\/\/www.orczhou.com\/wp-content\/uploads\/2025\/05\/image-60.png\" alt=\"\" class=\"wp-image-18695\" srcset=\"https:\/\/www.orczhou.com\/wp-content\/uploads\/2025\/05\/image-60.png 474w, https:\/\/www.orczhou.com\/wp-content\/uploads\/2025\/05\/image-60-300x189.png 300w\" sizes=\"auto, (max-width: 474px) 100vw, 474px\" \/><\/figure>\n<\/div>\n<\/div>\n\n\n\n<h4 class=\"wp-block-heading\">2.2 \u6570\u636e\u9875\u4e8c\u8fdb\u5236\u6570\u636e<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"adoc\" class=\"language-adoc\">$ view -b t_r.ibd\n3073 0000c000: 646e 9e73 0000 0003 ffff ffff ffff ffff  dn.s............\n3074 0000c010: 0000 0007 de81 961e 45bf 0000 0000 0000  ........E.......\n3075 0000c020: 0000 0000 01d0 0002 0114 8004 0000 0000  ................\n3076 0000c030: 00ce 0002 0001 0002 0000 0000 0000 0000  ................\n3077 0000c040: 0000 0000 0000 0000 030c 0000 01d0 0000  ................\n3078 0000c050: 0002 00f2 0000 01d0 0000 0002 0032 0100  .............2..\n3079 0000c060: 0200 1d69 6e66 696d 756d 0003 000b 0000  ...infimum......\n3080 0000c070: 7375 7072 656d 756d 0f03 0000 0010 004e  supremum.......N\n3081 0000c080: 8000 0001 0000 0090 f05b bb00 0001 3101  .........[....1.\n3082 0000c090: 107a 7a78 8f8a 4b61 3736 6535 6663 3237  .zzx..Ka76e5fc27\n3083 0000c0a0: 3839 3961 6461 3131 6234 6561 6664 3062  899ada11b4eafd0b\n3084 0000c0b0: 3161 3761 3466 637a 7a78 4065 7861 6d70  1a7a4fczzx@examp\n3085 0000c0c0: 6c65 2e63 6f6d 0f03 0000 0018 ffa2 8000  le.com..........\n3086 0000c0d0: 0002 0000 0090 f05b bb00 0001 3101 1d79  .......[....1..y\n3087 0000c0e0: 6871 8fb8 b262 3662 6463 3864 6364 6465  hq...b6bdc8dcdde\n3088 0000c0f0: 6163 6563 6530 3964 3536 3937 3134 3564  acece09d5697145d\n3089 0000c100: 3337 3364 3979 6871 4065 7861 6d70 6c65  373d9yhq@example\n3090 0000c110: 2e63 6f6d 0000 0000 0000 0000 0000 0000  .com............\n3091 0000c120: 0000 0000 0000 0000 0000 0000 0000 0000  ................\n3092 0000c130: 0000 0000 0000 0000 0000 0000 0000 0000  ................\n     ......\n4094 0000ffd0: 0000 0000 0000 0000 0000 0000 0000 0000  ................\n4095 0000ffe0: 0000 0000 0000 0000 0000 0000 0000 0000  ................\n4096 0000fff0: 0000 0000 0070 0063 646e 9e73 de81 961e  .....p.cdn.s....<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">3. InnoDB \u7528\u6237\u201c\u8bb0\u5f55\u201d\u683c\u5f0f\u6982\u8ff0<\/h3>\n\n\n\n<p>\u5173\u4e8e\u8be5\u683c\u5f0f\u7684\u63cf\u8ff0\uff0c\u53ef\u4ee5\u53c2\u8003<code>innobase\/rem\/rem0rec.c<\/code>\u4e2d\u7684\u6ce8\u91ca\u8bf4\u660e\u90e8\u5206\uff0c\u6709\u6bd4\u8f83\u8be6\u7ec6\u7684\u8bf4\u660e\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"c\" class=\"language-c\">\/*\n...\n| length of the last non-null variable-length field of data:\n  if the maximum length is 255, one byte; otherwise,\n  0xxxxxxx (one byte, length=0..127), or 1exxxxxxxxxxxxxx (two bytes,\n  length=128..16383, extern storage flag) |\n...\n| length of first variable-length field of data |\n| SQL-null flags (1 bit per nullable field), padded to full bytes |\n| 4 bits used to delete mark a record, and mark a predefined\n  minimum record in alphabetical order |\n| 4 bits giving the number of records owned by this record\n  (this term is explained in page0page.h) |\n| 13 bits giving the order number of this record in the\n  heap of the index page |\n| 3 bits record type: 000=conventional, 001=node pointer (inside B-tree),\n  010=infimum, 011=supremum, 1xx=reserved |\n| two bytes giving a relative pointer to the next record in the page |\nORIGIN of the record\n| first field of data |\n...\n| last field of data |\n...\n*\/<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">4. InnoDB \u9875\u5185\u7684\u8bb0\u5f55<\/h3>\n\n\n\n<p>\u5728\u4e00\u4e2a\u9875\u9762\u5185\uff0cInnoDB\u5b58\u50a8\u6bcf\u6761\u7269\u7406\u8bb0\u5f55\u65f6\uff0c\u90fd\u4f1a\u5728\u8bb0\u5f55\u4e2d\u5b58\u50a8\u4e00\u4e2a\u201c\u6307\u9488\u201d\uff0c\u8be5\u201c\u6307\u9488\u201d\u6307\u5411\u4e0b\u4e00\u6761\u8bb0\u5f55\u7684\u7269\u7406\u4f4d\u7f6e\uff0c\u5e76\u4e14\u5728\u5b9e\u73b0\u65f6\uff0c\u8be5\u201c\u6307\u9488\u201d\u662f\u4ee5\u5f53\u524d\u8bb0\u5f55\u504f\u79fb\u7684\u65b9\u5f0f\u5b58\u50a8\u7684\u3002<\/p>\n\n\n\n<p>\u6240\u4ee5\uff0c\u5982\u679c\u6211\u4eec\u80fd\u591f\u627e\u5230\u9875\u9762\u5185\u7684\u7b2c\u4e00\u6761\u8bb0\u5f55\uff0c\u90a3\u4e48\u5c31\u53ef\u4ee5\u4f9d\u6b64\u987a\u5e8f\u7684\u904d\u5386\u6574\u4e2a\u9875\u9762\u5185\u7684\u8bb0\u5f55\u4e86\u3002\u627e\u5230\u7b2c\u4e00\u6761\u8bb0\u5f55\u5927\u6982\u6709\u5f88\u591a\u7684\u65b9\u6cd5\uff0c\u8fd9\u91cc\u8bf4\u8bf4InnoDB\u7684\u5b9e\u73b0\uff1a<code>infimum<\/code>\u548c<code>supremum<\/code>\u3002\u7b80\u5355\u6765\u8bf4\uff0cInnoDB\u4f1a\u5728\u9875\u9762\u4e2d\u5b58\u50a8\u4e00\u4e2a<code>infimum<\/code>\u8bb0\u5f55\uff0c\u8be5\u8bb0\u5f55\u53ef\u4ee5\u8ba4\u4e3a\u662f\u8be5\u9875\u9762\u7684\u6781\u5c0f\u503c\uff0c\u8be5\u8bb0\u5f55\u4e2d\u7684\u201cNext Record\u201d\u5373\u4e3a\u5b9e\u9645\u7684\u8be5\u9875\u9762\u6700\u5c0f\u503c\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">4.1 \u7cfb\u7edf\u8bb0\u5f55(system record)\uff1ainfimum \u548c supremum<\/h4>\n\n\n\n<p><code>infimum<\/code>\u548c<code>supremum<\/code>\u662f\u6bcf\u4e2a<code>InnoDB<\/code>\u9875\u9762\u5185\u5b58\u50a8\u4e24\u6761\u7269\u7406\u8bb0\u5f55\uff0c\u5206\u522b\u4ee3\u8868\u201c\u8d77\u59cb\u6700\u5c0f\u8bb0\u5f55\u201d\u548c\u201c\u7ed3\u675f\u6700\u5927\u8bb0\u5f55\u201d\u3002\u6240\u4ee5\u5982\u679c\u4f7f\u7528\u4e0a\u8ff0\u7684\u4e0b\u4e00\u6761\u8bb0\u5f55\u201c\u6307\u9488\u201d\u904d\u5386\u9875\u5185\u6240\u6709\u8bb0\u5f55\uff0c\u5219\u603b\u662f\u4ece<code>infimum<\/code>\u5f00\u59cb\uff0c\u4ee5<code>supremum<\/code>\u7ed3\u675f\uff0c\u4e2d\u95f4\u5c31\u662f\u6240\u6709\u7684\u7528\u6237\u8bb0\u5f55\u3002<\/p>\n\n\n\n<p>\u5728\u9875\u9762\u627e\u5230<code>infimum<\/code>\u548c<code>supremum<\/code>\u8bb0\u5f55\u7684\u65b9\u6cd5\u6709\u4e24\u79cd\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>infimum<\/code>\u548c<code>supremum<\/code>\u5728\u9875\u9762\u7684\u504f\u79fb\uff0c\u603b\u662f<code>99<\/code>\u548c<code>112<\/code><\/li>\n\n\n\n<li>\u4ece<code>Page Directory<\/code>\u7684<code>slot<\/code>\u4e2d\u67e5\u627e\uff1a\u7b2c\u4e00\u4e2a<code>slot<\/code>\u603b\u662f\u6307\u5411<code>infimum<\/code>\uff1b\u6700\u540e\u4e00\u4e2a<code>slot<\/code>\u603b\u662f\u6307\u5411<code>supremum<\/code><\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">4.2 \u4ecePage Directory\u627e\u5230infimum<\/h4>\n\n\n\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-28f84493 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<p>\u5728\u524d\u6587\u201cB<sup>+<\/sup>-Tree\u7684\u5185\u90e8\u641c\u7d22\uff1aInnoDB\u7684\u5b9e\u73b0\u201d\uff0c\u5df2\u7ecf\u6982\u8ff0\u4e86<code>slot 0<\/code>\u4e2d\u603b\u662f\u5b58\u50a8\u7684<code>infimum<\/code>\u8bb0\u5f55\uff0c\u5219\u53ef\u4ee5\u901a\u8fc7\u9875\u9762\u5e95\u90e8\u5411\u524d\u504f\u79fb<code>PAGE_DIR<\/code>\uff08InnoDB\u4e2d<code>PAGE_DIR<\/code>\u7684\u503c\u662f<code>8<\/code>\uff09\uff0c\u7136\u540e\u627e\u5230<code>slot 0<\/code>\u5bf9\u5e94\u7684\u8bb0\u5f55\u7684\u504f\u79fb\uff0c\u5373<code>infimum<\/code>\u7684\u504f\u79fb\uff0c\u800c\u56e0\u4e3a\u4e00\u4e2a<code>slot<\/code>\u5b58\u50a8\u7684\u504f\u79fb\u5730\u5740\u90fd\u662f<code>2 bytes<\/code> \u3002\u6240\u4ee5\uff0c\u5728\u9875\u9762\u5185\u7684\u5012\u6570\u7b2c10\u30019\u4e2a\u5b57\u8282\uff0c\u5373\u4e3a<code>infimum<\/code>\u5728\u9875\u5185\u7684\u504f\u79fb\u5730\u5740\uff0c\u5373<code>0x0063<\/code>\u3002<\/p>\n<\/div>\n\n\n\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<figure data-wp-context=\"{&quot;imageId&quot;:&quot;6a751d95d7bbd&quot;}\" data-wp-interactive=\"core\/image\" data-wp-key=\"6a751d95d7bbd\" class=\"wp-block-image alignleft size-large wp-lightbox-container\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"358\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/www.orczhou.com\/wp-content\/uploads\/2025\/05\/image-61-1024x358.png\" alt=\"\" class=\"wp-image-18746\" srcset=\"https:\/\/www.orczhou.com\/wp-content\/uploads\/2025\/05\/image-61-1024x358.png 1024w, https:\/\/www.orczhou.com\/wp-content\/uploads\/2025\/05\/image-61-300x105.png 300w, https:\/\/www.orczhou.com\/wp-content\/uploads\/2025\/05\/image-61-768x269.png 768w, https:\/\/www.orczhou.com\/wp-content\/uploads\/2025\/05\/image-61-1536x537.png 1536w, https:\/\/www.orczhou.com\/wp-content\/uploads\/2025\/05\/image-61.png 1584w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\taria-label=\"Enlarge\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.imageButtonRight\"\n\t\t\tdata-wp-style--top=\"state.imageButtonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><figcaption class=\"wp-element-caption\">Page Directory\u4e2d\u7684slot\u662f\u4ece\u9ad8\u4f4d\u5730\u5740\u5411\u5730\u4f4d\u5730\u5740\u6269\u5c55\u3002\u6545\u8fd9\u91cc\uff0cslot 0\u6307\u5411\u7684\u662f 0x0063\uff1bslot 1\u6307\u5411\u7684\u662f0x0070\u3002<\/figcaption><\/figure>\n<\/div>\n<\/div>\n\n\n\n<h4 class=\"wp-block-heading\">4.3 \u201c\u8bb0\u5f55\u201d\u6307\u9488<\/h4>\n\n\n\n<p>\u8fd9\u91cc\u6709\u4e24\u70b9\u9700\u8981\u6ce8\u610f\uff1a<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u4e00\u822c\u201c\u8bb0\u5f55\u201d\u6307\u9488\u901a\u5e38\u662f\u6307\u5411\u8bb0\u5f55\u7684\u201cthe origin of the record\u201d\uff0c\u5373\u5b9e\u9645\u6570\u636e\u5f00\u59cb\u7684\u5730\u65b9\u3002\u4e0d\u5305\u542b\u201c\u8bb0\u5f55\u5934\u201d\u90e8\u5206<\/li>\n\n\n\n<li>\u4e00\u822c\u201c\u8bb0\u5f55\u201d\u6307\u9488\u4f1a\u4f7f\u7528\u4e24\u79cd\u65b9\u5f0f\u8868\u793a\uff1a(a) \u9875\u5185\u504f\u79fb\uff1b(b) \u76f8\u5f53\u4e8e\u5f53\u524d\u8bb0\u5f55\u7684\u504f\u79fb\u3002\u4e0d\u540c\u7684\u5730\u65b9\u4f1a\u4e0d\u540c\uff0c\u4f8b\u5982\u201c\u8bb0\u5f55\u5934\u201d\u4e2d\u5b58\u50a8next record\u7684\u6307\u9488\u5219\u662f\u201c\u76f8\u5bf9\u504f\u79fb\u201d\uff0c\u800c<code>slot<\/code>\u5185\u5b58\u50a8\u7684\u5219\u662f\u9875\u5185\u7edd\u5bf9\u504f\u79fb\u3002<\/li>\n<\/ol>\n\n\n\n<p>\u7406\u89e3\u4e0a\u8ff0\u4e24\u70b9\uff0c\u5bf9\u4e8e\u7406\u89e3\u540e\u7eed\u5185\u5bb9\u662f\u5f88\u91cd\u8981\u7684\uff0c\u8981\u4e0d\u7136\uff0c\u53ef\u80fd\u4f1a\u7b97\u9519\u5730\u5740\u3002<\/p>\n\n\n\n<p>\u4f8b\u5982\uff0c\u4e0a\u8ff0\u7684<code>slot 0<\/code>\u4e2d\u8bb0\u5f55\u7684<code>infimum<\/code>\u7684\u504f\u79fb<code>0x0063<\/code>\u5c31\u662f\u7edd\u5bf9\u504f\u79fb\uff1b\u800c<code>infimum<\/code>\u4e2d\u5b58\u50a8\u7684<code>next record<\/code>\u504f\u79fb\uff0c\u5219\u662f\u76f8\u5bf9\u4e8e<code>infimum<\/code>\u7684\u504f\u79fb\u5730\u5740\u3002\u4f8b\u5982\uff0c<code>next record<\/code>\u504f\u79fb\u662f<code>00 1d<\/code>\uff0c\u90a3\u4e48\u610f\u5473\u7740\u8fd9\u6761\u8bb0\u5f55\u7684\u504f\u79fb\u662f<code>0x0063+0x001d<\/code>\uff0c\u5373\u7edd\u5bf9\u504f\u79fb\u662f\uff1a<code>0x0080<\/code>\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">4.4 \u8bb0\u5f55\u5934 record header<\/h4>\n\n\n\n<p>\u6309\u7167\u4e0a\u8ff0\u65b9\u6cd5\uff0c\u8fd9\u91cc\u5df2\u7ecf\u627e\u5230\u7b2c\u4e00\u6761\uff08\u6309\u5927\u5c0f\u987a\u5e8f\uff09\u8bb0\u5f55\u7684\u201c\u8bb0\u5f55\u6307\u9488\u201d\uff0c\u5373<code>0x0080<\/code>\u3002\u628a\u8bb0\u5f55\u7684\u5934\u90e8\uff08record header\uff09\u548c\u8bb0\u5f55\u672c\u8eab\u6570\u636e\u4ece\u4e0a\u8ff0\u4e8c\u8fdb\u5236\u6570\u636e\u5355\u72ec\u53d6\u51fa\u6765\uff0c\u5982\u4e0b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">                                   |&lt;-record header-&gt;|\n3080 0000c070: ................... 0f03 0000 0010 004e  supremum.......N\n               |&lt;---------- field data   -----------&gt;|\n3081 0000c080: 8000 0001 0000 0090 f05b bb00 0001 3101  .........[....1.\n               ^\n               |--&gt; record pointer\/offset (the origin of the record)\n3082 0000c090: 107a 7a78 8f8a 4b61 3736 6535 6663 3237  .zzx..Ka76e5fc27\n3083 0000c0a0: 3839 3961 6461 3131 6234 6561 6664 3062  899ada11b4eafd0b\n3084 0000c0b0: 3161 3761 3466 637a 7a78 4065 7861 6d70  1a7a4fczzx@examp\n3085 0000c0c0: 6c65 2e63 6f6d ........................  le.com..........\n              |&lt;-field data-&gt;|<\/code><\/pre>\n\n\n\n<p>\u6ce8\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u5728\u83b7\u5f97\u4e86 <code>record pointer<\/code>\u540e\uff0c\u662f\u65e0\u6cd5\u7b80\u5355\u7684\u3001\u76f4\u63a5\u83b7\u5f97<code>record header<\/code>\u957f\u5ea6\u7684\uff0c\u4e5f\u65e0\u6cd5\u7b80\u5355\u7684\u83b7\u53d6\u8bb0\u5f55\u672c\u8eab\u7684\u957f\u5ea6\u7684\u3002\u800c\u662f\u9700\u8981\u6839\u636e\u5143\u6570\u636e\u5e93\u3001\u4ee5\u53ca<code>record header<\/code>\u4e2d\u7684\u90e8\u5206\u6570\u636e\uff0c\u8ba1\u7b97\u800c\u6765\u3002<\/li>\n\n\n\n<li><code>record header<\/code> \u7684\u957f\u5ea6\u83b7\u53d6\uff0c\u662f\u6bd4\u8f83\u590d\u6742\u7684\u3002\u8fd9\u91cc\u505a\u4e00\u5b9a\u7684\u7b80\u5316\uff0c\u63cf\u8ff0\u5982\u4e0b\uff1a\n<ul class=\"wp-block-list\">\n<li><code>record pointer<\/code>\u5411\u524d\uff08<code>record header<\/code>\u65b9\u5411\uff09\u79fb\u52a8\uff0c5\u4e2abytes\u662f\u76f8\u5bf9\u56fa\u5b9a\u7684\uff0c\u5305\u542b\u4e86\n<ul class=\"wp-block-list\">\n<li><code>2 bytes<\/code>: next record<\/li>\n\n\n\n<li><code>3 bits<\/code>: record type<\/li>\n\n\n\n<li><code>13 bits<\/code>: the order number of this record<\/li>\n\n\n\n<li><code>4 bits<\/code>: the number of records owned by this record(slot) <\/li>\n\n\n\n<li><code>4 bits<\/code>: delete mark and mark a predefined  minimum record<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><code>record pointer<\/code>\u518d\u5411\u524d\u7684 <code>n<\/code>\u4e2a<code>bytes<\/code>\u5219\u7528\u4e8e\u5b58\u50a8 <code>null<\/code> \u7684<code>field<\/code>\uff0c\u8be5\u5b58\u50a8\u6a21\u5f0f\u4e3a\u6309\u6807\u8bb0\u4f4d\u5b58\u50a8\uff0c\u4e14\u6309<code>bytes<\/code>\u8865\u9f50\uff1a\n<ul class=\"wp-block-list\">\n<li>\u4f8b\u5982\uff0c\u8fd9\u91cc\u4e00\u5171\u6709<code>5<\/code>\u4e2a<code>fields<\/code>\uff0c\u5219\u9700\u8981<code>1 bytes<\/code>\uff0c\u4f5c\u4e3a\u6807\u8bb0\u4f4d\uff1b\u5982\u679c\u67d0\u4e2a<code>field<\/code>\u4e3a<code>null<\/code>\u5219\u5bf9\u5e94\u7684<code>bit<\/code>\u5373\u6807\u8bb0\u4f4d<code>1<\/code><\/li>\n\n\n\n<li>\u6240\u4ee5\uff0c\u8fd9\u91cc\u7684 <code>n=1<\/code><\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><code>record pointer<\/code>\u518d\u5411\u524d\u7684<code>m<\/code>\u4e2a<code>bytes<\/code>\u5219\u7528\u4e8e\u5b58\u50a8\u53d8\u6210\u5217\u7684\u5b9e\u9645\u957f\u5ea6\u3002\u672c\u793a\u4f8b\u4e2d\uff0c\u5171\u6709\u4e24\u4e2a\u53d8\u6210\u5217\uff0c\u6545\u8fd9\u91cc\u7684 <code>m = 2<\/code><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">4.5 \u8bb0\u5f55\u7684\u89e3\u6790Record Header<\/h4>\n\n\n\n<p>\u8fd9\u91cc\u4ee5\u9875\u9762\u4e2d\u7684\u7b2c\u4e00\u6761\u8bb0\u5f55\u4e3a\u793a\u4f8b\uff0c\u7ee7\u7eed\u89e3\u6790\u8be5\u8bb0\u5f55\u7684\u5934\u90e8\u4fe1\u606f\u3002\u8be6\u60c5\u5982\u4e0b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">(&lt;------------- record header \/ hex -----------------&gt;) (&lt;----- data\/hex -----&gt;)\n0f03 0000             0010             004e             8000 0001 0000 0090 f05b \n\n(hex)(&lt;---------------  binary   --------------------&gt;) (&lt;----- data\/hex -----&gt;)\n0f03 0000000000000000 0000000000010000 0000000001001110 8000 0001 0000 0090 f05b\n| |  |&lt;-----&gt;|&lt;-&gt;|&lt;--&gt;|&lt;----------&gt;|   |&lt;------------&gt;|\n| |  |       |   |    |            |   |\n| |  |       |   |    |            |   |--&gt;(2 bytes) next record\n| |  |       |   |    |            |\n| |  |       |   |    |            |--&gt;(3 bits) record type: 000=conventional\n| |  |       |   |    |\n| |  |       |   |    |--&gt;(13 bits) the order number of this record\n| |  |       |   |\n| |  |       |   |--&gt;(4 bits) the number of records owned by this record(slot)\n| |  |       |\n| |  |       |--&gt;(4 bits) delete mark and mark a predefined  minimum record\n| |  |\n| |  |--&gt;(8 bits) null-flag (here ,no null field at all, 5 field, so 1 bytes )\n| |\n| |--&gt;(1 byte) length of 1st variable field, so length is 03\n|\n|--&gt;(1 byte) length of 2nd variable field, so length is 0f(15)\n<\/code><\/pre>\n\n\n\n<p>\u7ed3\u5408\u8bb0\u5f55\u5934\u90e8\u4fe1\u606f\uff0c\u518d\u7ed3\u5408\u201c\u5143\u6570\u636e\u4fe1\u606f\u201d\uff0c\u5219\u5c31\u53ef\u4ee5\u89e3\u6790\u51fa\u8bb0\u5f55\u672c\u8eab\u7684\u4fe1\u606f\u4e86\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">5. \u5176\u4ed6<\/h3>\n\n\n\n<p>\u6709\u5f88\u591a\u4eba\u5bf9\u8fd9\u4e2a\u95ee\u9898\u5df2\u7ecf\u6709\u4e86\u975e\u5e38\u6df1\u5165\u5230\u8bf4\u660e\u6216\u7814\u7a76\uff0c\u5982\u4e0b\u7ed9\u51fa\u4e3b\u8981\u7684\u53c2\u8003\u94fe\u63a5\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/dev.mysql.com\/doc\/refman\/8.4\/en\/innodb-row-format.html\">MySQL Documentation: InnoDB Row Formats<\/a> \u975e\u5e38\u8be6\u7ec6\u7684\u4ecb\u7ecd\u4e86\u591a\u79cd<code>InnoDB<\/code>\u884c\u683c\u5f0f\u7c7b\u578b\uff1aREDUNDANT\u3001COMPACT \u3001DYNAMIC \u3001COMPRESSED\u7b49<\/li>\n\n\n\n<li>Jeremy Cole 2013 <a href=\"https:\/\/blog.jcole.us\/2013\/01\/10\/the-physical-structure-of-records-in-innodb\/\">The physical structure of records in InnoDB<\/a><\/li>\n\n\n\n<li>Jeremy Cole 2013 <a href=\"https:\/\/blog.jcole.us\/2013\/01\/10\/the-physical-structure-of-records-in-innodb\/\"><\/a><a href=\"https:\/\/blog.jcole.us\/2013\/01\/03\/the-basics-of-innodb-space-file-layout\/\">The basics of InnoDB space file layout<\/a><\/li>\n\n\n\n<li>Annamalai Gurusami MySQL Blog Archive 2014 <a href=\"https:\/\/dev.mysql.com\/blog-archive\/externally-stored-fields-in-innodb\/\">Externally Stored Fields in InnoDB<\/a><\/li>\n\n\n\n<li>Heikki Tuuri. Calvin Sun. 2009-04 <a href=\"https:\/\/speakerdeck.com\/xy\/innodb-internals\">InnoDB Internals: InnoDB File Formats and Source Code Structure<\/a><\/li>\n\n\n\n<li>Neoreminder 2020 <a href=\"https:\/\/neoremind.com\/2020\/01\/inside_innodb_file\/\">\u4eceMySQL InnoDB\u7269\u7406\u6587\u4ef6\u683c\u5f0f\u6df1\u5165\u7406\u89e3\u7d22\u5f15<\/a><\/li>\n\n\n\n<li>Yungyu 2020 <a href=\"https:\/\/www.cnblogs.com\/yungyu16\/p\/12940451.html\">InnoDB &#8212; \u884c\u8bb0\u5f55\u683c\u5f0f<\/a><\/li>\n<\/ul>\n\n\n\n<p><\/p>\n\n\n\n<p>\u5ef6\u4f38\u8ba8\u8bba\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u5404\u79cd\u6570\u636e\u7c7b\u578b\u7684\u5e8f\u5217\u4e0e\u53cd\u5e8f\u5217\u5316\uff0c\u4ee5\u53ca\u5bf9\u5e94\u7684\u6548\u7387\u8003\u8651<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>B+Tree<\/code>\u3001<code>B+-Tree<\/code> \u5747\u6307<code>B<sup>+<\/sup>-Tree<\/code><\/li>\n\n\n\n<li>\u4e00\u822c\u7684\uff0c<code>B-Tree<\/code>\u6307\u72ed\u4e49\u7684\u3001\u7ecf\u5178\u7684<code>B-Tree<\/code>\uff0c\u8be5\u7ed3\u6784\u4e3b\u8981\u53c2\u8003\uff1a<a href=\"https:\/\/www.orczhou.com\/index.php\/2025\/05\/understanding-innodb-and-b-tree-01\/\">\u4e86\u89e3 InnoDB \u7684\u7d22\u5f15\u7ed3\u6784\uff1aB-Tree \u57fa\u7840<\/a><\/li>\n\n\n\n<li>\u6709\u65f6\u5019\uff0c<code>B-Tree<\/code>\u4e5f\u4f1a\u6307\u4ee3<code>B<sup>+<\/sup>-Tree<\/code>\u6216\u5176\u4ed6<code>B-Tree<\/code>\u53d8\u79cd\uff1b\u8fd9\u79cd\u7528\u6cd5\u4e5f\u662f\u975e\u5e38\u5e7f\u6cdb\u7684\uff0c\u4f8b\u5982\uff0c\u5728<a href=\"https:\/\/dev.mysql.com\/doc\/refman\/8.4\/en\/innodb-physical-structure.html\"><code>MySQL\/InnoDB<\/code>\u7684\u6587\u6863<\/a>\u4e2d\uff0c\u4ec5\u4f7f\u7528<code>B-Tree<\/code>\uff0c\u800c\u66f4\u4e3a\u51c6\u786e\u7684\u8bf4\u662f<code>B+-Tree<\/code><\/li>\n\n\n\n<li>\u201c\u8282\u70b9\u201d\uff08<code>Node<\/code>\uff09\u3001\u201c\u9875\u9762\u201d\uff08<code>Page<\/code>\uff09\u3001\u201c\u6570\u636e\u5757\u201d\u3001\u201c\u5757\u201d(<code>Block<\/code>)\u7b49\u5747\u6307\u5b58\u50a8<code>B-Tree<\/code>\u6216<code>B<sup>+<\/sup>-Tree<\/code>\u7684\u8282\u70b9\uff0c\u5373\u6811\u7ed3\u6784\u7684\u8282\u70b9\uff0c\u5185\u90e8\u53ef\u4ee5\u5b58\u50a8\u591a\u4e2a\u952e\u503c\u3002\u5728\u4e0d\u540c\u7684\u8bed\u5883\u4e0b\uff0c\u5927\u5bb6\u4f1a\u7528\u4e0d\u540c\u7684\u8bcd\uff0c\u4f8b\u5982\u901a\u5e38\u5728\u7b97\u6cd5\u8bfe\u7a0b\/\u4e66\u7c4d\u4e2d\uff0c\u4f1a\u66f4\u591a\u7684\u4f7f\u7528\u201c\u8282\u70b9\u201d\uff08<code>Node<\/code>\uff09\uff1b\u800c\u5728\u6570\u636e\u5e93\u5b9e\u73b0\u4e2d\uff0c\u5219\u66f4\u559c\u6b22\u7528\u201c\u9875\u9762\u201d\uff08<code>Page<\/code>\uff09\u6216\u201c\u5757\u201d(<code>Block<\/code>)\uff1b\u66f4\u4e3a\u7ec6\u8282\u7684\uff0c\u5982\u679c\u5728\u5185\u5b58\u4e2d\uff0c\u5219\u66f4\u591a\u7684\u65f6\u5019\u7528\u201c\u9875\u9762\u201d\uff08<code>Page<\/code>\uff09\uff0c\u5728\u78c1\u76d8\u4e0a\uff0c\u5219\u66f4\u591a\u7684\u201c\u5757\u201d(<code>Block<\/code>)\u3002\u5404\u79cd\u60c5\u51b5\u4e0b\u6df7\u7528\u7684\u4e5f\u5f88\u591a\uff0c\u5e76\u6ca1\u6709\u4ec0\u4e48\u95ee\u9898\u3002<\/li>\n\n\n\n<li>\u201c\u8bb0\u5f55\u201d\uff08record\uff09\u3001\u201c\u884c\u201d\uff08row\uff09\u3001tuple\u90fd\u662f\u8868\u793a\u8868\u4e2d\u7684\u4e00\u884c\u8bb0\u5f55\uff0c\u901a\u5e38\u5305\u542b\u591a\u4e2a\u5b57\u6bb5\u6570\u636e\u3002<\/li>\n\n\n\n<li>\u7d22\u5f15\u5165\u53e3\uff08<code>Entry<\/code>\uff09\u7b49\u662f\u6307\u5b8c\u6574\u7684\u201c\u952e\u503c\u5bf9\u201d\uff0c\u5728\u53f6\u5b50\u8282\u70b9\u4e2d\uff0c\u901a\u5e38\u5305\u62ec\\( (k_i, a_i) \\)\uff1b\u5728\u975e\u53f6\u5b50\u8282\u70b9\u4e2d\u53ef\u80fd\u7684\u5f62\u5f0f\u662f\uff1a\\( (k_i,p_i, a_i) \\) \u6216 \\( (k_i, p_i) \\)<\/li>\n\n\n\n<li><code>TAOCP<\/code> \u662f \u201cThe Art of Computer Programming\u201d\u7684\u7f29\u5199<\/li>\n<\/ul>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e86\u89e3InnoDB\u7684\u7269\u7406\u5b58\u50a8\u53ef\u4ee5\u4e3a\u540e\u7eed\u8fdb\u4e00\u6b65\u4e86\u89e3\u5176\u65e5\u5fd7\u5b58\u50a8\u6253\u4e0b\u57fa\u7840\u3002\u5728\u524d\u8ff0\u7684\u5185\u5bb9\uff0c\u8f83\u4e3a\u8be6\u7ec6\u7684\u4ecb\u7ecd\u4e86InnoDB\u5185\u90e8\u7684B+-Tree\u5b58\u50a8\uff0c\u672c\u6587\u5728\u6b64\u57fa\u7840\u4e0a\uff0c\u7ee7\u7eed\u4ecb\u7ecd\uff0c\u4e00\u4e2aB+-Tree\u7684\u8282\u70b9\uff08\u7ecf\u5e38\u79f0\u4f5c\u201c\u9875\u9762\u201d\uff09\u4e2d\uff0c\u5982\u4f55\u5b58\u50a8\u5355\u6761\u8bb0\u5f55\u7684\u3002\u672c\u6587\uff0c\u4ec5\u4ecb\u7ecd\u5176\u4e00\u822c\u5b9e\u73b0\uff0c\u5e76\u4e0d\u5bf9InnoDB\u8bb0\u5f55\u683c\u5f0f\u7684\u5404\u79cd\u7c7b\u578b\u3001\u573a\u666f\u505a\u8be6\u7ec6\u4ecb\u7ecd\u3002 \u8fd9\u90e8\u5206\u5012\u6ca1\u6709\u4ec0\u4e48\u590d\u6742\u7684\u7406\u8bba\u7684\uff0c\u66f4\u591a\u7684\u662f\u4e00\u4e9b\u5b9e\u8df5\u7ecf\u9a8c\u4ee5\u53ca\u5b9e\u9645\u5e94\u7528\u573a\u666f\u4e2d\u5404\u79cd\u60c5\u51b5\u7684\u8003\u8651\u4e0e\u9002\u914d\u3002 \u6700\u4e3a\u76f4\u63a5\u7684\uff0c\u5219\u662f\u6309\u7167\u201c\u6570\u636e\u8868\u201d\u5404\u4e2a\u5217\u7684\u5143\u6570\u636e\u987a\u5e8f\u6392\u5217\u5373\u53ef\u3002\u800c\u4e8b\u5b9e\u4e0a\uff0c\u8fd9\u4e5f\u662fInnoDB\u5b9e\u73b0\u7684\u57fa\u672c\u539f\u5219\u3002\u4f46\u5728\u5b9e\u8df5\u4e2d\uff0c\u8fd8\u6709\u5f88\u591a\u7684\u95ee\u9898\u8981\u53bb\u89e3\u51b3\uff1a \u4e00\u6761\u8bb0\u5f55\u5206\u4e3a\u4e24\u4e2a\u90e8\u5206\uff0cRecord Header 1. \u51c6\u5907\u6d4b\u8bd5\u6570\u636e \u8fd9\u91cc\u65b0\u5efa\u8868\uff0c\u5e76\u5199\u5165\u4e24\u6761\u65b0\u7684\u6570\u636e\uff1a \uff08\u6ce8\uff1a\u6700\u597d\u4e0d\u8981\u8fd9\u6837\u5b58\u50a8hash\u503c\uff09 2. \u627e\u5230\u6570\u636e\u9875 \u8fd9\u9700\u8981\u4e00\u4e9b\u80cc\u666f\u77e5\u8bc6\uff0c\u4f46\u5e76\u4e0d\u662f\u672c\u6587\u4ecb\u7ecd\u7684\u91cd\u70b9\u3002\u5728\u72ec\u7acb\u8868\u7a7a\u95f4\uff08\u5f53\u524dMySQL\u7684\u9ed8\u8ba4\u884c\u4e3a\uff09\u7684\u60c5\u51b5\u4e0b\uff0c\uff1a 2.1 \u4e3a\u4ec0\u4e48\u662f\u7b2c\u56db\u4e2a\u9875\u9762 \u5982\u679c\u5bf9\u4e8e\u8fd9\u4e2a\u95ee\u9898\u611f\u5174\u8da3\u7684\u8bdd\uff0c\u53ef\u4ee5\u53c2\u8003 The basics of InnoDB space file layout \u4e2d\u5173\u4e8e\u201cPer-table space files\u201d\u7684\u63cf\u8ff0\u3002\u53ef\u4ee5\u770b\u5230\uff0c\u7b2c\u56db\u4e2a\u9875\u9762\u5373\u4e3aINDEX: Root page of first index\u3002 \u4f7f\u7528vim\uff08:%!xxd)\u67e5\u770b\u65f6\uff0c\u6bcf\u884c16 Bytes\uff0c\u4e00\u4e2a\u9875\u9762\u5c31\u662f1024\u884c\uff0c\u7b2c\u56db\u4e2a\u9875\u9762\uff0c\u5373\u4ece3073\u884c\u5f00\u59cb\uff0c\u52304096\u884c\u7ed3\u675f\u3002 2.2 \u6570\u636e\u9875\u4e8c\u8fdb\u5236\u6570\u636e 3. InnoDB \u7528\u6237\u201c\u8bb0\u5f55\u201d\u683c\u5f0f\u6982\u8ff0 \u5173\u4e8e\u8be5\u683c\u5f0f\u7684\u63cf\u8ff0\uff0c\u53ef\u4ee5\u53c2\u8003innobase\/rem\/rem0rec.c\u4e2d\u7684\u6ce8\u91ca\u8bf4\u660e\u90e8\u5206\uff0c\u6709\u6bd4\u8f83\u8be6\u7ec6\u7684\u8bf4\u660e\u3002 4. InnoDB \u9875\u5185\u7684\u8bb0\u5f55 \u5728\u4e00\u4e2a\u9875\u9762\u5185\uff0cInnoDB\u5b58\u50a8\u6bcf\u6761\u7269\u7406\u8bb0\u5f55\u65f6\uff0c\u90fd\u4f1a\u5728\u8bb0\u5f55\u4e2d\u5b58\u50a8\u4e00\u4e2a\u201c\u6307\u9488\u201d\uff0c\u8be5\u201c\u6307\u9488\u201d\u6307\u5411\u4e0b\u4e00\u6761\u8bb0\u5f55\u7684\u7269\u7406\u4f4d\u7f6e\uff0c\u5e76\u4e14\u5728\u5b9e\u73b0\u65f6\uff0c\u8be5\u201c\u6307\u9488\u201d\u662f\u4ee5\u5f53\u524d\u8bb0\u5f55\u504f\u79fb\u7684\u65b9\u5f0f\u5b58\u50a8\u7684\u3002 \u6240\u4ee5\uff0c\u5982\u679c\u6211\u4eec\u80fd\u591f\u627e\u5230\u9875\u9762\u5185\u7684\u7b2c\u4e00\u6761\u8bb0\u5f55\uff0c\u90a3\u4e48\u5c31\u53ef\u4ee5\u4f9d\u6b64\u987a\u5e8f\u7684\u904d\u5386\u6574\u4e2a\u9875\u9762\u5185\u7684\u8bb0\u5f55\u4e86\u3002\u627e\u5230\u7b2c\u4e00\u6761\u8bb0\u5f55\u5927\u6982\u6709\u5f88\u591a\u7684\u65b9\u6cd5\uff0c\u8fd9\u91cc\u8bf4\u8bf4InnoDB\u7684\u5b9e\u73b0\uff1ainfimum\u548csupremum\u3002\u7b80\u5355\u6765\u8bf4\uff0cInnoDB\u4f1a\u5728\u9875\u9762\u4e2d\u5b58\u50a8\u4e00\u4e2ainfimum\u8bb0\u5f55\uff0c\u8be5\u8bb0\u5f55\u53ef\u4ee5\u8ba4\u4e3a\u662f\u8be5\u9875\u9762\u7684\u6781\u5c0f\u503c\uff0c\u8be5\u8bb0\u5f55\u4e2d\u7684\u201cNext Record\u201d\u5373\u4e3a\u5b9e\u9645\u7684\u8be5\u9875\u9762\u6700\u5c0f\u503c\u3002 4.1 \u7cfb\u7edf\u8bb0\u5f55(system record)\uff1ainfimum \u548c supremum infimum\u548csupremum\u662f\u6bcf\u4e2aInnoDB\u9875\u9762\u5185\u5b58\u50a8\u4e24\u6761\u7269\u7406\u8bb0\u5f55\uff0c\u5206\u522b\u4ee3\u8868\u201c\u8d77\u59cb\u6700\u5c0f\u8bb0\u5f55\u201d\u548c\u201c\u7ed3\u675f\u6700\u5927\u8bb0\u5f55\u201d\u3002\u6240\u4ee5\u5982\u679c\u4f7f\u7528\u4e0a\u8ff0\u7684\u4e0b\u4e00\u6761\u8bb0\u5f55\u201c\u6307\u9488\u201d\u904d\u5386\u9875\u5185\u6240\u6709\u8bb0\u5f55\uff0c\u5219\u603b\u662f\u4eceinfimum\u5f00\u59cb\uff0c\u4ee5supremum\u7ed3\u675f\uff0c\u4e2d\u95f4\u5c31\u662f\u6240\u6709\u7684\u7528\u6237\u8bb0\u5f55\u3002 \u5728\u9875\u9762\u627e\u5230infimum\u548csupremum\u8bb0\u5f55\u7684\u65b9\u6cd5\u6709\u4e24\u79cd\uff1a 4.2 \u4ecePage Directory\u627e\u5230infimum \u5728\u524d\u6587\u201cB+-Tree\u7684\u5185\u90e8\u641c\u7d22\uff1aInnoDB\u7684\u5b9e\u73b0\u201d\uff0c\u5df2\u7ecf\u6982\u8ff0\u4e86slot [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":24387,"comment_status":"open","ping_status":"closed","sticky":false,"template":"wp-custom-template-a-1440-px-width-template","format":"standard","meta":{"_eb_attr":"","inline_featured_image":false,"_tocer_settings":[],"footnotes":""},"categories":[126,137],"tags":[],"class_list":["post-18678","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-database","category-learning-more"],"_links":{"self":[{"href":"https:\/\/www.orczhou.com\/index.php\/wp-json\/wp\/v2\/posts\/18678","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.orczhou.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.orczhou.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.orczhou.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.orczhou.com\/index.php\/wp-json\/wp\/v2\/comments?post=18678"}],"version-history":[{"count":32,"href":"https:\/\/www.orczhou.com\/index.php\/wp-json\/wp\/v2\/posts\/18678\/revisions"}],"predecessor-version":[{"id":24393,"href":"https:\/\/www.orczhou.com\/index.php\/wp-json\/wp\/v2\/posts\/18678\/revisions\/24393"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.orczhou.com\/index.php\/wp-json\/wp\/v2\/media\/24387"}],"wp:attachment":[{"href":"https:\/\/www.orczhou.com\/index.php\/wp-json\/wp\/v2\/media?parent=18678"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.orczhou.com\/index.php\/wp-json\/wp\/v2\/categories?post=18678"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.orczhou.com\/index.php\/wp-json\/wp\/v2\/tags?post=18678"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}