{"kind": "storage", "major": "18", "item": {"slug": "storage-page-layout", "name": "Database Page Layout", "name_zh": "", "category": "\u7269\u7406\u7ed3\u6784", "summary": "\u672c\u8282\u6982\u8ff0 PostgreSQL \u8868\u548c\u7d22\u5f15\u5185\u90e8\u6240\u4f7f\u7528\u7684\u9875\u9762\u683c\u5f0f\u3002 [19] \u5e8f\u5217\u548c TOAST \u8868\u7684\u683c\u5f0f\u4e0e\u666e\u901a\u8868\u76f8\u540c\u3002", "aliases": [], "content_hash": "96dd201fa1f442bb669f3fd636d5f6793291491b2d1cb5737d509efa9ffd956a", "versions": {"10": {"facts": [{"label": "\u5b9a\u4e49\u8303\u56f4", "value": "\u540c\u7248\u672c\u6838\u5fc3\u7269\u7406\u5b58\u50a8\u6587\u6863"}], "tables": [{"key": "layout-0", "rows": [{"c0": "PageHeaderData", "c1": "\u957f 24 \u5b57\u8282\uff0c\u5305\u542b\u9875\u9762\u7684\u901a\u7528\u4fe1\u606f\uff0c\u4f8b\u5982\u7a7a\u95f2\u7a7a\u95f4\u6307\u9488\u3002"}, {"c0": "ItemIdData", "c1": "\u6307\u5411\u5b9e\u9645\u6570\u636e\u9879\u7684\u884c\u6307\u9488\u6570\u7ec4\u3002\u6bcf\u9879\u4e3a\u4e00\u4e2a\uff08\u504f\u79fb\uff0c\u957f\u5ea6\uff09\u5bf9\uff0c\u5360 4 \u5b57\u8282\u3002"}, {"c0": "\u7a7a\u95f2\u7a7a\u95f4", "c1": "\u5c1a\u672a\u5206\u914d\u7684\u7a7a\u95f4\u3002\u65b0\u884c\u6307\u9488\u4ece\u8be5\u533a\u57df\u7684\u8d77\u59cb\u5904\u5206\u914d\uff0c\u65b0\u6570\u636e\u9879\u4ece\u672b\u5c3e\u5904\u5206\u914d\u3002"}, {"c0": "\u9879", "c1": "\u5b9e\u9645\u7684\u6570\u636e\u9879\u672c\u8eab\u3002"}, {"c0": "\u7279\u6b8a\u7a7a\u95f4", "c1": "\u7d22\u5f15\u8bbf\u95ee\u65b9\u6cd5\u4e13\u7528\u6570\u636e\u3002\u4e0d\u540c\u65b9\u6cd5\u5b58\u50a8\u7684\u5185\u5bb9\u4e0d\u540c\uff0c\u666e\u901a\u8868\u4e2d\u6b64\u533a\u57df\u4e3a\u7a7a\u3002"}], "title": "\u9875\u9762\u603b\u4f53\u5e03\u5c40", "columns": [{"key": "c0", "label": "\u9879\u76ee"}, {"key": "c1", "label": "\u8bf4\u660e"}]}, {"key": "layout-1", "rows": [{"c0": "pd_lsn", "c1": "PageXLogRecPtr", "c2": "8 \u5b57\u8282", "c3": "LSN\uff1a\u8be5\u9875\u6700\u540e\u4e00\u6b21\u53d8\u5316\u6240\u5bf9\u5e94 WAL \u8bb0\u5f55\u7684\u6700\u540e\u4e00\u4e2a\u5b57\u8282\u4e4b\u540e\u7684\u4f4d\u7f6e\u3002"}, {"c0": "pd_checksum", "c1": "uint16", "c2": "2 \u5b57\u8282", "c3": "\u9875\u9762\u6821\u9a8c\u548c"}, {"c0": "pd_flags", "c1": "uint16", "c2": "2 \u5b57\u8282", "c3": "\u6807\u5fd7\u4f4d"}, {"c0": "pd_lower", "c1": "LocationIndex", "c2": "2 \u5b57\u8282", "c3": "\u7a7a\u95f2\u7a7a\u95f4\u8d77\u59cb\u4f4d\u7f6e\u7684\u504f\u79fb\u91cf"}, {"c0": "pd_upper", "c1": "LocationIndex", "c2": "2 \u5b57\u8282", "c3": "\u7a7a\u95f2\u7a7a\u95f4\u7ed3\u675f\u4f4d\u7f6e\u7684\u504f\u79fb\u91cf"}, {"c0": "pd_special", "c1": "LocationIndex", "c2": "2 \u5b57\u8282", "c3": "\u7279\u6b8a\u7a7a\u95f4\u8d77\u59cb\u4f4d\u7f6e\u7684\u504f\u79fb\u91cf"}, {"c0": "pd_pagesize_version", "c1": "uint16", "c2": "2 \u5b57\u8282", "c3": "\u9875\u9762\u5927\u5c0f\u4e0e\u5e03\u5c40\u7248\u672c\u53f7\u4fe1\u606f"}, {"c0": "pd_prune_xid", "c1": "TransactionId", "c2": "4 \u5b57\u8282", "c3": "\u9875\u9762\u4e0a\u6700\u65e9\u7684\u5c1a\u672a\u4fee\u526a\u7684 XMAX\uff1b\u6ca1\u6709\u5219\u4e3a\u96f6"}], "title": "PageHeaderData \u5e03\u5c40", "columns": [{"key": "c0", "label": "\u5b57\u6bb5"}, {"key": "c1", "label": "\u7c7b\u578b"}, {"key": "c2", "label": "\u957f\u5ea6"}, {"key": "c3", "label": "\u8bf4\u660e"}]}, {"key": "layout-2", "rows": [{"c0": "t_xmin", "c1": "TransactionId", "c2": "4 \u5b57\u8282", "c3": "\u63d2\u5165\u4e8b\u52a1\u7684 XID"}, {"c0": "t_xmax", "c1": "TransactionId", "c2": "4 \u5b57\u8282", "c3": "\u5220\u9664\u4e8b\u52a1\u7684 XID"}, {"c0": "t_cid", "c1": "CommandId", "c2": "4 \u5b57\u8282", "c3": "\u63d2\u5165\u548c\uff0f\u6216\u5220\u9664\u547d\u4ee4\u7684 CID\uff0c\u4e0e t_xvac \u5171\u7528\u5b58\u50a8\u4f4d\u7f6e"}, {"c0": "t_xvac", "c1": "TransactionId", "c2": "4 \u5b57\u8282", "c3": "VACUUM \u64cd\u4f5c\u79fb\u52a8\u884c\u7248\u672c\u65f6\u4f7f\u7528\u7684 XID"}, {"c0": "t_ctid", "c1": "ItemPointerData", "c2": "6 \u5b57\u8282", "c3": "\u672c\u884c\u7248\u672c\u6216\u8f83\u65b0\u884c\u7248\u672c\u7684\u5f53\u524d TID"}, {"c0": "t_infomask2", "c1": "uint16", "c2": "2 \u5b57\u8282", "c3": "\u5c5e\u6027\u6570\u91cf\u53ca\u5404\u79cd\u6807\u5fd7\u4f4d"}, {"c0": "t_infomask", "c1": "uint16", "c2": "2 \u5b57\u8282", "c3": "\u5404\u79cd\u6807\u5fd7\u4f4d"}, {"c0": "t_hoff", "c1": "uint8", "c2": "1 \u5b57\u8282", "c3": "\u7528\u6237\u6570\u636e\u7684\u504f\u79fb\u91cf"}], "title": "HeapTupleHeaderData \u5e03\u5c40", "columns": [{"key": "c0", "label": "\u5b57\u6bb5"}, {"key": "c1", "label": "\u7c7b\u578b"}, {"key": "c2", "label": "\u957f\u5ea6"}, {"key": "c3", "label": "\u8bf4\u660e"}]}], "diagram": "page-layout", "related": [{"url": "/wiki/relopts/?v=10", "label": "\u5b58\u50a8\u53c2\u6570"}], "release": {"ref": "https://ftp.postgresql.org/pub/source/v10.23/postgresql-10.23.tar.bz2", "label": "10.23", "major": "10", "channel": "stable", "revision": "94a4b2528372458e5662c18d406629266667c437198160a18cdfd2c4a4d6eee9"}, "sources": [{"url": "https://pg.center/docs/10/storage-page-layout.html", "path": "storage-page-layout.html", "label": "PostgreSQL 10 English manual", "sha256": "d3caf82da1c279a219594b5caf0d00338c183e5d44c9f7ce07977a92e83010a5", "language": "en", "original_url": "/docs/10/storage-page-layout.html"}], "sections": [], "signature": "", "description": ["\u672c\u8282\u6982\u8ff0 PostgreSQL \u8868\u548c\u7d22\u5f15\u5185\u90e8\u6240\u4f7f\u7528\u7684\u9875\u9762\u683c\u5f0f\u3002 [15] \u5e8f\u5217\u548c TOAST \u8868\u7684\u683c\u5f0f\u4e0e\u666e\u901a\u8868\u76f8\u540c\u3002"], "manual_html": "<div class=\"sect1\">\n<div class=\"titlepage\">\n<div>\n<div>\n<h2 class=\"title\" lang=\"zh\">\n<div>\n<div>\n<h2 class=\"title\" style=\"clear: both\">67.6.\u00a0\u6570\u636e\u5e93\u9875\u9762\u5e03\u5c40 </h2>\n</div>\n</div>\n</h2>\n</div>\n</div>\n</div>\n<p lang=\"zh\">\u672c\u8282\u6982\u8ff0 <span class=\"productname\">PostgreSQL</span> \u8868\u548c\u7d22\u5f15\u5185\u90e8\u6240\u4f7f\u7528\u7684\u9875\u9762\u683c\u5f0f\u3002<a class=\"footnote\" href=\"/docs/10/storage-page-layout.html#ftn.id-1.10.20.8.2.2\"><sup class=\"footnote\" id=\"id-1.10.20.8.2.2\">[15]</sup></a> \u5e8f\u5217\u548c <acronym class=\"acronym\">TOAST</acronym> \u8868\u7684\u683c\u5f0f\u4e0e\u666e\u901a\u8868\u76f8\u540c\u3002</p>\n<p lang=\"zh\">\u5728\u4e0b\u9762\u7684\u8bf4\u660e\u4e2d\uff0c\u5047\u5b9a\u4e00\u4e2a<em class=\"firstterm\">\u5b57\u8282</em>\u5305\u542b 8 \u4e2a\u4f4d\u3002\u53e6\u5916\uff0c\u672f\u8bed<em class=\"firstterm\">\u9879</em>\u6307\u7684\u662f\u5b58\u50a8\u5728\u9875\u9762\u4e0a\u7684\u5355\u4e2a\u6570\u636e\u503c\u3002\u5728\u8868\u4e2d\uff0c\u9879\u662f\u4e00\u884c\uff1b\u5728\u7d22\u5f15\u4e2d\uff0c\u9879\u662f\u4e00\u6761\u7d22\u5f15\u6761\u76ee\u3002</p>\n<p lang=\"zh\">\u6bcf\u4e2a\u8868\u548c\u7d22\u5f15\u90fd\u5b58\u50a8\u4e3a\u56fa\u5b9a\u5927\u5c0f\u7684<em class=\"firstterm\">\u9875\u9762</em>\u6570\u7ec4\uff08\u901a\u5e38\u4e3a 8 kB\uff0c\u4e0d\u8fc7\u5728\u7f16\u8bd1\u670d\u52a1\u5668\u65f6\u53ef\u4ee5\u9009\u62e9\u4e0d\u540c\u7684\u9875\u9762\u5927\u5c0f\uff09\u3002\u5728\u8868\u4e2d\uff0c\u6240\u6709\u9875\u9762\u5728\u903b\u8f91\u4e0a\u90fd\u662f\u7b49\u4ef7\u7684\uff0c\u56e0\u6b64\u67d0\u4e2a\u7279\u5b9a\u9879\uff08\u884c\uff09\u53ef\u4ee5\u5b58\u653e\u5728\u4efb\u610f\u9875\u9762\u4e2d\u3002\u5728\u7d22\u5f15\u4e2d\uff0c\u7b2c\u4e00\u9875\u901a\u5e38\u4fdd\u7559\u4e3a<em class=\"firstterm\">\u5143\u9875</em>\uff0c\u7528\u4e8e\u4fdd\u5b58\u63a7\u5236\u4fe1\u606f\uff1b\u5e76\u4e14\u6839\u636e\u7d22\u5f15\u8bbf\u95ee\u65b9\u6cd5\u7684\u4e0d\u540c\uff0c\u7d22\u5f15\u4e2d\u8fd8\u53ef\u80fd\u5b58\u5728\u4e0d\u540c\u7c7b\u578b\u7684\u9875\u9762\u3002</p>\n<p lang=\"zh\"><a class=\"xref\" href=\"/docs/10/storage-page-layout.html#PAGE-TABLE\" title=\"\u8868\u00a067.2.\u00a0\u603b\u4f53\u9875\u9762\u5e03\u5c40\">\u8868\u00a067.2</a>\u5c55\u793a\u4e86\u9875\u9762\u7684\u603b\u4f53\u5e03\u5c40\u3002\u6bcf\u4e2a\u9875\u9762\u5305\u542b\u4e94\u4e2a\u90e8\u5206\u3002</p>\n<div class=\"table\">\n<p class=\"title\" lang=\"zh\"><strong>\u8868\u00a067.2.\u00a0\u603b\u4f53\u9875\u9762\u5e03\u5c40</strong></p>\n<div class=\"table-contents\">\n<table class=\"table\">\n<thead>\n<tr>\n<th lang=\"zh\">\u9879\u76ee</th>\n<th lang=\"zh\">\u8bf4\u660e</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>PageHeaderData</td>\n<td lang=\"zh\">\u957f 24 \u5b57\u8282\uff0c\u5305\u542b\u9875\u9762\u7684\u901a\u7528\u4fe1\u606f\uff0c\u4f8b\u5982\u7a7a\u95f2\u7a7a\u95f4\u6307\u9488\u3002</td>\n</tr>\n<tr>\n<td>ItemIdData</td>\n<td lang=\"zh\">\u6307\u5411\u5b9e\u9645\u6570\u636e\u9879\u7684\u884c\u6307\u9488\u6570\u7ec4\u3002\u6bcf\u9879\u4e3a\u4e00\u4e2a\uff08\u504f\u79fb\uff0c\u957f\u5ea6\uff09\u5bf9\uff0c\u5360 4 \u5b57\u8282\u3002</td>\n</tr>\n<tr>\n<td lang=\"zh\">\u7a7a\u95f2\u7a7a\u95f4</td>\n<td lang=\"zh\">\u5c1a\u672a\u5206\u914d\u7684\u7a7a\u95f4\u3002\u65b0\u884c\u6307\u9488\u4ece\u8be5\u533a\u57df\u7684\u8d77\u59cb\u5904\u5206\u914d\uff0c\u65b0\u6570\u636e\u9879\u4ece\u672b\u5c3e\u5904\u5206\u914d\u3002</td>\n</tr>\n<tr>\n<td lang=\"zh\">\u9879</td>\n<td lang=\"zh\">\u5b9e\u9645\u7684\u6570\u636e\u9879\u672c\u8eab\u3002</td>\n</tr>\n<tr>\n<td lang=\"zh\">\u7279\u6b8a\u7a7a\u95f4</td>\n<td lang=\"zh\">\u7d22\u5f15\u8bbf\u95ee\u65b9\u6cd5\u4e13\u7528\u6570\u636e\u3002\u4e0d\u540c\u65b9\u6cd5\u5b58\u50a8\u7684\u5185\u5bb9\u4e0d\u540c\uff0c\u666e\u901a\u8868\u4e2d\u6b64\u533a\u57df\u4e3a\u7a7a\u3002</td>\n</tr>\n</tbody>\n</table>\n</div>\n</div>\n<br class=\"table-break\"/>\n<p lang=\"zh\">\u6bcf\u9875\u7684\u524d 24 \u5b57\u8282\u662f\u9875\u9996\u90e8 PageHeaderData\uff0c\u8be6\u7ec6\u683c\u5f0f\u89c1\u8868 67.3\u3002\u7b2c\u4e00\u4e2a\u5b57\u6bb5\u8ddf\u8e2a\u4e0e\u8be5\u9875\u76f8\u5173\u7684\u6700\u8fd1\u4e00\u6761 WAL \u8bb0\u5f55\uff1b\u7b2c\u4e8c\u4e2a\u5b57\u6bb5\u5728\u542f\u7528\u6570\u636e\u6821\u9a8c\u548c\u65f6\u4fdd\u5b58\u9875\u9762\u6821\u9a8c\u548c\u3002\u4e4b\u540e\u662f\u4e00\u4e2a\u5305\u542b\u6807\u5fd7\u4f4d\u7684 2 \u5b57\u8282\u5b57\u6bb5\uff0c\u518d\u540e\u9762\u662f\u4e09\u4e2a 2 \u5b57\u8282\u6574\u6570 pd_lower\u3001pd_upper \u548c pd_special\uff0c\u5206\u522b\u8bb0\u5f55\u4ece\u9875\u8d77\u70b9\u5230\u672a\u5206\u914d\u7a7a\u95f4\u8d77\u70b9\u3001\u672a\u5206\u914d\u7a7a\u95f4\u7ec8\u70b9\u53ca\u7279\u6b8a\u7a7a\u95f4\u8d77\u70b9\u7684\u5b57\u8282\u504f\u79fb\u91cf\u3002\u63a5\u4e0b\u6765\u7684 2 \u5b57\u8282 pd_pagesize_version \u540c\u65f6\u4fdd\u5b58\u9875\u5927\u5c0f\u548c\u7248\u672c\u6807\u8bc6\u3002PostgreSQL 8.3 \u8d77\u7248\u672c\u53f7\u4e3a 4\uff1b8.1 \u4e0e 8.2 \u4f7f\u7528 3\uff1b8.0 \u4f7f\u7528 2\uff1b7.3 \u4e0e 7.4 \u4f7f\u7528 1\uff1b\u66f4\u65e9\u7248\u672c\u4f7f\u7528 0\u3002\u591a\u6570\u7248\u672c\u7684\u57fa\u672c\u9875\u9762\u5e03\u5c40\u548c\u9996\u90e8\u683c\u5f0f\u5e76\u672a\u53d8\u5316\uff0c\u4f46\u5806\u884c\u9996\u90e8\u5e03\u5c40\u6709\u53d8\u5316\u3002\u9875\u5927\u5c0f\u57fa\u672c\u53ea\u7528\u4e8e\u4ea4\u53c9\u68c0\u67e5\uff1b\u540c\u4e00\u5b89\u88c5\u4e0d\u652f\u6301\u591a\u79cd\u9875\u5927\u5c0f\u3002\u6700\u540e\u4e00\u4e2a\u5b57\u6bb5\u63d0\u793a\u4fee\u526a\u8be5\u9875\u662f\u5426\u53ef\u80fd\u6709\u76ca\uff0c\u8bb0\u5f55\u8be5\u9875\u6700\u65e9\u7684\u5c1a\u672a\u4fee\u526a\u7684 XMAX\u3002</p>\n<div class=\"table\">\n<p class=\"title\" lang=\"zh\"><strong>\u8868\u00a067.3.\u00a0PageHeaderData \u5e03\u5c40</strong></p>\n<div class=\"table-contents\">\n<table class=\"table\">\n<thead>\n<tr>\n<th lang=\"zh\">\u5b57\u6bb5</th>\n<th lang=\"zh\">\u7c7b\u578b</th>\n<th lang=\"zh\">\u957f\u5ea6</th>\n<th lang=\"zh\">\u8bf4\u660e</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>pd_lsn</td>\n<td>PageXLogRecPtr</td>\n<td lang=\"zh\">8 \u5b57\u8282</td>\n<td lang=\"zh\">LSN\uff1a\u8be5\u9875\u6700\u540e\u4e00\u6b21\u53d8\u5316\u6240\u5bf9\u5e94 WAL \u8bb0\u5f55\u7684\u6700\u540e\u4e00\u4e2a\u5b57\u8282\u4e4b\u540e\u7684\u4f4d\u7f6e\u3002</td>\n</tr>\n<tr>\n<td>pd_checksum</td>\n<td>uint16</td>\n<td lang=\"zh\">2 \u5b57\u8282</td>\n<td lang=\"zh\">\u9875\u9762\u6821\u9a8c\u548c</td>\n</tr>\n<tr>\n<td>pd_flags</td>\n<td>uint16</td>\n<td lang=\"zh\">2 \u5b57\u8282</td>\n<td lang=\"zh\">\u6807\u5fd7\u4f4d</td>\n</tr>\n<tr>\n<td>pd_lower</td>\n<td>LocationIndex</td>\n<td lang=\"zh\">2 \u5b57\u8282</td>\n<td lang=\"zh\">\u7a7a\u95f2\u7a7a\u95f4\u8d77\u59cb\u4f4d\u7f6e\u7684\u504f\u79fb\u91cf</td>\n</tr>\n<tr>\n<td>pd_upper</td>\n<td>LocationIndex</td>\n<td lang=\"zh\">2 \u5b57\u8282</td>\n<td lang=\"zh\">\u7a7a\u95f2\u7a7a\u95f4\u7ed3\u675f\u4f4d\u7f6e\u7684\u504f\u79fb\u91cf</td>\n</tr>\n<tr>\n<td>pd_special</td>\n<td>LocationIndex</td>\n<td lang=\"zh\">2 \u5b57\u8282</td>\n<td lang=\"zh\">\u7279\u6b8a\u7a7a\u95f4\u8d77\u59cb\u4f4d\u7f6e\u7684\u504f\u79fb\u91cf</td>\n</tr>\n<tr>\n<td>pd_pagesize_version</td>\n<td>uint16</td>\n<td lang=\"zh\">2 \u5b57\u8282</td>\n<td lang=\"zh\">\u9875\u9762\u5927\u5c0f\u4e0e\u5e03\u5c40\u7248\u672c\u53f7\u4fe1\u606f</td>\n</tr>\n<tr>\n<td>pd_prune_xid</td>\n<td>TransactionId</td>\n<td lang=\"zh\">4 \u5b57\u8282</td>\n<td lang=\"zh\">\u9875\u9762\u4e0a\u6700\u65e9\u7684\u5c1a\u672a\u4fee\u526a\u7684 XMAX\uff1b\u6ca1\u6709\u5219\u4e3a\u96f6</td>\n</tr>\n</tbody>\n</table>\n</div>\n</div>\n<br class=\"table-break\"/>\n<p lang=\"zh\">\u6240\u6709\u7ec6\u8282\u90fd\u53ef\u4ee5\u5728 <code class=\"filename\">src/include/storage/bufpage.h</code> \u4e2d\u627e\u5230\u3002</p>\n<p lang=\"zh\">\u9875\u5934\u4e4b\u540e\u662f\u9879\u6807\u8bc6\u7b26\uff08<code class=\"type\">ItemIdData</code>\uff09\uff0c\u6bcf\u4e2a\u9700\u8981\u56db\u4e2a\u5b57\u8282\u3002\u4e00\u4e2a\u9879\u6807\u8bc6\u7b26\u5305\u542b\u9879\u8d77\u59cb\u4f4d\u7f6e\u7684\u5b57\u8282\u504f\u79fb\u91cf\u3001\u5176\u5b57\u8282\u957f\u5ea6\uff0c\u4ee5\u53ca\u82e5\u5e72\u5f71\u54cd\u89e3\u91ca\u65b9\u5f0f\u7684\u5c5e\u6027\u4f4d\u3002\u65b0\u7684\u9879\u6807\u8bc6\u7b26\u4f1a\u6839\u636e\u9700\u8981\u4ece\u672a\u5206\u914d\u7a7a\u95f4\u7684\u8d77\u59cb\u5904\u5206\u914d\u3002\u5f53\u524d\u5df2\u6709\u591a\u5c11\u4e2a\u9879\u6807\u8bc6\u7b26\uff0c\u53ef\u4ee5\u901a\u8fc7\u67e5\u770b <code class=\"structfield\">pd_lower</code> \u5f97\u77e5\uff1b\u5206\u914d\u65b0\u6807\u8bc6\u7b26\u65f6\u5b83\u4f1a\u589e\u52a0\u3002\u56e0\u4e3a\u4e00\u4e2a\u9879\u6807\u8bc6\u7b26\u5728\u88ab\u91ca\u653e\u4e4b\u524d\u6c38\u8fdc\u4e0d\u4f1a\u79fb\u52a8\uff0c\u6240\u4ee5\u5373\u4f7f\u9879\u672c\u8eab\u4e3a\u4e86\u6574\u7406\u7a7a\u95f2\u7a7a\u95f4\u800c\u5728\u9875\u9762\u5185\u79fb\u52a8\uff0c\u5176\u7d22\u5f15\u4ecd\u7136\u53ef\u4ee5\u88ab\u957f\u671f\u7528\u6765\u5f15\u7528\u8be5\u9879\u3002\u4e8b\u5b9e\u4e0a\uff0c\u6bcf\u4e2a\u6307\u5411\u9879\u7684\u6307\u9488\uff08<code class=\"type\">ItemPointer</code>\uff0c\u4e5f\u79f0 <code class=\"type\">CTID</code>\uff09\u5728 <span class=\"productname\">PostgreSQL</span> \u4e2d\u90fd\u7531\u9875\u53f7\u548c\u9879\u6807\u8bc6\u7b26\u7d22\u5f15\u6784\u6210\u3002</p>\n<p lang=\"zh\">\u9879\u672c\u8eab\u5b58\u50a8\u5728\u4ece\u672a\u5206\u914d\u7a7a\u95f4\u672b\u5c3e\u5f00\u59cb\u3001\u5411\u540e\u5206\u914d\u7684\u533a\u57df\u4e2d\u3002\u5176\u786e\u5207\u7ed3\u6784\u53d6\u51b3\u4e8e\u8868\u8981\u5305\u542b\u4ec0\u4e48\u5185\u5bb9\u3002\u8868\u548c\u5e8f\u5217\u90fd\u4f7f\u7528\u4e00\u79cd\u540d\u4e3a <code class=\"type\">HeapTupleHeaderData</code> \u7684\u7ed3\u6784\u4f53\uff0c\u5982\u4e0b\u6240\u8ff0\u3002</p>\n<p lang=\"zh\">\u6700\u540e\u4e00\u90e8\u5206\u662f<span class=\"quote\">\u201c<span class=\"quote\">\u7279\u6b8a\u90e8\u5206</span>\u201d</span>\uff0c\u5176\u4e2d\u53ef\u4ee5\u5b58\u653e\u8bbf\u95ee\u65b9\u6cd5\u5e0c\u671b\u4fdd\u5b58\u7684\u4efb\u4f55\u5185\u5bb9\u3002\u4f8b\u5982\uff0cB-\u6811\u7d22\u5f15\u4f1a\u5728\u8fd9\u91cc\u4fdd\u5b58\u6307\u5411\u9875\u9762\u5de6\u3001\u53f3\u5144\u5f1f\u7684\u94fe\u63a5\uff0c\u4ee5\u53ca\u5176\u4ed6\u4e00\u4e9b\u4e0e\u7d22\u5f15\u7ed3\u6784\u76f8\u5173\u7684\u6570\u636e\u3002\u666e\u901a\u8868\u5b8c\u5168\u4e0d\u4f7f\u7528\u7279\u6b8a\u90e8\u5206\uff08\u901a\u8fc7\u5c06 <code class=\"structfield\">pd_special</code> \u8bbe\u4e3a\u9875\u9762\u5927\u5c0f\u6765\u8868\u793a\uff09\u3002</p>\n<p lang=\"zh\">\u6240\u6709\u8868\u884c\u7684\u7ed3\u6784\u90fd\u76f8\u540c\u3002\u5b83\u4eec\u90fd\u6709\u4e00\u4e2a\u56fa\u5b9a\u5927\u5c0f\u7684\u5934\u90e8\uff08\u5728\u5927\u591a\u6570\u673a\u5668\u4e0a\u5360 23 \u5b57\u8282\uff09\uff0c\u540e\u9762\u8ddf\u7740\u53ef\u9009\u7684\u7a7a\u503c\u4f4d\u56fe\u3001\u53ef\u9009\u7684\u5bf9\u8c61 ID \u5b57\u6bb5\u4ee5\u53ca\u7528\u6237\u6570\u636e\u3002\u5934\u90e8\u7684\u8be6\u7ec6\u683c\u5f0f\u89c1<a class=\"xref\" href=\"/docs/10/storage-page-layout.html#HEAPTUPLEHEADERDATA-TABLE\" title=\"\u8868\u00a067.4.\u00a0HeapTupleHeaderData \u5e03\u5c40\">\u8868\u00a067.4</a>\u3002\u5b9e\u9645\u7528\u6237\u6570\u636e\uff08\u884c\u7684\u5404\u5217\uff09\u4ece <code class=\"structfield\">t_hoff</code> \u6307\u793a\u7684\u504f\u79fb\u4f4d\u7f6e\u5f00\u59cb\uff0c\u5b83\u5fc5\u987b\u59cb\u7ec8\u662f\u8be5\u5e73\u53f0 MAXALIGN \u5bf9\u9f50\u5355\u4f4d\u7684\u6574\u6570\u500d\u3002\u53ea\u6709\u5f53 <em class=\"firstterm\">HEAP_HASNULL</em> \u4f4d\u5728 <code class=\"structfield\">t_infomask</code> \u4e2d\u88ab\u7f6e\u4f4d\u65f6\uff0c\u7a7a\u503c\u4f4d\u56fe\u624d\u5b58\u5728\u3002\u82e5\u5b58\u5728\uff0c\u5b83\u7d27\u968f\u56fa\u5b9a\u5934\u90e8\u4e4b\u540e\uff0c\u5e76\u5360\u7528\u8db3\u591f\u591a\u7684\u5b57\u8282\uff0c\u4ee5\u4fbf\u4e3a\u6bcf\u4e2a\u6570\u636e\u5217\u63d0\u4f9b\u4e00\u4f4d\uff08\u4e5f\u5c31\u662f\u8bf4\uff0c\u603b\u5171\u4e3a <code class=\"structfield\">t_natts</code> \u4f4d\uff09\u3002\u5728\u8fd9\u4e2a\u4f4d\u56fe\u4e2d\uff0c1 \u8868\u793a\u975e\u7a7a\uff0c0 \u8868\u793a\u7a7a\u503c\u3002\u5f53\u4f4d\u56fe\u4e0d\u5b58\u5728\u65f6\uff0c\u5047\u5b9a\u6240\u6709\u5217\u90fd\u975e\u7a7a\u3002\u53ea\u6709\u5f53 <em class=\"firstterm\">HEAP_HASOID</em> \u4f4d\u5728 <code class=\"structfield\">t_infomask</code> \u4e2d\u88ab\u7f6e\u4f4d\u65f6\uff0c\u5bf9\u8c61 ID \u624d\u5b58\u5728\u3002\u82e5\u5b58\u5728\uff0c\u5b83\u4f4d\u4e8e <code class=\"structfield\">t_hoff</code> \u8fb9\u754c\u4e4b\u524d\u3002\u4e3a\u4e86\u8ba9 <code class=\"structfield\">t_hoff</code> \u6210\u4e3a MAXALIGN \u7684\u6574\u6570\u500d\u6240\u9700\u7684\u4efb\u4f55\u586b\u5145\uff0c\u90fd\u4f1a\u51fa\u73b0\u5728\u7a7a\u503c\u4f4d\u56fe\u4e0e\u5bf9\u8c61 ID \u4e4b\u95f4\u3002\uff08\u8fd9\u53c8\u53cd\u8fc7\u6765\u4fdd\u8bc1\u4e86\u5bf9\u8c61 ID \u7684\u5bf9\u9f50\u662f\u5408\u9002\u7684\u3002\uff09</p>\n<div class=\"table\">\n<p class=\"title\" lang=\"zh\"><strong>\u8868\u00a067.4.\u00a0HeapTupleHeaderData \u5e03\u5c40</strong></p>\n<div class=\"table-contents\">\n<table class=\"table\">\n<thead>\n<tr>\n<th lang=\"zh\">\u5b57\u6bb5</th>\n<th lang=\"zh\">\u7c7b\u578b</th>\n<th lang=\"zh\">\u957f\u5ea6</th>\n<th lang=\"zh\">\u8bf4\u660e</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>t_xmin</td>\n<td>TransactionId</td>\n<td lang=\"zh\">4 \u5b57\u8282</td>\n<td lang=\"zh\">\u63d2\u5165\u4e8b\u52a1\u7684 XID</td>\n</tr>\n<tr>\n<td>t_xmax</td>\n<td>TransactionId</td>\n<td lang=\"zh\">4 \u5b57\u8282</td>\n<td lang=\"zh\">\u5220\u9664\u4e8b\u52a1\u7684 XID</td>\n</tr>\n<tr>\n<td>t_cid</td>\n<td>CommandId</td>\n<td lang=\"zh\">4 \u5b57\u8282</td>\n<td lang=\"zh\">\u63d2\u5165\u548c\uff0f\u6216\u5220\u9664\u547d\u4ee4\u7684 CID\uff0c\u4e0e t_xvac \u5171\u7528\u5b58\u50a8\u4f4d\u7f6e</td>\n</tr>\n<tr>\n<td>t_xvac</td>\n<td>TransactionId</td>\n<td lang=\"zh\">4 \u5b57\u8282</td>\n<td lang=\"zh\">VACUUM \u64cd\u4f5c\u79fb\u52a8\u884c\u7248\u672c\u65f6\u4f7f\u7528\u7684 XID</td>\n</tr>\n<tr>\n<td>t_ctid</td>\n<td>ItemPointerData</td>\n<td lang=\"zh\">6 \u5b57\u8282</td>\n<td lang=\"zh\">\u672c\u884c\u7248\u672c\u6216\u8f83\u65b0\u884c\u7248\u672c\u7684\u5f53\u524d TID</td>\n</tr>\n<tr>\n<td>t_infomask2</td>\n<td>uint16</td>\n<td lang=\"zh\">2 \u5b57\u8282</td>\n<td lang=\"zh\">\u5c5e\u6027\u6570\u91cf\u53ca\u5404\u79cd\u6807\u5fd7\u4f4d</td>\n</tr>\n<tr>\n<td>t_infomask</td>\n<td>uint16</td>\n<td lang=\"zh\">2 \u5b57\u8282</td>\n<td lang=\"zh\">\u5404\u79cd\u6807\u5fd7\u4f4d</td>\n</tr>\n<tr>\n<td>t_hoff</td>\n<td>uint8</td>\n<td lang=\"zh\">1 \u5b57\u8282</td>\n<td lang=\"zh\">\u7528\u6237\u6570\u636e\u7684\u504f\u79fb\u91cf</td>\n</tr>\n</tbody>\n</table>\n</div>\n</div>\n<br class=\"table-break\"/>\n<p lang=\"zh\">\u6240\u6709\u7ec6\u8282\u90fd\u53ef\u4ee5\u5728 <code class=\"filename\">src/include/access/htup_details.h</code> \u4e2d\u627e\u5230\u3002</p>\n<p lang=\"zh\">\u8981\u89e3\u91ca\u5b9e\u9645\u6570\u636e\uff0c\u5fc5\u987b\u501f\u52a9\u4ece\u5176\u4ed6\u8868\u4e2d\u83b7\u5f97\u7684\u4fe1\u606f\uff0c\u5176\u4e2d\u5927\u90e8\u5206\u6765\u81ea <code class=\"structname\">pg_attribute</code>\u3002\u8bc6\u522b\u5b57\u6bb5\u4f4d\u7f6e\u6240\u9700\u7684\u5173\u952e\u503c\u662f <code class=\"structfield\">attlen</code> \u548c <code class=\"structfield\">attalign</code>\u3002\u9664\u975e\u6240\u6709\u5b57\u6bb5\u90fd\u662f\u5b9a\u5bbd\u4e14\u6ca1\u6709\u7a7a\u503c\uff0c\u5426\u5219\u6ca1\u6709\u529e\u6cd5\u76f4\u63a5\u53d6\u5f97\u67d0\u4e2a\u7279\u5b9a\u5c5e\u6027\u3002\u6240\u6709\u8fd9\u4e9b\u6280\u5de7\u90fd\u5c01\u88c5\u5728 <em class=\"firstterm\">heap_getattr</em>\u3001<em class=\"firstterm\">fastgetattr</em> \u548c <em class=\"firstterm\">heap_getsysattr</em> \u8fd9\u4e9b\u51fd\u6570\u4e2d\u3002</p>\n<p lang=\"zh\">\u8bfb\u53d6\u6570\u636e\u65f6\uff0c\u9700\u8981\u4f9d\u6b21\u68c0\u67e5\u6bcf\u4e2a\u5c5e\u6027\u3002\u9996\u5148\u6839\u636e\u7a7a\u503c\u4f4d\u56fe\u5224\u65ad\u8be5\u5b57\u6bb5\u662f\u5426\u4e3a NULL\u3002\u5982\u679c\u662f\uff0c\u5c31\u7ee7\u7eed\u4e0b\u4e00\u4e2a\u3002\u7136\u540e\u786e\u8ba4\u5bf9\u9f50\u662f\u5426\u6b63\u786e\u3002\u5982\u679c\u5b57\u6bb5\u662f\u5b9a\u5bbd\u5b57\u6bb5\uff0c\u90a3\u4e48\u5b83\u7684\u6240\u6709\u5b57\u8282\u90fd\u662f\u76f4\u63a5\u6446\u653e\u7684\uff1b\u5982\u679c\u5b83\u662f\u53d8\u957f\u5b57\u6bb5\uff08attlen = -1\uff09\uff0c\u60c5\u51b5\u5c31\u4f1a\u7a0d\u590d\u6742\u4e00\u4e9b\u3002\u6240\u6709\u53d8\u957f\u6570\u636e\u7c7b\u578b\u90fd\u5171\u4eab\u4e00\u4e2a\u901a\u7528\u5934\u90e8\u7ed3\u6784\u4f53 <code class=\"type\">struct varlena</code>\uff0c\u5176\u4e2d\u5305\u542b\u5df2\u5b58\u50a8\u503c\u7684\u603b\u957f\u5ea6\u4ee5\u53ca\u4e00\u4e9b\u6807\u5fd7\u4f4d\u3002\u6839\u636e\u8fd9\u4e9b\u6807\u5fd7\uff0c\u6570\u636e\u53ef\u80fd\u662f\u884c\u5185\u5b58\u50a8\u7684\uff0c\u4e5f\u53ef\u80fd\u4f4d\u4e8e <acronym class=\"acronym\">TOAST</acronym> \u8868\u4e2d\uff1b\u5b83\u4e5f\u53ef\u80fd\u662f\u7ecf\u8fc7\u538b\u7f29\u7684\uff08\u89c1<a class=\"xref\" href=\"/docs/10/storage-toast.html\" title=\"67.2.\u00a0TOAST\">\u7b2c\u00a067.2\u00a0\u8282</a>\uff09\u3002</p>\n<div class=\"footnotes\"><br/>\n<hr/>\n<div class=\"footnote\">\n<p lang=\"zh\"><br/>\n<hr style=\"width:100; text-align:left;margin-left: 0\"/>\n<div class=\"footnote\" id=\"ftn.id-1.10.20.8.2.2\">\n<p><a class=\"para\" href=\"/docs/10/storage-page-layout.html#id-1.10.20.8.2.2\"><sup class=\"para\">[15]</sup></a> \u5b9e\u9645\u4e0a\uff0c\u7d22\u5f15\u8bbf\u95ee\u65b9\u6cd5\u4e0d\u8981\u6c42\u5fc5\u987b\u4f7f\u7528\u8fd9\u79cd\u9875\u9762\u683c\u5f0f\u3002\u73b0\u6709\u7684\u6240\u6709\u7d22\u5f15\u65b9\u6cd5\u90fd\u4f7f\u7528\u8fd9\u79cd\u57fa\u672c\u683c\u5f0f\uff0c\u4f46\u7d22\u5f15\u5143\u9875\u4e2d\u4fdd\u5b58\u7684\u6570\u636e\u901a\u5e38\u5e76\u4e0d\u9075\u5faa\u9879\u5e03\u5c40\u89c4\u5219\u3002</p>\n</div>\n</p>\n</div>\n</div>\n</div>", "manual_path": "/docs/10/storage-page-layout.html", "localization": {"status": "complete", "sources": [{"url": "/docs/10/storage-page-layout.html", "method": "same-major semantic node", "sha256": "f5196eab2ac06b79d682b4ac96c0eb75f7b928846063df4001b7428eaece9bfc", "language": "zh", "matched_nodes": ["#STORAGE-PAGE-LAYOUT/div[0]", "#STORAGE-PAGE-LAYOUT/div[15]/p[0]", "#STORAGE-PAGE-LAYOUT/div[20]", "#STORAGE-PAGE-LAYOUT/div[5]/div[1]/table[0]/tbody[2]/tr[3]/td[0]", "#STORAGE-PAGE-LAYOUT/div[5]/p[0]", "#STORAGE-PAGE-LAYOUT/div[8]/div[1]/table[0]/tbody[2]/tr[0]/td[2]", "#STORAGE-PAGE-LAYOUT/div[8]/p[0]", "#STORAGE-PAGE-LAYOUT/p[10]", "#STORAGE-PAGE-LAYOUT/p[11]", "#STORAGE-PAGE-LAYOUT/p[12]", "#STORAGE-PAGE-LAYOUT/p[13]", "#STORAGE-PAGE-LAYOUT/p[14]", "#STORAGE-PAGE-LAYOUT/p[17]", "#STORAGE-PAGE-LAYOUT/p[18]", "#STORAGE-PAGE-LAYOUT/p[19]", "#STORAGE-PAGE-LAYOUT/p[1]", "#STORAGE-PAGE-LAYOUT/p[2]", "#STORAGE-PAGE-LAYOUT/p[3]", "#STORAGE-PAGE-LAYOUT/p[4]"]}], "language": "zh", "original_text": {"/versions/10/description/0": "This section provides an overview of the page format used within PostgreSQL tables and indexes. [15] Sequences and TOAST tables are formatted just like a regular table.", "/versions/10/facts/0/label": "Definition scope", "/versions/10/facts/0/value": "Same-version core physical storage documentation", "/versions/10/tables/0/title": "Overall Page Layout", "/versions/10/tables/1/title": "PageHeaderData Layout", "/versions/10/tables/2/title": "HeapTupleHeaderData Layout", "/versions/10/related/0/label": "Storage Parameters", "/versions/10/tables/0/rows/0/c1": "24 bytes long. Contains general information about the page, including free space pointers.", "/versions/10/tables/0/rows/1/c1": "Array of item identifiers pointing to the actual items. Each entry is an (offset,length) pair. 4 bytes per item.", "/versions/10/tables/0/rows/2/c0": "Free space", "/versions/10/tables/0/rows/2/c1": "The unallocated space. New item identifiers are allocated from the start of this area, new items from the end.", "/versions/10/tables/0/rows/3/c0": "Items", "/versions/10/tables/0/rows/3/c1": "The actual items themselves.", "/versions/10/tables/0/rows/4/c0": "Special space", "/versions/10/tables/0/rows/4/c1": "Index access method specific data. Different methods store different data. Empty in ordinary tables.", "/versions/10/tables/1/rows/0/c2": "8 bytes", "/versions/10/tables/1/rows/0/c3": "LSN: next byte after last byte of WAL record for last change to this page", "/versions/10/tables/1/rows/1/c2": "2 bytes", "/versions/10/tables/1/rows/1/c3": "Page checksum", "/versions/10/tables/1/rows/2/c2": "2 bytes", "/versions/10/tables/1/rows/2/c3": "Flag bits", "/versions/10/tables/1/rows/3/c2": "2 bytes", "/versions/10/tables/1/rows/3/c3": "Offset to start of free space", "/versions/10/tables/1/rows/4/c2": "2 bytes", "/versions/10/tables/1/rows/4/c3": "Offset to end of free space", "/versions/10/tables/1/rows/5/c2": "2 bytes", "/versions/10/tables/1/rows/5/c3": "Offset to start of special space", "/versions/10/tables/1/rows/6/c2": "2 bytes", "/versions/10/tables/1/rows/6/c3": "Page size and layout version number information", "/versions/10/tables/1/rows/7/c2": "4 bytes", "/versions/10/tables/1/rows/7/c3": "Oldest unpruned XMAX on page, or zero if none", "/versions/10/tables/2/rows/0/c2": "4 bytes", "/versions/10/tables/2/rows/0/c3": "insert XID stamp", "/versions/10/tables/2/rows/1/c2": "4 bytes", "/versions/10/tables/2/rows/1/c3": "delete XID stamp", "/versions/10/tables/2/rows/2/c2": "4 bytes", "/versions/10/tables/2/rows/2/c3": "insert and/or delete CID stamp (overlays with t_xvac)", "/versions/10/tables/2/rows/3/c2": "4 bytes", "/versions/10/tables/2/rows/3/c3": "XID for VACUUM operation moving a row version", "/versions/10/tables/2/rows/4/c2": "6 bytes", "/versions/10/tables/2/rows/4/c3": "current TID of this or newer row version", "/versions/10/tables/2/rows/5/c2": "2 bytes", "/versions/10/tables/2/rows/5/c3": "number of attributes, plus various flag bits", "/versions/10/tables/2/rows/6/c2": "2 bytes", "/versions/10/tables/2/rows/6/c3": "various flag bits", "/versions/10/tables/2/rows/7/c2": "1 byte", "/versions/10/tables/2/rows/7/c3": "offset to user data", "/versions/10/tables/0/columns/0/label": "Item", "/versions/10/tables/0/columns/1/label": "Description", "/versions/10/tables/1/columns/0/label": "Field", "/versions/10/tables/1/columns/1/label": "Type", "/versions/10/tables/1/columns/2/label": "Length", "/versions/10/tables/1/columns/3/label": "Description", "/versions/10/tables/2/columns/0/label": "Field", "/versions/10/tables/2/columns/1/label": "Type", "/versions/10/tables/2/columns/2/label": "Length", "/versions/10/tables/2/columns/3/label": "Description"}, "fallback_fields": [], "source_language": "en", "original_snapshot_sha256": "fe2b9d2b77c105987a22b829bed820e3f8dcedf242947648e1ae576491e537ad"}, "comparison_data": {"layouts": [{"key": "layout-0", "rows": [{"c0": "PageHeaderData", "c1": "24 bytes long. Contains general information about the page, including free space pointers."}, {"c0": "ItemIdData", "c1": "Array of item identifiers pointing to the actual items. Each entry is an (offset,length) pair. 4 bytes per item."}, {"c0": "Free space", "c1": "The unallocated space. New item identifiers are allocated from the start of this area, new items from the end."}, {"c0": "Items", "c1": "The actual items themselves."}, {"c0": "Special space", "c1": "Index access method specific data. Different methods store different data. Empty in ordinary tables."}], "title": "Overall Page Layout", "columns": [{"key": "c0", "label": "Item"}, {"key": "c1", "label": "Description"}]}, {"key": "layout-1", "rows": [{"c0": "pd_lsn", "c1": "PageXLogRecPtr", "c2": "8 bytes", "c3": "LSN: next byte after last byte of WAL record for last change to this page"}, {"c0": "pd_checksum", "c1": "uint16", "c2": "2 bytes", "c3": "Page checksum"}, {"c0": "pd_flags", "c1": "uint16", "c2": "2 bytes", "c3": "Flag bits"}, {"c0": "pd_lower", "c1": "LocationIndex", "c2": "2 bytes", "c3": "Offset to start of free space"}, {"c0": "pd_upper", "c1": "LocationIndex", "c2": "2 bytes", "c3": "Offset to end of free space"}, {"c0": "pd_special", "c1": "LocationIndex", "c2": "2 bytes", "c3": "Offset to start of special space"}, {"c0": "pd_pagesize_version", "c1": "uint16", "c2": "2 bytes", "c3": "Page size and layout version number information"}, {"c0": "pd_prune_xid", "c1": "TransactionId", "c2": "4 bytes", "c3": "Oldest unpruned XMAX on page, or zero if none"}], "title": "PageHeaderData Layout", "columns": [{"key": "c0", "label": "Field"}, {"key": "c1", "label": "Type"}, {"key": "c2", "label": "Length"}, {"key": "c3", "label": "Description"}]}, {"key": "layout-2", "rows": [{"c0": "t_xmin", "c1": "TransactionId", "c2": "4 bytes", "c3": "insert XID stamp"}, {"c0": "t_xmax", "c1": "TransactionId", "c2": "4 bytes", "c3": "delete XID stamp"}, {"c0": "t_cid", "c1": "CommandId", "c2": "4 bytes", "c3": "insert and/or delete CID stamp (overlays with t_xvac)"}, {"c0": "t_xvac", "c1": "TransactionId", "c2": "4 bytes", "c3": "XID for VACUUM operation moving a row version"}, {"c0": "t_ctid", "c1": "ItemPointerData", "c2": "6 bytes", "c3": "current TID of this or newer row version"}, {"c0": "t_infomask2", "c1": "uint16", "c2": "2 bytes", "c3": "number of attributes, plus various flag bits"}, {"c0": "t_infomask", "c1": "uint16", "c2": "2 bytes", "c3": "various flag bits"}, {"c0": "t_hoff", "c1": "uint8", "c2": "1 byte", "c3": "offset to user data"}], "title": "HeapTupleHeaderData Layout", "columns": [{"key": "c0", "label": "Field"}, {"key": "c1", "label": "Type"}, {"key": "c2", "label": "Length"}, {"key": "c3", "label": "Description"}]}]}, "comparison_hash": "b621fa85b3be27a0eb0d82986e9524f2ef0a776761901f0d429826eec4822d0a", "manual_language": "zh"}, "11": {"facts": [{"label": "\u5b9a\u4e49\u8303\u56f4", "value": "\u540c\u7248\u672c\u6838\u5fc3\u7269\u7406\u5b58\u50a8\u6587\u6863"}], "tables": [{"key": "layout-0", "rows": [{"c0": "PageHeaderData", "c1": "\u957f 24 \u5b57\u8282\uff0c\u5305\u542b\u9875\u9762\u7684\u901a\u7528\u4fe1\u606f\uff0c\u4f8b\u5982\u7a7a\u95f2\u7a7a\u95f4\u6307\u9488\u3002"}, {"c0": "ItemIdData", "c1": "\u6307\u5411\u5b9e\u9645\u6570\u636e\u9879\u7684\u884c\u6307\u9488\u6570\u7ec4\u3002\u6bcf\u9879\u4e3a\u4e00\u4e2a\uff08\u504f\u79fb\uff0c\u957f\u5ea6\uff09\u5bf9\uff0c\u5360 4 \u5b57\u8282\u3002"}, {"c0": "\u7a7a\u95f2\u7a7a\u95f4", "c1": "\u5c1a\u672a\u5206\u914d\u7684\u7a7a\u95f4\u3002\u65b0\u884c\u6307\u9488\u4ece\u8be5\u533a\u57df\u7684\u8d77\u59cb\u5904\u5206\u914d\uff0c\u65b0\u6570\u636e\u9879\u4ece\u672b\u5c3e\u5904\u5206\u914d\u3002"}, {"c0": "\u9879", "c1": "\u5b9e\u9645\u7684\u6570\u636e\u9879\u672c\u8eab\u3002"}, {"c0": "\u7279\u6b8a\u7a7a\u95f4", "c1": "\u7d22\u5f15\u8bbf\u95ee\u65b9\u6cd5\u4e13\u7528\u6570\u636e\u3002\u4e0d\u540c\u65b9\u6cd5\u5b58\u50a8\u7684\u5185\u5bb9\u4e0d\u540c\uff0c\u666e\u901a\u8868\u4e2d\u6b64\u533a\u57df\u4e3a\u7a7a\u3002"}], "title": "\u9875\u9762\u603b\u4f53\u5e03\u5c40", "columns": [{"key": "c0", "label": "\u9879\u76ee"}, {"key": "c1", "label": "\u8bf4\u660e"}]}, {"key": "layout-1", "rows": [{"c0": "pd_lsn", "c1": "PageXLogRecPtr", "c2": "8 \u5b57\u8282", "c3": "LSN\uff1a\u8be5\u9875\u6700\u540e\u4e00\u6b21\u53d8\u5316\u6240\u5bf9\u5e94 WAL \u8bb0\u5f55\u7684\u6700\u540e\u4e00\u4e2a\u5b57\u8282\u4e4b\u540e\u7684\u4f4d\u7f6e\u3002"}, {"c0": "pd_checksum", "c1": "uint16", "c2": "2 \u5b57\u8282", "c3": "\u9875\u9762\u6821\u9a8c\u548c"}, {"c0": "pd_flags", "c1": "uint16", "c2": "2 \u5b57\u8282", "c3": "\u6807\u5fd7\u4f4d"}, {"c0": "pd_lower", "c1": "LocationIndex", "c2": "2 \u5b57\u8282", "c3": "\u7a7a\u95f2\u7a7a\u95f4\u8d77\u59cb\u4f4d\u7f6e\u7684\u504f\u79fb\u91cf"}, {"c0": "pd_upper", "c1": "LocationIndex", "c2": "2 \u5b57\u8282", "c3": "\u7a7a\u95f2\u7a7a\u95f4\u7ed3\u675f\u4f4d\u7f6e\u7684\u504f\u79fb\u91cf"}, {"c0": "pd_special", "c1": "LocationIndex", "c2": "2 \u5b57\u8282", "c3": "\u7279\u6b8a\u7a7a\u95f4\u8d77\u59cb\u4f4d\u7f6e\u7684\u504f\u79fb\u91cf"}, {"c0": "pd_pagesize_version", "c1": "uint16", "c2": "2 \u5b57\u8282", "c3": "\u9875\u9762\u5927\u5c0f\u4e0e\u5e03\u5c40\u7248\u672c\u53f7\u4fe1\u606f"}, {"c0": "pd_prune_xid", "c1": "TransactionId", "c2": "4 \u5b57\u8282", "c3": "\u9875\u9762\u4e0a\u6700\u65e9\u7684\u5c1a\u672a\u4fee\u526a\u7684 XMAX\uff1b\u6ca1\u6709\u5219\u4e3a\u96f6"}], "title": "PageHeaderData \u5e03\u5c40", "columns": [{"key": "c0", "label": "\u5b57\u6bb5"}, {"key": "c1", "label": "\u7c7b\u578b"}, {"key": "c2", "label": "\u957f\u5ea6"}, {"key": "c3", "label": "\u8bf4\u660e"}]}, {"key": "layout-2", "rows": [{"c0": "t_xmin", "c1": "TransactionId", "c2": "4 \u5b57\u8282", "c3": "\u63d2\u5165\u4e8b\u52a1\u7684 XID"}, {"c0": "t_xmax", "c1": "TransactionId", "c2": "4 \u5b57\u8282", "c3": "\u5220\u9664\u4e8b\u52a1\u7684 XID"}, {"c0": "t_cid", "c1": "CommandId", "c2": "4 \u5b57\u8282", "c3": "\u63d2\u5165\u548c\uff0f\u6216\u5220\u9664\u547d\u4ee4\u7684 CID\uff0c\u4e0e t_xvac \u5171\u7528\u5b58\u50a8\u4f4d\u7f6e"}, {"c0": "t_xvac", "c1": "TransactionId", "c2": "4 \u5b57\u8282", "c3": "VACUUM \u64cd\u4f5c\u79fb\u52a8\u884c\u7248\u672c\u65f6\u4f7f\u7528\u7684 XID"}, {"c0": "t_ctid", "c1": "ItemPointerData", "c2": "6 \u5b57\u8282", "c3": "\u672c\u884c\u7248\u672c\u6216\u8f83\u65b0\u884c\u7248\u672c\u7684\u5f53\u524d TID"}, {"c0": "t_infomask2", "c1": "uint16", "c2": "2 \u5b57\u8282", "c3": "\u5c5e\u6027\u6570\u91cf\u53ca\u5404\u79cd\u6807\u5fd7\u4f4d"}, {"c0": "t_infomask", "c1": "uint16", "c2": "2 \u5b57\u8282", "c3": "\u5404\u79cd\u6807\u5fd7\u4f4d"}, {"c0": "t_hoff", "c1": "uint8", "c2": "1 \u5b57\u8282", "c3": "\u7528\u6237\u6570\u636e\u7684\u504f\u79fb\u91cf"}], "title": "HeapTupleHeaderData \u5e03\u5c40", "columns": [{"key": "c0", "label": "\u5b57\u6bb5"}, {"key": "c1", "label": "\u7c7b\u578b"}, {"key": "c2", "label": "\u957f\u5ea6"}, {"key": "c3", "label": "\u8bf4\u660e"}]}], "diagram": "page-layout", "related": [{"url": "/wiki/relopts/?v=11", "label": "\u5b58\u50a8\u53c2\u6570"}], "release": {"ref": "https://ftp.postgresql.org/pub/source/v11.22/postgresql-11.22.tar.bz2", "label": "11.22", "major": "11", "channel": "stable", "revision": "2cb7c97d7a0d7278851bbc9c61f467b69c094c72b81740b751108e7892ebe1f0"}, "sources": [{"url": "https://pg.center/docs/11/storage-page-layout.html", "path": "storage-page-layout.html", "label": "PostgreSQL 11 English manual", "sha256": "89ae53d52323261bb09214babd110c76bde78e92234cbea4a8e51c5548a1073b", "language": "en", "original_url": "/docs/11/storage-page-layout.html"}], "sections": [], "signature": "", "description": ["\u672c\u8282\u6982\u8ff0 PostgreSQL \u8868\u548c\u7d22\u5f15\u5185\u90e8\u6240\u4f7f\u7528\u7684\u9875\u9762\u683c\u5f0f\u3002 [15] \u5e8f\u5217\u548c TOAST \u8868\u7684\u683c\u5f0f\u4e0e\u666e\u901a\u8868\u76f8\u540c\u3002"], "manual_html": "<div class=\"sect1\">\n<div class=\"titlepage\">\n<div>\n<div>\n<h2 class=\"title\" lang=\"zh\">\n<div>\n<div>\n<h2 class=\"title\" style=\"clear: both\">69.6.\u00a0\u6570\u636e\u5e93\u9875\u9762\u5e03\u5c40 </h2>\n</div>\n</div>\n</h2>\n</div>\n</div>\n</div>\n<p lang=\"zh\">\u672c\u8282\u6982\u8ff0 <span class=\"productname\">PostgreSQL</span> \u8868\u548c\u7d22\u5f15\u5185\u90e8\u6240\u4f7f\u7528\u7684\u9875\u9762\u683c\u5f0f\u3002<a class=\"footnote\" href=\"/docs/11/storage-page-layout.html#ftn.id-1.10.21.8.2.2\"><sup class=\"footnote\" id=\"id-1.10.21.8.2.2\">[15]</sup></a> \u5e8f\u5217\u548c <acronym class=\"acronym\">TOAST</acronym> \u8868\u7684\u683c\u5f0f\u4e0e\u666e\u901a\u8868\u76f8\u540c\u3002</p>\n<p lang=\"zh\">\u5728\u4e0b\u9762\u7684\u8bf4\u660e\u4e2d\uff0c\u5047\u5b9a\u4e00\u4e2a<em class=\"firstterm\">\u5b57\u8282</em>\u5305\u542b 8 \u4e2a\u4f4d\u3002\u53e6\u5916\uff0c\u672f\u8bed<em class=\"firstterm\">\u9879</em>\u6307\u7684\u662f\u5b58\u50a8\u5728\u9875\u9762\u4e0a\u7684\u5355\u4e2a\u6570\u636e\u503c\u3002\u5728\u8868\u4e2d\uff0c\u9879\u662f\u4e00\u884c\uff1b\u5728\u7d22\u5f15\u4e2d\uff0c\u9879\u662f\u4e00\u6761\u7d22\u5f15\u6761\u76ee\u3002</p>\n<p lang=\"zh\">\u6bcf\u4e2a\u8868\u548c\u7d22\u5f15\u90fd\u5b58\u50a8\u4e3a\u56fa\u5b9a\u5927\u5c0f\u7684<em class=\"firstterm\">\u9875\u9762</em>\u6570\u7ec4\uff08\u901a\u5e38\u4e3a 8 kB\uff0c\u4e0d\u8fc7\u5728\u7f16\u8bd1\u670d\u52a1\u5668\u65f6\u53ef\u4ee5\u9009\u62e9\u4e0d\u540c\u7684\u9875\u9762\u5927\u5c0f\uff09\u3002\u5728\u8868\u4e2d\uff0c\u6240\u6709\u9875\u9762\u5728\u903b\u8f91\u4e0a\u90fd\u662f\u7b49\u4ef7\u7684\uff0c\u56e0\u6b64\u67d0\u4e2a\u7279\u5b9a\u9879\uff08\u884c\uff09\u53ef\u4ee5\u5b58\u653e\u5728\u4efb\u610f\u9875\u9762\u4e2d\u3002\u5728\u7d22\u5f15\u4e2d\uff0c\u7b2c\u4e00\u9875\u901a\u5e38\u4fdd\u7559\u4e3a<em class=\"firstterm\">\u5143\u9875</em>\uff0c\u7528\u4e8e\u4fdd\u5b58\u63a7\u5236\u4fe1\u606f\uff1b\u5e76\u4e14\u6839\u636e\u7d22\u5f15\u8bbf\u95ee\u65b9\u6cd5\u7684\u4e0d\u540c\uff0c\u7d22\u5f15\u4e2d\u8fd8\u53ef\u80fd\u5b58\u5728\u4e0d\u540c\u7c7b\u578b\u7684\u9875\u9762\u3002</p>\n<p lang=\"zh\"><a class=\"xref\" href=\"/docs/11/storage-page-layout.html#PAGE-TABLE\" title=\"\u8868\u00a069.2.\u00a0\u603b\u4f53\u9875\u9762\u5e03\u5c40\">\u8868\u00a069.2</a>\u5c55\u793a\u4e86\u9875\u9762\u7684\u603b\u4f53\u5e03\u5c40\u3002\u6bcf\u4e2a\u9875\u9762\u5305\u542b\u4e94\u4e2a\u90e8\u5206\u3002</p>\n<div class=\"table\">\n<p class=\"title\" lang=\"zh\"><strong>\u8868\u00a069.2.\u00a0\u603b\u4f53\u9875\u9762\u5e03\u5c40</strong></p>\n<div class=\"table-contents\">\n<table class=\"table\">\n<thead>\n<tr>\n<th lang=\"zh\">\u9879\u76ee</th>\n<th lang=\"zh\">\u8bf4\u660e</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>PageHeaderData</td>\n<td lang=\"zh\">\u957f 24 \u5b57\u8282\uff0c\u5305\u542b\u9875\u9762\u7684\u901a\u7528\u4fe1\u606f\uff0c\u4f8b\u5982\u7a7a\u95f2\u7a7a\u95f4\u6307\u9488\u3002</td>\n</tr>\n<tr>\n<td>ItemIdData</td>\n<td lang=\"zh\">\u6307\u5411\u5b9e\u9645\u6570\u636e\u9879\u7684\u884c\u6307\u9488\u6570\u7ec4\u3002\u6bcf\u9879\u4e3a\u4e00\u4e2a\uff08\u504f\u79fb\uff0c\u957f\u5ea6\uff09\u5bf9\uff0c\u5360 4 \u5b57\u8282\u3002</td>\n</tr>\n<tr>\n<td lang=\"zh\">\u7a7a\u95f2\u7a7a\u95f4</td>\n<td lang=\"zh\">\u5c1a\u672a\u5206\u914d\u7684\u7a7a\u95f4\u3002\u65b0\u884c\u6307\u9488\u4ece\u8be5\u533a\u57df\u7684\u8d77\u59cb\u5904\u5206\u914d\uff0c\u65b0\u6570\u636e\u9879\u4ece\u672b\u5c3e\u5904\u5206\u914d\u3002</td>\n</tr>\n<tr>\n<td lang=\"zh\">\u9879</td>\n<td lang=\"zh\">\u5b9e\u9645\u7684\u6570\u636e\u9879\u672c\u8eab\u3002</td>\n</tr>\n<tr>\n<td lang=\"zh\">\u7279\u6b8a\u7a7a\u95f4</td>\n<td lang=\"zh\">\u7d22\u5f15\u8bbf\u95ee\u65b9\u6cd5\u4e13\u7528\u6570\u636e\u3002\u4e0d\u540c\u65b9\u6cd5\u5b58\u50a8\u7684\u5185\u5bb9\u4e0d\u540c\uff0c\u666e\u901a\u8868\u4e2d\u6b64\u533a\u57df\u4e3a\u7a7a\u3002</td>\n</tr>\n</tbody>\n</table>\n</div>\n</div><br class=\"table-break\"/>\n<p lang=\"zh\">\u6bcf\u9875\u7684\u524d 24 \u5b57\u8282\u662f\u9875\u9996\u90e8 PageHeaderData\uff0c\u8be6\u7ec6\u683c\u5f0f\u89c1\u8868 69.3\u3002\u7b2c\u4e00\u4e2a\u5b57\u6bb5\u8ddf\u8e2a\u4e0e\u8be5\u9875\u76f8\u5173\u7684\u6700\u8fd1\u4e00\u6761 WAL \u8bb0\u5f55\uff1b\u7b2c\u4e8c\u4e2a\u5b57\u6bb5\u5728\u542f\u7528\u6570\u636e\u6821\u9a8c\u548c\u65f6\u4fdd\u5b58\u9875\u9762\u6821\u9a8c\u548c\u3002\u4e4b\u540e\u662f\u4e00\u4e2a\u5305\u542b\u6807\u5fd7\u4f4d\u7684 2 \u5b57\u8282\u5b57\u6bb5\uff0c\u518d\u540e\u9762\u662f\u4e09\u4e2a 2 \u5b57\u8282\u6574\u6570 pd_lower\u3001pd_upper \u548c pd_special\uff0c\u5206\u522b\u8bb0\u5f55\u4ece\u9875\u8d77\u70b9\u5230\u672a\u5206\u914d\u7a7a\u95f4\u8d77\u70b9\u3001\u672a\u5206\u914d\u7a7a\u95f4\u7ec8\u70b9\u53ca\u7279\u6b8a\u7a7a\u95f4\u8d77\u70b9\u7684\u5b57\u8282\u504f\u79fb\u91cf\u3002\u63a5\u4e0b\u6765\u7684 2 \u5b57\u8282 pd_pagesize_version \u540c\u65f6\u4fdd\u5b58\u9875\u5927\u5c0f\u548c\u7248\u672c\u6807\u8bc6\u3002PostgreSQL 8.3 \u8d77\u7248\u672c\u53f7\u4e3a 4\uff1b8.1 \u4e0e 8.2 \u4f7f\u7528 3\uff1b8.0 \u4f7f\u7528 2\uff1b7.3 \u4e0e 7.4 \u4f7f\u7528 1\uff1b\u66f4\u65e9\u7248\u672c\u4f7f\u7528 0\u3002\u591a\u6570\u7248\u672c\u7684\u57fa\u672c\u9875\u9762\u5e03\u5c40\u548c\u9996\u90e8\u683c\u5f0f\u5e76\u672a\u53d8\u5316\uff0c\u4f46\u5806\u884c\u9996\u90e8\u5e03\u5c40\u6709\u53d8\u5316\u3002\u9875\u5927\u5c0f\u57fa\u672c\u53ea\u7528\u4e8e\u4ea4\u53c9\u68c0\u67e5\uff1b\u540c\u4e00\u5b89\u88c5\u4e0d\u652f\u6301\u591a\u79cd\u9875\u5927\u5c0f\u3002\u6700\u540e\u4e00\u4e2a\u5b57\u6bb5\u63d0\u793a\u4fee\u526a\u8be5\u9875\u662f\u5426\u53ef\u80fd\u6709\u76ca\uff0c\u8bb0\u5f55\u8be5\u9875\u6700\u65e9\u7684\u5c1a\u672a\u4fee\u526a\u7684 XMAX\u3002</p>\n<div class=\"table\">\n<p class=\"title\" lang=\"zh\"><strong>\u8868\u00a069.3.\u00a0PageHeaderData \u5e03\u5c40</strong></p>\n<div class=\"table-contents\">\n<table class=\"table\">\n<thead>\n<tr>\n<th lang=\"zh\">\u5b57\u6bb5</th>\n<th lang=\"zh\">\u7c7b\u578b</th>\n<th lang=\"zh\">\u957f\u5ea6</th>\n<th lang=\"zh\">\u8bf4\u660e</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>pd_lsn</td>\n<td>PageXLogRecPtr</td>\n<td lang=\"zh\">8 \u5b57\u8282</td>\n<td lang=\"zh\">LSN\uff1a\u8be5\u9875\u6700\u540e\u4e00\u6b21\u53d8\u5316\u6240\u5bf9\u5e94 WAL \u8bb0\u5f55\u7684\u6700\u540e\u4e00\u4e2a\u5b57\u8282\u4e4b\u540e\u7684\u4f4d\u7f6e\u3002</td>\n</tr>\n<tr>\n<td>pd_checksum</td>\n<td>uint16</td>\n<td lang=\"zh\">2 \u5b57\u8282</td>\n<td lang=\"zh\">\u9875\u9762\u6821\u9a8c\u548c</td>\n</tr>\n<tr>\n<td>pd_flags</td>\n<td>uint16</td>\n<td lang=\"zh\">2 \u5b57\u8282</td>\n<td lang=\"zh\">\u6807\u5fd7\u4f4d</td>\n</tr>\n<tr>\n<td>pd_lower</td>\n<td>LocationIndex</td>\n<td lang=\"zh\">2 \u5b57\u8282</td>\n<td lang=\"zh\">\u7a7a\u95f2\u7a7a\u95f4\u8d77\u59cb\u4f4d\u7f6e\u7684\u504f\u79fb\u91cf</td>\n</tr>\n<tr>\n<td>pd_upper</td>\n<td>LocationIndex</td>\n<td lang=\"zh\">2 \u5b57\u8282</td>\n<td lang=\"zh\">\u7a7a\u95f2\u7a7a\u95f4\u7ed3\u675f\u4f4d\u7f6e\u7684\u504f\u79fb\u91cf</td>\n</tr>\n<tr>\n<td>pd_special</td>\n<td>LocationIndex</td>\n<td lang=\"zh\">2 \u5b57\u8282</td>\n<td lang=\"zh\">\u7279\u6b8a\u7a7a\u95f4\u8d77\u59cb\u4f4d\u7f6e\u7684\u504f\u79fb\u91cf</td>\n</tr>\n<tr>\n<td>pd_pagesize_version</td>\n<td>uint16</td>\n<td lang=\"zh\">2 \u5b57\u8282</td>\n<td lang=\"zh\">\u9875\u9762\u5927\u5c0f\u4e0e\u5e03\u5c40\u7248\u672c\u53f7\u4fe1\u606f</td>\n</tr>\n<tr>\n<td>pd_prune_xid</td>\n<td>TransactionId</td>\n<td lang=\"zh\">4 \u5b57\u8282</td>\n<td lang=\"zh\">\u9875\u9762\u4e0a\u6700\u65e9\u7684\u5c1a\u672a\u4fee\u526a\u7684 XMAX\uff1b\u6ca1\u6709\u5219\u4e3a\u96f6</td>\n</tr>\n</tbody>\n</table>\n</div>\n</div><br class=\"table-break\"/>\n<p lang=\"zh\">\u6240\u6709\u7ec6\u8282\u90fd\u53ef\u4ee5\u5728 <code class=\"filename\">src/include/storage/bufpage.h</code> \u4e2d\u627e\u5230\u3002</p>\n<p lang=\"zh\">\u9875\u5934\u4e4b\u540e\u662f\u9879\u6807\u8bc6\u7b26\uff08<code class=\"type\">ItemIdData</code>\uff09\uff0c\u6bcf\u4e2a\u9700\u8981\u56db\u4e2a\u5b57\u8282\u3002\u4e00\u4e2a\u9879\u6807\u8bc6\u7b26\u5305\u542b\u9879\u8d77\u59cb\u4f4d\u7f6e\u7684\u5b57\u8282\u504f\u79fb\u91cf\u3001\u5176\u5b57\u8282\u957f\u5ea6\uff0c\u4ee5\u53ca\u82e5\u5e72\u5f71\u54cd\u89e3\u91ca\u65b9\u5f0f\u7684\u5c5e\u6027\u4f4d\u3002\u65b0\u7684\u9879\u6807\u8bc6\u7b26\u4f1a\u6839\u636e\u9700\u8981\u4ece\u672a\u5206\u914d\u7a7a\u95f4\u7684\u8d77\u59cb\u5904\u5206\u914d\u3002\u5f53\u524d\u5df2\u6709\u591a\u5c11\u4e2a\u9879\u6807\u8bc6\u7b26\uff0c\u53ef\u4ee5\u901a\u8fc7\u67e5\u770b <code class=\"structfield\">pd_lower</code> \u5f97\u77e5\uff1b\u5206\u914d\u65b0\u6807\u8bc6\u7b26\u65f6\u5b83\u4f1a\u589e\u52a0\u3002\u56e0\u4e3a\u4e00\u4e2a\u9879\u6807\u8bc6\u7b26\u5728\u88ab\u91ca\u653e\u4e4b\u524d\u6c38\u8fdc\u4e0d\u4f1a\u79fb\u52a8\uff0c\u6240\u4ee5\u5373\u4f7f\u9879\u672c\u8eab\u4e3a\u4e86\u6574\u7406\u7a7a\u95f2\u7a7a\u95f4\u800c\u5728\u9875\u9762\u5185\u79fb\u52a8\uff0c\u5176\u7d22\u5f15\u4ecd\u7136\u53ef\u4ee5\u88ab\u957f\u671f\u7528\u6765\u5f15\u7528\u8be5\u9879\u3002\u4e8b\u5b9e\u4e0a\uff0c\u6bcf\u4e2a\u6307\u5411\u9879\u7684\u6307\u9488\uff08<code class=\"type\">ItemPointer</code>\uff0c\u4e5f\u79f0 <code class=\"type\">CTID</code>\uff09\u5728 <span class=\"productname\">PostgreSQL</span> \u4e2d\u90fd\u7531\u9875\u53f7\u548c\u9879\u6807\u8bc6\u7b26\u7d22\u5f15\u6784\u6210\u3002</p>\n<p lang=\"zh\">\u9879\u672c\u8eab\u5b58\u50a8\u5728\u4ece\u672a\u5206\u914d\u7a7a\u95f4\u672b\u5c3e\u5f00\u59cb\u3001\u5411\u540e\u5206\u914d\u7684\u533a\u57df\u4e2d\u3002\u5176\u786e\u5207\u7ed3\u6784\u53d6\u51b3\u4e8e\u8868\u8981\u5305\u542b\u4ec0\u4e48\u5185\u5bb9\u3002\u8868\u548c\u5e8f\u5217\u90fd\u4f7f\u7528\u4e00\u79cd\u540d\u4e3a <code class=\"type\">HeapTupleHeaderData</code> \u7684\u7ed3\u6784\u4f53\uff0c\u5982\u4e0b\u6240\u8ff0\u3002</p>\n<p lang=\"zh\">\u6700\u540e\u4e00\u90e8\u5206\u662f<span class=\"quote\">\u201c<span class=\"quote\">\u7279\u6b8a\u90e8\u5206</span>\u201d</span>\uff0c\u5176\u4e2d\u53ef\u4ee5\u5b58\u653e\u8bbf\u95ee\u65b9\u6cd5\u5e0c\u671b\u4fdd\u5b58\u7684\u4efb\u4f55\u5185\u5bb9\u3002\u4f8b\u5982\uff0cB-\u6811\u7d22\u5f15\u4f1a\u5728\u8fd9\u91cc\u4fdd\u5b58\u6307\u5411\u9875\u9762\u5de6\u3001\u53f3\u5144\u5f1f\u7684\u94fe\u63a5\uff0c\u4ee5\u53ca\u5176\u4ed6\u4e00\u4e9b\u4e0e\u7d22\u5f15\u7ed3\u6784\u76f8\u5173\u7684\u6570\u636e\u3002\u666e\u901a\u8868\u5b8c\u5168\u4e0d\u4f7f\u7528\u7279\u6b8a\u90e8\u5206\uff08\u901a\u8fc7\u5c06 <code class=\"structfield\">pd_special</code> \u8bbe\u4e3a\u9875\u9762\u5927\u5c0f\u6765\u8868\u793a\uff09\u3002</p>\n<div class=\"sect2\">\n<div class=\"titlepage\">\n<div>\n<div>\n<h3 class=\"title\" lang=\"zh\">\n<dl class=\"toc\">\n<dt><span class=\"sect2\"><a href=\"/docs/11/storage-page-layout.html#STORAGE-TUPLE-LAYOUT\">69.6.1. \u8868\u884c\u5e03\u5c40</a></span></dt>\n</dl>\n</h3>\n</div>\n</div>\n</div>\n<p lang=\"zh\">\u6240\u6709\u8868\u884c\u7684\u7ed3\u6784\u90fd\u76f8\u540c\u3002\u5b83\u4eec\u90fd\u6709\u4e00\u4e2a\u56fa\u5b9a\u5927\u5c0f\u7684\u5934\u90e8\uff08\u5728\u5927\u591a\u6570\u673a\u5668\u4e0a\u5360 23 \u5b57\u8282\uff09\uff0c\u540e\u9762\u8ddf\u7740\u53ef\u9009\u7684\u7a7a\u503c\u4f4d\u56fe\u3001\u53ef\u9009\u7684\u5bf9\u8c61 ID \u5b57\u6bb5\u4ee5\u53ca\u7528\u6237\u6570\u636e\u3002\u5934\u90e8\u7684\u8be6\u7ec6\u683c\u5f0f\u89c1<a class=\"xref\" href=\"/docs/11/storage-page-layout.html#HEAPTUPLEHEADERDATA-TABLE\" title=\"\u8868\u00a069.4.\u00a0HeapTupleHeaderData \u5e03\u5c40\">\u8868\u00a069.4</a>\u3002\u5b9e\u9645\u7528\u6237\u6570\u636e\uff08\u884c\u7684\u5404\u5217\uff09\u4ece <code class=\"structfield\">t_hoff</code> \u6307\u793a\u7684\u504f\u79fb\u4f4d\u7f6e\u5f00\u59cb\uff0c\u5b83\u5fc5\u987b\u59cb\u7ec8\u662f\u8be5\u5e73\u53f0 MAXALIGN \u5bf9\u9f50\u5355\u4f4d\u7684\u6574\u6570\u500d\u3002\u53ea\u6709\u5f53 <em class=\"firstterm\">HEAP_HASNULL</em> \u4f4d\u5728 <code class=\"structfield\">t_infomask</code> \u4e2d\u88ab\u7f6e\u4f4d\u65f6\uff0c\u7a7a\u503c\u4f4d\u56fe\u624d\u5b58\u5728\u3002\u82e5\u5b58\u5728\uff0c\u5b83\u7d27\u968f\u56fa\u5b9a\u5934\u90e8\u4e4b\u540e\uff0c\u5e76\u5360\u7528\u8db3\u591f\u591a\u7684\u5b57\u8282\uff0c\u4ee5\u4fbf\u4e3a\u6bcf\u4e2a\u6570\u636e\u5217\u63d0\u4f9b\u4e00\u4f4d\uff08\u4e5f\u5c31\u662f\u8bf4\uff0c\u603b\u5171\u4e3a <code class=\"structfield\">t_natts</code> \u4f4d\uff09\u3002\u5728\u8fd9\u4e2a\u4f4d\u56fe\u4e2d\uff0c1 \u8868\u793a\u975e\u7a7a\uff0c0 \u8868\u793a\u7a7a\u503c\u3002\u5f53\u4f4d\u56fe\u4e0d\u5b58\u5728\u65f6\uff0c\u5047\u5b9a\u6240\u6709\u5217\u90fd\u975e\u7a7a\u3002\u53ea\u6709\u5f53 <em class=\"firstterm\">HEAP_HASOID</em> \u4f4d\u5728 <code class=\"structfield\">t_infomask</code> \u4e2d\u88ab\u7f6e\u4f4d\u65f6\uff0c\u5bf9\u8c61 ID \u624d\u5b58\u5728\u3002\u82e5\u5b58\u5728\uff0c\u5b83\u4f4d\u4e8e <code class=\"structfield\">t_hoff</code> \u8fb9\u754c\u4e4b\u524d\u3002\u4e3a\u4e86\u8ba9 <code class=\"structfield\">t_hoff</code> \u6210\u4e3a MAXALIGN \u7684\u6574\u6570\u500d\u6240\u9700\u7684\u4efb\u4f55\u586b\u5145\uff0c\u90fd\u4f1a\u51fa\u73b0\u5728\u7a7a\u503c\u4f4d\u56fe\u4e0e\u5bf9\u8c61 ID \u4e4b\u95f4\u3002\uff08\u8fd9\u53c8\u53cd\u8fc7\u6765\u4fdd\u8bc1\u4e86\u5bf9\u8c61 ID \u7684\u5bf9\u9f50\u662f\u5408\u9002\u7684\u3002\uff09</p>\n<div class=\"table\">\n<p class=\"title\" lang=\"zh\"><strong>\u8868\u00a069.4.\u00a0HeapTupleHeaderData \u5e03\u5c40</strong></p>\n<div class=\"table-contents\">\n<table class=\"table\">\n<thead>\n<tr>\n<th lang=\"zh\">\u5b57\u6bb5</th>\n<th lang=\"zh\">\u7c7b\u578b</th>\n<th lang=\"zh\">\u957f\u5ea6</th>\n<th lang=\"zh\">\u8bf4\u660e</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>t_xmin</td>\n<td>TransactionId</td>\n<td lang=\"zh\">4 \u5b57\u8282</td>\n<td lang=\"zh\">\u63d2\u5165\u4e8b\u52a1\u7684 XID</td>\n</tr>\n<tr>\n<td>t_xmax</td>\n<td>TransactionId</td>\n<td lang=\"zh\">4 \u5b57\u8282</td>\n<td lang=\"zh\">\u5220\u9664\u4e8b\u52a1\u7684 XID</td>\n</tr>\n<tr>\n<td>t_cid</td>\n<td>CommandId</td>\n<td lang=\"zh\">4 \u5b57\u8282</td>\n<td lang=\"zh\">\u63d2\u5165\u548c\uff0f\u6216\u5220\u9664\u547d\u4ee4\u7684 CID\uff0c\u4e0e t_xvac \u5171\u7528\u5b58\u50a8\u4f4d\u7f6e</td>\n</tr>\n<tr>\n<td>t_xvac</td>\n<td>TransactionId</td>\n<td lang=\"zh\">4 \u5b57\u8282</td>\n<td lang=\"zh\">VACUUM \u64cd\u4f5c\u79fb\u52a8\u884c\u7248\u672c\u65f6\u4f7f\u7528\u7684 XID</td>\n</tr>\n<tr>\n<td>t_ctid</td>\n<td>ItemPointerData</td>\n<td lang=\"zh\">6 \u5b57\u8282</td>\n<td lang=\"zh\">\u672c\u884c\u7248\u672c\u6216\u8f83\u65b0\u884c\u7248\u672c\u7684\u5f53\u524d TID</td>\n</tr>\n<tr>\n<td>t_infomask2</td>\n<td>uint16</td>\n<td lang=\"zh\">2 \u5b57\u8282</td>\n<td lang=\"zh\">\u5c5e\u6027\u6570\u91cf\u53ca\u5404\u79cd\u6807\u5fd7\u4f4d</td>\n</tr>\n<tr>\n<td>t_infomask</td>\n<td>uint16</td>\n<td lang=\"zh\">2 \u5b57\u8282</td>\n<td lang=\"zh\">\u5404\u79cd\u6807\u5fd7\u4f4d</td>\n</tr>\n<tr>\n<td>t_hoff</td>\n<td>uint8</td>\n<td lang=\"zh\">1 \u5b57\u8282</td>\n<td lang=\"zh\">\u7528\u6237\u6570\u636e\u7684\u504f\u79fb\u91cf</td>\n</tr>\n</tbody>\n</table>\n</div>\n</div><br class=\"table-break\"/>\n<p lang=\"zh\">\u6240\u6709\u7ec6\u8282\u90fd\u53ef\u4ee5\u5728 <code class=\"filename\">src/include/access/htup_details.h</code> \u4e2d\u627e\u5230\u3002</p>\n<p lang=\"zh\">\u8981\u89e3\u91ca\u5b9e\u9645\u6570\u636e\uff0c\u5fc5\u987b\u501f\u52a9\u4ece\u5176\u4ed6\u8868\u4e2d\u83b7\u5f97\u7684\u4fe1\u606f\uff0c\u5176\u4e2d\u5927\u90e8\u5206\u6765\u81ea <code class=\"structname\">pg_attribute</code>\u3002\u8bc6\u522b\u5b57\u6bb5\u4f4d\u7f6e\u6240\u9700\u7684\u5173\u952e\u503c\u662f <code class=\"structfield\">attlen</code> \u548c <code class=\"structfield\">attalign</code>\u3002\u9664\u975e\u6240\u6709\u5b57\u6bb5\u90fd\u662f\u5b9a\u5bbd\u4e14\u6ca1\u6709\u7a7a\u503c\uff0c\u5426\u5219\u6ca1\u6709\u529e\u6cd5\u76f4\u63a5\u53d6\u5f97\u67d0\u4e2a\u7279\u5b9a\u5c5e\u6027\u3002\u6240\u6709\u8fd9\u4e9b\u6280\u5de7\u90fd\u5c01\u88c5\u5728 <em class=\"firstterm\">heap_getattr</em>\u3001<em class=\"firstterm\">fastgetattr</em> \u548c <em class=\"firstterm\">heap_getsysattr</em> \u8fd9\u4e9b\u51fd\u6570\u4e2d\u3002</p>\n<p lang=\"zh\">\u8bfb\u53d6\u6570\u636e\u65f6\uff0c\u9700\u8981\u4f9d\u6b21\u68c0\u67e5\u6bcf\u4e2a\u5c5e\u6027\u3002\u9996\u5148\u6839\u636e\u7a7a\u503c\u4f4d\u56fe\u5224\u65ad\u8be5\u5b57\u6bb5\u662f\u5426\u4e3a NULL\u3002\u5982\u679c\u662f\uff0c\u5c31\u7ee7\u7eed\u4e0b\u4e00\u4e2a\u3002\u7136\u540e\u786e\u8ba4\u5bf9\u9f50\u662f\u5426\u6b63\u786e\u3002\u5982\u679c\u5b57\u6bb5\u662f\u5b9a\u5bbd\u5b57\u6bb5\uff0c\u90a3\u4e48\u5b83\u7684\u6240\u6709\u5b57\u8282\u90fd\u662f\u76f4\u63a5\u6446\u653e\u7684\uff1b\u5982\u679c\u5b83\u662f\u53d8\u957f\u5b57\u6bb5\uff08attlen = -1\uff09\uff0c\u60c5\u51b5\u5c31\u4f1a\u7a0d\u590d\u6742\u4e00\u4e9b\u3002\u6240\u6709\u53d8\u957f\u6570\u636e\u7c7b\u578b\u90fd\u5171\u4eab\u4e00\u4e2a\u901a\u7528\u5934\u90e8\u7ed3\u6784\u4f53 <code class=\"type\">struct varlena</code>\uff0c\u5176\u4e2d\u5305\u542b\u5df2\u5b58\u50a8\u503c\u7684\u603b\u957f\u5ea6\u4ee5\u53ca\u4e00\u4e9b\u6807\u5fd7\u4f4d\u3002\u6839\u636e\u8fd9\u4e9b\u6807\u5fd7\uff0c\u6570\u636e\u53ef\u80fd\u662f\u884c\u5185\u5b58\u50a8\u7684\uff0c\u4e5f\u53ef\u80fd\u4f4d\u4e8e <acronym class=\"acronym\">TOAST</acronym> \u8868\u4e2d\uff1b\u5b83\u4e5f\u53ef\u80fd\u662f\u7ecf\u8fc7\u538b\u7f29\u7684\uff08\u89c1<a class=\"xref\" href=\"/docs/11/storage-toast.html\" title=\"69.2.\u00a0TOAST\">\u7b2c\u00a069.2\u00a0\u8282</a>\uff09\u3002</p>\n</div>\n<div class=\"footnotes\">\n<br/>\n<hr/>\n<div class=\"footnote\">\n<p lang=\"zh\">\n<br/>\n<hr style=\"width:100; text-align:left;margin-left: 0\"/>\n<div class=\"footnote\" id=\"ftn.id-1.10.21.8.2.2\">\n<p><a class=\"para\" href=\"/docs/11/storage-page-layout.html#id-1.10.21.8.2.2\"><sup class=\"para\">[15]</sup></a> \u5b9e\u9645\u4e0a\uff0c\u7d22\u5f15\u8bbf\u95ee\u65b9\u6cd5\u4e0d\u8981\u6c42\u5fc5\u987b\u4f7f\u7528\u8fd9\u79cd\u9875\u9762\u683c\u5f0f\u3002\u73b0\u6709\u7684\u6240\u6709\u7d22\u5f15\u65b9\u6cd5\u90fd\u4f7f\u7528\u8fd9\u79cd\u57fa\u672c\u683c\u5f0f\uff0c\u4f46\u7d22\u5f15\u5143\u9875\u4e2d\u4fdd\u5b58\u7684\u6570\u636e\u901a\u5e38\u5e76\u4e0d\u9075\u5faa\u9879\u5e03\u5c40\u89c4\u5219\u3002</p>\n</div>\n</p>\n</div>\n</div>\n</div>", "manual_path": "/docs/11/storage-page-layout.html", "localization": {"status": "complete", "sources": [{"url": "/docs/11/storage-page-layout.html", "method": "same-major semantic node", "sha256": "2e786c1b60ec8abf4a16033196a1e0170710e61ad0177788b174748ccda0ac62", "language": "zh", "matched_nodes": ["#STORAGE-PAGE-LAYOUT/div[0]", "#STORAGE-PAGE-LAYOUT/div[15]/div[2]/p[0]", "#STORAGE-PAGE-LAYOUT/div[15]/p[1]", "#STORAGE-PAGE-LAYOUT/div[15]/p[4]", "#STORAGE-PAGE-LAYOUT/div[15]/p[5]", "#STORAGE-PAGE-LAYOUT/div[15]/p[6]", "#STORAGE-PAGE-LAYOUT/div[16]", "#STORAGE-PAGE-LAYOUT/div[1]", "#STORAGE-PAGE-LAYOUT/div[6]/div[1]/table[0]/tbody[2]/tr[3]/td[0]", "#STORAGE-PAGE-LAYOUT/div[6]/p[0]", "#STORAGE-PAGE-LAYOUT/div[9]/div[1]/table[0]/tbody[2]/tr[0]/td[2]", "#STORAGE-PAGE-LAYOUT/div[9]/p[0]", "#STORAGE-PAGE-LAYOUT/p[11]", "#STORAGE-PAGE-LAYOUT/p[12]", "#STORAGE-PAGE-LAYOUT/p[13]", "#STORAGE-PAGE-LAYOUT/p[14]", "#STORAGE-PAGE-LAYOUT/p[2]", "#STORAGE-PAGE-LAYOUT/p[3]", "#STORAGE-PAGE-LAYOUT/p[4]", "#STORAGE-PAGE-LAYOUT/p[5]"]}], "language": "zh", "original_text": {"/versions/11/description/0": "This section provides an overview of the page format used within PostgreSQL tables and indexes. [15] Sequences and TOAST tables are formatted just like a regular table.", "/versions/11/facts/0/label": "Definition scope", "/versions/11/facts/0/value": "Same-version core physical storage documentation", "/versions/11/tables/0/title": "Overall Page Layout", "/versions/11/tables/1/title": "PageHeaderData Layout", "/versions/11/tables/2/title": "HeapTupleHeaderData Layout", "/versions/11/related/0/label": "Storage Parameters", "/versions/11/tables/0/rows/0/c1": "24 bytes long. Contains general information about the page, including free space pointers.", "/versions/11/tables/0/rows/1/c1": "Array of item identifiers pointing to the actual items. Each entry is an (offset,length) pair. 4 bytes per item.", "/versions/11/tables/0/rows/2/c0": "Free space", "/versions/11/tables/0/rows/2/c1": "The unallocated space. New item identifiers are allocated from the start of this area, new items from the end.", "/versions/11/tables/0/rows/3/c0": "Items", "/versions/11/tables/0/rows/3/c1": "The actual items themselves.", "/versions/11/tables/0/rows/4/c0": "Special space", "/versions/11/tables/0/rows/4/c1": "Index access method specific data. Different methods store different data. Empty in ordinary tables.", "/versions/11/tables/1/rows/0/c2": "8 bytes", "/versions/11/tables/1/rows/0/c3": "LSN: next byte after last byte of WAL record for last change to this page", "/versions/11/tables/1/rows/1/c2": "2 bytes", "/versions/11/tables/1/rows/1/c3": "Page checksum", "/versions/11/tables/1/rows/2/c2": "2 bytes", "/versions/11/tables/1/rows/2/c3": "Flag bits", "/versions/11/tables/1/rows/3/c2": "2 bytes", "/versions/11/tables/1/rows/3/c3": "Offset to start of free space", "/versions/11/tables/1/rows/4/c2": "2 bytes", "/versions/11/tables/1/rows/4/c3": "Offset to end of free space", "/versions/11/tables/1/rows/5/c2": "2 bytes", "/versions/11/tables/1/rows/5/c3": "Offset to start of special space", "/versions/11/tables/1/rows/6/c2": "2 bytes", "/versions/11/tables/1/rows/6/c3": "Page size and layout version number information", "/versions/11/tables/1/rows/7/c2": "4 bytes", "/versions/11/tables/1/rows/7/c3": "Oldest unpruned XMAX on page, or zero if none", "/versions/11/tables/2/rows/0/c2": "4 bytes", "/versions/11/tables/2/rows/0/c3": "insert XID stamp", "/versions/11/tables/2/rows/1/c2": "4 bytes", "/versions/11/tables/2/rows/1/c3": "delete XID stamp", "/versions/11/tables/2/rows/2/c2": "4 bytes", "/versions/11/tables/2/rows/2/c3": "insert and/or delete CID stamp (overlays with t_xvac)", "/versions/11/tables/2/rows/3/c2": "4 bytes", "/versions/11/tables/2/rows/3/c3": "XID for VACUUM operation moving a row version", "/versions/11/tables/2/rows/4/c2": "6 bytes", "/versions/11/tables/2/rows/4/c3": "current TID of this or newer row version", "/versions/11/tables/2/rows/5/c2": "2 bytes", "/versions/11/tables/2/rows/5/c3": "number of attributes, plus various flag bits", "/versions/11/tables/2/rows/6/c2": "2 bytes", "/versions/11/tables/2/rows/6/c3": "various flag bits", "/versions/11/tables/2/rows/7/c2": "1 byte", "/versions/11/tables/2/rows/7/c3": "offset to user data", "/versions/11/tables/0/columns/0/label": "Item", "/versions/11/tables/0/columns/1/label": "Description", "/versions/11/tables/1/columns/0/label": "Field", "/versions/11/tables/1/columns/1/label": "Type", "/versions/11/tables/1/columns/2/label": "Length", "/versions/11/tables/1/columns/3/label": "Description", "/versions/11/tables/2/columns/0/label": "Field", "/versions/11/tables/2/columns/1/label": "Type", "/versions/11/tables/2/columns/2/label": "Length", "/versions/11/tables/2/columns/3/label": "Description"}, "fallback_fields": [], "source_language": "en", "original_snapshot_sha256": "abf4d2c58772e88c62776b87290103a269cfe0dd53268ed18cc3914679c483bc"}, "comparison_data": {"layouts": [{"key": "layout-0", "rows": [{"c0": "PageHeaderData", "c1": "24 bytes long. Contains general information about the page, including free space pointers."}, {"c0": "ItemIdData", "c1": "Array of item identifiers pointing to the actual items. Each entry is an (offset,length) pair. 4 bytes per item."}, {"c0": "Free space", "c1": "The unallocated space. New item identifiers are allocated from the start of this area, new items from the end."}, {"c0": "Items", "c1": "The actual items themselves."}, {"c0": "Special space", "c1": "Index access method specific data. Different methods store different data. Empty in ordinary tables."}], "title": "Overall Page Layout", "columns": [{"key": "c0", "label": "Item"}, {"key": "c1", "label": "Description"}]}, {"key": "layout-1", "rows": [{"c0": "pd_lsn", "c1": "PageXLogRecPtr", "c2": "8 bytes", "c3": "LSN: next byte after last byte of WAL record for last change to this page"}, {"c0": "pd_checksum", "c1": "uint16", "c2": "2 bytes", "c3": "Page checksum"}, {"c0": "pd_flags", "c1": "uint16", "c2": "2 bytes", "c3": "Flag bits"}, {"c0": "pd_lower", "c1": "LocationIndex", "c2": "2 bytes", "c3": "Offset to start of free space"}, {"c0": "pd_upper", "c1": "LocationIndex", "c2": "2 bytes", "c3": "Offset to end of free space"}, {"c0": "pd_special", "c1": "LocationIndex", "c2": "2 bytes", "c3": "Offset to start of special space"}, {"c0": "pd_pagesize_version", "c1": "uint16", "c2": "2 bytes", "c3": "Page size and layout version number information"}, {"c0": "pd_prune_xid", "c1": "TransactionId", "c2": "4 bytes", "c3": "Oldest unpruned XMAX on page, or zero if none"}], "title": "PageHeaderData Layout", "columns": [{"key": "c0", "label": "Field"}, {"key": "c1", "label": "Type"}, {"key": "c2", "label": "Length"}, {"key": "c3", "label": "Description"}]}, {"key": "layout-2", "rows": [{"c0": "t_xmin", "c1": "TransactionId", "c2": "4 bytes", "c3": "insert XID stamp"}, {"c0": "t_xmax", "c1": "TransactionId", "c2": "4 bytes", "c3": "delete XID stamp"}, {"c0": "t_cid", "c1": "CommandId", "c2": "4 bytes", "c3": "insert and/or delete CID stamp (overlays with t_xvac)"}, {"c0": "t_xvac", "c1": "TransactionId", "c2": "4 bytes", "c3": "XID for VACUUM operation moving a row version"}, {"c0": "t_ctid", "c1": "ItemPointerData", "c2": "6 bytes", "c3": "current TID of this or newer row version"}, {"c0": "t_infomask2", "c1": "uint16", "c2": "2 bytes", "c3": "number of attributes, plus various flag bits"}, {"c0": "t_infomask", "c1": "uint16", "c2": "2 bytes", "c3": "various flag bits"}, {"c0": "t_hoff", "c1": "uint8", "c2": "1 byte", "c3": "offset to user data"}], "title": "HeapTupleHeaderData Layout", "columns": [{"key": "c0", "label": "Field"}, {"key": "c1", "label": "Type"}, {"key": "c2", "label": "Length"}, {"key": "c3", "label": "Description"}]}]}, "comparison_hash": "b621fa85b3be27a0eb0d82986e9524f2ef0a776761901f0d429826eec4822d0a", "manual_language": "zh"}, "12": {"facts": [{"label": "\u5b9a\u4e49\u8303\u56f4", "value": "\u540c\u7248\u672c\u6838\u5fc3\u7269\u7406\u5b58\u50a8\u6587\u6863"}], "tables": [{"key": "layout-0", "rows": [{"c0": "PageHeaderData", "c1": "\u957f 24 \u5b57\u8282\uff0c\u5305\u542b\u9875\u9762\u7684\u901a\u7528\u4fe1\u606f\uff0c\u4f8b\u5982\u7a7a\u95f2\u7a7a\u95f4\u6307\u9488\u3002"}, {"c0": "ItemIdData", "c1": "\u6307\u5411\u5b9e\u9645\u6570\u636e\u9879\u7684\u884c\u6307\u9488\u6570\u7ec4\u3002\u6bcf\u9879\u4e3a\u4e00\u4e2a\uff08\u504f\u79fb\uff0c\u957f\u5ea6\uff09\u5bf9\uff0c\u5360 4 \u5b57\u8282\u3002"}, {"c0": "\u7a7a\u95f2\u7a7a\u95f4", "c1": "\u5c1a\u672a\u5206\u914d\u7684\u7a7a\u95f4\u3002\u65b0\u884c\u6307\u9488\u4ece\u8be5\u533a\u57df\u7684\u8d77\u59cb\u5904\u5206\u914d\uff0c\u65b0\u6570\u636e\u9879\u4ece\u672b\u5c3e\u5904\u5206\u914d\u3002"}, {"c0": "\u9879", "c1": "\u5b9e\u9645\u7684\u6570\u636e\u9879\u672c\u8eab\u3002"}, {"c0": "\u7279\u6b8a\u7a7a\u95f4", "c1": "\u7d22\u5f15\u8bbf\u95ee\u65b9\u6cd5\u4e13\u7528\u6570\u636e\u3002\u4e0d\u540c\u65b9\u6cd5\u5b58\u50a8\u7684\u5185\u5bb9\u4e0d\u540c\uff0c\u666e\u901a\u8868\u4e2d\u6b64\u533a\u57df\u4e3a\u7a7a\u3002"}], "title": "\u9875\u9762\u603b\u4f53\u5e03\u5c40", "columns": [{"key": "c0", "label": "\u9879\u76ee"}, {"key": "c1", "label": "\u8bf4\u660e"}]}, {"key": "layout-1", "rows": [{"c0": "pd_lsn", "c1": "PageXLogRecPtr", "c2": "8 \u5b57\u8282", "c3": "LSN\uff1a\u8be5\u9875\u6700\u540e\u4e00\u6b21\u53d8\u5316\u6240\u5bf9\u5e94 WAL \u8bb0\u5f55\u7684\u6700\u540e\u4e00\u4e2a\u5b57\u8282\u4e4b\u540e\u7684\u4f4d\u7f6e\u3002"}, {"c0": "pd_checksum", "c1": "uint16", "c2": "2 \u5b57\u8282", "c3": "\u9875\u9762\u6821\u9a8c\u548c"}, {"c0": "pd_flags", "c1": "uint16", "c2": "2 \u5b57\u8282", "c3": "\u6807\u5fd7\u4f4d"}, {"c0": "pd_lower", "c1": "LocationIndex", "c2": "2 \u5b57\u8282", "c3": "\u7a7a\u95f2\u7a7a\u95f4\u8d77\u59cb\u4f4d\u7f6e\u7684\u504f\u79fb\u91cf"}, {"c0": "pd_upper", "c1": "LocationIndex", "c2": "2 \u5b57\u8282", "c3": "\u7a7a\u95f2\u7a7a\u95f4\u7ed3\u675f\u4f4d\u7f6e\u7684\u504f\u79fb\u91cf"}, {"c0": "pd_special", "c1": "LocationIndex", "c2": "2 \u5b57\u8282", "c3": "\u7279\u6b8a\u7a7a\u95f4\u8d77\u59cb\u4f4d\u7f6e\u7684\u504f\u79fb\u91cf"}, {"c0": "pd_pagesize_version", "c1": "uint16", "c2": "2 \u5b57\u8282", "c3": "\u9875\u9762\u5927\u5c0f\u4e0e\u5e03\u5c40\u7248\u672c\u53f7\u4fe1\u606f"}, {"c0": "pd_prune_xid", "c1": "TransactionId", "c2": "4 \u5b57\u8282", "c3": "\u9875\u9762\u4e0a\u6700\u65e9\u7684\u5c1a\u672a\u4fee\u526a\u7684 XMAX\uff1b\u6ca1\u6709\u5219\u4e3a\u96f6"}], "title": "PageHeaderData \u5e03\u5c40", "columns": [{"key": "c0", "label": "\u5b57\u6bb5"}, {"key": "c1", "label": "\u7c7b\u578b"}, {"key": "c2", "label": "\u957f\u5ea6"}, {"key": "c3", "label": "\u8bf4\u660e"}]}, {"key": "layout-2", "rows": [{"c0": "t_xmin", "c1": "TransactionId", "c2": "4 \u5b57\u8282", "c3": "\u63d2\u5165\u4e8b\u52a1\u7684 XID"}, {"c0": "t_xmax", "c1": "TransactionId", "c2": "4 \u5b57\u8282", "c3": "\u5220\u9664\u4e8b\u52a1\u7684 XID"}, {"c0": "t_cid", "c1": "CommandId", "c2": "4 \u5b57\u8282", "c3": "\u63d2\u5165\u548c\uff0f\u6216\u5220\u9664\u547d\u4ee4\u7684 CID\uff0c\u4e0e t_xvac \u5171\u7528\u5b58\u50a8\u4f4d\u7f6e"}, {"c0": "t_xvac", "c1": "TransactionId", "c2": "4 \u5b57\u8282", "c3": "VACUUM \u64cd\u4f5c\u79fb\u52a8\u884c\u7248\u672c\u65f6\u4f7f\u7528\u7684 XID"}, {"c0": "t_ctid", "c1": "ItemPointerData", "c2": "6 \u5b57\u8282", "c3": "\u672c\u884c\u7248\u672c\u6216\u8f83\u65b0\u884c\u7248\u672c\u7684\u5f53\u524d TID"}, {"c0": "t_infomask2", "c1": "uint16", "c2": "2 \u5b57\u8282", "c3": "\u5c5e\u6027\u6570\u91cf\u53ca\u5404\u79cd\u6807\u5fd7\u4f4d"}, {"c0": "t_infomask", "c1": "uint16", "c2": "2 \u5b57\u8282", "c3": "\u5404\u79cd\u6807\u5fd7\u4f4d"}, {"c0": "t_hoff", "c1": "uint8", "c2": "1 \u5b57\u8282", "c3": "\u7528\u6237\u6570\u636e\u7684\u504f\u79fb\u91cf"}], "title": "HeapTupleHeaderData \u5e03\u5c40", "columns": [{"key": "c0", "label": "\u5b57\u6bb5"}, {"key": "c1", "label": "\u7c7b\u578b"}, {"key": "c2", "label": "\u957f\u5ea6"}, {"key": "c3", "label": "\u8bf4\u660e"}]}], "diagram": "page-layout", "related": [{"url": "/wiki/tableam/?v=12", "label": "Table AM"}, {"url": "/wiki/relopts/?v=12", "label": "\u5b58\u50a8\u53c2\u6570"}], "release": {"ref": "https://ftp.postgresql.org/pub/source/v12.22/postgresql-12.22.tar.bz2", "label": "12.22", "major": "12", "channel": "stable", "revision": "8df3c0474782589d3c6f374b5133b1bd14d168086edbc13c6e72e67dd4527a3b"}, "sources": [{"url": "https://pg.center/docs/12/storage-page-layout.html", "path": "storage-page-layout.html", "label": "PostgreSQL 12 English manual", "sha256": "f485389ef7d0b5fd0a2ba4d0199308aac99fa413f8bdca01c3dab726841ee224", "language": "en", "original_url": "/docs/12/storage-page-layout.html"}], "sections": [], "signature": "", "description": ["\u672c\u8282\u6982\u8ff0 PostgreSQL \u8868\u548c\u7d22\u5f15\u5185\u90e8\u6240\u4f7f\u7528\u7684\u9875\u9762\u683c\u5f0f\u3002 [16] \u5e8f\u5217\u548c TOAST \u8868\u7684\u683c\u5f0f\u4e0e\u666e\u901a\u8868\u76f8\u540c\u3002"], "manual_html": "<div class=\"sect1\">\n<div class=\"titlepage\">\n<div>\n<div>\n<h2 class=\"title\" lang=\"zh\">\n<div>\n<div>\n<h2 class=\"title\" style=\"clear: both\">69.6.\u00a0\u6570\u636e\u5e93\u9875\u9762\u5e03\u5c40 </h2>\n</div>\n</div>\n</h2>\n</div>\n</div>\n</div>\n<p lang=\"zh\">\u672c\u8282\u6982\u8ff0 <span class=\"productname\">PostgreSQL</span> \u8868\u548c\u7d22\u5f15\u5185\u90e8\u6240\u4f7f\u7528\u7684\u9875\u9762\u683c\u5f0f\u3002<a class=\"footnote\" href=\"/docs/12/storage-page-layout.html#ftn.id-1.10.22.8.2.2\"><sup class=\"footnote\" id=\"id-1.10.22.8.2.2\">[16]</sup></a> \u5e8f\u5217\u548c <acronym class=\"acronym\">TOAST</acronym> \u8868\u7684\u683c\u5f0f\u4e0e\u666e\u901a\u8868\u76f8\u540c\u3002</p>\n<p lang=\"zh\">\u5728\u4e0b\u9762\u7684\u8bf4\u660e\u4e2d\uff0c\u5047\u5b9a\u4e00\u4e2a<em class=\"firstterm\">\u5b57\u8282</em>\u5305\u542b 8 \u4e2a\u4f4d\u3002\u53e6\u5916\uff0c\u672f\u8bed<em class=\"firstterm\">\u9879</em>\u6307\u7684\u662f\u5b58\u50a8\u5728\u9875\u9762\u4e0a\u7684\u5355\u4e2a\u6570\u636e\u503c\u3002\u5728\u8868\u4e2d\uff0c\u9879\u662f\u4e00\u884c\uff1b\u5728\u7d22\u5f15\u4e2d\uff0c\u9879\u662f\u4e00\u6761\u7d22\u5f15\u6761\u76ee\u3002</p>\n<p lang=\"zh\">\u6bcf\u4e2a\u8868\u548c\u7d22\u5f15\u90fd\u5b58\u50a8\u4e3a\u56fa\u5b9a\u5927\u5c0f\u7684<em class=\"firstterm\">\u9875\u9762</em>\u6570\u7ec4\uff08\u901a\u5e38\u4e3a 8 kB\uff0c\u4e0d\u8fc7\u5728\u7f16\u8bd1\u670d\u52a1\u5668\u65f6\u53ef\u4ee5\u9009\u62e9\u4e0d\u540c\u7684\u9875\u9762\u5927\u5c0f\uff09\u3002\u5728\u8868\u4e2d\uff0c\u6240\u6709\u9875\u9762\u5728\u903b\u8f91\u4e0a\u90fd\u662f\u7b49\u4ef7\u7684\uff0c\u56e0\u6b64\u67d0\u4e2a\u7279\u5b9a\u9879\uff08\u884c\uff09\u53ef\u4ee5\u5b58\u653e\u5728\u4efb\u610f\u9875\u9762\u4e2d\u3002\u5728\u7d22\u5f15\u4e2d\uff0c\u7b2c\u4e00\u9875\u901a\u5e38\u4fdd\u7559\u4e3a<em class=\"firstterm\">\u5143\u9875</em>\uff0c\u7528\u4e8e\u4fdd\u5b58\u63a7\u5236\u4fe1\u606f\uff1b\u5e76\u4e14\u6839\u636e\u7d22\u5f15\u8bbf\u95ee\u65b9\u6cd5\u7684\u4e0d\u540c\uff0c\u7d22\u5f15\u4e2d\u8fd8\u53ef\u80fd\u5b58\u5728\u4e0d\u540c\u7c7b\u578b\u7684\u9875\u9762\u3002</p>\n<p lang=\"zh\"><a class=\"xref\" href=\"/docs/12/storage-page-layout.html#PAGE-TABLE\" title=\"\u8868\u00a069.2.\u00a0\u603b\u4f53\u9875\u9762\u5e03\u5c40\">\u8868\u00a069.2</a>\u5c55\u793a\u4e86\u9875\u9762\u7684\u603b\u4f53\u5e03\u5c40\u3002\u6bcf\u4e2a\u9875\u9762\u5305\u542b\u4e94\u4e2a\u90e8\u5206\u3002</p>\n<div class=\"table\">\n<p class=\"title\" lang=\"zh\"><strong>\u8868\u00a069.2.\u00a0\u603b\u4f53\u9875\u9762\u5e03\u5c40</strong></p>\n<div class=\"table-contents\">\n<table class=\"table\">\n<thead>\n<tr>\n<th lang=\"zh\">\u9879\u76ee</th>\n<th lang=\"zh\">\u8bf4\u660e</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>PageHeaderData</td>\n<td lang=\"zh\">\u957f 24 \u5b57\u8282\uff0c\u5305\u542b\u9875\u9762\u7684\u901a\u7528\u4fe1\u606f\uff0c\u4f8b\u5982\u7a7a\u95f2\u7a7a\u95f4\u6307\u9488\u3002</td>\n</tr>\n<tr>\n<td>ItemIdData</td>\n<td lang=\"zh\">\u6307\u5411\u5b9e\u9645\u6570\u636e\u9879\u7684\u884c\u6307\u9488\u6570\u7ec4\u3002\u6bcf\u9879\u4e3a\u4e00\u4e2a\uff08\u504f\u79fb\uff0c\u957f\u5ea6\uff09\u5bf9\uff0c\u5360 4 \u5b57\u8282\u3002</td>\n</tr>\n<tr>\n<td lang=\"zh\">\u7a7a\u95f2\u7a7a\u95f4</td>\n<td lang=\"zh\">\u5c1a\u672a\u5206\u914d\u7684\u7a7a\u95f4\u3002\u65b0\u884c\u6307\u9488\u4ece\u8be5\u533a\u57df\u7684\u8d77\u59cb\u5904\u5206\u914d\uff0c\u65b0\u6570\u636e\u9879\u4ece\u672b\u5c3e\u5904\u5206\u914d\u3002</td>\n</tr>\n<tr>\n<td lang=\"zh\">\u9879</td>\n<td lang=\"zh\">\u5b9e\u9645\u7684\u6570\u636e\u9879\u672c\u8eab\u3002</td>\n</tr>\n<tr>\n<td lang=\"zh\">\u7279\u6b8a\u7a7a\u95f4</td>\n<td lang=\"zh\">\u7d22\u5f15\u8bbf\u95ee\u65b9\u6cd5\u4e13\u7528\u6570\u636e\u3002\u4e0d\u540c\u65b9\u6cd5\u5b58\u50a8\u7684\u5185\u5bb9\u4e0d\u540c\uff0c\u666e\u901a\u8868\u4e2d\u6b64\u533a\u57df\u4e3a\u7a7a\u3002</td>\n</tr>\n</tbody>\n</table>\n</div>\n</div><br class=\"table-break\"/>\n<p lang=\"zh\">\u6bcf\u9875\u7684\u524d 24 \u5b57\u8282\u662f\u9875\u9996\u90e8 PageHeaderData\uff0c\u8be6\u7ec6\u683c\u5f0f\u89c1\u8868 69.3\u3002\u7b2c\u4e00\u4e2a\u5b57\u6bb5\u8ddf\u8e2a\u4e0e\u8be5\u9875\u76f8\u5173\u7684\u6700\u8fd1\u4e00\u6761 WAL \u8bb0\u5f55\uff1b\u7b2c\u4e8c\u4e2a\u5b57\u6bb5\u5728\u542f\u7528\u6570\u636e\u6821\u9a8c\u548c\u65f6\u4fdd\u5b58\u9875\u9762\u6821\u9a8c\u548c\u3002\u4e4b\u540e\u662f\u4e00\u4e2a\u5305\u542b\u6807\u5fd7\u4f4d\u7684 2 \u5b57\u8282\u5b57\u6bb5\uff0c\u518d\u540e\u9762\u662f\u4e09\u4e2a 2 \u5b57\u8282\u6574\u6570 pd_lower\u3001pd_upper \u548c pd_special\uff0c\u5206\u522b\u8bb0\u5f55\u4ece\u9875\u8d77\u70b9\u5230\u672a\u5206\u914d\u7a7a\u95f4\u8d77\u70b9\u3001\u672a\u5206\u914d\u7a7a\u95f4\u7ec8\u70b9\u53ca\u7279\u6b8a\u7a7a\u95f4\u8d77\u70b9\u7684\u5b57\u8282\u504f\u79fb\u91cf\u3002\u63a5\u4e0b\u6765\u7684 2 \u5b57\u8282 pd_pagesize_version \u540c\u65f6\u4fdd\u5b58\u9875\u5927\u5c0f\u548c\u7248\u672c\u6807\u8bc6\u3002PostgreSQL 8.3 \u8d77\u7248\u672c\u53f7\u4e3a 4\uff1b8.1 \u4e0e 8.2 \u4f7f\u7528 3\uff1b8.0 \u4f7f\u7528 2\uff1b7.3 \u4e0e 7.4 \u4f7f\u7528 1\uff1b\u66f4\u65e9\u7248\u672c\u4f7f\u7528 0\u3002\u591a\u6570\u7248\u672c\u7684\u57fa\u672c\u9875\u9762\u5e03\u5c40\u548c\u9996\u90e8\u683c\u5f0f\u5e76\u672a\u53d8\u5316\uff0c\u4f46\u5806\u884c\u9996\u90e8\u5e03\u5c40\u6709\u53d8\u5316\u3002\u9875\u5927\u5c0f\u57fa\u672c\u53ea\u7528\u4e8e\u4ea4\u53c9\u68c0\u67e5\uff1b\u540c\u4e00\u5b89\u88c5\u4e0d\u652f\u6301\u591a\u79cd\u9875\u5927\u5c0f\u3002\u6700\u540e\u4e00\u4e2a\u5b57\u6bb5\u63d0\u793a\u4fee\u526a\u8be5\u9875\u662f\u5426\u53ef\u80fd\u6709\u76ca\uff0c\u8bb0\u5f55\u8be5\u9875\u6700\u65e9\u7684\u5c1a\u672a\u4fee\u526a\u7684 XMAX\u3002</p>\n<div class=\"table\">\n<p class=\"title\" lang=\"zh\"><strong>\u8868\u00a069.3.\u00a0PageHeaderData \u5e03\u5c40</strong></p>\n<div class=\"table-contents\">\n<table class=\"table\">\n<thead>\n<tr>\n<th lang=\"zh\">\u5b57\u6bb5</th>\n<th lang=\"zh\">\u7c7b\u578b</th>\n<th lang=\"zh\">\u957f\u5ea6</th>\n<th lang=\"zh\">\u8bf4\u660e</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>pd_lsn</td>\n<td>PageXLogRecPtr</td>\n<td lang=\"zh\">8 \u5b57\u8282</td>\n<td lang=\"zh\">LSN\uff1a\u8be5\u9875\u6700\u540e\u4e00\u6b21\u53d8\u5316\u6240\u5bf9\u5e94 WAL \u8bb0\u5f55\u7684\u6700\u540e\u4e00\u4e2a\u5b57\u8282\u4e4b\u540e\u7684\u4f4d\u7f6e\u3002</td>\n</tr>\n<tr>\n<td>pd_checksum</td>\n<td>uint16</td>\n<td lang=\"zh\">2 \u5b57\u8282</td>\n<td lang=\"zh\">\u9875\u9762\u6821\u9a8c\u548c</td>\n</tr>\n<tr>\n<td>pd_flags</td>\n<td>uint16</td>\n<td lang=\"zh\">2 \u5b57\u8282</td>\n<td lang=\"zh\">\u6807\u5fd7\u4f4d</td>\n</tr>\n<tr>\n<td>pd_lower</td>\n<td>LocationIndex</td>\n<td lang=\"zh\">2 \u5b57\u8282</td>\n<td lang=\"zh\">\u7a7a\u95f2\u7a7a\u95f4\u8d77\u59cb\u4f4d\u7f6e\u7684\u504f\u79fb\u91cf</td>\n</tr>\n<tr>\n<td>pd_upper</td>\n<td>LocationIndex</td>\n<td lang=\"zh\">2 \u5b57\u8282</td>\n<td lang=\"zh\">\u7a7a\u95f2\u7a7a\u95f4\u7ed3\u675f\u4f4d\u7f6e\u7684\u504f\u79fb\u91cf</td>\n</tr>\n<tr>\n<td>pd_special</td>\n<td>LocationIndex</td>\n<td lang=\"zh\">2 \u5b57\u8282</td>\n<td lang=\"zh\">\u7279\u6b8a\u7a7a\u95f4\u8d77\u59cb\u4f4d\u7f6e\u7684\u504f\u79fb\u91cf</td>\n</tr>\n<tr>\n<td>pd_pagesize_version</td>\n<td>uint16</td>\n<td lang=\"zh\">2 \u5b57\u8282</td>\n<td lang=\"zh\">\u9875\u9762\u5927\u5c0f\u4e0e\u5e03\u5c40\u7248\u672c\u53f7\u4fe1\u606f</td>\n</tr>\n<tr>\n<td>pd_prune_xid</td>\n<td>TransactionId</td>\n<td lang=\"zh\">4 \u5b57\u8282</td>\n<td lang=\"zh\">\u9875\u9762\u4e0a\u6700\u65e9\u7684\u5c1a\u672a\u4fee\u526a\u7684 XMAX\uff1b\u6ca1\u6709\u5219\u4e3a\u96f6</td>\n</tr>\n</tbody>\n</table>\n</div>\n</div><br class=\"table-break\"/>\n<p lang=\"zh\">\u6240\u6709\u7ec6\u8282\u90fd\u53ef\u4ee5\u5728 <code class=\"filename\">src/include/storage/bufpage.h</code> \u4e2d\u627e\u5230\u3002</p>\n<p lang=\"zh\">\u9875\u5934\u4e4b\u540e\u662f\u9879\u6807\u8bc6\u7b26\uff08<code class=\"type\">ItemIdData</code>\uff09\uff0c\u6bcf\u4e2a\u9700\u8981\u56db\u4e2a\u5b57\u8282\u3002\u4e00\u4e2a\u9879\u6807\u8bc6\u7b26\u5305\u542b\u9879\u8d77\u59cb\u4f4d\u7f6e\u7684\u5b57\u8282\u504f\u79fb\u91cf\u3001\u5176\u5b57\u8282\u957f\u5ea6\uff0c\u4ee5\u53ca\u82e5\u5e72\u5f71\u54cd\u89e3\u91ca\u65b9\u5f0f\u7684\u5c5e\u6027\u4f4d\u3002\u65b0\u7684\u9879\u6807\u8bc6\u7b26\u4f1a\u6839\u636e\u9700\u8981\u4ece\u672a\u5206\u914d\u7a7a\u95f4\u7684\u8d77\u59cb\u5904\u5206\u914d\u3002\u5f53\u524d\u5df2\u6709\u591a\u5c11\u4e2a\u9879\u6807\u8bc6\u7b26\uff0c\u53ef\u4ee5\u901a\u8fc7\u67e5\u770b <code class=\"structfield\">pd_lower</code> \u5f97\u77e5\uff1b\u5206\u914d\u65b0\u6807\u8bc6\u7b26\u65f6\u5b83\u4f1a\u589e\u52a0\u3002\u56e0\u4e3a\u4e00\u4e2a\u9879\u6807\u8bc6\u7b26\u5728\u88ab\u91ca\u653e\u4e4b\u524d\u6c38\u8fdc\u4e0d\u4f1a\u79fb\u52a8\uff0c\u6240\u4ee5\u5373\u4f7f\u9879\u672c\u8eab\u4e3a\u4e86\u6574\u7406\u7a7a\u95f2\u7a7a\u95f4\u800c\u5728\u9875\u9762\u5185\u79fb\u52a8\uff0c\u5176\u7d22\u5f15\u4ecd\u7136\u53ef\u4ee5\u88ab\u957f\u671f\u7528\u6765\u5f15\u7528\u8be5\u9879\u3002\u4e8b\u5b9e\u4e0a\uff0c\u6bcf\u4e2a\u6307\u5411\u9879\u7684\u6307\u9488\uff08<code class=\"type\">ItemPointer</code>\uff0c\u4e5f\u79f0 <code class=\"type\">CTID</code>\uff09\u5728 <span class=\"productname\">PostgreSQL</span> \u4e2d\u90fd\u7531\u9875\u53f7\u548c\u9879\u6807\u8bc6\u7b26\u7d22\u5f15\u6784\u6210\u3002</p>\n<p lang=\"zh\">\u9879\u672c\u8eab\u5b58\u50a8\u5728\u4ece\u672a\u5206\u914d\u7a7a\u95f4\u672b\u5c3e\u5f00\u59cb\u3001\u5411\u540e\u5206\u914d\u7684\u533a\u57df\u4e2d\u3002\u5176\u786e\u5207\u7ed3\u6784\u53d6\u51b3\u4e8e\u8868\u8981\u5305\u542b\u4ec0\u4e48\u5185\u5bb9\u3002\u8868\u548c\u5e8f\u5217\u90fd\u4f7f\u7528\u4e00\u79cd\u540d\u4e3a <code class=\"type\">HeapTupleHeaderData</code> \u7684\u7ed3\u6784\u4f53\uff0c\u5982\u4e0b\u6240\u8ff0\u3002</p>\n<p lang=\"zh\">\u6700\u540e\u4e00\u90e8\u5206\u662f<span class=\"quote\">\u201c<span class=\"quote\">\u7279\u6b8a\u90e8\u5206</span>\u201d</span>\uff0c\u5176\u4e2d\u53ef\u4ee5\u5b58\u653e\u8bbf\u95ee\u65b9\u6cd5\u5e0c\u671b\u4fdd\u5b58\u7684\u4efb\u4f55\u5185\u5bb9\u3002\u4f8b\u5982\uff0cB-\u6811\u7d22\u5f15\u4f1a\u5728\u8fd9\u91cc\u4fdd\u5b58\u6307\u5411\u9875\u9762\u5de6\u3001\u53f3\u5144\u5f1f\u7684\u94fe\u63a5\uff0c\u4ee5\u53ca\u5176\u4ed6\u4e00\u4e9b\u4e0e\u7d22\u5f15\u7ed3\u6784\u76f8\u5173\u7684\u6570\u636e\u3002\u666e\u901a\u8868\u5b8c\u5168\u4e0d\u4f7f\u7528\u7279\u6b8a\u90e8\u5206\uff08\u901a\u8fc7\u5c06 <code class=\"structfield\">pd_special</code> \u8bbe\u4e3a\u9875\u9762\u5927\u5c0f\u6765\u8868\u793a\uff09\u3002</p>\n<p lang=\"zh\"><a class=\"xref\" href=\"/docs/12/storage-page-layout.html#STORAGE-PAGE-LAYOUT-FIGURE\" title=\"\u56fe\u00a069.1.\u00a0\u9875\u9762\u5e03\u5c40\">\u56fe\u00a069.1</a>\u5c55\u793a\u4e86\u8fd9\u4e9b\u90e8\u5206\u5728\u9875\u9762\u4e2d\u7684\u5e03\u5c40\u65b9\u5f0f\u3002</p>\n<div class=\"figure col-xl-8 col-lg-10 col-md-12\">\n<p class=\"title\" lang=\"zh\">\n<p class=\"title\"><strong>\u56fe\u00a069.1.\u00a0\u9875\u9762\u5e03\u5c40</strong></p>\n<div class=\"figure-contents\">\n<div class=\"mediaobject\">\n<object data=\"pagelayout.svg\" type=\"image/svg+xml\" width=\"100%\">\n</object>\n</div>\n</div>\n</p>\n<div class=\"figure-contents\">\n<div class=\"mediaobject\">\n</div>\n</div>\n</div><br class=\"figure-break\"/>\n<div class=\"sect2\">\n<div class=\"titlepage\">\n<div>\n<div>\n<h3 class=\"title\" lang=\"zh\">\n<dl class=\"toc\">\n<dt><span class=\"sect2\"><a href=\"/docs/12/storage-page-layout.html#STORAGE-TUPLE-LAYOUT\">69.6.1. \u8868\u884c\u5e03\u5c40</a></span></dt>\n</dl>\n</h3>\n</div>\n</div>\n</div>\n<p lang=\"zh\">\u6240\u6709\u8868\u884c\u7684\u7ed3\u6784\u90fd\u76f8\u540c\u3002\u5b83\u4eec\u90fd\u6709\u4e00\u4e2a\u56fa\u5b9a\u5927\u5c0f\u7684\u5934\u90e8\uff08\u5728\u5927\u591a\u6570\u673a\u5668\u4e0a\u5360 23 \u5b57\u8282\uff09\uff0c\u540e\u9762\u8ddf\u7740\u53ef\u9009\u7684\u7a7a\u503c\u4f4d\u56fe\u3001\u53ef\u9009\u7684\u5bf9\u8c61 ID \u5b57\u6bb5\u4ee5\u53ca\u7528\u6237\u6570\u636e\u3002\u5934\u90e8\u7684\u8be6\u7ec6\u683c\u5f0f\u89c1<a class=\"xref\" href=\"/docs/12/storage-page-layout.html#HEAPTUPLEHEADERDATA-TABLE\" title=\"\u8868\u00a069.4.\u00a0HeapTupleHeaderData \u5e03\u5c40\">\u8868\u00a069.4</a>\u3002\u5b9e\u9645\u7528\u6237\u6570\u636e\uff08\u884c\u7684\u5404\u5217\uff09\u4ece <code class=\"structfield\">t_hoff</code> \u6307\u793a\u7684\u504f\u79fb\u4f4d\u7f6e\u5f00\u59cb\uff0c\u5b83\u5fc5\u987b\u59cb\u7ec8\u662f\u8be5\u5e73\u53f0 MAXALIGN \u5bf9\u9f50\u5355\u4f4d\u7684\u6574\u6570\u500d\u3002\u53ea\u6709\u5f53 <em class=\"firstterm\">HEAP_HASNULL</em> \u4f4d\u5728 <code class=\"structfield\">t_infomask</code> \u4e2d\u88ab\u7f6e\u4f4d\u65f6\uff0c\u7a7a\u503c\u4f4d\u56fe\u624d\u5b58\u5728\u3002\u82e5\u5b58\u5728\uff0c\u5b83\u7d27\u968f\u56fa\u5b9a\u5934\u90e8\u4e4b\u540e\uff0c\u5e76\u5360\u7528\u8db3\u591f\u591a\u7684\u5b57\u8282\uff0c\u4ee5\u4fbf\u4e3a\u6bcf\u4e2a\u6570\u636e\u5217\u63d0\u4f9b\u4e00\u4f4d\uff08\u4e5f\u5c31\u662f\u8bf4\uff0c\u5176\u4f4d\u6570\u7b49\u4e8e <code class=\"structfield\">t_infomask2</code> \u4e2d\u7684\u5c5e\u6027\u4e2a\u6570\uff09\u3002\u5728\u8fd9\u4e2a\u4f4d\u56fe\u4e2d\uff0c1 \u8868\u793a\u975e\u7a7a\uff0c0 \u8868\u793a\u7a7a\u503c\u3002\u5f53\u4f4d\u56fe\u4e0d\u5b58\u5728\u65f6\uff0c\u5047\u5b9a\u6240\u6709\u5217\u90fd\u975e\u7a7a\u3002\u53ea\u6709\u5f53 <em class=\"firstterm\">HEAP_HASOID_OLD</em> \u4f4d\u5728 <code class=\"structfield\">t_infomask</code> \u4e2d\u88ab\u7f6e\u4f4d\u65f6\uff0c\u5bf9\u8c61 ID \u624d\u5b58\u5728\u3002\u82e5\u5b58\u5728\uff0c\u5b83\u4f4d\u4e8e <code class=\"structfield\">t_hoff</code> \u8fb9\u754c\u4e4b\u524d\u3002\u4e3a\u4e86\u8ba9 <code class=\"structfield\">t_hoff</code> \u6210\u4e3a MAXALIGN \u7684\u6574\u6570\u500d\u6240\u9700\u7684\u4efb\u4f55\u586b\u5145\uff0c\u90fd\u4f1a\u51fa\u73b0\u5728\u7a7a\u503c\u4f4d\u56fe\u4e0e\u5bf9\u8c61 ID \u4e4b\u95f4\u3002\uff08\u8fd9\u53c8\u53cd\u8fc7\u6765\u4fdd\u8bc1\u4e86\u5bf9\u8c61 ID \u7684\u5bf9\u9f50\u662f\u5408\u9002\u7684\u3002\uff09</p>\n<div class=\"table\">\n<p class=\"title\" lang=\"zh\"><strong>\u8868\u00a069.4.\u00a0HeapTupleHeaderData \u5e03\u5c40</strong></p>\n<div class=\"table-contents\">\n<table class=\"table\">\n<thead>\n<tr>\n<th lang=\"zh\">\u5b57\u6bb5</th>\n<th lang=\"zh\">\u7c7b\u578b</th>\n<th lang=\"zh\">\u957f\u5ea6</th>\n<th lang=\"zh\">\u8bf4\u660e</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>t_xmin</td>\n<td>TransactionId</td>\n<td lang=\"zh\">4 \u5b57\u8282</td>\n<td lang=\"zh\">\u63d2\u5165\u4e8b\u52a1\u7684 XID</td>\n</tr>\n<tr>\n<td>t_xmax</td>\n<td>TransactionId</td>\n<td lang=\"zh\">4 \u5b57\u8282</td>\n<td lang=\"zh\">\u5220\u9664\u4e8b\u52a1\u7684 XID</td>\n</tr>\n<tr>\n<td>t_cid</td>\n<td>CommandId</td>\n<td lang=\"zh\">4 \u5b57\u8282</td>\n<td lang=\"zh\">\u63d2\u5165\u548c\uff0f\u6216\u5220\u9664\u547d\u4ee4\u7684 CID\uff0c\u4e0e t_xvac \u5171\u7528\u5b58\u50a8\u4f4d\u7f6e</td>\n</tr>\n<tr>\n<td>t_xvac</td>\n<td>TransactionId</td>\n<td lang=\"zh\">4 \u5b57\u8282</td>\n<td lang=\"zh\">VACUUM \u64cd\u4f5c\u79fb\u52a8\u884c\u7248\u672c\u65f6\u4f7f\u7528\u7684 XID</td>\n</tr>\n<tr>\n<td>t_ctid</td>\n<td>ItemPointerData</td>\n<td lang=\"zh\">6 \u5b57\u8282</td>\n<td lang=\"zh\">\u672c\u884c\u7248\u672c\u6216\u8f83\u65b0\u884c\u7248\u672c\u7684\u5f53\u524d TID</td>\n</tr>\n<tr>\n<td>t_infomask2</td>\n<td>uint16</td>\n<td lang=\"zh\">2 \u5b57\u8282</td>\n<td lang=\"zh\">\u5c5e\u6027\u6570\u91cf\u53ca\u5404\u79cd\u6807\u5fd7\u4f4d</td>\n</tr>\n<tr>\n<td>t_infomask</td>\n<td>uint16</td>\n<td lang=\"zh\">2 \u5b57\u8282</td>\n<td lang=\"zh\">\u5404\u79cd\u6807\u5fd7\u4f4d</td>\n</tr>\n<tr>\n<td>t_hoff</td>\n<td>uint8</td>\n<td lang=\"zh\">1 \u5b57\u8282</td>\n<td lang=\"zh\">\u7528\u6237\u6570\u636e\u7684\u504f\u79fb\u91cf</td>\n</tr>\n</tbody>\n</table>\n</div>\n</div><br class=\"table-break\"/>\n<p lang=\"zh\">\u6240\u6709\u7ec6\u8282\u90fd\u53ef\u4ee5\u5728 <code class=\"filename\">src/include/access/htup_details.h</code> \u4e2d\u627e\u5230\u3002</p>\n<p lang=\"zh\">\u8981\u89e3\u91ca\u5b9e\u9645\u6570\u636e\uff0c\u5fc5\u987b\u501f\u52a9\u4ece\u5176\u4ed6\u8868\u4e2d\u83b7\u5f97\u7684\u4fe1\u606f\uff0c\u5176\u4e2d\u5927\u90e8\u5206\u6765\u81ea <code class=\"structname\">pg_attribute</code>\u3002\u8bc6\u522b\u5b57\u6bb5\u4f4d\u7f6e\u6240\u9700\u7684\u5173\u952e\u503c\u662f <code class=\"structfield\">attlen</code> \u548c <code class=\"structfield\">attalign</code>\u3002\u9664\u975e\u6240\u6709\u5b57\u6bb5\u90fd\u662f\u5b9a\u5bbd\u4e14\u6ca1\u6709\u7a7a\u503c\uff0c\u5426\u5219\u6ca1\u6709\u529e\u6cd5\u76f4\u63a5\u53d6\u5f97\u67d0\u4e2a\u7279\u5b9a\u5c5e\u6027\u3002\u6240\u6709\u8fd9\u4e9b\u6280\u5de7\u90fd\u5c01\u88c5\u5728 <em class=\"firstterm\">heap_getattr</em>\u3001<em class=\"firstterm\">fastgetattr</em> \u548c <em class=\"firstterm\">heap_getsysattr</em> \u8fd9\u4e9b\u51fd\u6570\u4e2d\u3002</p>\n<p lang=\"zh\">\u8bfb\u53d6\u6570\u636e\u65f6\uff0c\u9700\u8981\u4f9d\u6b21\u68c0\u67e5\u6bcf\u4e2a\u5c5e\u6027\u3002\u9996\u5148\u6839\u636e\u7a7a\u503c\u4f4d\u56fe\u5224\u65ad\u8be5\u5b57\u6bb5\u662f\u5426\u4e3a NULL\u3002\u5982\u679c\u662f\uff0c\u5c31\u7ee7\u7eed\u4e0b\u4e00\u4e2a\u3002\u7136\u540e\u786e\u8ba4\u5bf9\u9f50\u662f\u5426\u6b63\u786e\u3002\u5982\u679c\u5b57\u6bb5\u662f\u5b9a\u5bbd\u5b57\u6bb5\uff0c\u90a3\u4e48\u5b83\u7684\u6240\u6709\u5b57\u8282\u90fd\u662f\u76f4\u63a5\u6446\u653e\u7684\uff1b\u5982\u679c\u5b83\u662f\u53d8\u957f\u5b57\u6bb5\uff08attlen = -1\uff09\uff0c\u60c5\u51b5\u5c31\u4f1a\u7a0d\u590d\u6742\u4e00\u4e9b\u3002\u6240\u6709\u53d8\u957f\u6570\u636e\u7c7b\u578b\u90fd\u5171\u4eab\u4e00\u4e2a\u901a\u7528\u5934\u90e8\u7ed3\u6784\u4f53 <code class=\"type\">struct varlena</code>\uff0c\u5176\u4e2d\u5305\u542b\u5df2\u5b58\u50a8\u503c\u7684\u603b\u957f\u5ea6\u4ee5\u53ca\u4e00\u4e9b\u6807\u5fd7\u4f4d\u3002\u6839\u636e\u8fd9\u4e9b\u6807\u5fd7\uff0c\u6570\u636e\u53ef\u80fd\u662f\u884c\u5185\u5b58\u50a8\u7684\uff0c\u4e5f\u53ef\u80fd\u4f4d\u4e8e <acronym class=\"acronym\">TOAST</acronym> \u8868\u4e2d\uff1b\u5b83\u4e5f\u53ef\u80fd\u662f\u7ecf\u8fc7\u538b\u7f29\u7684\uff08\u89c1<a class=\"xref\" href=\"/docs/12/storage-toast.html\" title=\"69.2.\u00a0TOAST\">\u7b2c\u00a069.2\u00a0\u8282</a>\uff09\u3002</p>\n</div>\n<div class=\"footnotes\">\n<br/>\n<hr/>\n<div class=\"footnote\">\n<p lang=\"zh\">\n<br/>\n<hr style=\"width:100; text-align:left;margin-left: 0\"/>\n<div class=\"footnote\" id=\"ftn.id-1.10.22.8.2.2\">\n<p><a class=\"para\" href=\"/docs/12/storage-page-layout.html#id-1.10.22.8.2.2\"><sup class=\"para\">[16]</sup></a> \u5b9e\u9645\u4e0a\uff0c\u8868\u8bbf\u95ee\u65b9\u6cd5\u548c\u7d22\u5f15\u8bbf\u95ee\u65b9\u6cd5\u90fd\u4e0d\u8981\u6c42\u5fc5\u987b\u4f7f\u7528\u8fd9\u79cd\u9875\u9762\u683c\u5f0f\u3002<code class=\"literal\">heap</code> \u8868\u8bbf\u95ee\u65b9\u6cd5\u59cb\u7ec8\u4f7f\u7528\u8fd9\u79cd\u683c\u5f0f\u3002\u73b0\u6709\u7684\u6240\u6709\u7d22\u5f15\u65b9\u6cd5\u4e5f\u90fd\u4f7f\u7528\u8fd9\u79cd\u57fa\u672c\u683c\u5f0f\uff0c\u4f46\u7d22\u5f15\u5143\u9875\u4e2d\u4fdd\u5b58\u7684\u6570\u636e\u901a\u5e38\u5e76\u4e0d\u9075\u5faa\u9879\u5e03\u5c40\u89c4\u5219\u3002</p>\n</div>\n</p>\n</div>\n</div>\n</div>", "manual_path": "/docs/12/storage-page-layout.html", "localization": {"status": "complete", "sources": [{"url": "/docs/12/storage-page-layout.html", "method": "same-major semantic node", "sha256": "f61914805748cb00cfee1c774b88cde0c23c3383ac638b65752b83955e547bb3", "language": "zh", "matched_nodes": ["#STORAGE-PAGE-LAYOUT/div[0]", "#STORAGE-PAGE-LAYOUT/div[16]", "#STORAGE-PAGE-LAYOUT/div[18]/div[2]/p[0]", "#STORAGE-PAGE-LAYOUT/div[18]/p[1]", "#STORAGE-PAGE-LAYOUT/div[18]/p[4]", "#STORAGE-PAGE-LAYOUT/div[18]/p[5]", "#STORAGE-PAGE-LAYOUT/div[18]/p[6]", "#STORAGE-PAGE-LAYOUT/div[19]", "#STORAGE-PAGE-LAYOUT/div[1]", "#STORAGE-PAGE-LAYOUT/div[6]/div[1]/table[0]/tbody[2]/tr[3]/td[0]", "#STORAGE-PAGE-LAYOUT/div[6]/p[0]", "#STORAGE-PAGE-LAYOUT/div[9]/div[1]/table[0]/tbody[2]/tr[0]/td[2]", "#STORAGE-PAGE-LAYOUT/div[9]/p[0]", "#STORAGE-PAGE-LAYOUT/p[11]", "#STORAGE-PAGE-LAYOUT/p[12]", "#STORAGE-PAGE-LAYOUT/p[13]", "#STORAGE-PAGE-LAYOUT/p[14]", "#STORAGE-PAGE-LAYOUT/p[15]", "#STORAGE-PAGE-LAYOUT/p[2]", "#STORAGE-PAGE-LAYOUT/p[3]", "#STORAGE-PAGE-LAYOUT/p[4]", "#STORAGE-PAGE-LAYOUT/p[5]"]}], "language": "zh", "original_text": {"/versions/12/description/0": "This section provides an overview of the page format used within PostgreSQL tables and indexes. [16] Sequences and TOAST tables are formatted just like a regular table.", "/versions/12/facts/0/label": "Definition scope", "/versions/12/facts/0/value": "Same-version core physical storage documentation", "/versions/12/tables/0/title": "Overall Page Layout", "/versions/12/tables/1/title": "PageHeaderData Layout", "/versions/12/tables/2/title": "HeapTupleHeaderData Layout", "/versions/12/related/1/label": "Storage Parameters", "/versions/12/tables/0/rows/0/c1": "24 bytes long. Contains general information about the page, including free space pointers.", "/versions/12/tables/0/rows/1/c1": "Array of item identifiers pointing to the actual items. Each entry is an (offset,length) pair. 4 bytes per item.", "/versions/12/tables/0/rows/2/c0": "Free space", "/versions/12/tables/0/rows/2/c1": "The unallocated space. New item identifiers are allocated from the start of this area, new items from the end.", "/versions/12/tables/0/rows/3/c0": "Items", "/versions/12/tables/0/rows/3/c1": "The actual items themselves.", "/versions/12/tables/0/rows/4/c0": "Special space", "/versions/12/tables/0/rows/4/c1": "Index access method specific data. Different methods store different data. Empty in ordinary tables.", "/versions/12/tables/1/rows/0/c2": "8 bytes", "/versions/12/tables/1/rows/0/c3": "LSN: next byte after last byte of WAL record for last change to this page", "/versions/12/tables/1/rows/1/c2": "2 bytes", "/versions/12/tables/1/rows/1/c3": "Page checksum", "/versions/12/tables/1/rows/2/c2": "2 bytes", "/versions/12/tables/1/rows/2/c3": "Flag bits", "/versions/12/tables/1/rows/3/c2": "2 bytes", "/versions/12/tables/1/rows/3/c3": "Offset to start of free space", "/versions/12/tables/1/rows/4/c2": "2 bytes", "/versions/12/tables/1/rows/4/c3": "Offset to end of free space", "/versions/12/tables/1/rows/5/c2": "2 bytes", "/versions/12/tables/1/rows/5/c3": "Offset to start of special space", "/versions/12/tables/1/rows/6/c2": "2 bytes", "/versions/12/tables/1/rows/6/c3": "Page size and layout version number information", "/versions/12/tables/1/rows/7/c2": "4 bytes", "/versions/12/tables/1/rows/7/c3": "Oldest unpruned XMAX on page, or zero if none", "/versions/12/tables/2/rows/0/c2": "4 bytes", "/versions/12/tables/2/rows/0/c3": "insert XID stamp", "/versions/12/tables/2/rows/1/c2": "4 bytes", "/versions/12/tables/2/rows/1/c3": "delete XID stamp", "/versions/12/tables/2/rows/2/c2": "4 bytes", "/versions/12/tables/2/rows/2/c3": "insert and/or delete CID stamp (overlays with t_xvac)", "/versions/12/tables/2/rows/3/c2": "4 bytes", "/versions/12/tables/2/rows/3/c3": "XID for VACUUM operation moving a row version", "/versions/12/tables/2/rows/4/c2": "6 bytes", "/versions/12/tables/2/rows/4/c3": "current TID of this or newer row version", "/versions/12/tables/2/rows/5/c2": "2 bytes", "/versions/12/tables/2/rows/5/c3": "number of attributes, plus various flag bits", "/versions/12/tables/2/rows/6/c2": "2 bytes", "/versions/12/tables/2/rows/6/c3": "various flag bits", "/versions/12/tables/2/rows/7/c2": "1 byte", "/versions/12/tables/2/rows/7/c3": "offset to user data", "/versions/12/tables/0/columns/0/label": "Item", "/versions/12/tables/0/columns/1/label": "Description", "/versions/12/tables/1/columns/0/label": "Field", "/versions/12/tables/1/columns/1/label": "Type", "/versions/12/tables/1/columns/2/label": "Length", "/versions/12/tables/1/columns/3/label": "Description", "/versions/12/tables/2/columns/0/label": "Field", "/versions/12/tables/2/columns/1/label": "Type", "/versions/12/tables/2/columns/2/label": "Length", "/versions/12/tables/2/columns/3/label": "Description"}, "fallback_fields": [], "source_language": "en", "original_snapshot_sha256": "e894e6a105e507df6ac503e64e7fb30cf607c12d222c495c9eae8c840695c6d4"}, "comparison_data": {"layouts": [{"key": "layout-0", "rows": [{"c0": "PageHeaderData", "c1": "24 bytes long. Contains general information about the page, including free space pointers."}, {"c0": "ItemIdData", "c1": "Array of item identifiers pointing to the actual items. Each entry is an (offset,length) pair. 4 bytes per item."}, {"c0": "Free space", "c1": "The unallocated space. New item identifiers are allocated from the start of this area, new items from the end."}, {"c0": "Items", "c1": "The actual items themselves."}, {"c0": "Special space", "c1": "Index access method specific data. Different methods store different data. Empty in ordinary tables."}], "title": "Overall Page Layout", "columns": [{"key": "c0", "label": "Item"}, {"key": "c1", "label": "Description"}]}, {"key": "layout-1", "rows": [{"c0": "pd_lsn", "c1": "PageXLogRecPtr", "c2": "8 bytes", "c3": "LSN: next byte after last byte of WAL record for last change to this page"}, {"c0": "pd_checksum", "c1": "uint16", "c2": "2 bytes", "c3": "Page checksum"}, {"c0": "pd_flags", "c1": "uint16", "c2": "2 bytes", "c3": "Flag bits"}, {"c0": "pd_lower", "c1": "LocationIndex", "c2": "2 bytes", "c3": "Offset to start of free space"}, {"c0": "pd_upper", "c1": "LocationIndex", "c2": "2 bytes", "c3": "Offset to end of free space"}, {"c0": "pd_special", "c1": "LocationIndex", "c2": "2 bytes", "c3": "Offset to start of special space"}, {"c0": "pd_pagesize_version", "c1": "uint16", "c2": "2 bytes", "c3": "Page size and layout version number information"}, {"c0": "pd_prune_xid", "c1": "TransactionId", "c2": "4 bytes", "c3": "Oldest unpruned XMAX on page, or zero if none"}], "title": "PageHeaderData Layout", "columns": [{"key": "c0", "label": "Field"}, {"key": "c1", "label": "Type"}, {"key": "c2", "label": "Length"}, {"key": "c3", "label": "Description"}]}, {"key": "layout-2", "rows": [{"c0": "t_xmin", "c1": "TransactionId", "c2": "4 bytes", "c3": "insert XID stamp"}, {"c0": "t_xmax", "c1": "TransactionId", "c2": "4 bytes", "c3": "delete XID stamp"}, {"c0": "t_cid", "c1": "CommandId", "c2": "4 bytes", "c3": "insert and/or delete CID stamp (overlays with t_xvac)"}, {"c0": "t_xvac", "c1": "TransactionId", "c2": "4 bytes", "c3": "XID for VACUUM operation moving a row version"}, {"c0": "t_ctid", "c1": "ItemPointerData", "c2": "6 bytes", "c3": "current TID of this or newer row version"}, {"c0": "t_infomask2", "c1": "uint16", "c2": "2 bytes", "c3": "number of attributes, plus various flag bits"}, {"c0": "t_infomask", "c1": "uint16", "c2": "2 bytes", "c3": "various flag bits"}, {"c0": "t_hoff", "c1": "uint8", "c2": "1 byte", "c3": "offset to user data"}], "title": "HeapTupleHeaderData Layout", "columns": [{"key": "c0", "label": "Field"}, {"key": "c1", "label": "Type"}, {"key": "c2", "label": "Length"}, {"key": "c3", "label": "Description"}]}]}, "comparison_hash": "b621fa85b3be27a0eb0d82986e9524f2ef0a776761901f0d429826eec4822d0a", "manual_language": "zh"}, "13": {"facts": [{"label": "\u5b9a\u4e49\u8303\u56f4", "value": "\u540c\u7248\u672c\u6838\u5fc3\u7269\u7406\u5b58\u50a8\u6587\u6863"}], "tables": [{"key": "layout-0", "rows": [{"c0": "PageHeaderData", "c1": "\u957f 24 \u5b57\u8282\uff0c\u5305\u542b\u9875\u9762\u7684\u901a\u7528\u4fe1\u606f\uff0c\u4f8b\u5982\u7a7a\u95f2\u7a7a\u95f4\u6307\u9488\u3002"}, {"c0": "ItemIdData", "c1": "\u6307\u5411\u5b9e\u9645\u6570\u636e\u9879\u7684\u884c\u6307\u9488\u6570\u7ec4\u3002\u6bcf\u9879\u4e3a\u4e00\u4e2a\uff08\u504f\u79fb\uff0c\u957f\u5ea6\uff09\u5bf9\uff0c\u5360 4 \u5b57\u8282\u3002"}, {"c0": "\u7a7a\u95f2\u7a7a\u95f4", "c1": "\u5c1a\u672a\u5206\u914d\u7684\u7a7a\u95f4\u3002\u65b0\u884c\u6307\u9488\u4ece\u8be5\u533a\u57df\u7684\u8d77\u59cb\u5904\u5206\u914d\uff0c\u65b0\u6570\u636e\u9879\u4ece\u672b\u5c3e\u5904\u5206\u914d\u3002"}, {"c0": "\u9879", "c1": "\u5b9e\u9645\u7684\u6570\u636e\u9879\u672c\u8eab\u3002"}, {"c0": "\u7279\u6b8a\u7a7a\u95f4", "c1": "\u7d22\u5f15\u8bbf\u95ee\u65b9\u6cd5\u4e13\u7528\u6570\u636e\u3002\u4e0d\u540c\u65b9\u6cd5\u5b58\u50a8\u7684\u5185\u5bb9\u4e0d\u540c\uff0c\u666e\u901a\u8868\u4e2d\u6b64\u533a\u57df\u4e3a\u7a7a\u3002"}], "title": "\u9875\u9762\u603b\u4f53\u5e03\u5c40", "columns": [{"key": "c0", "label": "\u9879\u76ee"}, {"key": "c1", "label": "\u8bf4\u660e"}]}, {"key": "layout-1", "rows": [{"c0": "pd_lsn", "c1": "PageXLogRecPtr", "c2": "8 \u5b57\u8282", "c3": "LSN\uff1a\u8be5\u9875\u6700\u540e\u4e00\u6b21\u53d8\u5316\u6240\u5bf9\u5e94 WAL \u8bb0\u5f55\u7684\u6700\u540e\u4e00\u4e2a\u5b57\u8282\u4e4b\u540e\u7684\u4f4d\u7f6e\u3002"}, {"c0": "pd_checksum", "c1": "uint16", "c2": "2 \u5b57\u8282", "c3": "\u9875\u9762\u6821\u9a8c\u548c"}, {"c0": "pd_flags", "c1": "uint16", "c2": "2 \u5b57\u8282", "c3": "\u6807\u5fd7\u4f4d"}, {"c0": "pd_lower", "c1": "LocationIndex", "c2": "2 \u5b57\u8282", "c3": "\u7a7a\u95f2\u7a7a\u95f4\u8d77\u59cb\u4f4d\u7f6e\u7684\u504f\u79fb\u91cf"}, {"c0": "pd_upper", "c1": "LocationIndex", "c2": "2 \u5b57\u8282", "c3": "\u7a7a\u95f2\u7a7a\u95f4\u7ed3\u675f\u4f4d\u7f6e\u7684\u504f\u79fb\u91cf"}, {"c0": "pd_special", "c1": "LocationIndex", "c2": "2 \u5b57\u8282", "c3": "\u7279\u6b8a\u7a7a\u95f4\u8d77\u59cb\u4f4d\u7f6e\u7684\u504f\u79fb\u91cf"}, {"c0": "pd_pagesize_version", "c1": "uint16", "c2": "2 \u5b57\u8282", "c3": "\u9875\u9762\u5927\u5c0f\u4e0e\u5e03\u5c40\u7248\u672c\u53f7\u4fe1\u606f"}, {"c0": "pd_prune_xid", "c1": "TransactionId", "c2": "4 \u5b57\u8282", "c3": "\u9875\u9762\u4e0a\u6700\u65e9\u7684\u5c1a\u672a\u4fee\u526a\u7684 XMAX\uff1b\u6ca1\u6709\u5219\u4e3a\u96f6"}], "title": "PageHeaderData \u5e03\u5c40", "columns": [{"key": "c0", "label": "\u5b57\u6bb5"}, {"key": "c1", "label": "\u7c7b\u578b"}, {"key": "c2", "label": "\u957f\u5ea6"}, {"key": "c3", "label": "\u8bf4\u660e"}]}, {"key": "layout-2", "rows": [{"c0": "t_xmin", "c1": "TransactionId", "c2": "4 \u5b57\u8282", "c3": "\u63d2\u5165\u4e8b\u52a1\u7684 XID"}, {"c0": "t_xmax", "c1": "TransactionId", "c2": "4 \u5b57\u8282", "c3": "\u5220\u9664\u4e8b\u52a1\u7684 XID"}, {"c0": "t_cid", "c1": "CommandId", "c2": "4 \u5b57\u8282", "c3": "\u63d2\u5165\u548c\uff0f\u6216\u5220\u9664\u547d\u4ee4\u7684 CID\uff0c\u4e0e t_xvac \u5171\u7528\u5b58\u50a8\u4f4d\u7f6e"}, {"c0": "t_xvac", "c1": "TransactionId", "c2": "4 \u5b57\u8282", "c3": "VACUUM \u64cd\u4f5c\u79fb\u52a8\u884c\u7248\u672c\u65f6\u4f7f\u7528\u7684 XID"}, {"c0": "t_ctid", "c1": "ItemPointerData", "c2": "6 \u5b57\u8282", "c3": "\u672c\u884c\u7248\u672c\u6216\u8f83\u65b0\u884c\u7248\u672c\u7684\u5f53\u524d TID"}, {"c0": "t_infomask2", "c1": "uint16", "c2": "2 \u5b57\u8282", "c3": "\u5c5e\u6027\u6570\u91cf\u53ca\u5404\u79cd\u6807\u5fd7\u4f4d"}, {"c0": "t_infomask", "c1": "uint16", "c2": "2 \u5b57\u8282", "c3": "\u5404\u79cd\u6807\u5fd7\u4f4d"}, {"c0": "t_hoff", "c1": "uint8", "c2": "1 \u5b57\u8282", "c3": "\u7528\u6237\u6570\u636e\u7684\u504f\u79fb\u91cf"}], "title": "HeapTupleHeaderData \u5e03\u5c40", "columns": [{"key": "c0", "label": "\u5b57\u6bb5"}, {"key": "c1", "label": "\u7c7b\u578b"}, {"key": "c2", "label": "\u957f\u5ea6"}, {"key": "c3", "label": "\u8bf4\u660e"}]}], "diagram": "page-layout", "related": [{"url": "/wiki/tableam/?v=13", "label": "Table AM"}, {"url": "/wiki/relopts/?v=13", "label": "\u5b58\u50a8\u53c2\u6570"}], "release": {"ref": "https://ftp.postgresql.org/pub/source/v13.23/postgresql-13.23.tar.bz2", "label": "13.23", "major": "13", "channel": "stable", "revision": "6ec3c82726af92b7dec873fa1cdf881eca92a4219787dfad05acb6b10e041fd6"}, "sources": [{"url": "https://pg.center/docs/13/storage-page-layout.html", "path": "storage-page-layout.html", "label": "PostgreSQL 13 English manual", "sha256": "80fe3b574871fad132942884c7d87a14369d6abc77a38aba7ba3fa84abca6a37", "language": "en", "original_url": "/docs/13/storage-page-layout.html"}], "sections": [], "signature": "", "description": ["\u672c\u8282\u6982\u8ff0 PostgreSQL \u8868\u548c\u7d22\u5f15\u5185\u90e8\u6240\u4f7f\u7528\u7684\u9875\u9762\u683c\u5f0f\u3002 [15] \u5e8f\u5217\u548c TOAST \u8868\u7684\u683c\u5f0f\u4e0e\u666e\u901a\u8868\u76f8\u540c\u3002"], "manual_html": "<div class=\"sect1\">\n<div class=\"titlepage\">\n<div>\n<div>\n<h2 class=\"title\" lang=\"zh\">\n<div>\n<div>\n<h2 class=\"title\" style=\"clear: both\">69.6.\u00a0\u6570\u636e\u5e93\u9875\u9762\u5e03\u5c40 </h2>\n</div>\n</div>\n</h2>\n</div>\n</div>\n</div>\n<p lang=\"zh\">\u672c\u8282\u6982\u8ff0 <span class=\"productname\">PostgreSQL</span> \u8868\u548c\u7d22\u5f15\u5185\u90e8\u6240\u4f7f\u7528\u7684\u9875\u9762\u683c\u5f0f\u3002<a class=\"footnote\" href=\"/docs/13/storage-page-layout.html#ftn.id-1.10.22.8.2.2\"><sup class=\"footnote\" id=\"id-1.10.22.8.2.2\">[15]</sup></a> \u5e8f\u5217\u548c <acronym class=\"acronym\">TOAST</acronym> \u8868\u7684\u683c\u5f0f\u4e0e\u666e\u901a\u8868\u76f8\u540c\u3002</p>\n<p lang=\"zh\">\u5728\u4e0b\u9762\u7684\u8bf4\u660e\u4e2d\uff0c\u5047\u5b9a\u4e00\u4e2a<em class=\"firstterm\">\u5b57\u8282</em>\u5305\u542b 8 \u4e2a\u4f4d\u3002\u53e6\u5916\uff0c\u672f\u8bed<em class=\"firstterm\">\u9879</em>\u6307\u7684\u662f\u5b58\u50a8\u5728\u9875\u9762\u4e0a\u7684\u5355\u4e2a\u6570\u636e\u503c\u3002\u5728\u8868\u4e2d\uff0c\u9879\u662f\u4e00\u884c\uff1b\u5728\u7d22\u5f15\u4e2d\uff0c\u9879\u662f\u4e00\u6761\u7d22\u5f15\u6761\u76ee\u3002</p>\n<p lang=\"zh\">\u6bcf\u4e2a\u8868\u548c\u7d22\u5f15\u90fd\u5b58\u50a8\u4e3a\u56fa\u5b9a\u5927\u5c0f\u7684<em class=\"firstterm\">\u9875\u9762</em>\u6570\u7ec4\uff08\u901a\u5e38\u4e3a 8 kB\uff0c\u4e0d\u8fc7\u5728\u7f16\u8bd1\u670d\u52a1\u5668\u65f6\u53ef\u4ee5\u9009\u62e9\u4e0d\u540c\u7684\u9875\u9762\u5927\u5c0f\uff09\u3002\u5728\u8868\u4e2d\uff0c\u6240\u6709\u9875\u9762\u5728\u903b\u8f91\u4e0a\u90fd\u662f\u7b49\u4ef7\u7684\uff0c\u56e0\u6b64\u67d0\u4e2a\u7279\u5b9a\u9879\uff08\u884c\uff09\u53ef\u4ee5\u5b58\u653e\u5728\u4efb\u610f\u9875\u9762\u4e2d\u3002\u5728\u7d22\u5f15\u4e2d\uff0c\u7b2c\u4e00\u9875\u901a\u5e38\u4fdd\u7559\u4e3a<em class=\"firstterm\">\u5143\u9875</em>\uff0c\u7528\u4e8e\u4fdd\u5b58\u63a7\u5236\u4fe1\u606f\uff1b\u5e76\u4e14\u6839\u636e\u7d22\u5f15\u8bbf\u95ee\u65b9\u6cd5\u7684\u4e0d\u540c\uff0c\u7d22\u5f15\u4e2d\u8fd8\u53ef\u80fd\u5b58\u5728\u4e0d\u540c\u7c7b\u578b\u7684\u9875\u9762\u3002</p>\n<p lang=\"zh\"><a class=\"xref\" href=\"/docs/13/storage-page-layout.html#PAGE-TABLE\" title=\"\u8868\u00a069.2.\u00a0\u603b\u4f53\u9875\u9762\u5e03\u5c40\">\u8868\u00a069.2</a>\u5c55\u793a\u4e86\u9875\u9762\u7684\u603b\u4f53\u5e03\u5c40\u3002\u6bcf\u4e2a\u9875\u9762\u5305\u542b\u4e94\u4e2a\u90e8\u5206\u3002</p>\n<div class=\"table\">\n<p class=\"title\" lang=\"zh\"><strong>\u8868\u00a069.2.\u00a0\u603b\u4f53\u9875\u9762\u5e03\u5c40</strong></p>\n<div class=\"table-contents\">\n<table class=\"table\">\n<thead>\n<tr>\n<th lang=\"zh\">\u9879\u76ee</th>\n<th lang=\"zh\">\u8bf4\u660e</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>PageHeaderData</td>\n<td lang=\"zh\">\u957f 24 \u5b57\u8282\uff0c\u5305\u542b\u9875\u9762\u7684\u901a\u7528\u4fe1\u606f\uff0c\u4f8b\u5982\u7a7a\u95f2\u7a7a\u95f4\u6307\u9488\u3002</td>\n</tr>\n<tr>\n<td>ItemIdData</td>\n<td lang=\"zh\">\u6307\u5411\u5b9e\u9645\u6570\u636e\u9879\u7684\u884c\u6307\u9488\u6570\u7ec4\u3002\u6bcf\u9879\u4e3a\u4e00\u4e2a\uff08\u504f\u79fb\uff0c\u957f\u5ea6\uff09\u5bf9\uff0c\u5360 4 \u5b57\u8282\u3002</td>\n</tr>\n<tr>\n<td lang=\"zh\">\u7a7a\u95f2\u7a7a\u95f4</td>\n<td lang=\"zh\">\u5c1a\u672a\u5206\u914d\u7684\u7a7a\u95f4\u3002\u65b0\u884c\u6307\u9488\u4ece\u8be5\u533a\u57df\u7684\u8d77\u59cb\u5904\u5206\u914d\uff0c\u65b0\u6570\u636e\u9879\u4ece\u672b\u5c3e\u5904\u5206\u914d\u3002</td>\n</tr>\n<tr>\n<td lang=\"zh\">\u9879</td>\n<td lang=\"zh\">\u5b9e\u9645\u7684\u6570\u636e\u9879\u672c\u8eab\u3002</td>\n</tr>\n<tr>\n<td lang=\"zh\">\u7279\u6b8a\u7a7a\u95f4</td>\n<td lang=\"zh\">\u7d22\u5f15\u8bbf\u95ee\u65b9\u6cd5\u4e13\u7528\u6570\u636e\u3002\u4e0d\u540c\u65b9\u6cd5\u5b58\u50a8\u7684\u5185\u5bb9\u4e0d\u540c\uff0c\u666e\u901a\u8868\u4e2d\u6b64\u533a\u57df\u4e3a\u7a7a\u3002</td>\n</tr>\n</tbody>\n</table>\n</div>\n</div><br class=\"table-break\"/>\n<p lang=\"zh\">\u6bcf\u9875\u7684\u524d 24 \u5b57\u8282\u662f\u9875\u9996\u90e8 PageHeaderData\uff0c\u8be6\u7ec6\u683c\u5f0f\u89c1\u8868 69.3\u3002\u7b2c\u4e00\u4e2a\u5b57\u6bb5\u8ddf\u8e2a\u4e0e\u8be5\u9875\u76f8\u5173\u7684\u6700\u8fd1\u4e00\u6761 WAL \u8bb0\u5f55\uff1b\u7b2c\u4e8c\u4e2a\u5b57\u6bb5\u5728\u542f\u7528\u6570\u636e\u6821\u9a8c\u548c\u65f6\u4fdd\u5b58\u9875\u9762\u6821\u9a8c\u548c\u3002\u4e4b\u540e\u662f\u4e00\u4e2a\u5305\u542b\u6807\u5fd7\u4f4d\u7684 2 \u5b57\u8282\u5b57\u6bb5\uff0c\u518d\u540e\u9762\u662f\u4e09\u4e2a 2 \u5b57\u8282\u6574\u6570 pd_lower\u3001pd_upper \u548c pd_special\uff0c\u5206\u522b\u8bb0\u5f55\u4ece\u9875\u8d77\u70b9\u5230\u672a\u5206\u914d\u7a7a\u95f4\u8d77\u70b9\u3001\u672a\u5206\u914d\u7a7a\u95f4\u7ec8\u70b9\u53ca\u7279\u6b8a\u7a7a\u95f4\u8d77\u70b9\u7684\u5b57\u8282\u504f\u79fb\u91cf\u3002\u63a5\u4e0b\u6765\u7684 2 \u5b57\u8282 pd_pagesize_version \u540c\u65f6\u4fdd\u5b58\u9875\u5927\u5c0f\u548c\u7248\u672c\u6807\u8bc6\u3002PostgreSQL 8.3 \u8d77\u7248\u672c\u53f7\u4e3a 4\uff1b8.1 \u4e0e 8.2 \u4f7f\u7528 3\uff1b8.0 \u4f7f\u7528 2\uff1b7.3 \u4e0e 7.4 \u4f7f\u7528 1\uff1b\u66f4\u65e9\u7248\u672c\u4f7f\u7528 0\u3002\u591a\u6570\u7248\u672c\u7684\u57fa\u672c\u9875\u9762\u5e03\u5c40\u548c\u9996\u90e8\u683c\u5f0f\u5e76\u672a\u53d8\u5316\uff0c\u4f46\u5806\u884c\u9996\u90e8\u5e03\u5c40\u6709\u53d8\u5316\u3002\u9875\u5927\u5c0f\u57fa\u672c\u53ea\u7528\u4e8e\u4ea4\u53c9\u68c0\u67e5\uff1b\u540c\u4e00\u5b89\u88c5\u4e0d\u652f\u6301\u591a\u79cd\u9875\u5927\u5c0f\u3002\u6700\u540e\u4e00\u4e2a\u5b57\u6bb5\u63d0\u793a\u4fee\u526a\u8be5\u9875\u662f\u5426\u53ef\u80fd\u6709\u76ca\uff0c\u8bb0\u5f55\u8be5\u9875\u6700\u65e9\u7684\u5c1a\u672a\u4fee\u526a\u7684 XMAX\u3002</p>\n<div class=\"table\">\n<p class=\"title\" lang=\"zh\"><strong>\u8868\u00a069.3.\u00a0PageHeaderData \u5e03\u5c40</strong></p>\n<div class=\"table-contents\">\n<table class=\"table\">\n<thead>\n<tr>\n<th lang=\"zh\">\u5b57\u6bb5</th>\n<th lang=\"zh\">\u7c7b\u578b</th>\n<th lang=\"zh\">\u957f\u5ea6</th>\n<th lang=\"zh\">\u8bf4\u660e</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>pd_lsn</td>\n<td>PageXLogRecPtr</td>\n<td lang=\"zh\">8 \u5b57\u8282</td>\n<td lang=\"zh\">LSN\uff1a\u8be5\u9875\u6700\u540e\u4e00\u6b21\u53d8\u5316\u6240\u5bf9\u5e94 WAL \u8bb0\u5f55\u7684\u6700\u540e\u4e00\u4e2a\u5b57\u8282\u4e4b\u540e\u7684\u4f4d\u7f6e\u3002</td>\n</tr>\n<tr>\n<td>pd_checksum</td>\n<td>uint16</td>\n<td lang=\"zh\">2 \u5b57\u8282</td>\n<td lang=\"zh\">\u9875\u9762\u6821\u9a8c\u548c</td>\n</tr>\n<tr>\n<td>pd_flags</td>\n<td>uint16</td>\n<td lang=\"zh\">2 \u5b57\u8282</td>\n<td lang=\"zh\">\u6807\u5fd7\u4f4d</td>\n</tr>\n<tr>\n<td>pd_lower</td>\n<td>LocationIndex</td>\n<td lang=\"zh\">2 \u5b57\u8282</td>\n<td lang=\"zh\">\u7a7a\u95f2\u7a7a\u95f4\u8d77\u59cb\u4f4d\u7f6e\u7684\u504f\u79fb\u91cf</td>\n</tr>\n<tr>\n<td>pd_upper</td>\n<td>LocationIndex</td>\n<td lang=\"zh\">2 \u5b57\u8282</td>\n<td lang=\"zh\">\u7a7a\u95f2\u7a7a\u95f4\u7ed3\u675f\u4f4d\u7f6e\u7684\u504f\u79fb\u91cf</td>\n</tr>\n<tr>\n<td>pd_special</td>\n<td>LocationIndex</td>\n<td lang=\"zh\">2 \u5b57\u8282</td>\n<td lang=\"zh\">\u7279\u6b8a\u7a7a\u95f4\u8d77\u59cb\u4f4d\u7f6e\u7684\u504f\u79fb\u91cf</td>\n</tr>\n<tr>\n<td>pd_pagesize_version</td>\n<td>uint16</td>\n<td lang=\"zh\">2 \u5b57\u8282</td>\n<td lang=\"zh\">\u9875\u9762\u5927\u5c0f\u4e0e\u5e03\u5c40\u7248\u672c\u53f7\u4fe1\u606f</td>\n</tr>\n<tr>\n<td>pd_prune_xid</td>\n<td>TransactionId</td>\n<td lang=\"zh\">4 \u5b57\u8282</td>\n<td lang=\"zh\">\u9875\u9762\u4e0a\u6700\u65e9\u7684\u5c1a\u672a\u4fee\u526a\u7684 XMAX\uff1b\u6ca1\u6709\u5219\u4e3a\u96f6</td>\n</tr>\n</tbody>\n</table>\n</div>\n</div><br class=\"table-break\"/>\n<p lang=\"zh\">\u6240\u6709\u7ec6\u8282\u90fd\u53ef\u4ee5\u5728 <code class=\"filename\">src/include/storage/bufpage.h</code> \u4e2d\u627e\u5230\u3002</p>\n<p lang=\"zh\">\u9875\u5934\u4e4b\u540e\u662f\u9879\u6807\u8bc6\u7b26\uff08<code class=\"type\">ItemIdData</code>\uff09\uff0c\u6bcf\u4e2a\u9700\u8981\u56db\u4e2a\u5b57\u8282\u3002\u4e00\u4e2a\u9879\u6807\u8bc6\u7b26\u5305\u542b\u9879\u8d77\u59cb\u4f4d\u7f6e\u7684\u5b57\u8282\u504f\u79fb\u91cf\u3001\u5176\u5b57\u8282\u957f\u5ea6\uff0c\u4ee5\u53ca\u82e5\u5e72\u5f71\u54cd\u89e3\u91ca\u65b9\u5f0f\u7684\u5c5e\u6027\u4f4d\u3002\u65b0\u7684\u9879\u6807\u8bc6\u7b26\u4f1a\u6839\u636e\u9700\u8981\u4ece\u672a\u5206\u914d\u7a7a\u95f4\u7684\u8d77\u59cb\u5904\u5206\u914d\u3002\u5f53\u524d\u5df2\u6709\u591a\u5c11\u4e2a\u9879\u6807\u8bc6\u7b26\uff0c\u53ef\u4ee5\u901a\u8fc7\u67e5\u770b <code class=\"structfield\">pd_lower</code> \u5f97\u77e5\uff1b\u5206\u914d\u65b0\u6807\u8bc6\u7b26\u65f6\u5b83\u4f1a\u589e\u52a0\u3002\u56e0\u4e3a\u4e00\u4e2a\u9879\u6807\u8bc6\u7b26\u5728\u88ab\u91ca\u653e\u4e4b\u524d\u6c38\u8fdc\u4e0d\u4f1a\u79fb\u52a8\uff0c\u6240\u4ee5\u5373\u4f7f\u9879\u672c\u8eab\u4e3a\u4e86\u6574\u7406\u7a7a\u95f2\u7a7a\u95f4\u800c\u5728\u9875\u9762\u5185\u79fb\u52a8\uff0c\u5176\u7d22\u5f15\u4ecd\u7136\u53ef\u4ee5\u88ab\u957f\u671f\u7528\u6765\u5f15\u7528\u8be5\u9879\u3002\u4e8b\u5b9e\u4e0a\uff0c\u6bcf\u4e2a\u6307\u5411\u9879\u7684\u6307\u9488\uff08<code class=\"type\">ItemPointer</code>\uff0c\u4e5f\u79f0 <code class=\"type\">CTID</code>\uff09\u5728 <span class=\"productname\">PostgreSQL</span> \u4e2d\u90fd\u7531\u9875\u53f7\u548c\u9879\u6807\u8bc6\u7b26\u7d22\u5f15\u6784\u6210\u3002</p>\n<p lang=\"zh\">\u9879\u672c\u8eab\u5b58\u50a8\u5728\u4ece\u672a\u5206\u914d\u7a7a\u95f4\u672b\u5c3e\u5f00\u59cb\u3001\u5411\u540e\u5206\u914d\u7684\u533a\u57df\u4e2d\u3002\u5176\u786e\u5207\u7ed3\u6784\u53d6\u51b3\u4e8e\u8868\u8981\u5305\u542b\u4ec0\u4e48\u5185\u5bb9\u3002\u8868\u548c\u5e8f\u5217\u90fd\u4f7f\u7528\u4e00\u79cd\u540d\u4e3a <code class=\"type\">HeapTupleHeaderData</code> \u7684\u7ed3\u6784\u4f53\uff0c\u5982\u4e0b\u6240\u8ff0\u3002</p>\n<p lang=\"zh\">\u6700\u540e\u4e00\u90e8\u5206\u662f<span class=\"quote\">\u201c<span class=\"quote\">\u7279\u6b8a\u90e8\u5206</span>\u201d</span>\uff0c\u5176\u4e2d\u53ef\u4ee5\u5b58\u653e\u8bbf\u95ee\u65b9\u6cd5\u5e0c\u671b\u4fdd\u5b58\u7684\u4efb\u4f55\u5185\u5bb9\u3002\u4f8b\u5982\uff0cB-\u6811\u7d22\u5f15\u4f1a\u5728\u8fd9\u91cc\u4fdd\u5b58\u6307\u5411\u9875\u9762\u5de6\u3001\u53f3\u5144\u5f1f\u7684\u94fe\u63a5\uff0c\u4ee5\u53ca\u5176\u4ed6\u4e00\u4e9b\u4e0e\u7d22\u5f15\u7ed3\u6784\u76f8\u5173\u7684\u6570\u636e\u3002\u666e\u901a\u8868\u5b8c\u5168\u4e0d\u4f7f\u7528\u7279\u6b8a\u90e8\u5206\uff08\u901a\u8fc7\u5c06 <code class=\"structfield\">pd_special</code> \u8bbe\u4e3a\u9875\u9762\u5927\u5c0f\u6765\u8868\u793a\uff09\u3002</p>\n<p lang=\"zh\"><a class=\"xref\" href=\"/docs/13/storage-page-layout.html#STORAGE-PAGE-LAYOUT-FIGURE\" title=\"\u56fe\u00a069.1.\u00a0\u9875\u9762\u5e03\u5c40\">\u56fe\u00a069.1</a>\u5c55\u793a\u4e86\u8fd9\u4e9b\u90e8\u5206\u5728\u9875\u9762\u4e2d\u7684\u5e03\u5c40\u65b9\u5f0f\u3002</p>\n<div class=\"figure col-xl-8 col-lg-10 col-md-12\">\n<p class=\"title\" lang=\"zh\">\n<p class=\"title\"><strong>\u56fe\u00a069.1.\u00a0\u9875\u9762\u5e03\u5c40</strong></p>\n<div class=\"figure-contents\">\n<div class=\"mediaobject\">\n<object data=\"pagelayout.svg\" type=\"image/svg+xml\" width=\"100%\">\n</object>\n</div>\n</div>\n</p>\n<div class=\"figure-contents\">\n<div class=\"mediaobject\">\n</div>\n</div>\n</div><br class=\"figure-break\"/>\n<div class=\"sect2\">\n<div class=\"titlepage\">\n<div>\n<div>\n<h3 class=\"title\" lang=\"zh\">\n<dl class=\"toc\">\n<dt><span class=\"sect2\"><a href=\"/docs/13/storage-page-layout.html#STORAGE-TUPLE-LAYOUT\">69.6.1. \u8868\u884c\u5e03\u5c40</a></span></dt>\n</dl>\n</h3>\n</div>\n</div>\n</div>\n<p lang=\"zh\">\u6240\u6709\u8868\u884c\u7684\u7ed3\u6784\u90fd\u76f8\u540c\u3002\u5b83\u4eec\u90fd\u6709\u4e00\u4e2a\u56fa\u5b9a\u5927\u5c0f\u7684\u5934\u90e8\uff08\u5728\u5927\u591a\u6570\u673a\u5668\u4e0a\u5360 23 \u5b57\u8282\uff09\uff0c\u540e\u9762\u8ddf\u7740\u53ef\u9009\u7684\u7a7a\u503c\u4f4d\u56fe\u3001\u53ef\u9009\u7684\u5bf9\u8c61 ID \u5b57\u6bb5\u4ee5\u53ca\u7528\u6237\u6570\u636e\u3002\u5934\u90e8\u7684\u8be6\u7ec6\u683c\u5f0f\u89c1<a class=\"xref\" href=\"/docs/13/storage-page-layout.html#HEAPTUPLEHEADERDATA-TABLE\" title=\"\u8868\u00a069.4.\u00a0HeapTupleHeaderData \u5e03\u5c40\">\u8868\u00a069.4</a>\u3002\u5b9e\u9645\u7528\u6237\u6570\u636e\uff08\u884c\u7684\u5404\u5217\uff09\u4ece <code class=\"structfield\">t_hoff</code> \u6307\u793a\u7684\u504f\u79fb\u4f4d\u7f6e\u5f00\u59cb\uff0c\u5b83\u5fc5\u987b\u59cb\u7ec8\u662f\u8be5\u5e73\u53f0 MAXALIGN \u5bf9\u9f50\u5355\u4f4d\u7684\u6574\u6570\u500d\u3002\u53ea\u6709\u5f53 <em class=\"firstterm\">HEAP_HASNULL</em> \u4f4d\u5728 <code class=\"structfield\">t_infomask</code> \u4e2d\u88ab\u7f6e\u4f4d\u65f6\uff0c\u7a7a\u503c\u4f4d\u56fe\u624d\u5b58\u5728\u3002\u82e5\u5b58\u5728\uff0c\u5b83\u7d27\u968f\u56fa\u5b9a\u5934\u90e8\u4e4b\u540e\uff0c\u5e76\u5360\u7528\u8db3\u591f\u591a\u7684\u5b57\u8282\uff0c\u4ee5\u4fbf\u4e3a\u6bcf\u4e2a\u6570\u636e\u5217\u63d0\u4f9b\u4e00\u4f4d\uff08\u4e5f\u5c31\u662f\u8bf4\uff0c\u5176\u4f4d\u6570\u7b49\u4e8e <code class=\"structfield\">t_infomask2</code> \u4e2d\u7684\u5c5e\u6027\u4e2a\u6570\uff09\u3002\u5728\u8fd9\u4e2a\u4f4d\u56fe\u4e2d\uff0c1 \u8868\u793a\u975e\u7a7a\uff0c0 \u8868\u793a\u7a7a\u503c\u3002\u5f53\u4f4d\u56fe\u4e0d\u5b58\u5728\u65f6\uff0c\u5047\u5b9a\u6240\u6709\u5217\u90fd\u975e\u7a7a\u3002\u53ea\u6709\u5f53 <em class=\"firstterm\">HEAP_HASOID_OLD</em> \u4f4d\u5728 <code class=\"structfield\">t_infomask</code> \u4e2d\u88ab\u7f6e\u4f4d\u65f6\uff0c\u5bf9\u8c61 ID \u624d\u5b58\u5728\u3002\u82e5\u5b58\u5728\uff0c\u5b83\u4f4d\u4e8e <code class=\"structfield\">t_hoff</code> \u8fb9\u754c\u4e4b\u524d\u3002\u4e3a\u4e86\u8ba9 <code class=\"structfield\">t_hoff</code> \u6210\u4e3a MAXALIGN \u7684\u6574\u6570\u500d\u6240\u9700\u7684\u4efb\u4f55\u586b\u5145\uff0c\u90fd\u4f1a\u51fa\u73b0\u5728\u7a7a\u503c\u4f4d\u56fe\u4e0e\u5bf9\u8c61 ID \u4e4b\u95f4\u3002\uff08\u8fd9\u53c8\u53cd\u8fc7\u6765\u4fdd\u8bc1\u4e86\u5bf9\u8c61 ID \u7684\u5bf9\u9f50\u662f\u5408\u9002\u7684\u3002\uff09</p>\n<div class=\"table\">\n<p class=\"title\" lang=\"zh\"><strong>\u8868\u00a069.4.\u00a0HeapTupleHeaderData \u5e03\u5c40</strong></p>\n<div class=\"table-contents\">\n<table class=\"table\">\n<thead>\n<tr>\n<th lang=\"zh\">\u5b57\u6bb5</th>\n<th lang=\"zh\">\u7c7b\u578b</th>\n<th lang=\"zh\">\u957f\u5ea6</th>\n<th lang=\"zh\">\u8bf4\u660e</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>t_xmin</td>\n<td>TransactionId</td>\n<td lang=\"zh\">4 \u5b57\u8282</td>\n<td lang=\"zh\">\u63d2\u5165\u4e8b\u52a1\u7684 XID</td>\n</tr>\n<tr>\n<td>t_xmax</td>\n<td>TransactionId</td>\n<td lang=\"zh\">4 \u5b57\u8282</td>\n<td lang=\"zh\">\u5220\u9664\u4e8b\u52a1\u7684 XID</td>\n</tr>\n<tr>\n<td>t_cid</td>\n<td>CommandId</td>\n<td lang=\"zh\">4 \u5b57\u8282</td>\n<td lang=\"zh\">\u63d2\u5165\u548c\uff0f\u6216\u5220\u9664\u547d\u4ee4\u7684 CID\uff0c\u4e0e t_xvac \u5171\u7528\u5b58\u50a8\u4f4d\u7f6e</td>\n</tr>\n<tr>\n<td>t_xvac</td>\n<td>TransactionId</td>\n<td lang=\"zh\">4 \u5b57\u8282</td>\n<td lang=\"zh\">VACUUM \u64cd\u4f5c\u79fb\u52a8\u884c\u7248\u672c\u65f6\u4f7f\u7528\u7684 XID</td>\n</tr>\n<tr>\n<td>t_ctid</td>\n<td>ItemPointerData</td>\n<td lang=\"zh\">6 \u5b57\u8282</td>\n<td lang=\"zh\">\u672c\u884c\u7248\u672c\u6216\u8f83\u65b0\u884c\u7248\u672c\u7684\u5f53\u524d TID</td>\n</tr>\n<tr>\n<td>t_infomask2</td>\n<td>uint16</td>\n<td lang=\"zh\">2 \u5b57\u8282</td>\n<td lang=\"zh\">\u5c5e\u6027\u6570\u91cf\u53ca\u5404\u79cd\u6807\u5fd7\u4f4d</td>\n</tr>\n<tr>\n<td>t_infomask</td>\n<td>uint16</td>\n<td lang=\"zh\">2 \u5b57\u8282</td>\n<td lang=\"zh\">\u5404\u79cd\u6807\u5fd7\u4f4d</td>\n</tr>\n<tr>\n<td>t_hoff</td>\n<td>uint8</td>\n<td lang=\"zh\">1 \u5b57\u8282</td>\n<td lang=\"zh\">\u7528\u6237\u6570\u636e\u7684\u504f\u79fb\u91cf</td>\n</tr>\n</tbody>\n</table>\n</div>\n</div><br class=\"table-break\"/>\n<p lang=\"zh\">\u6240\u6709\u7ec6\u8282\u90fd\u53ef\u4ee5\u5728 <code class=\"filename\">src/include/access/htup_details.h</code> \u4e2d\u627e\u5230\u3002</p>\n<p lang=\"zh\">\u8981\u89e3\u91ca\u5b9e\u9645\u6570\u636e\uff0c\u5fc5\u987b\u501f\u52a9\u4ece\u5176\u4ed6\u8868\u4e2d\u83b7\u5f97\u7684\u4fe1\u606f\uff0c\u5176\u4e2d\u5927\u90e8\u5206\u6765\u81ea <code class=\"structname\">pg_attribute</code>\u3002\u8bc6\u522b\u5b57\u6bb5\u4f4d\u7f6e\u6240\u9700\u7684\u5173\u952e\u503c\u662f <code class=\"structfield\">attlen</code> \u548c <code class=\"structfield\">attalign</code>\u3002\u9664\u975e\u6240\u6709\u5b57\u6bb5\u90fd\u662f\u5b9a\u5bbd\u4e14\u6ca1\u6709\u7a7a\u503c\uff0c\u5426\u5219\u6ca1\u6709\u529e\u6cd5\u76f4\u63a5\u53d6\u5f97\u67d0\u4e2a\u7279\u5b9a\u5c5e\u6027\u3002\u6240\u6709\u8fd9\u4e9b\u6280\u5de7\u90fd\u5c01\u88c5\u5728 <em class=\"firstterm\">heap_getattr</em>\u3001<em class=\"firstterm\">fastgetattr</em> \u548c <em class=\"firstterm\">heap_getsysattr</em> \u8fd9\u4e9b\u51fd\u6570\u4e2d\u3002</p>\n<p lang=\"zh\">\u8bfb\u53d6\u6570\u636e\u65f6\uff0c\u9700\u8981\u4f9d\u6b21\u68c0\u67e5\u6bcf\u4e2a\u5c5e\u6027\u3002\u9996\u5148\u6839\u636e\u7a7a\u503c\u4f4d\u56fe\u5224\u65ad\u8be5\u5b57\u6bb5\u662f\u5426\u4e3a NULL\u3002\u5982\u679c\u662f\uff0c\u5c31\u7ee7\u7eed\u4e0b\u4e00\u4e2a\u3002\u7136\u540e\u786e\u8ba4\u5bf9\u9f50\u662f\u5426\u6b63\u786e\u3002\u5982\u679c\u5b57\u6bb5\u662f\u5b9a\u5bbd\u5b57\u6bb5\uff0c\u90a3\u4e48\u5b83\u7684\u6240\u6709\u5b57\u8282\u90fd\u662f\u76f4\u63a5\u6446\u653e\u7684\uff1b\u5982\u679c\u5b83\u662f\u53d8\u957f\u5b57\u6bb5\uff08attlen = -1\uff09\uff0c\u60c5\u51b5\u5c31\u4f1a\u7a0d\u590d\u6742\u4e00\u4e9b\u3002\u6240\u6709\u53d8\u957f\u6570\u636e\u7c7b\u578b\u90fd\u5171\u4eab\u4e00\u4e2a\u901a\u7528\u5934\u90e8\u7ed3\u6784\u4f53 <code class=\"type\">struct varlena</code>\uff0c\u5176\u4e2d\u5305\u542b\u5df2\u5b58\u50a8\u503c\u7684\u603b\u957f\u5ea6\u4ee5\u53ca\u4e00\u4e9b\u6807\u5fd7\u4f4d\u3002\u6839\u636e\u8fd9\u4e9b\u6807\u5fd7\uff0c\u6570\u636e\u53ef\u80fd\u662f\u884c\u5185\u5b58\u50a8\u7684\uff0c\u4e5f\u53ef\u80fd\u4f4d\u4e8e <acronym class=\"acronym\">TOAST</acronym> \u8868\u4e2d\uff1b\u5b83\u4e5f\u53ef\u80fd\u662f\u7ecf\u8fc7\u538b\u7f29\u7684\uff08\u89c1<a class=\"xref\" href=\"/docs/13/storage-toast.html\" title=\"69.2.\u00a0TOAST\">\u7b2c\u00a069.2\u00a0\u8282</a>\uff09\u3002</p>\n</div>\n<div class=\"footnotes\">\n<br/>\n<hr/>\n<div class=\"footnote\">\n<p lang=\"zh\">\n<br/>\n<hr style=\"width:100; text-align:left;margin-left: 0\"/>\n<div class=\"footnote\" id=\"ftn.id-1.10.22.8.2.2\">\n<p><a class=\"para\" href=\"/docs/13/storage-page-layout.html#id-1.10.22.8.2.2\"><sup class=\"para\">[15]</sup></a> \u5b9e\u9645\u4e0a\uff0c\u8868\u8bbf\u95ee\u65b9\u6cd5\u548c\u7d22\u5f15\u8bbf\u95ee\u65b9\u6cd5\u90fd\u4e0d\u8981\u6c42\u5fc5\u987b\u4f7f\u7528\u8fd9\u79cd\u9875\u9762\u683c\u5f0f\u3002<code class=\"literal\">heap</code> \u8868\u8bbf\u95ee\u65b9\u6cd5\u59cb\u7ec8\u4f7f\u7528\u8fd9\u79cd\u683c\u5f0f\u3002\u73b0\u6709\u7684\u6240\u6709\u7d22\u5f15\u65b9\u6cd5\u4e5f\u90fd\u4f7f\u7528\u8fd9\u79cd\u57fa\u672c\u683c\u5f0f\uff0c\u4f46\u7d22\u5f15\u5143\u9875\u4e2d\u4fdd\u5b58\u7684\u6570\u636e\u901a\u5e38\u5e76\u4e0d\u9075\u5faa\u9879\u5e03\u5c40\u89c4\u5219\u3002</p>\n</div>\n</p>\n</div>\n</div>\n</div>", "manual_path": "/docs/13/storage-page-layout.html", "localization": {"status": "complete", "sources": [{"url": "/docs/13/storage-page-layout.html", "method": "same-major semantic node", "sha256": "8f345d33cebccf663d12f0103dacc41820cd492d575b5faf6bcab66832f8ba39", "language": "zh", "matched_nodes": ["#STORAGE-PAGE-LAYOUT/div[0]", "#STORAGE-PAGE-LAYOUT/div[16]", "#STORAGE-PAGE-LAYOUT/div[18]/div[2]/p[0]", "#STORAGE-PAGE-LAYOUT/div[18]/p[1]", "#STORAGE-PAGE-LAYOUT/div[18]/p[4]", "#STORAGE-PAGE-LAYOUT/div[18]/p[5]", "#STORAGE-PAGE-LAYOUT/div[18]/p[6]", "#STORAGE-PAGE-LAYOUT/div[19]", "#STORAGE-PAGE-LAYOUT/div[1]", "#STORAGE-PAGE-LAYOUT/div[6]/div[1]/table[0]/tbody[2]/tr[3]/td[0]", "#STORAGE-PAGE-LAYOUT/div[6]/p[0]", "#STORAGE-PAGE-LAYOUT/div[9]/div[1]/table[0]/tbody[2]/tr[0]/td[2]", "#STORAGE-PAGE-LAYOUT/div[9]/p[0]", "#STORAGE-PAGE-LAYOUT/p[11]", "#STORAGE-PAGE-LAYOUT/p[12]", "#STORAGE-PAGE-LAYOUT/p[13]", "#STORAGE-PAGE-LAYOUT/p[14]", "#STORAGE-PAGE-LAYOUT/p[15]", "#STORAGE-PAGE-LAYOUT/p[2]", "#STORAGE-PAGE-LAYOUT/p[3]", "#STORAGE-PAGE-LAYOUT/p[4]", "#STORAGE-PAGE-LAYOUT/p[5]"]}], "language": "zh", "original_text": {"/versions/13/description/0": "This section provides an overview of the page format used within PostgreSQL tables and indexes. [15] Sequences and TOAST tables are formatted just like a regular table.", "/versions/13/facts/0/label": "Definition scope", "/versions/13/facts/0/value": "Same-version core physical storage documentation", "/versions/13/tables/0/title": "Overall Page Layout", "/versions/13/tables/1/title": "PageHeaderData Layout", "/versions/13/tables/2/title": "HeapTupleHeaderData Layout", "/versions/13/related/1/label": "Storage Parameters", "/versions/13/tables/0/rows/0/c1": "24 bytes long. Contains general information about the page, including free space pointers.", "/versions/13/tables/0/rows/1/c1": "Array of item identifiers pointing to the actual items. Each entry is an (offset,length) pair. 4 bytes per item.", "/versions/13/tables/0/rows/2/c0": "Free space", "/versions/13/tables/0/rows/2/c1": "The unallocated space. New item identifiers are allocated from the start of this area, new items from the end.", "/versions/13/tables/0/rows/3/c0": "Items", "/versions/13/tables/0/rows/3/c1": "The actual items themselves.", "/versions/13/tables/0/rows/4/c0": "Special space", "/versions/13/tables/0/rows/4/c1": "Index access method specific data. Different methods store different data. Empty in ordinary tables.", "/versions/13/tables/1/rows/0/c2": "8 bytes", "/versions/13/tables/1/rows/0/c3": "LSN: next byte after last byte of WAL record for last change to this page", "/versions/13/tables/1/rows/1/c2": "2 bytes", "/versions/13/tables/1/rows/1/c3": "Page checksum", "/versions/13/tables/1/rows/2/c2": "2 bytes", "/versions/13/tables/1/rows/2/c3": "Flag bits", "/versions/13/tables/1/rows/3/c2": "2 bytes", "/versions/13/tables/1/rows/3/c3": "Offset to start of free space", "/versions/13/tables/1/rows/4/c2": "2 bytes", "/versions/13/tables/1/rows/4/c3": "Offset to end of free space", "/versions/13/tables/1/rows/5/c2": "2 bytes", "/versions/13/tables/1/rows/5/c3": "Offset to start of special space", "/versions/13/tables/1/rows/6/c2": "2 bytes", "/versions/13/tables/1/rows/6/c3": "Page size and layout version number information", "/versions/13/tables/1/rows/7/c2": "4 bytes", "/versions/13/tables/1/rows/7/c3": "Oldest unpruned XMAX on page, or zero if none", "/versions/13/tables/2/rows/0/c2": "4 bytes", "/versions/13/tables/2/rows/0/c3": "insert XID stamp", "/versions/13/tables/2/rows/1/c2": "4 bytes", "/versions/13/tables/2/rows/1/c3": "delete XID stamp", "/versions/13/tables/2/rows/2/c2": "4 bytes", "/versions/13/tables/2/rows/2/c3": "insert and/or delete CID stamp (overlays with t_xvac)", "/versions/13/tables/2/rows/3/c2": "4 bytes", "/versions/13/tables/2/rows/3/c3": "XID for VACUUM operation moving a row version", "/versions/13/tables/2/rows/4/c2": "6 bytes", "/versions/13/tables/2/rows/4/c3": "current TID of this or newer row version", "/versions/13/tables/2/rows/5/c2": "2 bytes", "/versions/13/tables/2/rows/5/c3": "number of attributes, plus various flag bits", "/versions/13/tables/2/rows/6/c2": "2 bytes", "/versions/13/tables/2/rows/6/c3": "various flag bits", "/versions/13/tables/2/rows/7/c2": "1 byte", "/versions/13/tables/2/rows/7/c3": "offset to user data", "/versions/13/tables/0/columns/0/label": "Item", "/versions/13/tables/0/columns/1/label": "Description", "/versions/13/tables/1/columns/0/label": "Field", "/versions/13/tables/1/columns/1/label": "Type", "/versions/13/tables/1/columns/2/label": "Length", "/versions/13/tables/1/columns/3/label": "Description", "/versions/13/tables/2/columns/0/label": "Field", "/versions/13/tables/2/columns/1/label": "Type", "/versions/13/tables/2/columns/2/label": "Length", "/versions/13/tables/2/columns/3/label": "Description"}, "fallback_fields": [], "source_language": "en", "original_snapshot_sha256": "11ca5bd7cdf60a5af2d848c365c069eb58cf427693a4d274a462832b386e46eb"}, "comparison_data": {"layouts": [{"key": "layout-0", "rows": [{"c0": "PageHeaderData", "c1": "24 bytes long. Contains general information about the page, including free space pointers."}, {"c0": "ItemIdData", "c1": "Array of item identifiers pointing to the actual items. Each entry is an (offset,length) pair. 4 bytes per item."}, {"c0": "Free space", "c1": "The unallocated space. New item identifiers are allocated from the start of this area, new items from the end."}, {"c0": "Items", "c1": "The actual items themselves."}, {"c0": "Special space", "c1": "Index access method specific data. Different methods store different data. Empty in ordinary tables."}], "title": "Overall Page Layout", "columns": [{"key": "c0", "label": "Item"}, {"key": "c1", "label": "Description"}]}, {"key": "layout-1", "rows": [{"c0": "pd_lsn", "c1": "PageXLogRecPtr", "c2": "8 bytes", "c3": "LSN: next byte after last byte of WAL record for last change to this page"}, {"c0": "pd_checksum", "c1": "uint16", "c2": "2 bytes", "c3": "Page checksum"}, {"c0": "pd_flags", "c1": "uint16", "c2": "2 bytes", "c3": "Flag bits"}, {"c0": "pd_lower", "c1": "LocationIndex", "c2": "2 bytes", "c3": "Offset to start of free space"}, {"c0": "pd_upper", "c1": "LocationIndex", "c2": "2 bytes", "c3": "Offset to end of free space"}, {"c0": "pd_special", "c1": "LocationIndex", "c2": "2 bytes", "c3": "Offset to start of special space"}, {"c0": "pd_pagesize_version", "c1": "uint16", "c2": "2 bytes", "c3": "Page size and layout version number information"}, {"c0": "pd_prune_xid", "c1": "TransactionId", "c2": "4 bytes", "c3": "Oldest unpruned XMAX on page, or zero if none"}], "title": "PageHeaderData Layout", "columns": [{"key": "c0", "label": "Field"}, {"key": "c1", "label": "Type"}, {"key": "c2", "label": "Length"}, {"key": "c3", "label": "Description"}]}, {"key": "layout-2", "rows": [{"c0": "t_xmin", "c1": "TransactionId", "c2": "4 bytes", "c3": "insert XID stamp"}, {"c0": "t_xmax", "c1": "TransactionId", "c2": "4 bytes", "c3": "delete XID stamp"}, {"c0": "t_cid", "c1": "CommandId", "c2": "4 bytes", "c3": "insert and/or delete CID stamp (overlays with t_xvac)"}, {"c0": "t_xvac", "c1": "TransactionId", "c2": "4 bytes", "c3": "XID for VACUUM operation moving a row version"}, {"c0": "t_ctid", "c1": "ItemPointerData", "c2": "6 bytes", "c3": "current TID of this or newer row version"}, {"c0": "t_infomask2", "c1": "uint16", "c2": "2 bytes", "c3": "number of attributes, plus various flag bits"}, {"c0": "t_infomask", "c1": "uint16", "c2": "2 bytes", "c3": "various flag bits"}, {"c0": "t_hoff", "c1": "uint8", "c2": "1 byte", "c3": "offset to user data"}], "title": "HeapTupleHeaderData Layout", "columns": [{"key": "c0", "label": "Field"}, {"key": "c1", "label": "Type"}, {"key": "c2", "label": "Length"}, {"key": "c3", "label": "Description"}]}]}, "comparison_hash": "b621fa85b3be27a0eb0d82986e9524f2ef0a776761901f0d429826eec4822d0a", "manual_language": "zh"}, "14": {"facts": [{"label": "\u5b9a\u4e49\u8303\u56f4", "value": "\u540c\u7248\u672c\u6838\u5fc3\u7269\u7406\u5b58\u50a8\u6587\u6863"}], "tables": [{"key": "layout-0", "rows": [{"c0": "PageHeaderData", "c1": "\u957f 24 \u5b57\u8282\uff0c\u5305\u542b\u9875\u9762\u7684\u901a\u7528\u4fe1\u606f\uff0c\u4f8b\u5982\u7a7a\u95f2\u7a7a\u95f4\u6307\u9488\u3002"}, {"c0": "ItemIdData", "c1": "\u6307\u5411\u5b9e\u9645\u6570\u636e\u9879\u7684\u884c\u6307\u9488\u6570\u7ec4\u3002\u6bcf\u9879\u4e3a\u4e00\u4e2a\uff08\u504f\u79fb\uff0c\u957f\u5ea6\uff09\u5bf9\uff0c\u5360 4 \u5b57\u8282\u3002"}, {"c0": "\u7a7a\u95f2\u7a7a\u95f4", "c1": "\u5c1a\u672a\u5206\u914d\u7684\u7a7a\u95f4\u3002\u65b0\u884c\u6307\u9488\u4ece\u8be5\u533a\u57df\u7684\u8d77\u59cb\u5904\u5206\u914d\uff0c\u65b0\u6570\u636e\u9879\u4ece\u672b\u5c3e\u5904\u5206\u914d\u3002"}, {"c0": "\u9879", "c1": "\u5b9e\u9645\u7684\u6570\u636e\u9879\u672c\u8eab\u3002"}, {"c0": "\u7279\u6b8a\u7a7a\u95f4", "c1": "\u7d22\u5f15\u8bbf\u95ee\u65b9\u6cd5\u4e13\u7528\u6570\u636e\u3002\u4e0d\u540c\u65b9\u6cd5\u5b58\u50a8\u7684\u5185\u5bb9\u4e0d\u540c\uff0c\u666e\u901a\u8868\u4e2d\u6b64\u533a\u57df\u4e3a\u7a7a\u3002"}], "title": "\u9875\u9762\u603b\u4f53\u5e03\u5c40", "columns": [{"key": "c0", "label": "\u9879\u76ee"}, {"key": "c1", "label": "\u8bf4\u660e"}]}, {"key": "layout-1", "rows": [{"c0": "pd_lsn", "c1": "PageXLogRecPtr", "c2": "8 \u5b57\u8282", "c3": "LSN\uff1a\u8be5\u9875\u6700\u540e\u4e00\u6b21\u53d8\u5316\u6240\u5bf9\u5e94 WAL \u8bb0\u5f55\u7684\u6700\u540e\u4e00\u4e2a\u5b57\u8282\u4e4b\u540e\u7684\u4f4d\u7f6e\u3002"}, {"c0": "pd_checksum", "c1": "uint16", "c2": "2 \u5b57\u8282", "c3": "\u9875\u9762\u6821\u9a8c\u548c"}, {"c0": "pd_flags", "c1": "uint16", "c2": "2 \u5b57\u8282", "c3": "\u6807\u5fd7\u4f4d"}, {"c0": "pd_lower", "c1": "LocationIndex", "c2": "2 \u5b57\u8282", "c3": "\u7a7a\u95f2\u7a7a\u95f4\u8d77\u59cb\u4f4d\u7f6e\u7684\u504f\u79fb\u91cf"}, {"c0": "pd_upper", "c1": "LocationIndex", "c2": "2 \u5b57\u8282", "c3": "\u7a7a\u95f2\u7a7a\u95f4\u7ed3\u675f\u4f4d\u7f6e\u7684\u504f\u79fb\u91cf"}, {"c0": "pd_special", "c1": "LocationIndex", "c2": "2 \u5b57\u8282", "c3": "\u7279\u6b8a\u7a7a\u95f4\u8d77\u59cb\u4f4d\u7f6e\u7684\u504f\u79fb\u91cf"}, {"c0": "pd_pagesize_version", "c1": "uint16", "c2": "2 \u5b57\u8282", "c3": "\u9875\u9762\u5927\u5c0f\u4e0e\u5e03\u5c40\u7248\u672c\u53f7\u4fe1\u606f"}, {"c0": "pd_prune_xid", "c1": "TransactionId", "c2": "4 \u5b57\u8282", "c3": "\u9875\u9762\u4e0a\u6700\u65e9\u7684\u5c1a\u672a\u4fee\u526a\u7684 XMAX\uff1b\u6ca1\u6709\u5219\u4e3a\u96f6"}], "title": "PageHeaderData \u5e03\u5c40", "columns": [{"key": "c0", "label": "\u5b57\u6bb5"}, {"key": "c1", "label": "\u7c7b\u578b"}, {"key": "c2", "label": "\u957f\u5ea6"}, {"key": "c3", "label": "\u8bf4\u660e"}]}, {"key": "layout-2", "rows": [{"c0": "t_xmin", "c1": "TransactionId", "c2": "4 \u5b57\u8282", "c3": "\u63d2\u5165\u4e8b\u52a1\u7684 XID"}, {"c0": "t_xmax", "c1": "TransactionId", "c2": "4 \u5b57\u8282", "c3": "\u5220\u9664\u4e8b\u52a1\u7684 XID"}, {"c0": "t_cid", "c1": "CommandId", "c2": "4 \u5b57\u8282", "c3": "\u63d2\u5165\u548c\uff0f\u6216\u5220\u9664\u547d\u4ee4\u7684 CID\uff0c\u4e0e t_xvac \u5171\u7528\u5b58\u50a8\u4f4d\u7f6e"}, {"c0": "t_xvac", "c1": "TransactionId", "c2": "4 \u5b57\u8282", "c3": "VACUUM \u64cd\u4f5c\u79fb\u52a8\u884c\u7248\u672c\u65f6\u4f7f\u7528\u7684 XID"}, {"c0": "t_ctid", "c1": "ItemPointerData", "c2": "6 \u5b57\u8282", "c3": "\u672c\u884c\u7248\u672c\u6216\u8f83\u65b0\u884c\u7248\u672c\u7684\u5f53\u524d TID"}, {"c0": "t_infomask2", "c1": "uint16", "c2": "2 \u5b57\u8282", "c3": "\u5c5e\u6027\u6570\u91cf\u53ca\u5404\u79cd\u6807\u5fd7\u4f4d"}, {"c0": "t_infomask", "c1": "uint16", "c2": "2 \u5b57\u8282", "c3": "\u5404\u79cd\u6807\u5fd7\u4f4d"}, {"c0": "t_hoff", "c1": "uint8", "c2": "1 \u5b57\u8282", "c3": "\u7528\u6237\u6570\u636e\u7684\u504f\u79fb\u91cf"}], "title": "HeapTupleHeaderData \u5e03\u5c40", "columns": [{"key": "c0", "label": "\u5b57\u6bb5"}, {"key": "c1", "label": "\u7c7b\u578b"}, {"key": "c2", "label": "\u957f\u5ea6"}, {"key": "c3", "label": "\u8bf4\u660e"}]}], "diagram": "page-layout", "related": [{"url": "/wiki/tableam/?v=14", "label": "Table AM"}, {"url": "/wiki/relopts/?v=14", "label": "\u5b58\u50a8\u53c2\u6570"}], "release": {"ref": "https://ftp.postgresql.org/pub/source/v14.24/postgresql-14.24.tar.bz2", "label": "14.24", "major": "14", "channel": "stable", "revision": "a7fa7ed3d558172355f51406097a7bd4f6b473be80f311ef7cda96bf383d8897"}, "sources": [{"url": "https://pg.center/docs/14/storage-page-layout.html", "path": "storage-page-layout.html", "label": "PostgreSQL 14 English manual", "sha256": "0086151fad97655a71308a5389066374e3e178c423cb855b4084e7a2c3b078c5", "language": "en", "original_url": "/docs/14/storage-page-layout.html"}], "sections": [], "signature": "", "description": ["\u672c\u8282\u6982\u8ff0 PostgreSQL \u8868\u548c\u7d22\u5f15\u5185\u90e8\u6240\u4f7f\u7528\u7684\u9875\u9762\u683c\u5f0f\u3002 [17] \u5e8f\u5217\u548c TOAST \u8868\u7684\u683c\u5f0f\u4e0e\u666e\u901a\u8868\u76f8\u540c\u3002"], "manual_html": "<div class=\"sect1\">\n<div class=\"titlepage\">\n<div>\n<div>\n<h2 class=\"title\" lang=\"zh\">\n<div>\n<div>\n<h2 class=\"title\" style=\"clear: both\">70.6.\u00a0\u6570\u636e\u5e93\u9875\u9762\u5e03\u5c40 </h2>\n</div>\n</div>\n</h2>\n</div>\n</div>\n</div>\n<p lang=\"zh\">\u672c\u8282\u6982\u8ff0 <span class=\"productname\">PostgreSQL</span> \u8868\u548c\u7d22\u5f15\u5185\u90e8\u6240\u4f7f\u7528\u7684\u9875\u9762\u683c\u5f0f\u3002<a class=\"footnote\" href=\"/docs/14/storage-page-layout.html#ftn.id-1.10.22.8.2.2\"><sup class=\"footnote\" id=\"id-1.10.22.8.2.2\">[17]</sup></a> \u5e8f\u5217\u548c <acronym class=\"acronym\">TOAST</acronym> \u8868\u7684\u683c\u5f0f\u4e0e\u666e\u901a\u8868\u76f8\u540c\u3002</p>\n<p lang=\"zh\">\u5728\u4e0b\u9762\u7684\u8bf4\u660e\u4e2d\uff0c\u5047\u5b9a\u4e00\u4e2a<em class=\"firstterm\">\u5b57\u8282</em>\u5305\u542b 8 \u4e2a\u4f4d\u3002\u53e6\u5916\uff0c\u672f\u8bed<em class=\"firstterm\">\u9879</em>\u6307\u7684\u662f\u5b58\u50a8\u5728\u9875\u9762\u4e0a\u7684\u5355\u4e2a\u6570\u636e\u503c\u3002\u5728\u8868\u4e2d\uff0c\u9879\u662f\u4e00\u884c\uff1b\u5728\u7d22\u5f15\u4e2d\uff0c\u9879\u662f\u4e00\u6761\u7d22\u5f15\u6761\u76ee\u3002</p>\n<p lang=\"zh\">\u6bcf\u4e2a\u8868\u548c\u7d22\u5f15\u90fd\u5b58\u50a8\u4e3a\u56fa\u5b9a\u5927\u5c0f\u7684<em class=\"firstterm\">\u9875\u9762</em>\u6570\u7ec4\uff08\u901a\u5e38\u4e3a 8 kB\uff0c\u4e0d\u8fc7\u5728\u7f16\u8bd1\u670d\u52a1\u5668\u65f6\u53ef\u4ee5\u9009\u62e9\u4e0d\u540c\u7684\u9875\u9762\u5927\u5c0f\uff09\u3002\u5728\u8868\u4e2d\uff0c\u6240\u6709\u9875\u9762\u5728\u903b\u8f91\u4e0a\u90fd\u662f\u7b49\u4ef7\u7684\uff0c\u56e0\u6b64\u67d0\u4e2a\u7279\u5b9a\u9879\uff08\u884c\uff09\u53ef\u4ee5\u5b58\u653e\u5728\u4efb\u610f\u9875\u9762\u4e2d\u3002\u5728\u7d22\u5f15\u4e2d\uff0c\u7b2c\u4e00\u9875\u901a\u5e38\u4fdd\u7559\u4e3a<em class=\"firstterm\">\u5143\u9875</em>\uff0c\u7528\u4e8e\u4fdd\u5b58\u63a7\u5236\u4fe1\u606f\uff1b\u5e76\u4e14\u6839\u636e\u7d22\u5f15\u8bbf\u95ee\u65b9\u6cd5\u7684\u4e0d\u540c\uff0c\u7d22\u5f15\u4e2d\u8fd8\u53ef\u80fd\u5b58\u5728\u4e0d\u540c\u7c7b\u578b\u7684\u9875\u9762\u3002</p>\n<p lang=\"zh\"><a class=\"xref\" href=\"/docs/14/storage-page-layout.html#PAGE-TABLE\" title=\"\u8868\u00a070.2.\u00a0\u603b\u4f53\u9875\u9762\u5e03\u5c40\">\u8868\u00a070.2</a>\u5c55\u793a\u4e86\u9875\u9762\u7684\u603b\u4f53\u5e03\u5c40\u3002\u6bcf\u4e2a\u9875\u9762\u5305\u542b\u4e94\u4e2a\u90e8\u5206\u3002</p>\n<div class=\"table\">\n<p class=\"title\" lang=\"zh\"><strong>\u8868\u00a070.2.\u00a0\u603b\u4f53\u9875\u9762\u5e03\u5c40</strong></p>\n<div class=\"table-contents\">\n<table class=\"table\">\n<thead>\n<tr>\n<th lang=\"zh\">\u9879\u76ee</th>\n<th lang=\"zh\">\u8bf4\u660e</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>PageHeaderData</td>\n<td lang=\"zh\">\u957f 24 \u5b57\u8282\uff0c\u5305\u542b\u9875\u9762\u7684\u901a\u7528\u4fe1\u606f\uff0c\u4f8b\u5982\u7a7a\u95f2\u7a7a\u95f4\u6307\u9488\u3002</td>\n</tr>\n<tr>\n<td>ItemIdData</td>\n<td lang=\"zh\">\u6307\u5411\u5b9e\u9645\u6570\u636e\u9879\u7684\u884c\u6307\u9488\u6570\u7ec4\u3002\u6bcf\u9879\u4e3a\u4e00\u4e2a\uff08\u504f\u79fb\uff0c\u957f\u5ea6\uff09\u5bf9\uff0c\u5360 4 \u5b57\u8282\u3002</td>\n</tr>\n<tr>\n<td lang=\"zh\">\u7a7a\u95f2\u7a7a\u95f4</td>\n<td lang=\"zh\">\u5c1a\u672a\u5206\u914d\u7684\u7a7a\u95f4\u3002\u65b0\u884c\u6307\u9488\u4ece\u8be5\u533a\u57df\u7684\u8d77\u59cb\u5904\u5206\u914d\uff0c\u65b0\u6570\u636e\u9879\u4ece\u672b\u5c3e\u5904\u5206\u914d\u3002</td>\n</tr>\n<tr>\n<td lang=\"zh\">\u9879</td>\n<td lang=\"zh\">\u5b9e\u9645\u7684\u6570\u636e\u9879\u672c\u8eab\u3002</td>\n</tr>\n<tr>\n<td lang=\"zh\">\u7279\u6b8a\u7a7a\u95f4</td>\n<td lang=\"zh\">\u7d22\u5f15\u8bbf\u95ee\u65b9\u6cd5\u4e13\u7528\u6570\u636e\u3002\u4e0d\u540c\u65b9\u6cd5\u5b58\u50a8\u7684\u5185\u5bb9\u4e0d\u540c\uff0c\u666e\u901a\u8868\u4e2d\u6b64\u533a\u57df\u4e3a\u7a7a\u3002</td>\n</tr>\n</tbody>\n</table>\n</div>\n</div><br class=\"table-break\"/>\n<p lang=\"zh\">\u6bcf\u9875\u7684\u524d 24 \u5b57\u8282\u662f\u9875\u9996\u90e8 PageHeaderData\uff0c\u8be6\u7ec6\u683c\u5f0f\u89c1\u8868 70.3\u3002\u7b2c\u4e00\u4e2a\u5b57\u6bb5\u8ddf\u8e2a\u4e0e\u8be5\u9875\u76f8\u5173\u7684\u6700\u8fd1\u4e00\u6761 WAL \u8bb0\u5f55\uff1b\u7b2c\u4e8c\u4e2a\u5b57\u6bb5\u5728\u542f\u7528\u6570\u636e\u6821\u9a8c\u548c\u65f6\u4fdd\u5b58\u9875\u9762\u6821\u9a8c\u548c\u3002\u4e4b\u540e\u662f\u4e00\u4e2a\u5305\u542b\u6807\u5fd7\u4f4d\u7684 2 \u5b57\u8282\u5b57\u6bb5\uff0c\u518d\u540e\u9762\u662f\u4e09\u4e2a 2 \u5b57\u8282\u6574\u6570 pd_lower\u3001pd_upper \u548c pd_special\uff0c\u5206\u522b\u8bb0\u5f55\u4ece\u9875\u8d77\u70b9\u5230\u672a\u5206\u914d\u7a7a\u95f4\u8d77\u70b9\u3001\u672a\u5206\u914d\u7a7a\u95f4\u7ec8\u70b9\u53ca\u7279\u6b8a\u7a7a\u95f4\u8d77\u70b9\u7684\u5b57\u8282\u504f\u79fb\u91cf\u3002\u63a5\u4e0b\u6765\u7684 2 \u5b57\u8282 pd_pagesize_version \u540c\u65f6\u4fdd\u5b58\u9875\u5927\u5c0f\u548c\u7248\u672c\u6807\u8bc6\u3002PostgreSQL 8.3 \u8d77\u7248\u672c\u53f7\u4e3a 4\uff1b8.1 \u4e0e 8.2 \u4f7f\u7528 3\uff1b8.0 \u4f7f\u7528 2\uff1b7.3 \u4e0e 7.4 \u4f7f\u7528 1\uff1b\u66f4\u65e9\u7248\u672c\u4f7f\u7528 0\u3002\u591a\u6570\u7248\u672c\u7684\u57fa\u672c\u9875\u9762\u5e03\u5c40\u548c\u9996\u90e8\u683c\u5f0f\u5e76\u672a\u53d8\u5316\uff0c\u4f46\u5806\u884c\u9996\u90e8\u5e03\u5c40\u6709\u53d8\u5316\u3002\u9875\u5927\u5c0f\u57fa\u672c\u53ea\u7528\u4e8e\u4ea4\u53c9\u68c0\u67e5\uff1b\u540c\u4e00\u5b89\u88c5\u4e0d\u652f\u6301\u591a\u79cd\u9875\u5927\u5c0f\u3002\u6700\u540e\u4e00\u4e2a\u5b57\u6bb5\u63d0\u793a\u4fee\u526a\u8be5\u9875\u662f\u5426\u53ef\u80fd\u6709\u76ca\uff0c\u8bb0\u5f55\u8be5\u9875\u6700\u65e9\u7684\u5c1a\u672a\u4fee\u526a\u7684 XMAX\u3002</p>\n<div class=\"table\">\n<p class=\"title\" lang=\"zh\"><strong>\u8868\u00a070.3.\u00a0PageHeaderData \u5e03\u5c40</strong></p>\n<div class=\"table-contents\">\n<table class=\"table\">\n<thead>\n<tr>\n<th lang=\"zh\">\u5b57\u6bb5</th>\n<th lang=\"zh\">\u7c7b\u578b</th>\n<th lang=\"zh\">\u957f\u5ea6</th>\n<th lang=\"zh\">\u8bf4\u660e</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>pd_lsn</td>\n<td>PageXLogRecPtr</td>\n<td lang=\"zh\">8 \u5b57\u8282</td>\n<td lang=\"zh\">LSN\uff1a\u8be5\u9875\u6700\u540e\u4e00\u6b21\u53d8\u5316\u6240\u5bf9\u5e94 WAL \u8bb0\u5f55\u7684\u6700\u540e\u4e00\u4e2a\u5b57\u8282\u4e4b\u540e\u7684\u4f4d\u7f6e\u3002</td>\n</tr>\n<tr>\n<td>pd_checksum</td>\n<td>uint16</td>\n<td lang=\"zh\">2 \u5b57\u8282</td>\n<td lang=\"zh\">\u9875\u9762\u6821\u9a8c\u548c</td>\n</tr>\n<tr>\n<td>pd_flags</td>\n<td>uint16</td>\n<td lang=\"zh\">2 \u5b57\u8282</td>\n<td lang=\"zh\">\u6807\u5fd7\u4f4d</td>\n</tr>\n<tr>\n<td>pd_lower</td>\n<td>LocationIndex</td>\n<td lang=\"zh\">2 \u5b57\u8282</td>\n<td lang=\"zh\">\u7a7a\u95f2\u7a7a\u95f4\u8d77\u59cb\u4f4d\u7f6e\u7684\u504f\u79fb\u91cf</td>\n</tr>\n<tr>\n<td>pd_upper</td>\n<td>LocationIndex</td>\n<td lang=\"zh\">2 \u5b57\u8282</td>\n<td lang=\"zh\">\u7a7a\u95f2\u7a7a\u95f4\u7ed3\u675f\u4f4d\u7f6e\u7684\u504f\u79fb\u91cf</td>\n</tr>\n<tr>\n<td>pd_special</td>\n<td>LocationIndex</td>\n<td lang=\"zh\">2 \u5b57\u8282</td>\n<td lang=\"zh\">\u7279\u6b8a\u7a7a\u95f4\u8d77\u59cb\u4f4d\u7f6e\u7684\u504f\u79fb\u91cf</td>\n</tr>\n<tr>\n<td>pd_pagesize_version</td>\n<td>uint16</td>\n<td lang=\"zh\">2 \u5b57\u8282</td>\n<td lang=\"zh\">\u9875\u9762\u5927\u5c0f\u4e0e\u5e03\u5c40\u7248\u672c\u53f7\u4fe1\u606f</td>\n</tr>\n<tr>\n<td>pd_prune_xid</td>\n<td>TransactionId</td>\n<td lang=\"zh\">4 \u5b57\u8282</td>\n<td lang=\"zh\">\u9875\u9762\u4e0a\u6700\u65e9\u7684\u5c1a\u672a\u4fee\u526a\u7684 XMAX\uff1b\u6ca1\u6709\u5219\u4e3a\u96f6</td>\n</tr>\n</tbody>\n</table>\n</div>\n</div><br class=\"table-break\"/>\n<p lang=\"zh\">\u6240\u6709\u7ec6\u8282\u90fd\u53ef\u4ee5\u5728 <code class=\"filename\">src/include/storage/bufpage.h</code> \u4e2d\u627e\u5230\u3002</p>\n<p lang=\"zh\">\u9875\u5934\u4e4b\u540e\u662f\u9879\u6807\u8bc6\u7b26\uff08<code class=\"type\">ItemIdData</code>\uff09\uff0c\u6bcf\u4e2a\u9700\u8981\u56db\u4e2a\u5b57\u8282\u3002\u4e00\u4e2a\u9879\u6807\u8bc6\u7b26\u5305\u542b\u9879\u8d77\u59cb\u4f4d\u7f6e\u7684\u5b57\u8282\u504f\u79fb\u91cf\u3001\u5176\u5b57\u8282\u957f\u5ea6\uff0c\u4ee5\u53ca\u82e5\u5e72\u5f71\u54cd\u89e3\u91ca\u65b9\u5f0f\u7684\u5c5e\u6027\u4f4d\u3002\u65b0\u7684\u9879\u6807\u8bc6\u7b26\u4f1a\u6839\u636e\u9700\u8981\u4ece\u672a\u5206\u914d\u7a7a\u95f4\u7684\u8d77\u59cb\u5904\u5206\u914d\u3002\u5f53\u524d\u5df2\u6709\u591a\u5c11\u4e2a\u9879\u6807\u8bc6\u7b26\uff0c\u53ef\u4ee5\u901a\u8fc7\u67e5\u770b <code class=\"structfield\">pd_lower</code> \u5f97\u77e5\uff1b\u5206\u914d\u65b0\u6807\u8bc6\u7b26\u65f6\u5b83\u4f1a\u589e\u52a0\u3002\u56e0\u4e3a\u4e00\u4e2a\u9879\u6807\u8bc6\u7b26\u5728\u88ab\u91ca\u653e\u4e4b\u524d\u6c38\u8fdc\u4e0d\u4f1a\u79fb\u52a8\uff0c\u6240\u4ee5\u5373\u4f7f\u9879\u672c\u8eab\u4e3a\u4e86\u6574\u7406\u7a7a\u95f2\u7a7a\u95f4\u800c\u5728\u9875\u9762\u5185\u79fb\u52a8\uff0c\u5176\u7d22\u5f15\u4ecd\u7136\u53ef\u4ee5\u88ab\u957f\u671f\u7528\u6765\u5f15\u7528\u8be5\u9879\u3002\u4e8b\u5b9e\u4e0a\uff0c\u6bcf\u4e2a\u6307\u5411\u9879\u7684\u6307\u9488\uff08<code class=\"type\">ItemPointer</code>\uff0c\u4e5f\u79f0 <code class=\"type\">CTID</code>\uff09\u5728 <span class=\"productname\">PostgreSQL</span> \u4e2d\u90fd\u7531\u9875\u53f7\u548c\u9879\u6807\u8bc6\u7b26\u7d22\u5f15\u6784\u6210\u3002</p>\n<p lang=\"zh\">\u9879\u672c\u8eab\u5b58\u50a8\u5728\u4ece\u672a\u5206\u914d\u7a7a\u95f4\u672b\u5c3e\u5f00\u59cb\u3001\u5411\u540e\u5206\u914d\u7684\u533a\u57df\u4e2d\u3002\u5176\u786e\u5207\u7ed3\u6784\u53d6\u51b3\u4e8e\u8868\u8981\u5305\u542b\u4ec0\u4e48\u5185\u5bb9\u3002\u8868\u548c\u5e8f\u5217\u90fd\u4f7f\u7528\u4e00\u79cd\u540d\u4e3a <code class=\"type\">HeapTupleHeaderData</code> \u7684\u7ed3\u6784\u4f53\uff0c\u5982\u4e0b\u6240\u8ff0\u3002</p>\n<p lang=\"zh\">\u6700\u540e\u4e00\u90e8\u5206\u662f<span class=\"quote\">\u201c<span class=\"quote\">\u7279\u6b8a\u90e8\u5206</span>\u201d</span>\uff0c\u5176\u4e2d\u53ef\u4ee5\u5b58\u653e\u8bbf\u95ee\u65b9\u6cd5\u5e0c\u671b\u4fdd\u5b58\u7684\u4efb\u4f55\u5185\u5bb9\u3002\u4f8b\u5982\uff0cB-\u6811\u7d22\u5f15\u4f1a\u5728\u8fd9\u91cc\u4fdd\u5b58\u6307\u5411\u9875\u9762\u5de6\u3001\u53f3\u5144\u5f1f\u7684\u94fe\u63a5\uff0c\u4ee5\u53ca\u5176\u4ed6\u4e00\u4e9b\u4e0e\u7d22\u5f15\u7ed3\u6784\u76f8\u5173\u7684\u6570\u636e\u3002\u666e\u901a\u8868\u5b8c\u5168\u4e0d\u4f7f\u7528\u7279\u6b8a\u90e8\u5206\uff08\u901a\u8fc7\u5c06 <code class=\"structfield\">pd_special</code> \u8bbe\u4e3a\u9875\u9762\u5927\u5c0f\u6765\u8868\u793a\uff09\u3002</p>\n<p lang=\"zh\"><a class=\"xref\" href=\"/docs/14/storage-page-layout.html#STORAGE-PAGE-LAYOUT-FIGURE\" title=\"\u56fe\u00a070.1.\u00a0\u9875\u9762\u5e03\u5c40\">\u56fe\u00a070.1</a>\u5c55\u793a\u4e86\u8fd9\u4e9b\u90e8\u5206\u5728\u9875\u9762\u4e2d\u7684\u5e03\u5c40\u65b9\u5f0f\u3002</p>\n<div class=\"figure col-xl-8 col-lg-10 col-md-12\">\n<p class=\"title\" lang=\"zh\">\n<p class=\"title\"><strong>\u56fe\u00a070.1.\u00a0\u9875\u9762\u5e03\u5c40</strong></p>\n<div class=\"figure-contents\">\n<div class=\"mediaobject\">\n<object data=\"pagelayout.svg\" type=\"image/svg+xml\" width=\"100%\">\n</object>\n</div>\n</div>\n</p>\n<div class=\"figure-contents\">\n<div class=\"mediaobject\">\n</div>\n</div>\n</div><br class=\"figure-break\"/>\n<div class=\"sect2\">\n<div class=\"titlepage\">\n<div>\n<div>\n<h3 class=\"title\" lang=\"zh\">\n<dl class=\"toc\">\n<dt><span class=\"sect2\"><a href=\"/docs/14/storage-page-layout.html#STORAGE-TUPLE-LAYOUT\">70.6.1. \u8868\u884c\u5e03\u5c40</a></span></dt>\n</dl>\n</h3>\n</div>\n</div>\n</div>\n<p lang=\"zh\">\u6240\u6709\u8868\u884c\u7684\u7ed3\u6784\u90fd\u76f8\u540c\u3002\u5b83\u4eec\u90fd\u6709\u4e00\u4e2a\u56fa\u5b9a\u5927\u5c0f\u7684\u5934\u90e8\uff08\u5728\u5927\u591a\u6570\u673a\u5668\u4e0a\u5360 23 \u5b57\u8282\uff09\uff0c\u540e\u9762\u8ddf\u7740\u53ef\u9009\u7684\u7a7a\u503c\u4f4d\u56fe\u3001\u53ef\u9009\u7684\u5bf9\u8c61 ID \u5b57\u6bb5\u4ee5\u53ca\u7528\u6237\u6570\u636e\u3002\u5934\u90e8\u7684\u8be6\u7ec6\u683c\u5f0f\u89c1<a class=\"xref\" href=\"/docs/14/storage-page-layout.html#HEAPTUPLEHEADERDATA-TABLE\" title=\"\u8868\u00a070.4.\u00a0HeapTupleHeaderData \u5e03\u5c40\">\u8868\u00a070.4</a>\u3002\u5b9e\u9645\u7528\u6237\u6570\u636e\uff08\u884c\u7684\u5404\u5217\uff09\u4ece <code class=\"structfield\">t_hoff</code> \u6307\u793a\u7684\u504f\u79fb\u4f4d\u7f6e\u5f00\u59cb\uff0c\u5b83\u5fc5\u987b\u59cb\u7ec8\u662f\u8be5\u5e73\u53f0 MAXALIGN \u5bf9\u9f50\u5355\u4f4d\u7684\u6574\u6570\u500d\u3002\u53ea\u6709\u5f53 <em class=\"firstterm\">HEAP_HASNULL</em> \u4f4d\u5728 <code class=\"structfield\">t_infomask</code> \u4e2d\u88ab\u7f6e\u4f4d\u65f6\uff0c\u7a7a\u503c\u4f4d\u56fe\u624d\u5b58\u5728\u3002\u82e5\u5b58\u5728\uff0c\u5b83\u7d27\u968f\u56fa\u5b9a\u5934\u90e8\u4e4b\u540e\uff0c\u5e76\u5360\u7528\u8db3\u591f\u591a\u7684\u5b57\u8282\uff0c\u4ee5\u4fbf\u4e3a\u6bcf\u4e2a\u6570\u636e\u5217\u63d0\u4f9b\u4e00\u4f4d\uff08\u4e5f\u5c31\u662f\u8bf4\uff0c\u5176\u4f4d\u6570\u7b49\u4e8e <code class=\"structfield\">t_infomask2</code> \u4e2d\u7684\u5c5e\u6027\u4e2a\u6570\uff09\u3002\u5728\u8fd9\u4e2a\u4f4d\u56fe\u4e2d\uff0c1 \u8868\u793a\u975e\u7a7a\uff0c0 \u8868\u793a\u7a7a\u503c\u3002\u5f53\u4f4d\u56fe\u4e0d\u5b58\u5728\u65f6\uff0c\u5047\u5b9a\u6240\u6709\u5217\u90fd\u975e\u7a7a\u3002\u53ea\u6709\u5f53 <em class=\"firstterm\">HEAP_HASOID_OLD</em> \u4f4d\u5728 <code class=\"structfield\">t_infomask</code> \u4e2d\u88ab\u7f6e\u4f4d\u65f6\uff0c\u5bf9\u8c61 ID \u624d\u5b58\u5728\u3002\u82e5\u5b58\u5728\uff0c\u5b83\u4f4d\u4e8e <code class=\"structfield\">t_hoff</code> \u8fb9\u754c\u4e4b\u524d\u3002\u4e3a\u4e86\u8ba9 <code class=\"structfield\">t_hoff</code> \u6210\u4e3a MAXALIGN \u7684\u6574\u6570\u500d\u6240\u9700\u7684\u4efb\u4f55\u586b\u5145\uff0c\u90fd\u4f1a\u51fa\u73b0\u5728\u7a7a\u503c\u4f4d\u56fe\u4e0e\u5bf9\u8c61 ID \u4e4b\u95f4\u3002\uff08\u8fd9\u53c8\u53cd\u8fc7\u6765\u4fdd\u8bc1\u4e86\u5bf9\u8c61 ID \u7684\u5bf9\u9f50\u662f\u5408\u9002\u7684\u3002\uff09</p>\n<div class=\"table\">\n<p class=\"title\" lang=\"zh\"><strong>\u8868\u00a070.4.\u00a0HeapTupleHeaderData \u5e03\u5c40</strong></p>\n<div class=\"table-contents\">\n<table class=\"table\">\n<thead>\n<tr>\n<th lang=\"zh\">\u5b57\u6bb5</th>\n<th lang=\"zh\">\u7c7b\u578b</th>\n<th lang=\"zh\">\u957f\u5ea6</th>\n<th lang=\"zh\">\u8bf4\u660e</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>t_xmin</td>\n<td>TransactionId</td>\n<td lang=\"zh\">4 \u5b57\u8282</td>\n<td lang=\"zh\">\u63d2\u5165\u4e8b\u52a1\u7684 XID</td>\n</tr>\n<tr>\n<td>t_xmax</td>\n<td>TransactionId</td>\n<td lang=\"zh\">4 \u5b57\u8282</td>\n<td lang=\"zh\">\u5220\u9664\u4e8b\u52a1\u7684 XID</td>\n</tr>\n<tr>\n<td>t_cid</td>\n<td>CommandId</td>\n<td lang=\"zh\">4 \u5b57\u8282</td>\n<td lang=\"zh\">\u63d2\u5165\u548c\uff0f\u6216\u5220\u9664\u547d\u4ee4\u7684 CID\uff0c\u4e0e t_xvac \u5171\u7528\u5b58\u50a8\u4f4d\u7f6e</td>\n</tr>\n<tr>\n<td>t_xvac</td>\n<td>TransactionId</td>\n<td lang=\"zh\">4 \u5b57\u8282</td>\n<td lang=\"zh\">VACUUM \u64cd\u4f5c\u79fb\u52a8\u884c\u7248\u672c\u65f6\u4f7f\u7528\u7684 XID</td>\n</tr>\n<tr>\n<td>t_ctid</td>\n<td>ItemPointerData</td>\n<td lang=\"zh\">6 \u5b57\u8282</td>\n<td lang=\"zh\">\u672c\u884c\u7248\u672c\u6216\u8f83\u65b0\u884c\u7248\u672c\u7684\u5f53\u524d TID</td>\n</tr>\n<tr>\n<td>t_infomask2</td>\n<td>uint16</td>\n<td lang=\"zh\">2 \u5b57\u8282</td>\n<td lang=\"zh\">\u5c5e\u6027\u6570\u91cf\u53ca\u5404\u79cd\u6807\u5fd7\u4f4d</td>\n</tr>\n<tr>\n<td>t_infomask</td>\n<td>uint16</td>\n<td lang=\"zh\">2 \u5b57\u8282</td>\n<td lang=\"zh\">\u5404\u79cd\u6807\u5fd7\u4f4d</td>\n</tr>\n<tr>\n<td>t_hoff</td>\n<td>uint8</td>\n<td lang=\"zh\">1 \u5b57\u8282</td>\n<td lang=\"zh\">\u7528\u6237\u6570\u636e\u7684\u504f\u79fb\u91cf</td>\n</tr>\n</tbody>\n</table>\n</div>\n</div><br class=\"table-break\"/>\n<p lang=\"zh\">\u6240\u6709\u7ec6\u8282\u90fd\u53ef\u4ee5\u5728 <code class=\"filename\">src/include/access/htup_details.h</code> \u4e2d\u627e\u5230\u3002</p>\n<p lang=\"zh\">\u8981\u89e3\u91ca\u5b9e\u9645\u6570\u636e\uff0c\u5fc5\u987b\u501f\u52a9\u4ece\u5176\u4ed6\u8868\u4e2d\u83b7\u5f97\u7684\u4fe1\u606f\uff0c\u5176\u4e2d\u5927\u90e8\u5206\u6765\u81ea <code class=\"structname\">pg_attribute</code>\u3002\u8bc6\u522b\u5b57\u6bb5\u4f4d\u7f6e\u6240\u9700\u7684\u5173\u952e\u503c\u662f <code class=\"structfield\">attlen</code> \u548c <code class=\"structfield\">attalign</code>\u3002\u9664\u975e\u6240\u6709\u5b57\u6bb5\u90fd\u662f\u5b9a\u5bbd\u4e14\u6ca1\u6709\u7a7a\u503c\uff0c\u5426\u5219\u6ca1\u6709\u529e\u6cd5\u76f4\u63a5\u53d6\u5f97\u67d0\u4e2a\u7279\u5b9a\u5c5e\u6027\u3002\u6240\u6709\u8fd9\u4e9b\u6280\u5de7\u90fd\u5c01\u88c5\u5728 <em class=\"firstterm\">heap_getattr</em>\u3001<em class=\"firstterm\">fastgetattr</em> \u548c <em class=\"firstterm\">heap_getsysattr</em> \u8fd9\u4e9b\u51fd\u6570\u4e2d\u3002</p>\n<p lang=\"zh\">\u8bfb\u53d6\u6570\u636e\u65f6\uff0c\u9700\u8981\u4f9d\u6b21\u68c0\u67e5\u6bcf\u4e2a\u5c5e\u6027\u3002\u9996\u5148\u6839\u636e\u7a7a\u503c\u4f4d\u56fe\u5224\u65ad\u8be5\u5b57\u6bb5\u662f\u5426\u4e3a NULL\u3002\u5982\u679c\u662f\uff0c\u5c31\u7ee7\u7eed\u4e0b\u4e00\u4e2a\u3002\u7136\u540e\u786e\u8ba4\u5bf9\u9f50\u662f\u5426\u6b63\u786e\u3002\u5982\u679c\u5b57\u6bb5\u662f\u5b9a\u5bbd\u5b57\u6bb5\uff0c\u90a3\u4e48\u5b83\u7684\u6240\u6709\u5b57\u8282\u90fd\u662f\u76f4\u63a5\u6446\u653e\u7684\uff1b\u5982\u679c\u5b83\u662f\u53d8\u957f\u5b57\u6bb5\uff08attlen = -1\uff09\uff0c\u60c5\u51b5\u5c31\u4f1a\u7a0d\u590d\u6742\u4e00\u4e9b\u3002\u6240\u6709\u53d8\u957f\u6570\u636e\u7c7b\u578b\u90fd\u5171\u4eab\u4e00\u4e2a\u901a\u7528\u5934\u90e8\u7ed3\u6784\u4f53 <code class=\"type\">struct varlena</code>\uff0c\u5176\u4e2d\u5305\u542b\u5df2\u5b58\u50a8\u503c\u7684\u603b\u957f\u5ea6\u4ee5\u53ca\u4e00\u4e9b\u6807\u5fd7\u4f4d\u3002\u6839\u636e\u8fd9\u4e9b\u6807\u5fd7\uff0c\u6570\u636e\u53ef\u80fd\u662f\u884c\u5185\u5b58\u50a8\u7684\uff0c\u4e5f\u53ef\u80fd\u4f4d\u4e8e <acronym class=\"acronym\">TOAST</acronym> \u8868\u4e2d\uff1b\u5b83\u4e5f\u53ef\u80fd\u662f\u7ecf\u8fc7\u538b\u7f29\u7684\uff08\u89c1<a class=\"xref\" href=\"/docs/14/storage-toast.html\" title=\"70.2.\u00a0TOAST\">\u7b2c\u00a070.2\u00a0\u8282</a>\uff09\u3002</p>\n</div>\n<div class=\"footnotes\">\n<br/>\n<hr/>\n<div class=\"footnote\">\n<p lang=\"zh\">\n<br/>\n<hr style=\"width:100; text-align:left;margin-left: 0\"/>\n<div class=\"footnote\" id=\"ftn.id-1.10.22.8.2.2\">\n<p><a class=\"para\" href=\"/docs/14/storage-page-layout.html#id-1.10.22.8.2.2\"><sup class=\"para\">[17]</sup></a> \u5b9e\u9645\u4e0a\uff0c\u8868\u8bbf\u95ee\u65b9\u6cd5\u548c\u7d22\u5f15\u8bbf\u95ee\u65b9\u6cd5\u90fd\u4e0d\u8981\u6c42\u5fc5\u987b\u4f7f\u7528\u8fd9\u79cd\u9875\u9762\u683c\u5f0f\u3002<code class=\"literal\">heap</code> \u8868\u8bbf\u95ee\u65b9\u6cd5\u59cb\u7ec8\u4f7f\u7528\u8fd9\u79cd\u683c\u5f0f\u3002\u73b0\u6709\u7684\u6240\u6709\u7d22\u5f15\u65b9\u6cd5\u4e5f\u90fd\u4f7f\u7528\u8fd9\u79cd\u57fa\u672c\u683c\u5f0f\uff0c\u4f46\u7d22\u5f15\u5143\u9875\u4e2d\u4fdd\u5b58\u7684\u6570\u636e\u901a\u5e38\u5e76\u4e0d\u9075\u5faa\u9879\u5e03\u5c40\u89c4\u5219\u3002</p>\n</div>\n</p>\n</div>\n</div>\n</div>", "manual_path": "/docs/14/storage-page-layout.html", "localization": {"status": "complete", "sources": [{"url": "/docs/14/storage-page-layout.html", "method": "same-major semantic node", "sha256": "715a2f826a4e1ec9a3eae2da9e5746928bdaf5a5b7e05ee60ed9eedf4ab90747", "language": "zh", "matched_nodes": ["#STORAGE-PAGE-LAYOUT/div[0]", "#STORAGE-PAGE-LAYOUT/div[16]", "#STORAGE-PAGE-LAYOUT/div[18]/div[2]/p[0]", "#STORAGE-PAGE-LAYOUT/div[18]/p[1]", "#STORAGE-PAGE-LAYOUT/div[18]/p[4]", "#STORAGE-PAGE-LAYOUT/div[18]/p[5]", "#STORAGE-PAGE-LAYOUT/div[18]/p[6]", "#STORAGE-PAGE-LAYOUT/div[19]", "#STORAGE-PAGE-LAYOUT/div[1]", "#STORAGE-PAGE-LAYOUT/div[6]/div[1]/table[0]/tbody[2]/tr[3]/td[0]", "#STORAGE-PAGE-LAYOUT/div[6]/p[0]", "#STORAGE-PAGE-LAYOUT/div[9]/div[1]/table[0]/tbody[2]/tr[0]/td[2]", "#STORAGE-PAGE-LAYOUT/div[9]/p[0]", "#STORAGE-PAGE-LAYOUT/p[11]", "#STORAGE-PAGE-LAYOUT/p[12]", "#STORAGE-PAGE-LAYOUT/p[13]", "#STORAGE-PAGE-LAYOUT/p[14]", "#STORAGE-PAGE-LAYOUT/p[15]", "#STORAGE-PAGE-LAYOUT/p[2]", "#STORAGE-PAGE-LAYOUT/p[3]", "#STORAGE-PAGE-LAYOUT/p[4]", "#STORAGE-PAGE-LAYOUT/p[5]"]}], "language": "zh", "original_text": {"/versions/14/description/0": "This section provides an overview of the page format used within PostgreSQL tables and indexes. [17] Sequences and TOAST tables are formatted just like a regular table.", "/versions/14/facts/0/label": "Definition scope", "/versions/14/facts/0/value": "Same-version core physical storage documentation", "/versions/14/tables/0/title": "Overall Page Layout", "/versions/14/tables/1/title": "PageHeaderData Layout", "/versions/14/tables/2/title": "HeapTupleHeaderData Layout", "/versions/14/related/1/label": "Storage Parameters", "/versions/14/tables/0/rows/0/c1": "24 bytes long. Contains general information about the page, including free space pointers.", "/versions/14/tables/0/rows/1/c1": "Array of item identifiers pointing to the actual items. Each entry is an (offset,length) pair. 4 bytes per item.", "/versions/14/tables/0/rows/2/c0": "Free space", "/versions/14/tables/0/rows/2/c1": "The unallocated space. New item identifiers are allocated from the start of this area, new items from the end.", "/versions/14/tables/0/rows/3/c0": "Items", "/versions/14/tables/0/rows/3/c1": "The actual items themselves.", "/versions/14/tables/0/rows/4/c0": "Special space", "/versions/14/tables/0/rows/4/c1": "Index access method specific data. Different methods store different data. Empty in ordinary tables.", "/versions/14/tables/1/rows/0/c2": "8 bytes", "/versions/14/tables/1/rows/0/c3": "LSN: next byte after last byte of WAL record for last change to this page", "/versions/14/tables/1/rows/1/c2": "2 bytes", "/versions/14/tables/1/rows/1/c3": "Page checksum", "/versions/14/tables/1/rows/2/c2": "2 bytes", "/versions/14/tables/1/rows/2/c3": "Flag bits", "/versions/14/tables/1/rows/3/c2": "2 bytes", "/versions/14/tables/1/rows/3/c3": "Offset to start of free space", "/versions/14/tables/1/rows/4/c2": "2 bytes", "/versions/14/tables/1/rows/4/c3": "Offset to end of free space", "/versions/14/tables/1/rows/5/c2": "2 bytes", "/versions/14/tables/1/rows/5/c3": "Offset to start of special space", "/versions/14/tables/1/rows/6/c2": "2 bytes", "/versions/14/tables/1/rows/6/c3": "Page size and layout version number information", "/versions/14/tables/1/rows/7/c2": "4 bytes", "/versions/14/tables/1/rows/7/c3": "Oldest unpruned XMAX on page, or zero if none", "/versions/14/tables/2/rows/0/c2": "4 bytes", "/versions/14/tables/2/rows/0/c3": "insert XID stamp", "/versions/14/tables/2/rows/1/c2": "4 bytes", "/versions/14/tables/2/rows/1/c3": "delete XID stamp", "/versions/14/tables/2/rows/2/c2": "4 bytes", "/versions/14/tables/2/rows/2/c3": "insert and/or delete CID stamp (overlays with t_xvac)", "/versions/14/tables/2/rows/3/c2": "4 bytes", "/versions/14/tables/2/rows/3/c3": "XID for VACUUM operation moving a row version", "/versions/14/tables/2/rows/4/c2": "6 bytes", "/versions/14/tables/2/rows/4/c3": "current TID of this or newer row version", "/versions/14/tables/2/rows/5/c2": "2 bytes", "/versions/14/tables/2/rows/5/c3": "number of attributes, plus various flag bits", "/versions/14/tables/2/rows/6/c2": "2 bytes", "/versions/14/tables/2/rows/6/c3": "various flag bits", "/versions/14/tables/2/rows/7/c2": "1 byte", "/versions/14/tables/2/rows/7/c3": "offset to user data", "/versions/14/tables/0/columns/0/label": "Item", "/versions/14/tables/0/columns/1/label": "Description", "/versions/14/tables/1/columns/0/label": "Field", "/versions/14/tables/1/columns/1/label": "Type", "/versions/14/tables/1/columns/2/label": "Length", "/versions/14/tables/1/columns/3/label": "Description", "/versions/14/tables/2/columns/0/label": "Field", "/versions/14/tables/2/columns/1/label": "Type", "/versions/14/tables/2/columns/2/label": "Length", "/versions/14/tables/2/columns/3/label": "Description"}, "fallback_fields": [], "source_language": "en", "original_snapshot_sha256": "d8a9500aec1fb565a19e9ffdc490074c420a72baa8dec05432da16302224ccf7"}, "comparison_data": {"layouts": [{"key": "layout-0", "rows": [{"c0": "PageHeaderData", "c1": "24 bytes long. Contains general information about the page, including free space pointers."}, {"c0": "ItemIdData", "c1": "Array of item identifiers pointing to the actual items. Each entry is an (offset,length) pair. 4 bytes per item."}, {"c0": "Free space", "c1": "The unallocated space. New item identifiers are allocated from the start of this area, new items from the end."}, {"c0": "Items", "c1": "The actual items themselves."}, {"c0": "Special space", "c1": "Index access method specific data. Different methods store different data. Empty in ordinary tables."}], "title": "Overall Page Layout", "columns": [{"key": "c0", "label": "Item"}, {"key": "c1", "label": "Description"}]}, {"key": "layout-1", "rows": [{"c0": "pd_lsn", "c1": "PageXLogRecPtr", "c2": "8 bytes", "c3": "LSN: next byte after last byte of WAL record for last change to this page"}, {"c0": "pd_checksum", "c1": "uint16", "c2": "2 bytes", "c3": "Page checksum"}, {"c0": "pd_flags", "c1": "uint16", "c2": "2 bytes", "c3": "Flag bits"}, {"c0": "pd_lower", "c1": "LocationIndex", "c2": "2 bytes", "c3": "Offset to start of free space"}, {"c0": "pd_upper", "c1": "LocationIndex", "c2": "2 bytes", "c3": "Offset to end of free space"}, {"c0": "pd_special", "c1": "LocationIndex", "c2": "2 bytes", "c3": "Offset to start of special space"}, {"c0": "pd_pagesize_version", "c1": "uint16", "c2": "2 bytes", "c3": "Page size and layout version number information"}, {"c0": "pd_prune_xid", "c1": "TransactionId", "c2": "4 bytes", "c3": "Oldest unpruned XMAX on page, or zero if none"}], "title": "PageHeaderData Layout", "columns": [{"key": "c0", "label": "Field"}, {"key": "c1", "label": "Type"}, {"key": "c2", "label": "Length"}, {"key": "c3", "label": "Description"}]}, {"key": "layout-2", "rows": [{"c0": "t_xmin", "c1": "TransactionId", "c2": "4 bytes", "c3": "insert XID stamp"}, {"c0": "t_xmax", "c1": "TransactionId", "c2": "4 bytes", "c3": "delete XID stamp"}, {"c0": "t_cid", "c1": "CommandId", "c2": "4 bytes", "c3": "insert and/or delete CID stamp (overlays with t_xvac)"}, {"c0": "t_xvac", "c1": "TransactionId", "c2": "4 bytes", "c3": "XID for VACUUM operation moving a row version"}, {"c0": "t_ctid", "c1": "ItemPointerData", "c2": "6 bytes", "c3": "current TID of this or newer row version"}, {"c0": "t_infomask2", "c1": "uint16", "c2": "2 bytes", "c3": "number of attributes, plus various flag bits"}, {"c0": "t_infomask", "c1": "uint16", "c2": "2 bytes", "c3": "various flag bits"}, {"c0": "t_hoff", "c1": "uint8", "c2": "1 byte", "c3": "offset to user data"}], "title": "HeapTupleHeaderData Layout", "columns": [{"key": "c0", "label": "Field"}, {"key": "c1", "label": "Type"}, {"key": "c2", "label": "Length"}, {"key": "c3", "label": "Description"}]}]}, "comparison_hash": "b621fa85b3be27a0eb0d82986e9524f2ef0a776761901f0d429826eec4822d0a", "manual_language": "zh"}, "15": {"facts": [{"label": "\u5b9a\u4e49\u8303\u56f4", "value": "\u540c\u7248\u672c\u6838\u5fc3\u7269\u7406\u5b58\u50a8\u6587\u6863"}], "tables": [{"key": "layout-0", "rows": [{"c0": "PageHeaderData", "c1": "\u957f 24 \u5b57\u8282\uff0c\u5305\u542b\u9875\u9762\u7684\u901a\u7528\u4fe1\u606f\uff0c\u4f8b\u5982\u7a7a\u95f2\u7a7a\u95f4\u6307\u9488\u3002"}, {"c0": "ItemIdData", "c1": "\u6307\u5411\u5b9e\u9645\u6570\u636e\u9879\u7684\u884c\u6307\u9488\u6570\u7ec4\u3002\u6bcf\u9879\u4e3a\u4e00\u4e2a\uff08\u504f\u79fb\uff0c\u957f\u5ea6\uff09\u5bf9\uff0c\u5360 4 \u5b57\u8282\u3002"}, {"c0": "\u7a7a\u95f2\u7a7a\u95f4", "c1": "\u5c1a\u672a\u5206\u914d\u7684\u7a7a\u95f4\u3002\u65b0\u884c\u6307\u9488\u4ece\u8be5\u533a\u57df\u7684\u8d77\u59cb\u5904\u5206\u914d\uff0c\u65b0\u6570\u636e\u9879\u4ece\u672b\u5c3e\u5904\u5206\u914d\u3002"}, {"c0": "\u9879", "c1": "\u5b9e\u9645\u7684\u6570\u636e\u9879\u672c\u8eab\u3002"}, {"c0": "\u7279\u6b8a\u7a7a\u95f4", "c1": "\u7d22\u5f15\u8bbf\u95ee\u65b9\u6cd5\u4e13\u7528\u6570\u636e\u3002\u4e0d\u540c\u65b9\u6cd5\u5b58\u50a8\u7684\u5185\u5bb9\u4e0d\u540c\uff0c\u666e\u901a\u8868\u4e2d\u6b64\u533a\u57df\u4e3a\u7a7a\u3002"}], "title": "\u9875\u9762\u603b\u4f53\u5e03\u5c40", "columns": [{"key": "c0", "label": "\u9879\u76ee"}, {"key": "c1", "label": "\u8bf4\u660e"}]}, {"key": "layout-1", "rows": [{"c0": "pd_lsn", "c1": "PageXLogRecPtr", "c2": "8 \u5b57\u8282", "c3": "LSN\uff1a\u8be5\u9875\u6700\u540e\u4e00\u6b21\u53d8\u5316\u6240\u5bf9\u5e94 WAL \u8bb0\u5f55\u7684\u6700\u540e\u4e00\u4e2a\u5b57\u8282\u4e4b\u540e\u7684\u4f4d\u7f6e\u3002"}, {"c0": "pd_checksum", "c1": "uint16", "c2": "2 \u5b57\u8282", "c3": "\u9875\u9762\u6821\u9a8c\u548c"}, {"c0": "pd_flags", "c1": "uint16", "c2": "2 \u5b57\u8282", "c3": "\u6807\u5fd7\u4f4d"}, {"c0": "pd_lower", "c1": "LocationIndex", "c2": "2 \u5b57\u8282", "c3": "\u7a7a\u95f2\u7a7a\u95f4\u8d77\u59cb\u4f4d\u7f6e\u7684\u504f\u79fb\u91cf"}, {"c0": "pd_upper", "c1": "LocationIndex", "c2": "2 \u5b57\u8282", "c3": "\u7a7a\u95f2\u7a7a\u95f4\u7ed3\u675f\u4f4d\u7f6e\u7684\u504f\u79fb\u91cf"}, {"c0": "pd_special", "c1": "LocationIndex", "c2": "2 \u5b57\u8282", "c3": "\u7279\u6b8a\u7a7a\u95f4\u8d77\u59cb\u4f4d\u7f6e\u7684\u504f\u79fb\u91cf"}, {"c0": "pd_pagesize_version", "c1": "uint16", "c2": "2 \u5b57\u8282", "c3": "\u9875\u9762\u5927\u5c0f\u4e0e\u5e03\u5c40\u7248\u672c\u53f7\u4fe1\u606f"}, {"c0": "pd_prune_xid", "c1": "TransactionId", "c2": "4 \u5b57\u8282", "c3": "\u9875\u9762\u4e0a\u6700\u65e9\u7684\u5c1a\u672a\u4fee\u526a\u7684 XMAX\uff1b\u6ca1\u6709\u5219\u4e3a\u96f6"}], "title": "PageHeaderData \u5e03\u5c40", "columns": [{"key": "c0", "label": "\u5b57\u6bb5"}, {"key": "c1", "label": "\u7c7b\u578b"}, {"key": "c2", "label": "\u957f\u5ea6"}, {"key": "c3", "label": "\u8bf4\u660e"}]}, {"key": "layout-2", "rows": [{"c0": "t_xmin", "c1": "TransactionId", "c2": "4 \u5b57\u8282", "c3": "\u63d2\u5165\u4e8b\u52a1\u7684 XID"}, {"c0": "t_xmax", "c1": "TransactionId", "c2": "4 \u5b57\u8282", "c3": "\u5220\u9664\u4e8b\u52a1\u7684 XID"}, {"c0": "t_cid", "c1": "CommandId", "c2": "4 \u5b57\u8282", "c3": "\u63d2\u5165\u548c\uff0f\u6216\u5220\u9664\u547d\u4ee4\u7684 CID\uff0c\u4e0e t_xvac \u5171\u7528\u5b58\u50a8\u4f4d\u7f6e"}, {"c0": "t_xvac", "c1": "TransactionId", "c2": "4 \u5b57\u8282", "c3": "VACUUM \u64cd\u4f5c\u79fb\u52a8\u884c\u7248\u672c\u65f6\u4f7f\u7528\u7684 XID"}, {"c0": "t_ctid", "c1": "ItemPointerData", "c2": "6 \u5b57\u8282", "c3": "\u672c\u884c\u7248\u672c\u6216\u8f83\u65b0\u884c\u7248\u672c\u7684\u5f53\u524d TID"}, {"c0": "t_infomask2", "c1": "uint16", "c2": "2 \u5b57\u8282", "c3": "\u5c5e\u6027\u6570\u91cf\u53ca\u5404\u79cd\u6807\u5fd7\u4f4d"}, {"c0": "t_infomask", "c1": "uint16", "c2": "2 \u5b57\u8282", "c3": "\u5404\u79cd\u6807\u5fd7\u4f4d"}, {"c0": "t_hoff", "c1": "uint8", "c2": "1 \u5b57\u8282", "c3": "\u7528\u6237\u6570\u636e\u7684\u504f\u79fb\u91cf"}], "title": "HeapTupleHeaderData \u5e03\u5c40", "columns": [{"key": "c0", "label": "\u5b57\u6bb5"}, {"key": "c1", "label": "\u7c7b\u578b"}, {"key": "c2", "label": "\u957f\u5ea6"}, {"key": "c3", "label": "\u8bf4\u660e"}]}], "diagram": "page-layout", "related": [{"url": "/wiki/tableam/?v=15", "label": "Table AM"}, {"url": "/wiki/relopts/?v=15", "label": "\u5b58\u50a8\u53c2\u6570"}], "release": {"ref": "https://ftp.postgresql.org/pub/source/v15.19/postgresql-15.19.tar.bz2", "label": "15.19", "major": "15", "channel": "stable", "revision": "e1a64a87a46b825b88c082e4518161a47aab53c45694964f8ba1df28f7859f89"}, "sources": [{"url": "https://pg.center/docs/15/storage-page-layout.html", "path": "storage-page-layout.html", "label": "PostgreSQL 15 English manual", "sha256": "88f0ede4c4e120bd501055521215dd74f073965c658098e4b694f28e5fb427b5", "language": "en", "original_url": "/docs/15/storage-page-layout.html"}], "sections": [], "signature": "", "description": ["\u672c\u8282\u6982\u8ff0 PostgreSQL \u8868\u548c\u7d22\u5f15\u5185\u90e8\u6240\u4f7f\u7528\u7684\u9875\u9762\u683c\u5f0f\u3002 [17] \u5e8f\u5217\u548c TOAST \u8868\u7684\u683c\u5f0f\u4e0e\u666e\u901a\u8868\u76f8\u540c\u3002"], "manual_html": "<div class=\"sect1\">\n<div class=\"titlepage\">\n<div>\n<div>\n<h2 class=\"title\" lang=\"zh\">\n<div>\n<div>\n<h2 class=\"title\" style=\"clear: both\">73.6.\u00a0\u6570\u636e\u5e93\u9875\u9762\u5e03\u5c40 </h2>\n</div>\n</div>\n</h2>\n</div>\n</div>\n</div>\n<p lang=\"zh\">\u672c\u8282\u6982\u8ff0 <span class=\"productname\">PostgreSQL</span> \u8868\u548c\u7d22\u5f15\u5185\u90e8\u6240\u4f7f\u7528\u7684\u9875\u9762\u683c\u5f0f\u3002<a class=\"footnote\" href=\"/docs/15/storage-page-layout.html#ftn.id-1.10.24.8.2.2\"><sup class=\"footnote\" id=\"id-1.10.24.8.2.2\">[17]</sup></a> \u5e8f\u5217\u548c <acronym class=\"acronym\">TOAST</acronym> \u8868\u7684\u683c\u5f0f\u4e0e\u666e\u901a\u8868\u76f8\u540c\u3002</p>\n<p lang=\"zh\">\u5728\u4e0b\u9762\u7684\u8bf4\u660e\u4e2d\uff0c\u5047\u5b9a\u4e00\u4e2a<em class=\"firstterm\">\u5b57\u8282</em>\u5305\u542b 8 \u4e2a\u4f4d\u3002\u53e6\u5916\uff0c\u672f\u8bed<em class=\"firstterm\">\u9879</em>\u6307\u7684\u662f\u5b58\u50a8\u5728\u9875\u9762\u4e0a\u7684\u5355\u4e2a\u6570\u636e\u503c\u3002\u5728\u8868\u4e2d\uff0c\u9879\u662f\u4e00\u884c\uff1b\u5728\u7d22\u5f15\u4e2d\uff0c\u9879\u662f\u4e00\u6761\u7d22\u5f15\u6761\u76ee\u3002</p>\n<p lang=\"zh\">\u6bcf\u4e2a\u8868\u548c\u7d22\u5f15\u90fd\u5b58\u50a8\u4e3a\u56fa\u5b9a\u5927\u5c0f\u7684<em class=\"firstterm\">\u9875\u9762</em>\u6570\u7ec4\uff08\u901a\u5e38\u4e3a 8 kB\uff0c\u4e0d\u8fc7\u5728\u7f16\u8bd1\u670d\u52a1\u5668\u65f6\u53ef\u4ee5\u9009\u62e9\u4e0d\u540c\u7684\u9875\u9762\u5927\u5c0f\uff09\u3002\u5728\u8868\u4e2d\uff0c\u6240\u6709\u9875\u9762\u5728\u903b\u8f91\u4e0a\u90fd\u662f\u7b49\u4ef7\u7684\uff0c\u56e0\u6b64\u67d0\u4e2a\u7279\u5b9a\u9879\uff08\u884c\uff09\u53ef\u4ee5\u5b58\u653e\u5728\u4efb\u610f\u9875\u9762\u4e2d\u3002\u5728\u7d22\u5f15\u4e2d\uff0c\u7b2c\u4e00\u9875\u901a\u5e38\u4fdd\u7559\u4e3a<em class=\"firstterm\">\u5143\u9875</em>\uff0c\u7528\u4e8e\u4fdd\u5b58\u63a7\u5236\u4fe1\u606f\uff1b\u5e76\u4e14\u6839\u636e\u7d22\u5f15\u8bbf\u95ee\u65b9\u6cd5\u7684\u4e0d\u540c\uff0c\u7d22\u5f15\u4e2d\u8fd8\u53ef\u80fd\u5b58\u5728\u4e0d\u540c\u7c7b\u578b\u7684\u9875\u9762\u3002</p>\n<p lang=\"zh\"><a class=\"xref\" href=\"/docs/15/storage-page-layout.html#PAGE-TABLE\" title=\"\u8868\u00a073.2.\u00a0\u603b\u4f53\u9875\u9762\u5e03\u5c40\">\u8868\u00a073.2</a>\u5c55\u793a\u4e86\u9875\u9762\u7684\u603b\u4f53\u5e03\u5c40\u3002\u6bcf\u4e2a\u9875\u9762\u5305\u542b\u4e94\u4e2a\u90e8\u5206\u3002</p>\n<div class=\"table\">\n<p class=\"title\" lang=\"zh\"><strong>\u8868\u00a073.2.\u00a0\u603b\u4f53\u9875\u9762\u5e03\u5c40</strong></p>\n<div class=\"table-contents\">\n<table class=\"table\">\n<thead>\n<tr>\n<th lang=\"zh\">\u9879\u76ee</th>\n<th lang=\"zh\">\u8bf4\u660e</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>PageHeaderData</td>\n<td lang=\"zh\">\u957f 24 \u5b57\u8282\uff0c\u5305\u542b\u9875\u9762\u7684\u901a\u7528\u4fe1\u606f\uff0c\u4f8b\u5982\u7a7a\u95f2\u7a7a\u95f4\u6307\u9488\u3002</td>\n</tr>\n<tr>\n<td>ItemIdData</td>\n<td lang=\"zh\">\u6307\u5411\u5b9e\u9645\u6570\u636e\u9879\u7684\u884c\u6307\u9488\u6570\u7ec4\u3002\u6bcf\u9879\u4e3a\u4e00\u4e2a\uff08\u504f\u79fb\uff0c\u957f\u5ea6\uff09\u5bf9\uff0c\u5360 4 \u5b57\u8282\u3002</td>\n</tr>\n<tr>\n<td lang=\"zh\">\u7a7a\u95f2\u7a7a\u95f4</td>\n<td lang=\"zh\">\u5c1a\u672a\u5206\u914d\u7684\u7a7a\u95f4\u3002\u65b0\u884c\u6307\u9488\u4ece\u8be5\u533a\u57df\u7684\u8d77\u59cb\u5904\u5206\u914d\uff0c\u65b0\u6570\u636e\u9879\u4ece\u672b\u5c3e\u5904\u5206\u914d\u3002</td>\n</tr>\n<tr>\n<td lang=\"zh\">\u9879</td>\n<td lang=\"zh\">\u5b9e\u9645\u7684\u6570\u636e\u9879\u672c\u8eab\u3002</td>\n</tr>\n<tr>\n<td lang=\"zh\">\u7279\u6b8a\u7a7a\u95f4</td>\n<td lang=\"zh\">\u7d22\u5f15\u8bbf\u95ee\u65b9\u6cd5\u4e13\u7528\u6570\u636e\u3002\u4e0d\u540c\u65b9\u6cd5\u5b58\u50a8\u7684\u5185\u5bb9\u4e0d\u540c\uff0c\u666e\u901a\u8868\u4e2d\u6b64\u533a\u57df\u4e3a\u7a7a\u3002</td>\n</tr>\n</tbody>\n</table>\n</div>\n</div><br class=\"table-break\"/>\n<p lang=\"zh\">\u6bcf\u9875\u7684\u524d 24 \u5b57\u8282\u662f\u9875\u9996\u90e8 PageHeaderData\uff0c\u8be6\u7ec6\u683c\u5f0f\u89c1\u8868 73.3\u3002\u7b2c\u4e00\u4e2a\u5b57\u6bb5\u8ddf\u8e2a\u4e0e\u8be5\u9875\u76f8\u5173\u7684\u6700\u8fd1\u4e00\u6761 WAL \u8bb0\u5f55\uff1b\u7b2c\u4e8c\u4e2a\u5b57\u6bb5\u5728\u542f\u7528\u6570\u636e\u6821\u9a8c\u548c\u65f6\u4fdd\u5b58\u9875\u9762\u6821\u9a8c\u548c\u3002\u4e4b\u540e\u662f\u4e00\u4e2a\u5305\u542b\u6807\u5fd7\u4f4d\u7684 2 \u5b57\u8282\u5b57\u6bb5\uff0c\u518d\u540e\u9762\u662f\u4e09\u4e2a 2 \u5b57\u8282\u6574\u6570 pd_lower\u3001pd_upper \u548c pd_special\uff0c\u5206\u522b\u8bb0\u5f55\u4ece\u9875\u8d77\u70b9\u5230\u672a\u5206\u914d\u7a7a\u95f4\u8d77\u70b9\u3001\u672a\u5206\u914d\u7a7a\u95f4\u7ec8\u70b9\u53ca\u7279\u6b8a\u7a7a\u95f4\u8d77\u70b9\u7684\u5b57\u8282\u504f\u79fb\u91cf\u3002\u63a5\u4e0b\u6765\u7684 2 \u5b57\u8282 pd_pagesize_version \u540c\u65f6\u4fdd\u5b58\u9875\u5927\u5c0f\u548c\u7248\u672c\u6807\u8bc6\u3002PostgreSQL 8.3 \u8d77\u7248\u672c\u53f7\u4e3a 4\uff1b8.1 \u4e0e 8.2 \u4f7f\u7528 3\uff1b8.0 \u4f7f\u7528 2\uff1b7.3 \u4e0e 7.4 \u4f7f\u7528 1\uff1b\u66f4\u65e9\u7248\u672c\u4f7f\u7528 0\u3002\u591a\u6570\u7248\u672c\u7684\u57fa\u672c\u9875\u9762\u5e03\u5c40\u548c\u9996\u90e8\u683c\u5f0f\u5e76\u672a\u53d8\u5316\uff0c\u4f46\u5806\u884c\u9996\u90e8\u5e03\u5c40\u6709\u53d8\u5316\u3002\u9875\u5927\u5c0f\u57fa\u672c\u53ea\u7528\u4e8e\u4ea4\u53c9\u68c0\u67e5\uff1b\u540c\u4e00\u5b89\u88c5\u4e0d\u652f\u6301\u591a\u79cd\u9875\u5927\u5c0f\u3002\u6700\u540e\u4e00\u4e2a\u5b57\u6bb5\u63d0\u793a\u4fee\u526a\u8be5\u9875\u662f\u5426\u53ef\u80fd\u6709\u76ca\uff0c\u8bb0\u5f55\u8be5\u9875\u6700\u65e9\u7684\u5c1a\u672a\u4fee\u526a\u7684 XMAX\u3002</p>\n<div class=\"table\">\n<p class=\"title\" lang=\"zh\"><strong>\u8868\u00a073.3.\u00a0PageHeaderData \u5e03\u5c40</strong></p>\n<div class=\"table-contents\">\n<table class=\"table\">\n<thead>\n<tr>\n<th lang=\"zh\">\u5b57\u6bb5</th>\n<th lang=\"zh\">\u7c7b\u578b</th>\n<th lang=\"zh\">\u957f\u5ea6</th>\n<th lang=\"zh\">\u8bf4\u660e</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>pd_lsn</td>\n<td>PageXLogRecPtr</td>\n<td lang=\"zh\">8 \u5b57\u8282</td>\n<td lang=\"zh\">LSN\uff1a\u8be5\u9875\u6700\u540e\u4e00\u6b21\u53d8\u5316\u6240\u5bf9\u5e94 WAL \u8bb0\u5f55\u7684\u6700\u540e\u4e00\u4e2a\u5b57\u8282\u4e4b\u540e\u7684\u4f4d\u7f6e\u3002</td>\n</tr>\n<tr>\n<td>pd_checksum</td>\n<td>uint16</td>\n<td lang=\"zh\">2 \u5b57\u8282</td>\n<td lang=\"zh\">\u9875\u9762\u6821\u9a8c\u548c</td>\n</tr>\n<tr>\n<td>pd_flags</td>\n<td>uint16</td>\n<td lang=\"zh\">2 \u5b57\u8282</td>\n<td lang=\"zh\">\u6807\u5fd7\u4f4d</td>\n</tr>\n<tr>\n<td>pd_lower</td>\n<td>LocationIndex</td>\n<td lang=\"zh\">2 \u5b57\u8282</td>\n<td lang=\"zh\">\u7a7a\u95f2\u7a7a\u95f4\u8d77\u59cb\u4f4d\u7f6e\u7684\u504f\u79fb\u91cf</td>\n</tr>\n<tr>\n<td>pd_upper</td>\n<td>LocationIndex</td>\n<td lang=\"zh\">2 \u5b57\u8282</td>\n<td lang=\"zh\">\u7a7a\u95f2\u7a7a\u95f4\u7ed3\u675f\u4f4d\u7f6e\u7684\u504f\u79fb\u91cf</td>\n</tr>\n<tr>\n<td>pd_special</td>\n<td>LocationIndex</td>\n<td lang=\"zh\">2 \u5b57\u8282</td>\n<td lang=\"zh\">\u7279\u6b8a\u7a7a\u95f4\u8d77\u59cb\u4f4d\u7f6e\u7684\u504f\u79fb\u91cf</td>\n</tr>\n<tr>\n<td>pd_pagesize_version</td>\n<td>uint16</td>\n<td lang=\"zh\">2 \u5b57\u8282</td>\n<td lang=\"zh\">\u9875\u9762\u5927\u5c0f\u4e0e\u5e03\u5c40\u7248\u672c\u53f7\u4fe1\u606f</td>\n</tr>\n<tr>\n<td>pd_prune_xid</td>\n<td>TransactionId</td>\n<td lang=\"zh\">4 \u5b57\u8282</td>\n<td lang=\"zh\">\u9875\u9762\u4e0a\u6700\u65e9\u7684\u5c1a\u672a\u4fee\u526a\u7684 XMAX\uff1b\u6ca1\u6709\u5219\u4e3a\u96f6</td>\n</tr>\n</tbody>\n</table>\n</div>\n</div><br class=\"table-break\"/>\n<p lang=\"zh\">\u6240\u6709\u7ec6\u8282\u90fd\u53ef\u4ee5\u5728 <code class=\"filename\">src/include/storage/bufpage.h</code> \u4e2d\u627e\u5230\u3002</p>\n<p lang=\"zh\">\u9875\u5934\u4e4b\u540e\u662f\u9879\u6807\u8bc6\u7b26\uff08<code class=\"type\">ItemIdData</code>\uff09\uff0c\u6bcf\u4e2a\u9700\u8981\u56db\u4e2a\u5b57\u8282\u3002\u4e00\u4e2a\u9879\u6807\u8bc6\u7b26\u5305\u542b\u9879\u8d77\u59cb\u4f4d\u7f6e\u7684\u5b57\u8282\u504f\u79fb\u91cf\u3001\u5176\u5b57\u8282\u957f\u5ea6\uff0c\u4ee5\u53ca\u82e5\u5e72\u5f71\u54cd\u89e3\u91ca\u65b9\u5f0f\u7684\u5c5e\u6027\u4f4d\u3002\u65b0\u7684\u9879\u6807\u8bc6\u7b26\u4f1a\u6839\u636e\u9700\u8981\u4ece\u672a\u5206\u914d\u7a7a\u95f4\u7684\u8d77\u59cb\u5904\u5206\u914d\u3002\u5f53\u524d\u5df2\u6709\u591a\u5c11\u4e2a\u9879\u6807\u8bc6\u7b26\uff0c\u53ef\u4ee5\u901a\u8fc7\u67e5\u770b <code class=\"structfield\">pd_lower</code> \u5f97\u77e5\uff1b\u5206\u914d\u65b0\u6807\u8bc6\u7b26\u65f6\u5b83\u4f1a\u589e\u52a0\u3002\u56e0\u4e3a\u4e00\u4e2a\u9879\u6807\u8bc6\u7b26\u5728\u88ab\u91ca\u653e\u4e4b\u524d\u6c38\u8fdc\u4e0d\u4f1a\u79fb\u52a8\uff0c\u6240\u4ee5\u5373\u4f7f\u9879\u672c\u8eab\u4e3a\u4e86\u6574\u7406\u7a7a\u95f2\u7a7a\u95f4\u800c\u5728\u9875\u9762\u5185\u79fb\u52a8\uff0c\u5176\u7d22\u5f15\u4ecd\u7136\u53ef\u4ee5\u88ab\u957f\u671f\u7528\u6765\u5f15\u7528\u8be5\u9879\u3002\u4e8b\u5b9e\u4e0a\uff0c\u6bcf\u4e2a\u6307\u5411\u9879\u7684\u6307\u9488\uff08<code class=\"type\">ItemPointer</code>\uff0c\u4e5f\u79f0 <code class=\"type\">CTID</code>\uff09\u5728 <span class=\"productname\">PostgreSQL</span> \u4e2d\u90fd\u7531\u9875\u53f7\u548c\u9879\u6807\u8bc6\u7b26\u7d22\u5f15\u6784\u6210\u3002</p>\n<p lang=\"zh\">\u9879\u672c\u8eab\u5b58\u50a8\u5728\u4ece\u672a\u5206\u914d\u7a7a\u95f4\u672b\u5c3e\u5f00\u59cb\u3001\u5411\u540e\u5206\u914d\u7684\u533a\u57df\u4e2d\u3002\u5176\u786e\u5207\u7ed3\u6784\u53d6\u51b3\u4e8e\u8868\u8981\u5305\u542b\u4ec0\u4e48\u5185\u5bb9\u3002\u8868\u548c\u5e8f\u5217\u90fd\u4f7f\u7528\u4e00\u79cd\u540d\u4e3a <code class=\"type\">HeapTupleHeaderData</code> \u7684\u7ed3\u6784\u4f53\uff0c\u5982\u4e0b\u6240\u8ff0\u3002</p>\n<p lang=\"zh\">\u6700\u540e\u4e00\u90e8\u5206\u662f<span class=\"quote\">\u201c<span class=\"quote\">\u7279\u6b8a\u90e8\u5206</span>\u201d</span>\uff0c\u5176\u4e2d\u53ef\u4ee5\u5b58\u653e\u8bbf\u95ee\u65b9\u6cd5\u5e0c\u671b\u4fdd\u5b58\u7684\u4efb\u4f55\u5185\u5bb9\u3002\u4f8b\u5982\uff0cB-\u6811\u7d22\u5f15\u4f1a\u5728\u8fd9\u91cc\u4fdd\u5b58\u6307\u5411\u9875\u9762\u5de6\u3001\u53f3\u5144\u5f1f\u7684\u94fe\u63a5\uff0c\u4ee5\u53ca\u5176\u4ed6\u4e00\u4e9b\u4e0e\u7d22\u5f15\u7ed3\u6784\u76f8\u5173\u7684\u6570\u636e\u3002\u666e\u901a\u8868\u5b8c\u5168\u4e0d\u4f7f\u7528\u7279\u6b8a\u90e8\u5206\uff08\u901a\u8fc7\u5c06 <code class=\"structfield\">pd_special</code> \u8bbe\u4e3a\u9875\u9762\u5927\u5c0f\u6765\u8868\u793a\uff09\u3002</p>\n<p lang=\"zh\"><a class=\"xref\" href=\"/docs/15/storage-page-layout.html#STORAGE-PAGE-LAYOUT-FIGURE\" title=\"\u56fe\u00a073.1.\u00a0\u9875\u9762\u5e03\u5c40\">\u56fe\u00a073.1</a>\u5c55\u793a\u4e86\u8fd9\u4e9b\u90e8\u5206\u5728\u9875\u9762\u4e2d\u7684\u5e03\u5c40\u65b9\u5f0f\u3002</p>\n<div class=\"figure col-xl-8 col-lg-10 col-md-12\">\n<p class=\"title\" lang=\"zh\">\n<p class=\"title\"><strong>\u56fe\u00a073.1.\u00a0\u9875\u9762\u5e03\u5c40</strong></p>\n<div class=\"figure-contents\">\n<div class=\"mediaobject\">\n<object data=\"pagelayout.svg\" type=\"image/svg+xml\" width=\"100%\">\n</object>\n</div>\n</div>\n</p>\n<div class=\"figure-contents\">\n<div class=\"mediaobject\">\n</div>\n</div>\n</div><br class=\"figure-break\"/>\n<div class=\"sect2\">\n<div class=\"titlepage\">\n<div>\n<div>\n<h3 class=\"title\" lang=\"zh\">\n<dl class=\"toc\">\n<dt><span class=\"sect2\"><a href=\"/docs/15/storage-page-layout.html#STORAGE-TUPLE-LAYOUT\">73.6.1. \u8868\u884c\u5e03\u5c40</a></span></dt>\n</dl>\n</h3>\n</div>\n</div>\n</div>\n<p lang=\"zh\">\u6240\u6709\u8868\u884c\u7684\u7ed3\u6784\u90fd\u76f8\u540c\u3002\u5b83\u4eec\u90fd\u6709\u4e00\u4e2a\u56fa\u5b9a\u5927\u5c0f\u7684\u5934\u90e8\uff08\u5728\u5927\u591a\u6570\u673a\u5668\u4e0a\u5360 23 \u5b57\u8282\uff09\uff0c\u540e\u9762\u8ddf\u7740\u53ef\u9009\u7684\u7a7a\u503c\u4f4d\u56fe\u3001\u53ef\u9009\u7684\u5bf9\u8c61 ID \u5b57\u6bb5\u4ee5\u53ca\u7528\u6237\u6570\u636e\u3002\u5934\u90e8\u7684\u8be6\u7ec6\u683c\u5f0f\u89c1<a class=\"xref\" href=\"/docs/15/storage-page-layout.html#HEAPTUPLEHEADERDATA-TABLE\" title=\"\u8868\u00a073.4.\u00a0HeapTupleHeaderData \u5e03\u5c40\">\u8868\u00a073.4</a>\u3002\u5b9e\u9645\u7528\u6237\u6570\u636e\uff08\u884c\u7684\u5404\u5217\uff09\u4ece <code class=\"structfield\">t_hoff</code> \u6307\u793a\u7684\u504f\u79fb\u4f4d\u7f6e\u5f00\u59cb\uff0c\u5b83\u5fc5\u987b\u59cb\u7ec8\u662f\u8be5\u5e73\u53f0 MAXALIGN \u5bf9\u9f50\u5355\u4f4d\u7684\u6574\u6570\u500d\u3002\u53ea\u6709\u5f53 <em class=\"firstterm\">HEAP_HASNULL</em> \u4f4d\u5728 <code class=\"structfield\">t_infomask</code> \u4e2d\u88ab\u7f6e\u4f4d\u65f6\uff0c\u7a7a\u503c\u4f4d\u56fe\u624d\u5b58\u5728\u3002\u82e5\u5b58\u5728\uff0c\u5b83\u7d27\u968f\u56fa\u5b9a\u5934\u90e8\u4e4b\u540e\uff0c\u5e76\u5360\u7528\u8db3\u591f\u591a\u7684\u5b57\u8282\uff0c\u4ee5\u4fbf\u4e3a\u6bcf\u4e2a\u6570\u636e\u5217\u63d0\u4f9b\u4e00\u4f4d\uff08\u4e5f\u5c31\u662f\u8bf4\uff0c\u5176\u4f4d\u6570\u7b49\u4e8e <code class=\"structfield\">t_infomask2</code> \u4e2d\u7684\u5c5e\u6027\u4e2a\u6570\uff09\u3002\u5728\u8fd9\u4e2a\u4f4d\u56fe\u4e2d\uff0c1 \u8868\u793a\u975e\u7a7a\uff0c0 \u8868\u793a\u7a7a\u503c\u3002\u5f53\u4f4d\u56fe\u4e0d\u5b58\u5728\u65f6\uff0c\u5047\u5b9a\u6240\u6709\u5217\u90fd\u975e\u7a7a\u3002\u53ea\u6709\u5f53 <em class=\"firstterm\">HEAP_HASOID_OLD</em> \u4f4d\u5728 <code class=\"structfield\">t_infomask</code> \u4e2d\u88ab\u7f6e\u4f4d\u65f6\uff0c\u5bf9\u8c61 ID \u624d\u5b58\u5728\u3002\u82e5\u5b58\u5728\uff0c\u5b83\u4f4d\u4e8e <code class=\"structfield\">t_hoff</code> \u8fb9\u754c\u4e4b\u524d\u3002\u4e3a\u4e86\u8ba9 <code class=\"structfield\">t_hoff</code> \u6210\u4e3a MAXALIGN \u7684\u6574\u6570\u500d\u6240\u9700\u7684\u4efb\u4f55\u586b\u5145\uff0c\u90fd\u4f1a\u51fa\u73b0\u5728\u7a7a\u503c\u4f4d\u56fe\u4e0e\u5bf9\u8c61 ID \u4e4b\u95f4\u3002\uff08\u8fd9\u53c8\u53cd\u8fc7\u6765\u4fdd\u8bc1\u4e86\u5bf9\u8c61 ID \u7684\u5bf9\u9f50\u662f\u5408\u9002\u7684\u3002\uff09</p>\n<div class=\"table\">\n<p class=\"title\" lang=\"zh\"><strong>\u8868\u00a073.4.\u00a0HeapTupleHeaderData \u5e03\u5c40</strong></p>\n<div class=\"table-contents\">\n<table class=\"table\">\n<thead>\n<tr>\n<th lang=\"zh\">\u5b57\u6bb5</th>\n<th lang=\"zh\">\u7c7b\u578b</th>\n<th lang=\"zh\">\u957f\u5ea6</th>\n<th lang=\"zh\">\u8bf4\u660e</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>t_xmin</td>\n<td>TransactionId</td>\n<td lang=\"zh\">4 \u5b57\u8282</td>\n<td lang=\"zh\">\u63d2\u5165\u4e8b\u52a1\u7684 XID</td>\n</tr>\n<tr>\n<td>t_xmax</td>\n<td>TransactionId</td>\n<td lang=\"zh\">4 \u5b57\u8282</td>\n<td lang=\"zh\">\u5220\u9664\u4e8b\u52a1\u7684 XID</td>\n</tr>\n<tr>\n<td>t_cid</td>\n<td>CommandId</td>\n<td lang=\"zh\">4 \u5b57\u8282</td>\n<td lang=\"zh\">\u63d2\u5165\u548c\uff0f\u6216\u5220\u9664\u547d\u4ee4\u7684 CID\uff0c\u4e0e t_xvac \u5171\u7528\u5b58\u50a8\u4f4d\u7f6e</td>\n</tr>\n<tr>\n<td>t_xvac</td>\n<td>TransactionId</td>\n<td lang=\"zh\">4 \u5b57\u8282</td>\n<td lang=\"zh\">VACUUM \u64cd\u4f5c\u79fb\u52a8\u884c\u7248\u672c\u65f6\u4f7f\u7528\u7684 XID</td>\n</tr>\n<tr>\n<td>t_ctid</td>\n<td>ItemPointerData</td>\n<td lang=\"zh\">6 \u5b57\u8282</td>\n<td lang=\"zh\">\u672c\u884c\u7248\u672c\u6216\u8f83\u65b0\u884c\u7248\u672c\u7684\u5f53\u524d TID</td>\n</tr>\n<tr>\n<td>t_infomask2</td>\n<td>uint16</td>\n<td lang=\"zh\">2 \u5b57\u8282</td>\n<td lang=\"zh\">\u5c5e\u6027\u6570\u91cf\u53ca\u5404\u79cd\u6807\u5fd7\u4f4d</td>\n</tr>\n<tr>\n<td>t_infomask</td>\n<td>uint16</td>\n<td lang=\"zh\">2 \u5b57\u8282</td>\n<td lang=\"zh\">\u5404\u79cd\u6807\u5fd7\u4f4d</td>\n</tr>\n<tr>\n<td>t_hoff</td>\n<td>uint8</td>\n<td lang=\"zh\">1 \u5b57\u8282</td>\n<td lang=\"zh\">\u7528\u6237\u6570\u636e\u7684\u504f\u79fb\u91cf</td>\n</tr>\n</tbody>\n</table>\n</div>\n</div><br class=\"table-break\"/>\n<p lang=\"zh\">\u6240\u6709\u7ec6\u8282\u90fd\u53ef\u4ee5\u5728 <code class=\"filename\">src/include/access/htup_details.h</code> \u4e2d\u627e\u5230\u3002</p>\n<p lang=\"zh\">\u8981\u89e3\u91ca\u5b9e\u9645\u6570\u636e\uff0c\u5fc5\u987b\u501f\u52a9\u4ece\u5176\u4ed6\u8868\u4e2d\u83b7\u5f97\u7684\u4fe1\u606f\uff0c\u5176\u4e2d\u5927\u90e8\u5206\u6765\u81ea <code class=\"structname\">pg_attribute</code>\u3002\u8bc6\u522b\u5b57\u6bb5\u4f4d\u7f6e\u6240\u9700\u7684\u5173\u952e\u503c\u662f <code class=\"structfield\">attlen</code> \u548c <code class=\"structfield\">attalign</code>\u3002\u9664\u975e\u6240\u6709\u5b57\u6bb5\u90fd\u662f\u5b9a\u5bbd\u4e14\u6ca1\u6709\u7a7a\u503c\uff0c\u5426\u5219\u6ca1\u6709\u529e\u6cd5\u76f4\u63a5\u53d6\u5f97\u67d0\u4e2a\u7279\u5b9a\u5c5e\u6027\u3002\u6240\u6709\u8fd9\u4e9b\u6280\u5de7\u90fd\u5c01\u88c5\u5728 <em class=\"firstterm\">heap_getattr</em>\u3001<em class=\"firstterm\">fastgetattr</em> \u548c <em class=\"firstterm\">heap_getsysattr</em> \u8fd9\u4e9b\u51fd\u6570\u4e2d\u3002</p>\n<p lang=\"zh\">\u8bfb\u53d6\u6570\u636e\u65f6\uff0c\u9700\u8981\u4f9d\u6b21\u68c0\u67e5\u6bcf\u4e2a\u5c5e\u6027\u3002\u9996\u5148\u6839\u636e\u7a7a\u503c\u4f4d\u56fe\u5224\u65ad\u8be5\u5b57\u6bb5\u662f\u5426\u4e3a NULL\u3002\u5982\u679c\u662f\uff0c\u5c31\u7ee7\u7eed\u4e0b\u4e00\u4e2a\u3002\u7136\u540e\u786e\u8ba4\u5bf9\u9f50\u662f\u5426\u6b63\u786e\u3002\u5982\u679c\u5b57\u6bb5\u662f\u5b9a\u5bbd\u5b57\u6bb5\uff0c\u90a3\u4e48\u5b83\u7684\u6240\u6709\u5b57\u8282\u90fd\u662f\u76f4\u63a5\u6446\u653e\u7684\uff1b\u5982\u679c\u5b83\u662f\u53d8\u957f\u5b57\u6bb5\uff08attlen = -1\uff09\uff0c\u60c5\u51b5\u5c31\u4f1a\u7a0d\u590d\u6742\u4e00\u4e9b\u3002\u6240\u6709\u53d8\u957f\u6570\u636e\u7c7b\u578b\u90fd\u5171\u4eab\u4e00\u4e2a\u901a\u7528\u5934\u90e8\u7ed3\u6784\u4f53 <code class=\"type\">struct varlena</code>\uff0c\u5176\u4e2d\u5305\u542b\u5df2\u5b58\u50a8\u503c\u7684\u603b\u957f\u5ea6\u4ee5\u53ca\u4e00\u4e9b\u6807\u5fd7\u4f4d\u3002\u6839\u636e\u8fd9\u4e9b\u6807\u5fd7\uff0c\u6570\u636e\u53ef\u80fd\u662f\u884c\u5185\u5b58\u50a8\u7684\uff0c\u4e5f\u53ef\u80fd\u4f4d\u4e8e <acronym class=\"acronym\">TOAST</acronym> \u8868\u4e2d\uff1b\u5b83\u4e5f\u53ef\u80fd\u662f\u7ecf\u8fc7\u538b\u7f29\u7684\uff08\u89c1<a class=\"xref\" href=\"/docs/15/storage-toast.html\" title=\"73.2.\u00a0TOAST\">\u7b2c\u00a073.2\u00a0\u8282</a>\uff09\u3002</p>\n</div>\n<div class=\"footnotes\">\n<br/>\n<hr/>\n<div class=\"footnote\">\n<p lang=\"zh\">\n<br/>\n<hr style=\"width:100; text-align:left;margin-left: 0\"/>\n<div class=\"footnote\" id=\"ftn.id-1.10.24.8.2.2\">\n<p><a class=\"para\" href=\"/docs/15/storage-page-layout.html#id-1.10.24.8.2.2\"><sup class=\"para\">[17]</sup></a> \u5b9e\u9645\u4e0a\uff0c\u8868\u8bbf\u95ee\u65b9\u6cd5\u548c\u7d22\u5f15\u8bbf\u95ee\u65b9\u6cd5\u90fd\u4e0d\u8981\u6c42\u5fc5\u987b\u4f7f\u7528\u8fd9\u79cd\u9875\u9762\u683c\u5f0f\u3002<code class=\"literal\">heap</code> \u8868\u8bbf\u95ee\u65b9\u6cd5\u59cb\u7ec8\u4f7f\u7528\u8fd9\u79cd\u683c\u5f0f\u3002\u73b0\u6709\u7684\u6240\u6709\u7d22\u5f15\u65b9\u6cd5\u4e5f\u90fd\u4f7f\u7528\u8fd9\u79cd\u57fa\u672c\u683c\u5f0f\uff0c\u4f46\u7d22\u5f15\u5143\u9875\u4e2d\u4fdd\u5b58\u7684\u6570\u636e\u901a\u5e38\u5e76\u4e0d\u9075\u5faa\u9879\u5e03\u5c40\u89c4\u5219\u3002</p>\n</div>\n</p>\n</div>\n</div>\n</div>", "manual_path": "/docs/15/storage-page-layout.html", "localization": {"status": "complete", "sources": [{"url": "/docs/15/storage-page-layout.html", "method": "same-major semantic node", "sha256": "2c2602d84ed184bdd78e6473fd991c8f64d4e6921371324f0d349f423eba5718", "language": "zh", "matched_nodes": ["#STORAGE-PAGE-LAYOUT/div[0]", "#STORAGE-PAGE-LAYOUT/div[16]", "#STORAGE-PAGE-LAYOUT/div[18]/div[2]/p[0]", "#STORAGE-PAGE-LAYOUT/div[18]/p[1]", "#STORAGE-PAGE-LAYOUT/div[18]/p[4]", "#STORAGE-PAGE-LAYOUT/div[18]/p[5]", "#STORAGE-PAGE-LAYOUT/div[18]/p[6]", "#STORAGE-PAGE-LAYOUT/div[19]", "#STORAGE-PAGE-LAYOUT/div[1]", "#STORAGE-PAGE-LAYOUT/div[6]/div[1]/table[0]/tbody[2]/tr[3]/td[0]", "#STORAGE-PAGE-LAYOUT/div[6]/p[0]", "#STORAGE-PAGE-LAYOUT/div[9]/div[1]/table[0]/tbody[2]/tr[0]/td[2]", "#STORAGE-PAGE-LAYOUT/div[9]/p[0]", "#STORAGE-PAGE-LAYOUT/p[11]", "#STORAGE-PAGE-LAYOUT/p[12]", "#STORAGE-PAGE-LAYOUT/p[13]", "#STORAGE-PAGE-LAYOUT/p[14]", "#STORAGE-PAGE-LAYOUT/p[15]", "#STORAGE-PAGE-LAYOUT/p[2]", "#STORAGE-PAGE-LAYOUT/p[3]", "#STORAGE-PAGE-LAYOUT/p[4]", "#STORAGE-PAGE-LAYOUT/p[5]"]}], "language": "zh", "original_text": {"/versions/15/description/0": "This section provides an overview of the page format used within PostgreSQL tables and indexes. [17] Sequences and TOAST tables are formatted just like a regular table.", "/versions/15/facts/0/label": "Definition scope", "/versions/15/facts/0/value": "Same-version core physical storage documentation", "/versions/15/tables/0/title": "Overall Page Layout", "/versions/15/tables/1/title": "PageHeaderData Layout", "/versions/15/tables/2/title": "HeapTupleHeaderData Layout", "/versions/15/related/1/label": "Storage Parameters", "/versions/15/tables/0/rows/0/c1": "24 bytes long. Contains general information about the page, including free space pointers.", "/versions/15/tables/0/rows/1/c1": "Array of item identifiers pointing to the actual items. Each entry is an (offset,length) pair. 4 bytes per item.", "/versions/15/tables/0/rows/2/c0": "Free space", "/versions/15/tables/0/rows/2/c1": "The unallocated space. New item identifiers are allocated from the start of this area, new items from the end.", "/versions/15/tables/0/rows/3/c0": "Items", "/versions/15/tables/0/rows/3/c1": "The actual items themselves.", "/versions/15/tables/0/rows/4/c0": "Special space", "/versions/15/tables/0/rows/4/c1": "Index access method specific data. Different methods store different data. Empty in ordinary tables.", "/versions/15/tables/1/rows/0/c2": "8 bytes", "/versions/15/tables/1/rows/0/c3": "LSN: next byte after last byte of WAL record for last change to this page", "/versions/15/tables/1/rows/1/c2": "2 bytes", "/versions/15/tables/1/rows/1/c3": "Page checksum", "/versions/15/tables/1/rows/2/c2": "2 bytes", "/versions/15/tables/1/rows/2/c3": "Flag bits", "/versions/15/tables/1/rows/3/c2": "2 bytes", "/versions/15/tables/1/rows/3/c3": "Offset to start of free space", "/versions/15/tables/1/rows/4/c2": "2 bytes", "/versions/15/tables/1/rows/4/c3": "Offset to end of free space", "/versions/15/tables/1/rows/5/c2": "2 bytes", "/versions/15/tables/1/rows/5/c3": "Offset to start of special space", "/versions/15/tables/1/rows/6/c2": "2 bytes", "/versions/15/tables/1/rows/6/c3": "Page size and layout version number information", "/versions/15/tables/1/rows/7/c2": "4 bytes", "/versions/15/tables/1/rows/7/c3": "Oldest unpruned XMAX on page, or zero if none", "/versions/15/tables/2/rows/0/c2": "4 bytes", "/versions/15/tables/2/rows/0/c3": "insert XID stamp", "/versions/15/tables/2/rows/1/c2": "4 bytes", "/versions/15/tables/2/rows/1/c3": "delete XID stamp", "/versions/15/tables/2/rows/2/c2": "4 bytes", "/versions/15/tables/2/rows/2/c3": "insert and/or delete CID stamp (overlays with t_xvac)", "/versions/15/tables/2/rows/3/c2": "4 bytes", "/versions/15/tables/2/rows/3/c3": "XID for VACUUM operation moving a row version", "/versions/15/tables/2/rows/4/c2": "6 bytes", "/versions/15/tables/2/rows/4/c3": "current TID of this or newer row version", "/versions/15/tables/2/rows/5/c2": "2 bytes", "/versions/15/tables/2/rows/5/c3": "number of attributes, plus various flag bits", "/versions/15/tables/2/rows/6/c2": "2 bytes", "/versions/15/tables/2/rows/6/c3": "various flag bits", "/versions/15/tables/2/rows/7/c2": "1 byte", "/versions/15/tables/2/rows/7/c3": "offset to user data", "/versions/15/tables/0/columns/0/label": "Item", "/versions/15/tables/0/columns/1/label": "Description", "/versions/15/tables/1/columns/0/label": "Field", "/versions/15/tables/1/columns/1/label": "Type", "/versions/15/tables/1/columns/2/label": "Length", "/versions/15/tables/1/columns/3/label": "Description", "/versions/15/tables/2/columns/0/label": "Field", "/versions/15/tables/2/columns/1/label": "Type", "/versions/15/tables/2/columns/2/label": "Length", "/versions/15/tables/2/columns/3/label": "Description"}, "fallback_fields": [], "source_language": "en", "original_snapshot_sha256": "e61fd3c3f0927e4b772c8a656200291beeebf0e12e44a082a829a312d18d8f64"}, "comparison_data": {"layouts": [{"key": "layout-0", "rows": [{"c0": "PageHeaderData", "c1": "24 bytes long. Contains general information about the page, including free space pointers."}, {"c0": "ItemIdData", "c1": "Array of item identifiers pointing to the actual items. Each entry is an (offset,length) pair. 4 bytes per item."}, {"c0": "Free space", "c1": "The unallocated space. New item identifiers are allocated from the start of this area, new items from the end."}, {"c0": "Items", "c1": "The actual items themselves."}, {"c0": "Special space", "c1": "Index access method specific data. Different methods store different data. Empty in ordinary tables."}], "title": "Overall Page Layout", "columns": [{"key": "c0", "label": "Item"}, {"key": "c1", "label": "Description"}]}, {"key": "layout-1", "rows": [{"c0": "pd_lsn", "c1": "PageXLogRecPtr", "c2": "8 bytes", "c3": "LSN: next byte after last byte of WAL record for last change to this page"}, {"c0": "pd_checksum", "c1": "uint16", "c2": "2 bytes", "c3": "Page checksum"}, {"c0": "pd_flags", "c1": "uint16", "c2": "2 bytes", "c3": "Flag bits"}, {"c0": "pd_lower", "c1": "LocationIndex", "c2": "2 bytes", "c3": "Offset to start of free space"}, {"c0": "pd_upper", "c1": "LocationIndex", "c2": "2 bytes", "c3": "Offset to end of free space"}, {"c0": "pd_special", "c1": "LocationIndex", "c2": "2 bytes", "c3": "Offset to start of special space"}, {"c0": "pd_pagesize_version", "c1": "uint16", "c2": "2 bytes", "c3": "Page size and layout version number information"}, {"c0": "pd_prune_xid", "c1": "TransactionId", "c2": "4 bytes", "c3": "Oldest unpruned XMAX on page, or zero if none"}], "title": "PageHeaderData Layout", "columns": [{"key": "c0", "label": "Field"}, {"key": "c1", "label": "Type"}, {"key": "c2", "label": "Length"}, {"key": "c3", "label": "Description"}]}, {"key": "layout-2", "rows": [{"c0": "t_xmin", "c1": "TransactionId", "c2": "4 bytes", "c3": "insert XID stamp"}, {"c0": "t_xmax", "c1": "TransactionId", "c2": "4 bytes", "c3": "delete XID stamp"}, {"c0": "t_cid", "c1": "CommandId", "c2": "4 bytes", "c3": "insert and/or delete CID stamp (overlays with t_xvac)"}, {"c0": "t_xvac", "c1": "TransactionId", "c2": "4 bytes", "c3": "XID for VACUUM operation moving a row version"}, {"c0": "t_ctid", "c1": "ItemPointerData", "c2": "6 bytes", "c3": "current TID of this or newer row version"}, {"c0": "t_infomask2", "c1": "uint16", "c2": "2 bytes", "c3": "number of attributes, plus various flag bits"}, {"c0": "t_infomask", "c1": "uint16", "c2": "2 bytes", "c3": "various flag bits"}, {"c0": "t_hoff", "c1": "uint8", "c2": "1 byte", "c3": "offset to user data"}], "title": "HeapTupleHeaderData Layout", "columns": [{"key": "c0", "label": "Field"}, {"key": "c1", "label": "Type"}, {"key": "c2", "label": "Length"}, {"key": "c3", "label": "Description"}]}]}, "comparison_hash": "b621fa85b3be27a0eb0d82986e9524f2ef0a776761901f0d429826eec4822d0a", "manual_language": "zh"}, "16": {"facts": [{"label": "\u5b9a\u4e49\u8303\u56f4", "value": "\u540c\u7248\u672c\u6838\u5fc3\u7269\u7406\u5b58\u50a8\u6587\u6863"}], "tables": [{"key": "layout-0", "rows": [{"c0": "PageHeaderData", "c1": "\u957f 24 \u5b57\u8282\uff0c\u5305\u542b\u9875\u9762\u7684\u901a\u7528\u4fe1\u606f\uff0c\u4f8b\u5982\u7a7a\u95f2\u7a7a\u95f4\u6307\u9488\u3002"}, {"c0": "ItemIdData", "c1": "\u6307\u5411\u5b9e\u9645\u6570\u636e\u9879\u7684\u884c\u6307\u9488\u6570\u7ec4\u3002\u6bcf\u9879\u4e3a\u4e00\u4e2a\uff08\u504f\u79fb\uff0c\u957f\u5ea6\uff09\u5bf9\uff0c\u5360 4 \u5b57\u8282\u3002"}, {"c0": "\u7a7a\u95f2\u7a7a\u95f4", "c1": "\u5c1a\u672a\u5206\u914d\u7684\u7a7a\u95f4\u3002\u65b0\u884c\u6307\u9488\u4ece\u8be5\u533a\u57df\u7684\u8d77\u59cb\u5904\u5206\u914d\uff0c\u65b0\u6570\u636e\u9879\u4ece\u672b\u5c3e\u5904\u5206\u914d\u3002"}, {"c0": "\u9879", "c1": "\u5b9e\u9645\u7684\u6570\u636e\u9879\u672c\u8eab\u3002"}, {"c0": "\u7279\u6b8a\u7a7a\u95f4", "c1": "\u7d22\u5f15\u8bbf\u95ee\u65b9\u6cd5\u4e13\u7528\u6570\u636e\u3002\u4e0d\u540c\u65b9\u6cd5\u5b58\u50a8\u7684\u5185\u5bb9\u4e0d\u540c\uff0c\u666e\u901a\u8868\u4e2d\u6b64\u533a\u57df\u4e3a\u7a7a\u3002"}], "title": "\u9875\u9762\u603b\u4f53\u5e03\u5c40", "columns": [{"key": "c0", "label": "\u9879\u76ee"}, {"key": "c1", "label": "\u8bf4\u660e"}]}, {"key": "layout-1", "rows": [{"c0": "pd_lsn", "c1": "PageXLogRecPtr", "c2": "8 \u5b57\u8282", "c3": "LSN\uff1a\u8be5\u9875\u6700\u540e\u4e00\u6b21\u53d8\u5316\u6240\u5bf9\u5e94 WAL \u8bb0\u5f55\u7684\u6700\u540e\u4e00\u4e2a\u5b57\u8282\u4e4b\u540e\u7684\u4f4d\u7f6e\u3002"}, {"c0": "pd_checksum", "c1": "uint16", "c2": "2 \u5b57\u8282", "c3": "\u9875\u9762\u6821\u9a8c\u548c"}, {"c0": "pd_flags", "c1": "uint16", "c2": "2 \u5b57\u8282", "c3": "\u6807\u5fd7\u4f4d"}, {"c0": "pd_lower", "c1": "LocationIndex", "c2": "2 \u5b57\u8282", "c3": "\u7a7a\u95f2\u7a7a\u95f4\u8d77\u59cb\u4f4d\u7f6e\u7684\u504f\u79fb\u91cf"}, {"c0": "pd_upper", "c1": "LocationIndex", "c2": "2 \u5b57\u8282", "c3": "\u7a7a\u95f2\u7a7a\u95f4\u7ed3\u675f\u4f4d\u7f6e\u7684\u504f\u79fb\u91cf"}, {"c0": "pd_special", "c1": "LocationIndex", "c2": "2 \u5b57\u8282", "c3": "\u7279\u6b8a\u7a7a\u95f4\u8d77\u59cb\u4f4d\u7f6e\u7684\u504f\u79fb\u91cf"}, {"c0": "pd_pagesize_version", "c1": "uint16", "c2": "2 \u5b57\u8282", "c3": "\u9875\u9762\u5927\u5c0f\u4e0e\u5e03\u5c40\u7248\u672c\u53f7\u4fe1\u606f"}, {"c0": "pd_prune_xid", "c1": "TransactionId", "c2": "4 \u5b57\u8282", "c3": "\u9875\u9762\u4e0a\u6700\u65e9\u7684\u5c1a\u672a\u4fee\u526a\u7684 XMAX\uff1b\u6ca1\u6709\u5219\u4e3a\u96f6"}], "title": "PageHeaderData \u5e03\u5c40", "columns": [{"key": "c0", "label": "\u5b57\u6bb5"}, {"key": "c1", "label": "\u7c7b\u578b"}, {"key": "c2", "label": "\u957f\u5ea6"}, {"key": "c3", "label": "\u8bf4\u660e"}]}, {"key": "layout-2", "rows": [{"c0": "t_xmin", "c1": "TransactionId", "c2": "4 \u5b57\u8282", "c3": "\u63d2\u5165\u4e8b\u52a1\u7684 XID"}, {"c0": "t_xmax", "c1": "TransactionId", "c2": "4 \u5b57\u8282", "c3": "\u5220\u9664\u4e8b\u52a1\u7684 XID"}, {"c0": "t_cid", "c1": "CommandId", "c2": "4 \u5b57\u8282", "c3": "\u63d2\u5165\u548c\uff0f\u6216\u5220\u9664\u547d\u4ee4\u7684 CID\uff0c\u4e0e t_xvac \u5171\u7528\u5b58\u50a8\u4f4d\u7f6e"}, {"c0": "t_xvac", "c1": "TransactionId", "c2": "4 \u5b57\u8282", "c3": "VACUUM \u64cd\u4f5c\u79fb\u52a8\u884c\u7248\u672c\u65f6\u4f7f\u7528\u7684 XID"}, {"c0": "t_ctid", "c1": "ItemPointerData", "c2": "6 \u5b57\u8282", "c3": "\u672c\u884c\u7248\u672c\u6216\u8f83\u65b0\u884c\u7248\u672c\u7684\u5f53\u524d TID"}, {"c0": "t_infomask2", "c1": "uint16", "c2": "2 \u5b57\u8282", "c3": "\u5c5e\u6027\u6570\u91cf\u53ca\u5404\u79cd\u6807\u5fd7\u4f4d"}, {"c0": "t_infomask", "c1": "uint16", "c2": "2 \u5b57\u8282", "c3": "\u5404\u79cd\u6807\u5fd7\u4f4d"}, {"c0": "t_hoff", "c1": "uint8", "c2": "1 \u5b57\u8282", "c3": "\u7528\u6237\u6570\u636e\u7684\u504f\u79fb\u91cf"}], "title": "HeapTupleHeaderData \u5e03\u5c40", "columns": [{"key": "c0", "label": "\u5b57\u6bb5"}, {"key": "c1", "label": "\u7c7b\u578b"}, {"key": "c2", "label": "\u957f\u5ea6"}, {"key": "c3", "label": "\u8bf4\u660e"}]}], "diagram": "page-layout", "related": [{"url": "/wiki/tableam/?v=16", "label": "Table AM"}, {"url": "/wiki/relopts/?v=16", "label": "\u5b58\u50a8\u53c2\u6570"}], "release": {"ref": "https://ftp.postgresql.org/pub/source/v16.15/postgresql-16.15.tar.bz2", "label": "16.15", "major": "16", "channel": "stable", "revision": "c1575341fa7bd40f5274ea465b34390f4dc64cdd0770af327005caaeb9f6b7ed"}, "sources": [{"url": "https://pg.center/docs/16/storage-page-layout.html", "path": "storage-page-layout.html", "label": "PostgreSQL 16 English manual", "sha256": "8575d1a8e8bb10ffdccc043783fce8d53e59bd6e98f1cd66b3761a90d4d77c27", "language": "en", "original_url": "/docs/16/storage-page-layout.html"}], "sections": [], "signature": "", "description": ["\u672c\u8282\u6982\u8ff0 PostgreSQL \u8868\u548c\u7d22\u5f15\u5185\u90e8\u6240\u4f7f\u7528\u7684\u9875\u9762\u683c\u5f0f\u3002 [17] \u5e8f\u5217\u548c TOAST \u8868\u7684\u683c\u5f0f\u4e0e\u666e\u901a\u8868\u76f8\u540c\u3002"], "manual_html": "<div class=\"sect1\">\n<div class=\"titlepage\">\n<div>\n<div>\n<h2 class=\"title\" lang=\"zh\">\n<div>\n<div>\n<h2 class=\"title\" style=\"clear: both\">73.6.\u00a0\u6570\u636e\u5e93\u9875\u9762\u5e03\u5c40 </h2>\n</div>\n</div>\n</h2>\n</div>\n</div>\n</div>\n<p lang=\"zh\">\u672c\u8282\u6982\u8ff0 <span class=\"productname\">PostgreSQL</span> \u8868\u548c\u7d22\u5f15\u5185\u90e8\u6240\u4f7f\u7528\u7684\u9875\u9762\u683c\u5f0f\u3002<a class=\"footnote\" href=\"/docs/16/storage-page-layout.html#ftn.id-1.10.24.8.2.2\"><sup class=\"footnote\" id=\"id-1.10.24.8.2.2\">[17]</sup></a> \u5e8f\u5217\u548c <acronym class=\"acronym\">TOAST</acronym> \u8868\u7684\u683c\u5f0f\u4e0e\u666e\u901a\u8868\u76f8\u540c\u3002</p>\n<p lang=\"zh\">\u5728\u4e0b\u9762\u7684\u8bf4\u660e\u4e2d\uff0c\u5047\u5b9a\u4e00\u4e2a<em class=\"firstterm\">\u5b57\u8282</em>\u5305\u542b 8 \u4e2a\u4f4d\u3002\u53e6\u5916\uff0c\u672f\u8bed<em class=\"firstterm\">\u9879</em>\u6307\u7684\u662f\u5b58\u50a8\u5728\u9875\u9762\u4e0a\u7684\u5355\u4e2a\u6570\u636e\u503c\u3002\u5728\u8868\u4e2d\uff0c\u9879\u662f\u4e00\u884c\uff1b\u5728\u7d22\u5f15\u4e2d\uff0c\u9879\u662f\u4e00\u6761\u7d22\u5f15\u6761\u76ee\u3002</p>\n<p lang=\"zh\">\u6bcf\u4e2a\u8868\u548c\u7d22\u5f15\u90fd\u5b58\u50a8\u4e3a\u56fa\u5b9a\u5927\u5c0f\u7684<em class=\"firstterm\">\u9875\u9762</em>\u6570\u7ec4\uff08\u901a\u5e38\u4e3a 8 kB\uff0c\u4e0d\u8fc7\u5728\u7f16\u8bd1\u670d\u52a1\u5668\u65f6\u53ef\u4ee5\u9009\u62e9\u4e0d\u540c\u7684\u9875\u9762\u5927\u5c0f\uff09\u3002\u5728\u8868\u4e2d\uff0c\u6240\u6709\u9875\u9762\u5728\u903b\u8f91\u4e0a\u90fd\u662f\u7b49\u4ef7\u7684\uff0c\u56e0\u6b64\u67d0\u4e2a\u7279\u5b9a\u9879\uff08\u884c\uff09\u53ef\u4ee5\u5b58\u653e\u5728\u4efb\u610f\u9875\u9762\u4e2d\u3002\u5728\u7d22\u5f15\u4e2d\uff0c\u7b2c\u4e00\u9875\u901a\u5e38\u4fdd\u7559\u4e3a<em class=\"firstterm\">\u5143\u9875</em>\uff0c\u7528\u4e8e\u4fdd\u5b58\u63a7\u5236\u4fe1\u606f\uff1b\u5e76\u4e14\u6839\u636e\u7d22\u5f15\u8bbf\u95ee\u65b9\u6cd5\u7684\u4e0d\u540c\uff0c\u7d22\u5f15\u4e2d\u8fd8\u53ef\u80fd\u5b58\u5728\u4e0d\u540c\u7c7b\u578b\u7684\u9875\u9762\u3002</p>\n<p lang=\"zh\"><a class=\"xref\" href=\"/docs/16/storage-page-layout.html#PAGE-TABLE\" title=\"\u8868\u00a073.2.\u00a0\u603b\u4f53\u9875\u9762\u5e03\u5c40\">\u8868\u00a073.2</a>\u5c55\u793a\u4e86\u9875\u9762\u7684\u603b\u4f53\u5e03\u5c40\u3002\u6bcf\u4e2a\u9875\u9762\u5305\u542b\u4e94\u4e2a\u90e8\u5206\u3002</p>\n<div class=\"table\">\n<p class=\"title\" lang=\"zh\"><strong>\u8868\u00a073.2.\u00a0\u603b\u4f53\u9875\u9762\u5e03\u5c40</strong></p>\n<div class=\"table-contents\">\n<table class=\"table\">\n<thead>\n<tr>\n<th lang=\"zh\">\u9879\u76ee</th>\n<th lang=\"zh\">\u8bf4\u660e</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>PageHeaderData</td>\n<td lang=\"zh\">\u957f 24 \u5b57\u8282\uff0c\u5305\u542b\u9875\u9762\u7684\u901a\u7528\u4fe1\u606f\uff0c\u4f8b\u5982\u7a7a\u95f2\u7a7a\u95f4\u6307\u9488\u3002</td>\n</tr>\n<tr>\n<td>ItemIdData</td>\n<td lang=\"zh\">\u6307\u5411\u5b9e\u9645\u6570\u636e\u9879\u7684\u884c\u6307\u9488\u6570\u7ec4\u3002\u6bcf\u9879\u4e3a\u4e00\u4e2a\uff08\u504f\u79fb\uff0c\u957f\u5ea6\uff09\u5bf9\uff0c\u5360 4 \u5b57\u8282\u3002</td>\n</tr>\n<tr>\n<td lang=\"zh\">\u7a7a\u95f2\u7a7a\u95f4</td>\n<td lang=\"zh\">\u5c1a\u672a\u5206\u914d\u7684\u7a7a\u95f4\u3002\u65b0\u884c\u6307\u9488\u4ece\u8be5\u533a\u57df\u7684\u8d77\u59cb\u5904\u5206\u914d\uff0c\u65b0\u6570\u636e\u9879\u4ece\u672b\u5c3e\u5904\u5206\u914d\u3002</td>\n</tr>\n<tr>\n<td lang=\"zh\">\u9879</td>\n<td lang=\"zh\">\u5b9e\u9645\u7684\u6570\u636e\u9879\u672c\u8eab\u3002</td>\n</tr>\n<tr>\n<td lang=\"zh\">\u7279\u6b8a\u7a7a\u95f4</td>\n<td lang=\"zh\">\u7d22\u5f15\u8bbf\u95ee\u65b9\u6cd5\u4e13\u7528\u6570\u636e\u3002\u4e0d\u540c\u65b9\u6cd5\u5b58\u50a8\u7684\u5185\u5bb9\u4e0d\u540c\uff0c\u666e\u901a\u8868\u4e2d\u6b64\u533a\u57df\u4e3a\u7a7a\u3002</td>\n</tr>\n</tbody>\n</table>\n</div>\n</div><br class=\"table-break\"/>\n<p lang=\"zh\">\u6bcf\u9875\u7684\u524d 24 \u5b57\u8282\u662f\u9875\u9996\u90e8 PageHeaderData\uff0c\u8be6\u7ec6\u683c\u5f0f\u89c1\u8868 73.3\u3002\u7b2c\u4e00\u4e2a\u5b57\u6bb5\u8ddf\u8e2a\u4e0e\u8be5\u9875\u76f8\u5173\u7684\u6700\u8fd1\u4e00\u6761 WAL \u8bb0\u5f55\uff1b\u7b2c\u4e8c\u4e2a\u5b57\u6bb5\u5728\u542f\u7528\u6570\u636e\u6821\u9a8c\u548c\u65f6\u4fdd\u5b58\u9875\u9762\u6821\u9a8c\u548c\u3002\u4e4b\u540e\u662f\u4e00\u4e2a\u5305\u542b\u6807\u5fd7\u4f4d\u7684 2 \u5b57\u8282\u5b57\u6bb5\uff0c\u518d\u540e\u9762\u662f\u4e09\u4e2a 2 \u5b57\u8282\u6574\u6570 pd_lower\u3001pd_upper \u548c pd_special\uff0c\u5206\u522b\u8bb0\u5f55\u4ece\u9875\u8d77\u70b9\u5230\u672a\u5206\u914d\u7a7a\u95f4\u8d77\u70b9\u3001\u672a\u5206\u914d\u7a7a\u95f4\u7ec8\u70b9\u53ca\u7279\u6b8a\u7a7a\u95f4\u8d77\u70b9\u7684\u5b57\u8282\u504f\u79fb\u91cf\u3002\u63a5\u4e0b\u6765\u7684 2 \u5b57\u8282 pd_pagesize_version \u540c\u65f6\u4fdd\u5b58\u9875\u5927\u5c0f\u548c\u7248\u672c\u6807\u8bc6\u3002PostgreSQL 8.3 \u8d77\u7248\u672c\u53f7\u4e3a 4\uff1b8.1 \u4e0e 8.2 \u4f7f\u7528 3\uff1b8.0 \u4f7f\u7528 2\uff1b7.3 \u4e0e 7.4 \u4f7f\u7528 1\uff1b\u66f4\u65e9\u7248\u672c\u4f7f\u7528 0\u3002\u591a\u6570\u7248\u672c\u7684\u57fa\u672c\u9875\u9762\u5e03\u5c40\u548c\u9996\u90e8\u683c\u5f0f\u5e76\u672a\u53d8\u5316\uff0c\u4f46\u5806\u884c\u9996\u90e8\u5e03\u5c40\u6709\u53d8\u5316\u3002\u9875\u5927\u5c0f\u57fa\u672c\u53ea\u7528\u4e8e\u4ea4\u53c9\u68c0\u67e5\uff1b\u540c\u4e00\u5b89\u88c5\u4e0d\u652f\u6301\u591a\u79cd\u9875\u5927\u5c0f\u3002\u6700\u540e\u4e00\u4e2a\u5b57\u6bb5\u63d0\u793a\u4fee\u526a\u8be5\u9875\u662f\u5426\u53ef\u80fd\u6709\u76ca\uff0c\u8bb0\u5f55\u8be5\u9875\u6700\u65e9\u7684\u5c1a\u672a\u4fee\u526a\u7684 XMAX\u3002</p>\n<div class=\"table\">\n<p class=\"title\" lang=\"zh\"><strong>\u8868\u00a073.3.\u00a0PageHeaderData \u5e03\u5c40</strong></p>\n<div class=\"table-contents\">\n<table class=\"table\">\n<thead>\n<tr>\n<th lang=\"zh\">\u5b57\u6bb5</th>\n<th lang=\"zh\">\u7c7b\u578b</th>\n<th lang=\"zh\">\u957f\u5ea6</th>\n<th lang=\"zh\">\u8bf4\u660e</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>pd_lsn</td>\n<td>PageXLogRecPtr</td>\n<td lang=\"zh\">8 \u5b57\u8282</td>\n<td lang=\"zh\">LSN\uff1a\u8be5\u9875\u6700\u540e\u4e00\u6b21\u53d8\u5316\u6240\u5bf9\u5e94 WAL \u8bb0\u5f55\u7684\u6700\u540e\u4e00\u4e2a\u5b57\u8282\u4e4b\u540e\u7684\u4f4d\u7f6e\u3002</td>\n</tr>\n<tr>\n<td>pd_checksum</td>\n<td>uint16</td>\n<td lang=\"zh\">2 \u5b57\u8282</td>\n<td lang=\"zh\">\u9875\u9762\u6821\u9a8c\u548c</td>\n</tr>\n<tr>\n<td>pd_flags</td>\n<td>uint16</td>\n<td lang=\"zh\">2 \u5b57\u8282</td>\n<td lang=\"zh\">\u6807\u5fd7\u4f4d</td>\n</tr>\n<tr>\n<td>pd_lower</td>\n<td>LocationIndex</td>\n<td lang=\"zh\">2 \u5b57\u8282</td>\n<td lang=\"zh\">\u7a7a\u95f2\u7a7a\u95f4\u8d77\u59cb\u4f4d\u7f6e\u7684\u504f\u79fb\u91cf</td>\n</tr>\n<tr>\n<td>pd_upper</td>\n<td>LocationIndex</td>\n<td lang=\"zh\">2 \u5b57\u8282</td>\n<td lang=\"zh\">\u7a7a\u95f2\u7a7a\u95f4\u7ed3\u675f\u4f4d\u7f6e\u7684\u504f\u79fb\u91cf</td>\n</tr>\n<tr>\n<td>pd_special</td>\n<td>LocationIndex</td>\n<td lang=\"zh\">2 \u5b57\u8282</td>\n<td lang=\"zh\">\u7279\u6b8a\u7a7a\u95f4\u8d77\u59cb\u4f4d\u7f6e\u7684\u504f\u79fb\u91cf</td>\n</tr>\n<tr>\n<td>pd_pagesize_version</td>\n<td>uint16</td>\n<td lang=\"zh\">2 \u5b57\u8282</td>\n<td lang=\"zh\">\u9875\u9762\u5927\u5c0f\u4e0e\u5e03\u5c40\u7248\u672c\u53f7\u4fe1\u606f</td>\n</tr>\n<tr>\n<td>pd_prune_xid</td>\n<td>TransactionId</td>\n<td lang=\"zh\">4 \u5b57\u8282</td>\n<td lang=\"zh\">\u9875\u9762\u4e0a\u6700\u65e9\u7684\u5c1a\u672a\u4fee\u526a\u7684 XMAX\uff1b\u6ca1\u6709\u5219\u4e3a\u96f6</td>\n</tr>\n</tbody>\n</table>\n</div>\n</div><br class=\"table-break\"/>\n<p lang=\"zh\">\u6240\u6709\u7ec6\u8282\u90fd\u53ef\u4ee5\u5728 <code class=\"filename\">src/include/storage/bufpage.h</code> \u4e2d\u627e\u5230\u3002</p>\n<p lang=\"zh\">\u9875\u5934\u4e4b\u540e\u662f\u9879\u6807\u8bc6\u7b26\uff08<code class=\"type\">ItemIdData</code>\uff09\uff0c\u6bcf\u4e2a\u9700\u8981\u56db\u4e2a\u5b57\u8282\u3002\u4e00\u4e2a\u9879\u6807\u8bc6\u7b26\u5305\u542b\u9879\u8d77\u59cb\u4f4d\u7f6e\u7684\u5b57\u8282\u504f\u79fb\u91cf\u3001\u5176\u5b57\u8282\u957f\u5ea6\uff0c\u4ee5\u53ca\u82e5\u5e72\u5f71\u54cd\u89e3\u91ca\u65b9\u5f0f\u7684\u5c5e\u6027\u4f4d\u3002\u65b0\u7684\u9879\u6807\u8bc6\u7b26\u4f1a\u6839\u636e\u9700\u8981\u4ece\u672a\u5206\u914d\u7a7a\u95f4\u7684\u8d77\u59cb\u5904\u5206\u914d\u3002\u5f53\u524d\u5df2\u6709\u591a\u5c11\u4e2a\u9879\u6807\u8bc6\u7b26\uff0c\u53ef\u4ee5\u901a\u8fc7\u67e5\u770b <code class=\"structfield\">pd_lower</code> \u5f97\u77e5\uff1b\u5206\u914d\u65b0\u6807\u8bc6\u7b26\u65f6\u5b83\u4f1a\u589e\u52a0\u3002\u56e0\u4e3a\u4e00\u4e2a\u9879\u6807\u8bc6\u7b26\u5728\u88ab\u91ca\u653e\u4e4b\u524d\u6c38\u8fdc\u4e0d\u4f1a\u79fb\u52a8\uff0c\u6240\u4ee5\u5373\u4f7f\u9879\u672c\u8eab\u4e3a\u4e86\u6574\u7406\u7a7a\u95f2\u7a7a\u95f4\u800c\u5728\u9875\u9762\u5185\u79fb\u52a8\uff0c\u5176\u7d22\u5f15\u4ecd\u7136\u53ef\u4ee5\u88ab\u957f\u671f\u7528\u6765\u5f15\u7528\u8be5\u9879\u3002\u4e8b\u5b9e\u4e0a\uff0c\u6bcf\u4e2a\u6307\u5411\u9879\u7684\u6307\u9488\uff08<code class=\"type\">ItemPointer</code>\uff0c\u4e5f\u79f0 <code class=\"type\">CTID</code>\uff09\u5728 <span class=\"productname\">PostgreSQL</span> \u4e2d\u90fd\u7531\u9875\u53f7\u548c\u9879\u6807\u8bc6\u7b26\u7d22\u5f15\u6784\u6210\u3002</p>\n<p lang=\"zh\">\u9879\u672c\u8eab\u5b58\u50a8\u5728\u4ece\u672a\u5206\u914d\u7a7a\u95f4\u672b\u5c3e\u5f00\u59cb\u3001\u5411\u540e\u5206\u914d\u7684\u533a\u57df\u4e2d\u3002\u5176\u786e\u5207\u7ed3\u6784\u53d6\u51b3\u4e8e\u8868\u8981\u5305\u542b\u4ec0\u4e48\u5185\u5bb9\u3002\u8868\u548c\u5e8f\u5217\u90fd\u4f7f\u7528\u4e00\u79cd\u540d\u4e3a <code class=\"type\">HeapTupleHeaderData</code> \u7684\u7ed3\u6784\u4f53\uff0c\u5982\u4e0b\u6240\u8ff0\u3002</p>\n<p lang=\"zh\">\u6700\u540e\u4e00\u90e8\u5206\u662f<span class=\"quote\">\u201c<span class=\"quote\">\u7279\u6b8a\u90e8\u5206</span>\u201d</span>\uff0c\u5176\u4e2d\u53ef\u4ee5\u5b58\u653e\u8bbf\u95ee\u65b9\u6cd5\u5e0c\u671b\u4fdd\u5b58\u7684\u4efb\u4f55\u5185\u5bb9\u3002\u4f8b\u5982\uff0cB-\u6811\u7d22\u5f15\u4f1a\u5728\u8fd9\u91cc\u4fdd\u5b58\u6307\u5411\u9875\u9762\u5de6\u3001\u53f3\u5144\u5f1f\u7684\u94fe\u63a5\uff0c\u4ee5\u53ca\u5176\u4ed6\u4e00\u4e9b\u4e0e\u7d22\u5f15\u7ed3\u6784\u76f8\u5173\u7684\u6570\u636e\u3002\u666e\u901a\u8868\u5b8c\u5168\u4e0d\u4f7f\u7528\u7279\u6b8a\u90e8\u5206\uff08\u901a\u8fc7\u5c06 <code class=\"structfield\">pd_special</code> \u8bbe\u4e3a\u9875\u9762\u5927\u5c0f\u6765\u8868\u793a\uff09\u3002</p>\n<p lang=\"zh\"><a class=\"xref\" href=\"/docs/16/storage-page-layout.html#STORAGE-PAGE-LAYOUT-FIGURE\" title=\"\u56fe\u00a073.1.\u00a0\u9875\u9762\u5e03\u5c40\">\u56fe\u00a073.1</a>\u5c55\u793a\u4e86\u8fd9\u4e9b\u90e8\u5206\u5728\u9875\u9762\u4e2d\u7684\u5e03\u5c40\u65b9\u5f0f\u3002</p>\n<div class=\"figure col-xl-8 col-lg-10 col-md-12\">\n<p class=\"title\" lang=\"zh\">\n<p class=\"title\"><strong>\u56fe\u00a073.1.\u00a0\u9875\u9762\u5e03\u5c40</strong></p>\n<div class=\"figure-contents\">\n<div class=\"mediaobject\">\n<object data=\"pagelayout.svg\" type=\"image/svg+xml\" width=\"100%\">\n</object>\n</div>\n</div>\n</p>\n<div class=\"figure-contents\">\n<div class=\"mediaobject\">\n</div>\n</div>\n</div><br class=\"figure-break\"/>\n<div class=\"sect2\">\n<div class=\"titlepage\">\n<div>\n<div>\n<h3 class=\"title\" lang=\"zh\">\n<dl class=\"toc\">\n<dt><span class=\"sect2\"><a href=\"/docs/16/storage-page-layout.html#STORAGE-TUPLE-LAYOUT\">73.6.1. \u8868\u884c\u5e03\u5c40</a></span></dt>\n</dl>\n</h3>\n</div>\n</div>\n</div>\n<p lang=\"zh\">\u6240\u6709\u8868\u884c\u7684\u7ed3\u6784\u90fd\u76f8\u540c\u3002\u5b83\u4eec\u90fd\u6709\u4e00\u4e2a\u56fa\u5b9a\u5927\u5c0f\u7684\u5934\u90e8\uff08\u5728\u5927\u591a\u6570\u673a\u5668\u4e0a\u5360 23 \u5b57\u8282\uff09\uff0c\u540e\u9762\u8ddf\u7740\u53ef\u9009\u7684\u7a7a\u503c\u4f4d\u56fe\u3001\u53ef\u9009\u7684\u5bf9\u8c61 ID \u5b57\u6bb5\u4ee5\u53ca\u7528\u6237\u6570\u636e\u3002\u5934\u90e8\u7684\u8be6\u7ec6\u683c\u5f0f\u89c1<a class=\"xref\" href=\"/docs/16/storage-page-layout.html#HEAPTUPLEHEADERDATA-TABLE\" title=\"\u8868\u00a073.4.\u00a0HeapTupleHeaderData \u5e03\u5c40\">\u8868\u00a073.4</a>\u3002\u5b9e\u9645\u7528\u6237\u6570\u636e\uff08\u884c\u7684\u5404\u5217\uff09\u4ece <code class=\"structfield\">t_hoff</code> \u6307\u793a\u7684\u504f\u79fb\u4f4d\u7f6e\u5f00\u59cb\uff0c\u5b83\u5fc5\u987b\u59cb\u7ec8\u662f\u8be5\u5e73\u53f0 MAXALIGN \u5bf9\u9f50\u5355\u4f4d\u7684\u6574\u6570\u500d\u3002\u53ea\u6709\u5f53 <em class=\"firstterm\">HEAP_HASNULL</em> \u4f4d\u5728 <code class=\"structfield\">t_infomask</code> \u4e2d\u88ab\u7f6e\u4f4d\u65f6\uff0c\u7a7a\u503c\u4f4d\u56fe\u624d\u5b58\u5728\u3002\u82e5\u5b58\u5728\uff0c\u5b83\u7d27\u968f\u56fa\u5b9a\u5934\u90e8\u4e4b\u540e\uff0c\u5e76\u5360\u7528\u8db3\u591f\u591a\u7684\u5b57\u8282\uff0c\u4ee5\u4fbf\u4e3a\u6bcf\u4e2a\u6570\u636e\u5217\u63d0\u4f9b\u4e00\u4f4d\uff08\u4e5f\u5c31\u662f\u8bf4\uff0c\u5176\u4f4d\u6570\u7b49\u4e8e <code class=\"structfield\">t_infomask2</code> \u4e2d\u7684\u5c5e\u6027\u4e2a\u6570\uff09\u3002\u5728\u8fd9\u4e2a\u4f4d\u56fe\u4e2d\uff0c1 \u8868\u793a\u975e\u7a7a\uff0c0 \u8868\u793a\u7a7a\u503c\u3002\u5f53\u4f4d\u56fe\u4e0d\u5b58\u5728\u65f6\uff0c\u5047\u5b9a\u6240\u6709\u5217\u90fd\u975e\u7a7a\u3002\u53ea\u6709\u5f53 <em class=\"firstterm\">HEAP_HASOID_OLD</em> \u4f4d\u5728 <code class=\"structfield\">t_infomask</code> \u4e2d\u88ab\u7f6e\u4f4d\u65f6\uff0c\u5bf9\u8c61 ID \u624d\u5b58\u5728\u3002\u82e5\u5b58\u5728\uff0c\u5b83\u4f4d\u4e8e <code class=\"structfield\">t_hoff</code> \u8fb9\u754c\u4e4b\u524d\u3002\u4e3a\u4e86\u8ba9 <code class=\"structfield\">t_hoff</code> \u6210\u4e3a MAXALIGN \u7684\u6574\u6570\u500d\u6240\u9700\u7684\u4efb\u4f55\u586b\u5145\uff0c\u90fd\u4f1a\u51fa\u73b0\u5728\u7a7a\u503c\u4f4d\u56fe\u4e0e\u5bf9\u8c61 ID \u4e4b\u95f4\u3002\uff08\u8fd9\u53c8\u53cd\u8fc7\u6765\u4fdd\u8bc1\u4e86\u5bf9\u8c61 ID \u7684\u5bf9\u9f50\u662f\u5408\u9002\u7684\u3002\uff09</p>\n<div class=\"table\">\n<p class=\"title\" lang=\"zh\"><strong>\u8868\u00a073.4.\u00a0HeapTupleHeaderData \u5e03\u5c40</strong></p>\n<div class=\"table-contents\">\n<table class=\"table\">\n<thead>\n<tr>\n<th lang=\"zh\">\u5b57\u6bb5</th>\n<th lang=\"zh\">\u7c7b\u578b</th>\n<th lang=\"zh\">\u957f\u5ea6</th>\n<th lang=\"zh\">\u8bf4\u660e</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>t_xmin</td>\n<td>TransactionId</td>\n<td lang=\"zh\">4 \u5b57\u8282</td>\n<td lang=\"zh\">\u63d2\u5165\u4e8b\u52a1\u7684 XID</td>\n</tr>\n<tr>\n<td>t_xmax</td>\n<td>TransactionId</td>\n<td lang=\"zh\">4 \u5b57\u8282</td>\n<td lang=\"zh\">\u5220\u9664\u4e8b\u52a1\u7684 XID</td>\n</tr>\n<tr>\n<td>t_cid</td>\n<td>CommandId</td>\n<td lang=\"zh\">4 \u5b57\u8282</td>\n<td lang=\"zh\">\u63d2\u5165\u548c\uff0f\u6216\u5220\u9664\u547d\u4ee4\u7684 CID\uff0c\u4e0e t_xvac \u5171\u7528\u5b58\u50a8\u4f4d\u7f6e</td>\n</tr>\n<tr>\n<td>t_xvac</td>\n<td>TransactionId</td>\n<td lang=\"zh\">4 \u5b57\u8282</td>\n<td lang=\"zh\">VACUUM \u64cd\u4f5c\u79fb\u52a8\u884c\u7248\u672c\u65f6\u4f7f\u7528\u7684 XID</td>\n</tr>\n<tr>\n<td>t_ctid</td>\n<td>ItemPointerData</td>\n<td lang=\"zh\">6 \u5b57\u8282</td>\n<td lang=\"zh\">\u672c\u884c\u7248\u672c\u6216\u8f83\u65b0\u884c\u7248\u672c\u7684\u5f53\u524d TID</td>\n</tr>\n<tr>\n<td>t_infomask2</td>\n<td>uint16</td>\n<td lang=\"zh\">2 \u5b57\u8282</td>\n<td lang=\"zh\">\u5c5e\u6027\u6570\u91cf\u53ca\u5404\u79cd\u6807\u5fd7\u4f4d</td>\n</tr>\n<tr>\n<td>t_infomask</td>\n<td>uint16</td>\n<td lang=\"zh\">2 \u5b57\u8282</td>\n<td lang=\"zh\">\u5404\u79cd\u6807\u5fd7\u4f4d</td>\n</tr>\n<tr>\n<td>t_hoff</td>\n<td>uint8</td>\n<td lang=\"zh\">1 \u5b57\u8282</td>\n<td lang=\"zh\">\u7528\u6237\u6570\u636e\u7684\u504f\u79fb\u91cf</td>\n</tr>\n</tbody>\n</table>\n</div>\n</div><br class=\"table-break\"/>\n<p lang=\"zh\">\u6240\u6709\u7ec6\u8282\u90fd\u53ef\u4ee5\u5728 <code class=\"filename\">src/include/access/htup_details.h</code> \u4e2d\u627e\u5230\u3002</p>\n<p lang=\"zh\">\u8981\u89e3\u91ca\u5b9e\u9645\u6570\u636e\uff0c\u5fc5\u987b\u501f\u52a9\u4ece\u5176\u4ed6\u8868\u4e2d\u83b7\u5f97\u7684\u4fe1\u606f\uff0c\u5176\u4e2d\u5927\u90e8\u5206\u6765\u81ea <code class=\"structname\">pg_attribute</code>\u3002\u8bc6\u522b\u5b57\u6bb5\u4f4d\u7f6e\u6240\u9700\u7684\u5173\u952e\u503c\u662f <code class=\"structfield\">attlen</code> \u548c <code class=\"structfield\">attalign</code>\u3002\u9664\u975e\u6240\u6709\u5b57\u6bb5\u90fd\u662f\u5b9a\u5bbd\u4e14\u6ca1\u6709\u7a7a\u503c\uff0c\u5426\u5219\u6ca1\u6709\u529e\u6cd5\u76f4\u63a5\u53d6\u5f97\u67d0\u4e2a\u7279\u5b9a\u5c5e\u6027\u3002\u6240\u6709\u8fd9\u4e9b\u6280\u5de7\u90fd\u5c01\u88c5\u5728 <em class=\"firstterm\">heap_getattr</em>\u3001<em class=\"firstterm\">fastgetattr</em> \u548c <em class=\"firstterm\">heap_getsysattr</em> \u8fd9\u4e9b\u51fd\u6570\u4e2d\u3002</p>\n<p lang=\"zh\">\u8bfb\u53d6\u6570\u636e\u65f6\uff0c\u9700\u8981\u4f9d\u6b21\u68c0\u67e5\u6bcf\u4e2a\u5c5e\u6027\u3002\u9996\u5148\u6839\u636e\u7a7a\u503c\u4f4d\u56fe\u5224\u65ad\u8be5\u5b57\u6bb5\u662f\u5426\u4e3a NULL\u3002\u5982\u679c\u662f\uff0c\u5c31\u7ee7\u7eed\u4e0b\u4e00\u4e2a\u3002\u7136\u540e\u786e\u8ba4\u5bf9\u9f50\u662f\u5426\u6b63\u786e\u3002\u5982\u679c\u5b57\u6bb5\u662f\u5b9a\u5bbd\u5b57\u6bb5\uff0c\u90a3\u4e48\u5b83\u7684\u6240\u6709\u5b57\u8282\u90fd\u662f\u76f4\u63a5\u6446\u653e\u7684\uff1b\u5982\u679c\u5b83\u662f\u53d8\u957f\u5b57\u6bb5\uff08attlen = -1\uff09\uff0c\u60c5\u51b5\u5c31\u4f1a\u7a0d\u590d\u6742\u4e00\u4e9b\u3002\u6240\u6709\u53d8\u957f\u6570\u636e\u7c7b\u578b\u90fd\u5171\u4eab\u4e00\u4e2a\u901a\u7528\u5934\u90e8\u7ed3\u6784\u4f53 <code class=\"type\">struct varlena</code>\uff0c\u5176\u4e2d\u5305\u542b\u5df2\u5b58\u50a8\u503c\u7684\u603b\u957f\u5ea6\u4ee5\u53ca\u4e00\u4e9b\u6807\u5fd7\u4f4d\u3002\u6839\u636e\u8fd9\u4e9b\u6807\u5fd7\uff0c\u6570\u636e\u53ef\u80fd\u662f\u884c\u5185\u5b58\u50a8\u7684\uff0c\u4e5f\u53ef\u80fd\u4f4d\u4e8e <acronym class=\"acronym\">TOAST</acronym> \u8868\u4e2d\uff1b\u5b83\u4e5f\u53ef\u80fd\u662f\u7ecf\u8fc7\u538b\u7f29\u7684\uff08\u89c1<a class=\"xref\" href=\"/docs/16/storage-toast.html\" title=\"73.2.\u00a0TOAST\">\u7b2c\u00a073.2\u00a0\u8282</a>\uff09\u3002</p>\n</div>\n<div class=\"footnotes\">\n<br/>\n<hr/>\n<div class=\"footnote\">\n<p lang=\"zh\">\n<br/>\n<hr style=\"width:100; text-align:left;margin-left: 0\"/>\n<div class=\"footnote\" id=\"ftn.id-1.10.24.8.2.2\">\n<p><a class=\"para\" href=\"/docs/16/storage-page-layout.html#id-1.10.24.8.2.2\"><sup class=\"para\">[17]</sup></a> \u5b9e\u9645\u4e0a\uff0c\u8868\u8bbf\u95ee\u65b9\u6cd5\u548c\u7d22\u5f15\u8bbf\u95ee\u65b9\u6cd5\u90fd\u4e0d\u8981\u6c42\u5fc5\u987b\u4f7f\u7528\u8fd9\u79cd\u9875\u9762\u683c\u5f0f\u3002<code class=\"literal\">heap</code> \u8868\u8bbf\u95ee\u65b9\u6cd5\u59cb\u7ec8\u4f7f\u7528\u8fd9\u79cd\u683c\u5f0f\u3002\u73b0\u6709\u7684\u6240\u6709\u7d22\u5f15\u65b9\u6cd5\u4e5f\u90fd\u4f7f\u7528\u8fd9\u79cd\u57fa\u672c\u683c\u5f0f\uff0c\u4f46\u7d22\u5f15\u5143\u9875\u4e2d\u4fdd\u5b58\u7684\u6570\u636e\u901a\u5e38\u5e76\u4e0d\u9075\u5faa\u9879\u5e03\u5c40\u89c4\u5219\u3002</p>\n</div>\n</p>\n</div>\n</div>\n</div>", "manual_path": "/docs/16/storage-page-layout.html", "localization": {"status": "complete", "sources": [{"url": "/docs/16/storage-page-layout.html", "method": "same-major semantic node", "sha256": "bf698675faf9fb84f4a709e4067ed25bc2ecbc55b98c2ea893349308b5af9d43", "language": "zh", "matched_nodes": ["#STORAGE-PAGE-LAYOUT/div[0]", "#STORAGE-PAGE-LAYOUT/div[16]", "#STORAGE-PAGE-LAYOUT/div[18]/div[2]/p[0]", "#STORAGE-PAGE-LAYOUT/div[18]/p[1]", "#STORAGE-PAGE-LAYOUT/div[18]/p[4]", "#STORAGE-PAGE-LAYOUT/div[18]/p[5]", "#STORAGE-PAGE-LAYOUT/div[18]/p[6]", "#STORAGE-PAGE-LAYOUT/div[19]", "#STORAGE-PAGE-LAYOUT/div[1]", "#STORAGE-PAGE-LAYOUT/div[6]/div[1]/table[0]/tbody[2]/tr[3]/td[0]", "#STORAGE-PAGE-LAYOUT/div[6]/p[0]", "#STORAGE-PAGE-LAYOUT/div[9]/div[1]/table[0]/tbody[2]/tr[0]/td[2]", "#STORAGE-PAGE-LAYOUT/div[9]/p[0]", "#STORAGE-PAGE-LAYOUT/p[11]", "#STORAGE-PAGE-LAYOUT/p[12]", "#STORAGE-PAGE-LAYOUT/p[13]", "#STORAGE-PAGE-LAYOUT/p[14]", "#STORAGE-PAGE-LAYOUT/p[15]", "#STORAGE-PAGE-LAYOUT/p[2]", "#STORAGE-PAGE-LAYOUT/p[3]", "#STORAGE-PAGE-LAYOUT/p[4]", "#STORAGE-PAGE-LAYOUT/p[5]"]}], "language": "zh", "original_text": {"/versions/16/description/0": "This section provides an overview of the page format used within PostgreSQL tables and indexes. [17] Sequences and TOAST tables are formatted just like a regular table.", "/versions/16/facts/0/label": "Definition scope", "/versions/16/facts/0/value": "Same-version core physical storage documentation", "/versions/16/tables/0/title": "Overall Page Layout", "/versions/16/tables/1/title": "PageHeaderData Layout", "/versions/16/tables/2/title": "HeapTupleHeaderData Layout", "/versions/16/related/1/label": "Storage Parameters", "/versions/16/tables/0/rows/0/c1": "24 bytes long. Contains general information about the page, including free space pointers.", "/versions/16/tables/0/rows/1/c1": "Array of item identifiers pointing to the actual items. Each entry is an (offset,length) pair. 4 bytes per item.", "/versions/16/tables/0/rows/2/c0": "Free space", "/versions/16/tables/0/rows/2/c1": "The unallocated space. New item identifiers are allocated from the start of this area, new items from the end.", "/versions/16/tables/0/rows/3/c0": "Items", "/versions/16/tables/0/rows/3/c1": "The actual items themselves.", "/versions/16/tables/0/rows/4/c0": "Special space", "/versions/16/tables/0/rows/4/c1": "Index access method specific data. Different methods store different data. Empty in ordinary tables.", "/versions/16/tables/1/rows/0/c2": "8 bytes", "/versions/16/tables/1/rows/0/c3": "LSN: next byte after last byte of WAL record for last change to this page", "/versions/16/tables/1/rows/1/c2": "2 bytes", "/versions/16/tables/1/rows/1/c3": "Page checksum", "/versions/16/tables/1/rows/2/c2": "2 bytes", "/versions/16/tables/1/rows/2/c3": "Flag bits", "/versions/16/tables/1/rows/3/c2": "2 bytes", "/versions/16/tables/1/rows/3/c3": "Offset to start of free space", "/versions/16/tables/1/rows/4/c2": "2 bytes", "/versions/16/tables/1/rows/4/c3": "Offset to end of free space", "/versions/16/tables/1/rows/5/c2": "2 bytes", "/versions/16/tables/1/rows/5/c3": "Offset to start of special space", "/versions/16/tables/1/rows/6/c2": "2 bytes", "/versions/16/tables/1/rows/6/c3": "Page size and layout version number information", "/versions/16/tables/1/rows/7/c2": "4 bytes", "/versions/16/tables/1/rows/7/c3": "Oldest unpruned XMAX on page, or zero if none", "/versions/16/tables/2/rows/0/c2": "4 bytes", "/versions/16/tables/2/rows/0/c3": "insert XID stamp", "/versions/16/tables/2/rows/1/c2": "4 bytes", "/versions/16/tables/2/rows/1/c3": "delete XID stamp", "/versions/16/tables/2/rows/2/c2": "4 bytes", "/versions/16/tables/2/rows/2/c3": "insert and/or delete CID stamp (overlays with t_xvac)", "/versions/16/tables/2/rows/3/c2": "4 bytes", "/versions/16/tables/2/rows/3/c3": "XID for VACUUM operation moving a row version", "/versions/16/tables/2/rows/4/c2": "6 bytes", "/versions/16/tables/2/rows/4/c3": "current TID of this or newer row version", "/versions/16/tables/2/rows/5/c2": "2 bytes", "/versions/16/tables/2/rows/5/c3": "number of attributes, plus various flag bits", "/versions/16/tables/2/rows/6/c2": "2 bytes", "/versions/16/tables/2/rows/6/c3": "various flag bits", "/versions/16/tables/2/rows/7/c2": "1 byte", "/versions/16/tables/2/rows/7/c3": "offset to user data", "/versions/16/tables/0/columns/0/label": "Item", "/versions/16/tables/0/columns/1/label": "Description", "/versions/16/tables/1/columns/0/label": "Field", "/versions/16/tables/1/columns/1/label": "Type", "/versions/16/tables/1/columns/2/label": "Length", "/versions/16/tables/1/columns/3/label": "Description", "/versions/16/tables/2/columns/0/label": "Field", "/versions/16/tables/2/columns/1/label": "Type", "/versions/16/tables/2/columns/2/label": "Length", "/versions/16/tables/2/columns/3/label": "Description"}, "fallback_fields": [], "source_language": "en", "original_snapshot_sha256": "e1df8334a9883479b66243f0a9b720d8ebf5954fbe6e1f08d2980ced037e0c6e"}, "comparison_data": {"layouts": [{"key": "layout-0", "rows": [{"c0": "PageHeaderData", "c1": "24 bytes long. Contains general information about the page, including free space pointers."}, {"c0": "ItemIdData", "c1": "Array of item identifiers pointing to the actual items. Each entry is an (offset,length) pair. 4 bytes per item."}, {"c0": "Free space", "c1": "The unallocated space. New item identifiers are allocated from the start of this area, new items from the end."}, {"c0": "Items", "c1": "The actual items themselves."}, {"c0": "Special space", "c1": "Index access method specific data. Different methods store different data. Empty in ordinary tables."}], "title": "Overall Page Layout", "columns": [{"key": "c0", "label": "Item"}, {"key": "c1", "label": "Description"}]}, {"key": "layout-1", "rows": [{"c0": "pd_lsn", "c1": "PageXLogRecPtr", "c2": "8 bytes", "c3": "LSN: next byte after last byte of WAL record for last change to this page"}, {"c0": "pd_checksum", "c1": "uint16", "c2": "2 bytes", "c3": "Page checksum"}, {"c0": "pd_flags", "c1": "uint16", "c2": "2 bytes", "c3": "Flag bits"}, {"c0": "pd_lower", "c1": "LocationIndex", "c2": "2 bytes", "c3": "Offset to start of free space"}, {"c0": "pd_upper", "c1": "LocationIndex", "c2": "2 bytes", "c3": "Offset to end of free space"}, {"c0": "pd_special", "c1": "LocationIndex", "c2": "2 bytes", "c3": "Offset to start of special space"}, {"c0": "pd_pagesize_version", "c1": "uint16", "c2": "2 bytes", "c3": "Page size and layout version number information"}, {"c0": "pd_prune_xid", "c1": "TransactionId", "c2": "4 bytes", "c3": "Oldest unpruned XMAX on page, or zero if none"}], "title": "PageHeaderData Layout", "columns": [{"key": "c0", "label": "Field"}, {"key": "c1", "label": "Type"}, {"key": "c2", "label": "Length"}, {"key": "c3", "label": "Description"}]}, {"key": "layout-2", "rows": [{"c0": "t_xmin", "c1": "TransactionId", "c2": "4 bytes", "c3": "insert XID stamp"}, {"c0": "t_xmax", "c1": "TransactionId", "c2": "4 bytes", "c3": "delete XID stamp"}, {"c0": "t_cid", "c1": "CommandId", "c2": "4 bytes", "c3": "insert and/or delete CID stamp (overlays with t_xvac)"}, {"c0": "t_xvac", "c1": "TransactionId", "c2": "4 bytes", "c3": "XID for VACUUM operation moving a row version"}, {"c0": "t_ctid", "c1": "ItemPointerData", "c2": "6 bytes", "c3": "current TID of this or newer row version"}, {"c0": "t_infomask2", "c1": "uint16", "c2": "2 bytes", "c3": "number of attributes, plus various flag bits"}, {"c0": "t_infomask", "c1": "uint16", "c2": "2 bytes", "c3": "various flag bits"}, {"c0": "t_hoff", "c1": "uint8", "c2": "1 byte", "c3": "offset to user data"}], "title": "HeapTupleHeaderData Layout", "columns": [{"key": "c0", "label": "Field"}, {"key": "c1", "label": "Type"}, {"key": "c2", "label": "Length"}, {"key": "c3", "label": "Description"}]}]}, "comparison_hash": "b621fa85b3be27a0eb0d82986e9524f2ef0a776761901f0d429826eec4822d0a", "manual_language": "zh"}, "17": {"facts": [{"label": "\u5b9a\u4e49\u8303\u56f4", "value": "\u540c\u7248\u672c\u6838\u5fc3\u7269\u7406\u5b58\u50a8\u6587\u6863"}], "tables": [{"key": "layout-0", "rows": [{"c0": "PageHeaderData", "c1": "\u957f 24 \u5b57\u8282\uff0c\u5305\u542b\u9875\u9762\u7684\u901a\u7528\u4fe1\u606f\uff0c\u4f8b\u5982\u7a7a\u95f2\u7a7a\u95f4\u6307\u9488\u3002"}, {"c0": "ItemIdData", "c1": "\u6307\u5411\u5b9e\u9645\u6570\u636e\u9879\u7684\u884c\u6307\u9488\u6570\u7ec4\u3002\u6bcf\u9879\u4e3a\u4e00\u4e2a\uff08\u504f\u79fb\uff0c\u957f\u5ea6\uff09\u5bf9\uff0c\u5360 4 \u5b57\u8282\u3002"}, {"c0": "\u7a7a\u95f2\u7a7a\u95f4", "c1": "\u5c1a\u672a\u5206\u914d\u7684\u7a7a\u95f4\u3002\u65b0\u884c\u6307\u9488\u4ece\u8be5\u533a\u57df\u7684\u8d77\u59cb\u5904\u5206\u914d\uff0c\u65b0\u6570\u636e\u9879\u4ece\u672b\u5c3e\u5904\u5206\u914d\u3002"}, {"c0": "\u9879", "c1": "\u5b9e\u9645\u7684\u6570\u636e\u9879\u672c\u8eab\u3002"}, {"c0": "\u7279\u6b8a\u7a7a\u95f4", "c1": "\u7d22\u5f15\u8bbf\u95ee\u65b9\u6cd5\u4e13\u7528\u6570\u636e\u3002\u4e0d\u540c\u65b9\u6cd5\u5b58\u50a8\u7684\u5185\u5bb9\u4e0d\u540c\uff0c\u666e\u901a\u8868\u4e2d\u6b64\u533a\u57df\u4e3a\u7a7a\u3002"}], "title": "\u9875\u9762\u603b\u4f53\u5e03\u5c40", "columns": [{"key": "c0", "label": "\u9879\u76ee"}, {"key": "c1", "label": "\u8bf4\u660e"}]}, {"key": "layout-1", "rows": [{"c0": "pd_lsn", "c1": "PageXLogRecPtr", "c2": "8 \u5b57\u8282", "c3": "LSN\uff1a\u8be5\u9875\u6700\u540e\u4e00\u6b21\u53d8\u5316\u6240\u5bf9\u5e94 WAL \u8bb0\u5f55\u7684\u6700\u540e\u4e00\u4e2a\u5b57\u8282\u4e4b\u540e\u7684\u4f4d\u7f6e\u3002"}, {"c0": "pd_checksum", "c1": "uint16", "c2": "2 \u5b57\u8282", "c3": "\u9875\u9762\u6821\u9a8c\u548c"}, {"c0": "pd_flags", "c1": "uint16", "c2": "2 \u5b57\u8282", "c3": "\u6807\u5fd7\u4f4d"}, {"c0": "pd_lower", "c1": "LocationIndex", "c2": "2 \u5b57\u8282", "c3": "\u7a7a\u95f2\u7a7a\u95f4\u8d77\u59cb\u4f4d\u7f6e\u7684\u504f\u79fb\u91cf"}, {"c0": "pd_upper", "c1": "LocationIndex", "c2": "2 \u5b57\u8282", "c3": "\u7a7a\u95f2\u7a7a\u95f4\u7ed3\u675f\u4f4d\u7f6e\u7684\u504f\u79fb\u91cf"}, {"c0": "pd_special", "c1": "LocationIndex", "c2": "2 \u5b57\u8282", "c3": "\u7279\u6b8a\u7a7a\u95f4\u8d77\u59cb\u4f4d\u7f6e\u7684\u504f\u79fb\u91cf"}, {"c0": "pd_pagesize_version", "c1": "uint16", "c2": "2 \u5b57\u8282", "c3": "\u9875\u9762\u5927\u5c0f\u4e0e\u5e03\u5c40\u7248\u672c\u53f7\u4fe1\u606f"}, {"c0": "pd_prune_xid", "c1": "TransactionId", "c2": "4 \u5b57\u8282", "c3": "\u9875\u9762\u4e0a\u6700\u65e9\u7684\u5c1a\u672a\u4fee\u526a\u7684 XMAX\uff1b\u6ca1\u6709\u5219\u4e3a\u96f6"}], "title": "PageHeaderData \u5e03\u5c40", "columns": [{"key": "c0", "label": "\u5b57\u6bb5"}, {"key": "c1", "label": "\u7c7b\u578b"}, {"key": "c2", "label": "\u957f\u5ea6"}, {"key": "c3", "label": "\u8bf4\u660e"}]}, {"key": "layout-2", "rows": [{"c0": "t_xmin", "c1": "TransactionId", "c2": "4 \u5b57\u8282", "c3": "\u63d2\u5165\u4e8b\u52a1\u7684 XID"}, {"c0": "t_xmax", "c1": "TransactionId", "c2": "4 \u5b57\u8282", "c3": "\u5220\u9664\u4e8b\u52a1\u7684 XID"}, {"c0": "t_cid", "c1": "CommandId", "c2": "4 \u5b57\u8282", "c3": "\u63d2\u5165\u548c\uff0f\u6216\u5220\u9664\u547d\u4ee4\u7684 CID\uff0c\u4e0e t_xvac \u5171\u7528\u5b58\u50a8\u4f4d\u7f6e"}, {"c0": "t_xvac", "c1": "TransactionId", "c2": "4 \u5b57\u8282", "c3": "VACUUM \u64cd\u4f5c\u79fb\u52a8\u884c\u7248\u672c\u65f6\u4f7f\u7528\u7684 XID"}, {"c0": "t_ctid", "c1": "ItemPointerData", "c2": "6 \u5b57\u8282", "c3": "\u672c\u884c\u7248\u672c\u6216\u8f83\u65b0\u884c\u7248\u672c\u7684\u5f53\u524d TID"}, {"c0": "t_infomask2", "c1": "uint16", "c2": "2 \u5b57\u8282", "c3": "\u5c5e\u6027\u6570\u91cf\u53ca\u5404\u79cd\u6807\u5fd7\u4f4d"}, {"c0": "t_infomask", "c1": "uint16", "c2": "2 \u5b57\u8282", "c3": "\u5404\u79cd\u6807\u5fd7\u4f4d"}, {"c0": "t_hoff", "c1": "uint8", "c2": "1 \u5b57\u8282", "c3": "\u7528\u6237\u6570\u636e\u7684\u504f\u79fb\u91cf"}], "title": "HeapTupleHeaderData \u5e03\u5c40", "columns": [{"key": "c0", "label": "\u5b57\u6bb5"}, {"key": "c1", "label": "\u7c7b\u578b"}, {"key": "c2", "label": "\u957f\u5ea6"}, {"key": "c3", "label": "\u8bf4\u660e"}]}], "diagram": "page-layout", "related": [{"url": "/wiki/tableam/?v=17", "label": "Table AM"}, {"url": "/wiki/relopts/?v=17", "label": "\u5b58\u50a8\u53c2\u6570"}], "release": {"ref": "https://ftp.postgresql.org/pub/source/v17.11/postgresql-17.11.tar.bz2", "label": "17.11", "major": "17", "channel": "stable", "revision": "dd27f2b3c59e73ed14aa3324901242bf69a032a6347805f274e6260322d42979"}, "sources": [{"url": "https://pg.center/docs/17/storage-page-layout.html", "path": "storage-page-layout.html", "label": "PostgreSQL 17 English manual", "sha256": "4ce2b67f1bce18b942c991f7f9ea2c9e048b128ca179967c5e5ae26336262876", "language": "en", "original_url": "/docs/17/storage-page-layout.html"}], "sections": [], "signature": "", "description": ["\u672c\u8282\u6982\u8ff0 PostgreSQL \u8868\u548c\u7d22\u5f15\u5185\u90e8\u6240\u4f7f\u7528\u7684\u9875\u9762\u683c\u5f0f\u3002 [17] \u5e8f\u5217\u548c TOAST \u8868\u7684\u683c\u5f0f\u4e0e\u666e\u901a\u8868\u76f8\u540c\u3002"], "manual_html": "<div class=\"sect1\">\n<div class=\"titlepage\">\n<div>\n<div>\n<h2 class=\"title\" lang=\"zh\">\n<div>\n<div>\n<h2 class=\"title\" style=\"clear: both\">65.6.\u00a0\u6570\u636e\u5e93\u9875\u9762\u5e03\u5c40 </h2>\n</div>\n</div>\n</h2>\n</div>\n</div>\n</div>\n<p lang=\"zh\">\u672c\u8282\u6982\u8ff0 <span class=\"productname\">PostgreSQL</span> \u8868\u548c\u7d22\u5f15\u5185\u90e8\u6240\u4f7f\u7528\u7684\u9875\u9762\u683c\u5f0f\u3002<a class=\"footnote\" href=\"/docs/17/storage-page-layout.html#ftn.id-1.10.18.8.2.2\"><sup class=\"footnote\" id=\"id-1.10.18.8.2.2\">[17]</sup></a> \u5e8f\u5217\u548c <acronym class=\"acronym\">TOAST</acronym> \u8868\u7684\u683c\u5f0f\u4e0e\u666e\u901a\u8868\u76f8\u540c\u3002</p>\n<p lang=\"zh\">\u5728\u4e0b\u9762\u7684\u8bf4\u660e\u4e2d\uff0c\u5047\u5b9a\u4e00\u4e2a<em class=\"firstterm\">\u5b57\u8282</em>\u5305\u542b 8 \u4e2a\u4f4d\u3002\u53e6\u5916\uff0c\u672f\u8bed<em class=\"firstterm\">\u9879</em>\u6307\u7684\u662f\u5b58\u50a8\u5728\u9875\u9762\u4e0a\u7684\u5355\u4e2a\u6570\u636e\u503c\u3002\u5728\u8868\u4e2d\uff0c\u9879\u662f\u4e00\u884c\uff1b\u5728\u7d22\u5f15\u4e2d\uff0c\u9879\u662f\u4e00\u6761\u7d22\u5f15\u6761\u76ee\u3002</p>\n<p lang=\"zh\">\u6bcf\u4e2a\u8868\u548c\u7d22\u5f15\u90fd\u5b58\u50a8\u4e3a\u56fa\u5b9a\u5927\u5c0f\u7684<em class=\"firstterm\">\u9875\u9762</em>\u6570\u7ec4\uff08\u901a\u5e38\u4e3a 8 kB\uff0c\u4e0d\u8fc7\u5728\u7f16\u8bd1\u670d\u52a1\u5668\u65f6\u53ef\u4ee5\u9009\u62e9\u4e0d\u540c\u7684\u9875\u9762\u5927\u5c0f\uff09\u3002\u5728\u8868\u4e2d\uff0c\u6240\u6709\u9875\u9762\u5728\u903b\u8f91\u4e0a\u90fd\u662f\u7b49\u4ef7\u7684\uff0c\u56e0\u6b64\u67d0\u4e2a\u7279\u5b9a\u9879\uff08\u884c\uff09\u53ef\u4ee5\u5b58\u653e\u5728\u4efb\u610f\u9875\u9762\u4e2d\u3002\u5728\u7d22\u5f15\u4e2d\uff0c\u7b2c\u4e00\u9875\u901a\u5e38\u4fdd\u7559\u4e3a<em class=\"firstterm\">\u5143\u9875</em>\uff0c\u7528\u4e8e\u4fdd\u5b58\u63a7\u5236\u4fe1\u606f\uff1b\u5e76\u4e14\u6839\u636e\u7d22\u5f15\u8bbf\u95ee\u65b9\u6cd5\u7684\u4e0d\u540c\uff0c\u7d22\u5f15\u4e2d\u8fd8\u53ef\u80fd\u5b58\u5728\u4e0d\u540c\u7c7b\u578b\u7684\u9875\u9762\u3002</p>\n<p lang=\"zh\"><a class=\"xref\" href=\"/docs/17/storage-page-layout.html#PAGE-TABLE\" title=\"\u8868\u00a065.2.\u00a0\u603b\u4f53\u9875\u9762\u5e03\u5c40\">\u8868\u00a065.2</a>\u5c55\u793a\u4e86\u9875\u9762\u7684\u603b\u4f53\u5e03\u5c40\u3002\u6bcf\u4e2a\u9875\u9762\u5305\u542b\u4e94\u4e2a\u90e8\u5206\u3002</p>\n<div class=\"table\">\n<p class=\"title\" lang=\"zh\"><strong>\u8868\u00a065.2.\u00a0\u603b\u4f53\u9875\u9762\u5e03\u5c40</strong></p>\n<div class=\"table-contents\">\n<table class=\"table\">\n<thead>\n<tr>\n<th lang=\"zh\">\u9879\u76ee</th>\n<th lang=\"zh\">\u8bf4\u660e</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>PageHeaderData</td>\n<td lang=\"zh\">\u957f 24 \u5b57\u8282\uff0c\u5305\u542b\u9875\u9762\u7684\u901a\u7528\u4fe1\u606f\uff0c\u4f8b\u5982\u7a7a\u95f2\u7a7a\u95f4\u6307\u9488\u3002</td>\n</tr>\n<tr>\n<td>ItemIdData</td>\n<td lang=\"zh\">\u6307\u5411\u5b9e\u9645\u6570\u636e\u9879\u7684\u884c\u6307\u9488\u6570\u7ec4\u3002\u6bcf\u9879\u4e3a\u4e00\u4e2a\uff08\u504f\u79fb\uff0c\u957f\u5ea6\uff09\u5bf9\uff0c\u5360 4 \u5b57\u8282\u3002</td>\n</tr>\n<tr>\n<td lang=\"zh\">\u7a7a\u95f2\u7a7a\u95f4</td>\n<td lang=\"zh\">\u5c1a\u672a\u5206\u914d\u7684\u7a7a\u95f4\u3002\u65b0\u884c\u6307\u9488\u4ece\u8be5\u533a\u57df\u7684\u8d77\u59cb\u5904\u5206\u914d\uff0c\u65b0\u6570\u636e\u9879\u4ece\u672b\u5c3e\u5904\u5206\u914d\u3002</td>\n</tr>\n<tr>\n<td lang=\"zh\">\u9879</td>\n<td lang=\"zh\">\u5b9e\u9645\u7684\u6570\u636e\u9879\u672c\u8eab\u3002</td>\n</tr>\n<tr>\n<td lang=\"zh\">\u7279\u6b8a\u7a7a\u95f4</td>\n<td lang=\"zh\">\u7d22\u5f15\u8bbf\u95ee\u65b9\u6cd5\u4e13\u7528\u6570\u636e\u3002\u4e0d\u540c\u65b9\u6cd5\u5b58\u50a8\u7684\u5185\u5bb9\u4e0d\u540c\uff0c\u666e\u901a\u8868\u4e2d\u6b64\u533a\u57df\u4e3a\u7a7a\u3002</td>\n</tr>\n</tbody>\n</table>\n</div>\n</div><br class=\"table-break\"/>\n<p lang=\"zh\">\u6bcf\u9875\u7684\u524d 24 \u5b57\u8282\u662f\u9875\u9996\u90e8 PageHeaderData\uff0c\u8be6\u7ec6\u683c\u5f0f\u89c1\u8868 65.3\u3002\u7b2c\u4e00\u4e2a\u5b57\u6bb5\u8ddf\u8e2a\u4e0e\u8be5\u9875\u76f8\u5173\u7684\u6700\u8fd1\u4e00\u6761 WAL \u8bb0\u5f55\uff1b\u7b2c\u4e8c\u4e2a\u5b57\u6bb5\u5728\u542f\u7528\u6570\u636e\u6821\u9a8c\u548c\u65f6\u4fdd\u5b58\u9875\u9762\u6821\u9a8c\u548c\u3002\u4e4b\u540e\u662f\u4e00\u4e2a\u5305\u542b\u6807\u5fd7\u4f4d\u7684 2 \u5b57\u8282\u5b57\u6bb5\uff0c\u518d\u540e\u9762\u662f\u4e09\u4e2a 2 \u5b57\u8282\u6574\u6570 pd_lower\u3001pd_upper \u548c pd_special\uff0c\u5206\u522b\u8bb0\u5f55\u4ece\u9875\u8d77\u70b9\u5230\u672a\u5206\u914d\u7a7a\u95f4\u8d77\u70b9\u3001\u672a\u5206\u914d\u7a7a\u95f4\u7ec8\u70b9\u53ca\u7279\u6b8a\u7a7a\u95f4\u8d77\u70b9\u7684\u5b57\u8282\u504f\u79fb\u91cf\u3002\u63a5\u4e0b\u6765\u7684 2 \u5b57\u8282 pd_pagesize_version \u540c\u65f6\u4fdd\u5b58\u9875\u5927\u5c0f\u548c\u7248\u672c\u6807\u8bc6\u3002PostgreSQL 8.3 \u8d77\u7248\u672c\u53f7\u4e3a 4\uff1b8.1 \u4e0e 8.2 \u4f7f\u7528 3\uff1b8.0 \u4f7f\u7528 2\uff1b7.3 \u4e0e 7.4 \u4f7f\u7528 1\uff1b\u66f4\u65e9\u7248\u672c\u4f7f\u7528 0\u3002\u591a\u6570\u7248\u672c\u7684\u57fa\u672c\u9875\u9762\u5e03\u5c40\u548c\u9996\u90e8\u683c\u5f0f\u5e76\u672a\u53d8\u5316\uff0c\u4f46\u5806\u884c\u9996\u90e8\u5e03\u5c40\u6709\u53d8\u5316\u3002\u9875\u5927\u5c0f\u57fa\u672c\u53ea\u7528\u4e8e\u4ea4\u53c9\u68c0\u67e5\uff1b\u540c\u4e00\u5b89\u88c5\u4e0d\u652f\u6301\u591a\u79cd\u9875\u5927\u5c0f\u3002\u6700\u540e\u4e00\u4e2a\u5b57\u6bb5\u63d0\u793a\u4fee\u526a\u8be5\u9875\u662f\u5426\u53ef\u80fd\u6709\u76ca\uff0c\u8bb0\u5f55\u8be5\u9875\u6700\u65e9\u7684\u5c1a\u672a\u4fee\u526a\u7684 XMAX\u3002</p>\n<div class=\"table\">\n<p class=\"title\" lang=\"zh\"><strong>\u8868\u00a065.3.\u00a0PageHeaderData \u5e03\u5c40</strong></p>\n<div class=\"table-contents\">\n<table class=\"table\">\n<thead>\n<tr>\n<th lang=\"zh\">\u5b57\u6bb5</th>\n<th lang=\"zh\">\u7c7b\u578b</th>\n<th lang=\"zh\">\u957f\u5ea6</th>\n<th lang=\"zh\">\u8bf4\u660e</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>pd_lsn</td>\n<td>PageXLogRecPtr</td>\n<td lang=\"zh\">8 \u5b57\u8282</td>\n<td lang=\"zh\">LSN\uff1a\u8be5\u9875\u6700\u540e\u4e00\u6b21\u53d8\u5316\u6240\u5bf9\u5e94 WAL \u8bb0\u5f55\u7684\u6700\u540e\u4e00\u4e2a\u5b57\u8282\u4e4b\u540e\u7684\u4f4d\u7f6e\u3002</td>\n</tr>\n<tr>\n<td>pd_checksum</td>\n<td>uint16</td>\n<td lang=\"zh\">2 \u5b57\u8282</td>\n<td lang=\"zh\">\u9875\u9762\u6821\u9a8c\u548c</td>\n</tr>\n<tr>\n<td>pd_flags</td>\n<td>uint16</td>\n<td lang=\"zh\">2 \u5b57\u8282</td>\n<td lang=\"zh\">\u6807\u5fd7\u4f4d</td>\n</tr>\n<tr>\n<td>pd_lower</td>\n<td>LocationIndex</td>\n<td lang=\"zh\">2 \u5b57\u8282</td>\n<td lang=\"zh\">\u7a7a\u95f2\u7a7a\u95f4\u8d77\u59cb\u4f4d\u7f6e\u7684\u504f\u79fb\u91cf</td>\n</tr>\n<tr>\n<td>pd_upper</td>\n<td>LocationIndex</td>\n<td lang=\"zh\">2 \u5b57\u8282</td>\n<td lang=\"zh\">\u7a7a\u95f2\u7a7a\u95f4\u7ed3\u675f\u4f4d\u7f6e\u7684\u504f\u79fb\u91cf</td>\n</tr>\n<tr>\n<td>pd_special</td>\n<td>LocationIndex</td>\n<td lang=\"zh\">2 \u5b57\u8282</td>\n<td lang=\"zh\">\u7279\u6b8a\u7a7a\u95f4\u8d77\u59cb\u4f4d\u7f6e\u7684\u504f\u79fb\u91cf</td>\n</tr>\n<tr>\n<td>pd_pagesize_version</td>\n<td>uint16</td>\n<td lang=\"zh\">2 \u5b57\u8282</td>\n<td lang=\"zh\">\u9875\u9762\u5927\u5c0f\u4e0e\u5e03\u5c40\u7248\u672c\u53f7\u4fe1\u606f</td>\n</tr>\n<tr>\n<td>pd_prune_xid</td>\n<td>TransactionId</td>\n<td lang=\"zh\">4 \u5b57\u8282</td>\n<td lang=\"zh\">\u9875\u9762\u4e0a\u6700\u65e9\u7684\u5c1a\u672a\u4fee\u526a\u7684 XMAX\uff1b\u6ca1\u6709\u5219\u4e3a\u96f6</td>\n</tr>\n</tbody>\n</table>\n</div>\n</div><br class=\"table-break\"/>\n<p lang=\"zh\">\u6240\u6709\u7ec6\u8282\u90fd\u53ef\u4ee5\u5728 <code class=\"filename\">src/include/storage/bufpage.h</code> \u4e2d\u627e\u5230\u3002</p>\n<p lang=\"zh\">\u9875\u5934\u4e4b\u540e\u662f\u9879\u6807\u8bc6\u7b26\uff08<code class=\"type\">ItemIdData</code>\uff09\uff0c\u6bcf\u4e2a\u9700\u8981\u56db\u4e2a\u5b57\u8282\u3002\u4e00\u4e2a\u9879\u6807\u8bc6\u7b26\u5305\u542b\u9879\u8d77\u59cb\u4f4d\u7f6e\u7684\u5b57\u8282\u504f\u79fb\u91cf\u3001\u5176\u5b57\u8282\u957f\u5ea6\uff0c\u4ee5\u53ca\u82e5\u5e72\u5f71\u54cd\u89e3\u91ca\u65b9\u5f0f\u7684\u5c5e\u6027\u4f4d\u3002\u65b0\u7684\u9879\u6807\u8bc6\u7b26\u4f1a\u6839\u636e\u9700\u8981\u4ece\u672a\u5206\u914d\u7a7a\u95f4\u7684\u8d77\u59cb\u5904\u5206\u914d\u3002\u5f53\u524d\u5df2\u6709\u591a\u5c11\u4e2a\u9879\u6807\u8bc6\u7b26\uff0c\u53ef\u4ee5\u901a\u8fc7\u67e5\u770b <code class=\"structfield\">pd_lower</code> \u5f97\u77e5\uff1b\u5206\u914d\u65b0\u6807\u8bc6\u7b26\u65f6\u5b83\u4f1a\u589e\u52a0\u3002\u56e0\u4e3a\u4e00\u4e2a\u9879\u6807\u8bc6\u7b26\u5728\u88ab\u91ca\u653e\u4e4b\u524d\u6c38\u8fdc\u4e0d\u4f1a\u79fb\u52a8\uff0c\u6240\u4ee5\u5373\u4f7f\u9879\u672c\u8eab\u4e3a\u4e86\u6574\u7406\u7a7a\u95f2\u7a7a\u95f4\u800c\u5728\u9875\u9762\u5185\u79fb\u52a8\uff0c\u5176\u7d22\u5f15\u4ecd\u7136\u53ef\u4ee5\u88ab\u957f\u671f\u7528\u6765\u5f15\u7528\u8be5\u9879\u3002\u4e8b\u5b9e\u4e0a\uff0c\u6bcf\u4e2a\u6307\u5411\u9879\u7684\u6307\u9488\uff08<code class=\"type\">ItemPointer</code>\uff0c\u4e5f\u79f0 <code class=\"type\">CTID</code>\uff09\u5728 <span class=\"productname\">PostgreSQL</span> \u4e2d\u90fd\u7531\u9875\u53f7\u548c\u9879\u6807\u8bc6\u7b26\u7d22\u5f15\u6784\u6210\u3002</p>\n<p lang=\"zh\">\u9879\u672c\u8eab\u5b58\u50a8\u5728\u4ece\u672a\u5206\u914d\u7a7a\u95f4\u672b\u5c3e\u5f00\u59cb\u3001\u5411\u540e\u5206\u914d\u7684\u533a\u57df\u4e2d\u3002\u5176\u786e\u5207\u7ed3\u6784\u53d6\u51b3\u4e8e\u8868\u8981\u5305\u542b\u4ec0\u4e48\u5185\u5bb9\u3002\u8868\u548c\u5e8f\u5217\u90fd\u4f7f\u7528\u4e00\u79cd\u540d\u4e3a <code class=\"type\">HeapTupleHeaderData</code> \u7684\u7ed3\u6784\u4f53\uff0c\u5982\u4e0b\u6240\u8ff0\u3002</p>\n<p lang=\"zh\">\u6700\u540e\u4e00\u90e8\u5206\u662f<span class=\"quote\">\u201c<span class=\"quote\">\u7279\u6b8a\u90e8\u5206</span>\u201d</span>\uff0c\u5176\u4e2d\u53ef\u4ee5\u5b58\u653e\u8bbf\u95ee\u65b9\u6cd5\u5e0c\u671b\u4fdd\u5b58\u7684\u4efb\u4f55\u5185\u5bb9\u3002\u4f8b\u5982\uff0cB-\u6811\u7d22\u5f15\u4f1a\u5728\u8fd9\u91cc\u4fdd\u5b58\u6307\u5411\u9875\u9762\u5de6\u3001\u53f3\u5144\u5f1f\u7684\u94fe\u63a5\uff0c\u4ee5\u53ca\u5176\u4ed6\u4e00\u4e9b\u4e0e\u7d22\u5f15\u7ed3\u6784\u76f8\u5173\u7684\u6570\u636e\u3002\u666e\u901a\u8868\u5b8c\u5168\u4e0d\u4f7f\u7528\u7279\u6b8a\u90e8\u5206\uff08\u901a\u8fc7\u5c06 <code class=\"structfield\">pd_special</code> \u8bbe\u4e3a\u9875\u9762\u5927\u5c0f\u6765\u8868\u793a\uff09\u3002</p>\n<p lang=\"zh\"><a class=\"xref\" href=\"/docs/17/storage-page-layout.html#STORAGE-PAGE-LAYOUT-FIGURE\" title=\"\u56fe\u00a065.1.\u00a0\u9875\u9762\u5e03\u5c40\">\u56fe\u00a065.1</a>\u5c55\u793a\u4e86\u8fd9\u4e9b\u90e8\u5206\u5728\u9875\u9762\u4e2d\u7684\u5e03\u5c40\u65b9\u5f0f\u3002</p>\n<div class=\"figure col-xl-8 col-lg-10 col-md-12\">\n<p class=\"title\" lang=\"zh\">\n<p class=\"title\"><strong>\u56fe\u00a065.1.\u00a0\u9875\u9762\u5e03\u5c40</strong></p>\n<div class=\"figure-contents\">\n<div class=\"mediaobject\">\n<object data=\"pagelayout.svg\" type=\"image/svg+xml\" width=\"100%\">\n</object>\n</div>\n</div>\n</p>\n<div class=\"figure-contents\">\n<div class=\"mediaobject\">\n</div>\n</div>\n</div><br class=\"figure-break\"/>\n<div class=\"sect2\">\n<div class=\"titlepage\">\n<div>\n<div>\n<h3 class=\"title\" lang=\"zh\">\n<dl class=\"toc\">\n<dt><span class=\"sect2\"><a href=\"/docs/17/storage-page-layout.html#STORAGE-TUPLE-LAYOUT\">65.6.1. \u8868\u884c\u5e03\u5c40</a></span></dt>\n</dl>\n</h3>\n</div>\n</div>\n</div>\n<p lang=\"zh\">\u6240\u6709\u8868\u884c\u7684\u7ed3\u6784\u90fd\u76f8\u540c\u3002\u5b83\u4eec\u90fd\u6709\u4e00\u4e2a\u56fa\u5b9a\u5927\u5c0f\u7684\u5934\u90e8\uff08\u5728\u5927\u591a\u6570\u673a\u5668\u4e0a\u5360 23 \u5b57\u8282\uff09\uff0c\u540e\u9762\u8ddf\u7740\u53ef\u9009\u7684\u7a7a\u503c\u4f4d\u56fe\u3001\u53ef\u9009\u7684\u5bf9\u8c61 ID \u5b57\u6bb5\u4ee5\u53ca\u7528\u6237\u6570\u636e\u3002\u5934\u90e8\u7684\u8be6\u7ec6\u683c\u5f0f\u89c1<a class=\"xref\" href=\"/docs/17/storage-page-layout.html#HEAPTUPLEHEADERDATA-TABLE\" title=\"\u8868\u00a065.4.\u00a0HeapTupleHeaderData \u5e03\u5c40\">\u8868\u00a065.4</a>\u3002\u5b9e\u9645\u7528\u6237\u6570\u636e\uff08\u884c\u7684\u5404\u5217\uff09\u4ece <code class=\"structfield\">t_hoff</code> \u6307\u793a\u7684\u504f\u79fb\u4f4d\u7f6e\u5f00\u59cb\uff0c\u5b83\u5fc5\u987b\u59cb\u7ec8\u662f\u8be5\u5e73\u53f0 MAXALIGN \u5bf9\u9f50\u5355\u4f4d\u7684\u6574\u6570\u500d\u3002\u53ea\u6709\u5f53 <em class=\"firstterm\">HEAP_HASNULL</em> \u4f4d\u5728 <code class=\"structfield\">t_infomask</code> \u4e2d\u88ab\u7f6e\u4f4d\u65f6\uff0c\u7a7a\u503c\u4f4d\u56fe\u624d\u5b58\u5728\u3002\u82e5\u5b58\u5728\uff0c\u5b83\u7d27\u968f\u56fa\u5b9a\u5934\u90e8\u4e4b\u540e\uff0c\u5e76\u5360\u7528\u8db3\u591f\u591a\u7684\u5b57\u8282\uff0c\u4ee5\u4fbf\u4e3a\u6bcf\u4e2a\u6570\u636e\u5217\u63d0\u4f9b\u4e00\u4f4d\uff08\u4e5f\u5c31\u662f\u8bf4\uff0c\u5176\u4f4d\u6570\u7b49\u4e8e <code class=\"structfield\">t_infomask2</code> \u4e2d\u7684\u5c5e\u6027\u4e2a\u6570\uff09\u3002\u5728\u8fd9\u4e2a\u4f4d\u56fe\u4e2d\uff0c1 \u8868\u793a\u975e\u7a7a\uff0c0 \u8868\u793a\u7a7a\u503c\u3002\u5f53\u4f4d\u56fe\u4e0d\u5b58\u5728\u65f6\uff0c\u5047\u5b9a\u6240\u6709\u5217\u90fd\u975e\u7a7a\u3002\u53ea\u6709\u5f53 <em class=\"firstterm\">HEAP_HASOID_OLD</em> \u4f4d\u5728 <code class=\"structfield\">t_infomask</code> \u4e2d\u88ab\u7f6e\u4f4d\u65f6\uff0c\u5bf9\u8c61 ID \u624d\u5b58\u5728\u3002\u82e5\u5b58\u5728\uff0c\u5b83\u4f4d\u4e8e <code class=\"structfield\">t_hoff</code> \u8fb9\u754c\u4e4b\u524d\u3002\u4e3a\u4e86\u8ba9 <code class=\"structfield\">t_hoff</code> \u6210\u4e3a MAXALIGN \u7684\u6574\u6570\u500d\u6240\u9700\u7684\u4efb\u4f55\u586b\u5145\uff0c\u90fd\u4f1a\u51fa\u73b0\u5728\u7a7a\u503c\u4f4d\u56fe\u4e0e\u5bf9\u8c61 ID \u4e4b\u95f4\u3002\uff08\u8fd9\u53c8\u53cd\u8fc7\u6765\u4fdd\u8bc1\u4e86\u5bf9\u8c61 ID \u7684\u5bf9\u9f50\u662f\u5408\u9002\u7684\u3002\uff09</p>\n<div class=\"table\">\n<p class=\"title\" lang=\"zh\"><strong>\u8868\u00a065.4.\u00a0HeapTupleHeaderData \u5e03\u5c40</strong></p>\n<div class=\"table-contents\">\n<table class=\"table\">\n<thead>\n<tr>\n<th lang=\"zh\">\u5b57\u6bb5</th>\n<th lang=\"zh\">\u7c7b\u578b</th>\n<th lang=\"zh\">\u957f\u5ea6</th>\n<th lang=\"zh\">\u8bf4\u660e</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>t_xmin</td>\n<td>TransactionId</td>\n<td lang=\"zh\">4 \u5b57\u8282</td>\n<td lang=\"zh\">\u63d2\u5165\u4e8b\u52a1\u7684 XID</td>\n</tr>\n<tr>\n<td>t_xmax</td>\n<td>TransactionId</td>\n<td lang=\"zh\">4 \u5b57\u8282</td>\n<td lang=\"zh\">\u5220\u9664\u4e8b\u52a1\u7684 XID</td>\n</tr>\n<tr>\n<td>t_cid</td>\n<td>CommandId</td>\n<td lang=\"zh\">4 \u5b57\u8282</td>\n<td lang=\"zh\">\u63d2\u5165\u548c\uff0f\u6216\u5220\u9664\u547d\u4ee4\u7684 CID\uff0c\u4e0e t_xvac \u5171\u7528\u5b58\u50a8\u4f4d\u7f6e</td>\n</tr>\n<tr>\n<td>t_xvac</td>\n<td>TransactionId</td>\n<td lang=\"zh\">4 \u5b57\u8282</td>\n<td lang=\"zh\">VACUUM \u64cd\u4f5c\u79fb\u52a8\u884c\u7248\u672c\u65f6\u4f7f\u7528\u7684 XID</td>\n</tr>\n<tr>\n<td>t_ctid</td>\n<td>ItemPointerData</td>\n<td lang=\"zh\">6 \u5b57\u8282</td>\n<td lang=\"zh\">\u672c\u884c\u7248\u672c\u6216\u8f83\u65b0\u884c\u7248\u672c\u7684\u5f53\u524d TID</td>\n</tr>\n<tr>\n<td>t_infomask2</td>\n<td>uint16</td>\n<td lang=\"zh\">2 \u5b57\u8282</td>\n<td lang=\"zh\">\u5c5e\u6027\u6570\u91cf\u53ca\u5404\u79cd\u6807\u5fd7\u4f4d</td>\n</tr>\n<tr>\n<td>t_infomask</td>\n<td>uint16</td>\n<td lang=\"zh\">2 \u5b57\u8282</td>\n<td lang=\"zh\">\u5404\u79cd\u6807\u5fd7\u4f4d</td>\n</tr>\n<tr>\n<td>t_hoff</td>\n<td>uint8</td>\n<td lang=\"zh\">1 \u5b57\u8282</td>\n<td lang=\"zh\">\u7528\u6237\u6570\u636e\u7684\u504f\u79fb\u91cf</td>\n</tr>\n</tbody>\n</table>\n</div>\n</div><br class=\"table-break\"/>\n<p lang=\"zh\">\u6240\u6709\u7ec6\u8282\u90fd\u53ef\u4ee5\u5728 <code class=\"filename\">src/include/access/htup_details.h</code> \u4e2d\u627e\u5230\u3002</p>\n<p lang=\"zh\">\u8981\u89e3\u91ca\u5b9e\u9645\u6570\u636e\uff0c\u5fc5\u987b\u501f\u52a9\u4ece\u5176\u4ed6\u8868\u4e2d\u83b7\u5f97\u7684\u4fe1\u606f\uff0c\u5176\u4e2d\u5927\u90e8\u5206\u6765\u81ea <code class=\"structname\">pg_attribute</code>\u3002\u8bc6\u522b\u5b57\u6bb5\u4f4d\u7f6e\u6240\u9700\u7684\u5173\u952e\u503c\u662f <code class=\"structfield\">attlen</code> \u548c <code class=\"structfield\">attalign</code>\u3002\u9664\u975e\u6240\u6709\u5b57\u6bb5\u90fd\u662f\u5b9a\u5bbd\u4e14\u6ca1\u6709\u7a7a\u503c\uff0c\u5426\u5219\u6ca1\u6709\u529e\u6cd5\u76f4\u63a5\u53d6\u5f97\u67d0\u4e2a\u7279\u5b9a\u5c5e\u6027\u3002\u6240\u6709\u8fd9\u4e9b\u6280\u5de7\u90fd\u5c01\u88c5\u5728 <em class=\"firstterm\">heap_getattr</em>\u3001<em class=\"firstterm\">fastgetattr</em> \u548c <em class=\"firstterm\">heap_getsysattr</em> \u8fd9\u4e9b\u51fd\u6570\u4e2d\u3002</p>\n<p lang=\"zh\">\u8bfb\u53d6\u6570\u636e\u65f6\uff0c\u9700\u8981\u4f9d\u6b21\u68c0\u67e5\u6bcf\u4e2a\u5c5e\u6027\u3002\u9996\u5148\u6839\u636e\u7a7a\u503c\u4f4d\u56fe\u5224\u65ad\u8be5\u5b57\u6bb5\u662f\u5426\u4e3a NULL\u3002\u5982\u679c\u662f\uff0c\u5c31\u7ee7\u7eed\u4e0b\u4e00\u4e2a\u3002\u7136\u540e\u786e\u8ba4\u5bf9\u9f50\u662f\u5426\u6b63\u786e\u3002\u5982\u679c\u5b57\u6bb5\u662f\u5b9a\u5bbd\u5b57\u6bb5\uff0c\u90a3\u4e48\u5b83\u7684\u6240\u6709\u5b57\u8282\u90fd\u662f\u76f4\u63a5\u6446\u653e\u7684\uff1b\u5982\u679c\u5b83\u662f\u53d8\u957f\u5b57\u6bb5\uff08attlen = -1\uff09\uff0c\u60c5\u51b5\u5c31\u4f1a\u7a0d\u590d\u6742\u4e00\u4e9b\u3002\u6240\u6709\u53d8\u957f\u6570\u636e\u7c7b\u578b\u90fd\u5171\u4eab\u4e00\u4e2a\u901a\u7528\u5934\u90e8\u7ed3\u6784\u4f53 <code class=\"type\">struct varlena</code>\uff0c\u5176\u4e2d\u5305\u542b\u5df2\u5b58\u50a8\u503c\u7684\u603b\u957f\u5ea6\u4ee5\u53ca\u4e00\u4e9b\u6807\u5fd7\u4f4d\u3002\u6839\u636e\u8fd9\u4e9b\u6807\u5fd7\uff0c\u6570\u636e\u53ef\u80fd\u662f\u884c\u5185\u5b58\u50a8\u7684\uff0c\u4e5f\u53ef\u80fd\u4f4d\u4e8e <acronym class=\"acronym\">TOAST</acronym> \u8868\u4e2d\uff1b\u5b83\u4e5f\u53ef\u80fd\u662f\u7ecf\u8fc7\u538b\u7f29\u7684\uff08\u89c1<a class=\"xref\" href=\"/docs/17/storage-toast.html\" title=\"65.2.\u00a0TOAST\">\u7b2c\u00a065.2\u00a0\u8282</a>\uff09\u3002</p>\n</div>\n<div class=\"footnotes\">\n<br/>\n<hr/>\n<div class=\"footnote\">\n<p lang=\"zh\">\n<br/>\n<hr style=\"width:100; text-align:left;margin-left: 0\"/>\n<div class=\"footnote\" id=\"ftn.id-1.10.18.8.2.2\">\n<p><a class=\"para\" href=\"/docs/17/storage-page-layout.html#id-1.10.18.8.2.2\"><sup class=\"para\">[17]</sup></a> \u5b9e\u9645\u4e0a\uff0c\u8868\u8bbf\u95ee\u65b9\u6cd5\u548c\u7d22\u5f15\u8bbf\u95ee\u65b9\u6cd5\u90fd\u4e0d\u8981\u6c42\u5fc5\u987b\u4f7f\u7528\u8fd9\u79cd\u9875\u9762\u683c\u5f0f\u3002<code class=\"literal\">heap</code> \u8868\u8bbf\u95ee\u65b9\u6cd5\u59cb\u7ec8\u4f7f\u7528\u8fd9\u79cd\u683c\u5f0f\u3002\u73b0\u6709\u7684\u6240\u6709\u7d22\u5f15\u65b9\u6cd5\u4e5f\u90fd\u4f7f\u7528\u8fd9\u79cd\u57fa\u672c\u683c\u5f0f\uff0c\u4f46\u7d22\u5f15\u5143\u9875\u4e2d\u4fdd\u5b58\u7684\u6570\u636e\u901a\u5e38\u5e76\u4e0d\u9075\u5faa\u9879\u5e03\u5c40\u89c4\u5219\u3002</p>\n</div>\n</p>\n</div>\n</div>\n</div>", "manual_path": "/docs/17/storage-page-layout.html", "localization": {"status": "complete", "sources": [{"url": "/docs/17/storage-page-layout.html", "method": "same-major semantic node", "sha256": "5f1706fce27c6505086f0b42549876c32ebaba985b000585c62535c69b933c3f", "language": "zh", "matched_nodes": ["#STORAGE-PAGE-LAYOUT/div[0]", "#STORAGE-PAGE-LAYOUT/div[16]", "#STORAGE-PAGE-LAYOUT/div[18]/div[2]/p[0]", "#STORAGE-PAGE-LAYOUT/div[18]/p[1]", "#STORAGE-PAGE-LAYOUT/div[18]/p[4]", "#STORAGE-PAGE-LAYOUT/div[18]/p[5]", "#STORAGE-PAGE-LAYOUT/div[18]/p[6]", "#STORAGE-PAGE-LAYOUT/div[19]", "#STORAGE-PAGE-LAYOUT/div[1]", "#STORAGE-PAGE-LAYOUT/div[6]/div[1]/table[0]/tbody[2]/tr[3]/td[0]", "#STORAGE-PAGE-LAYOUT/div[6]/p[0]", "#STORAGE-PAGE-LAYOUT/div[9]/div[1]/table[0]/tbody[2]/tr[0]/td[2]", "#STORAGE-PAGE-LAYOUT/div[9]/p[0]", "#STORAGE-PAGE-LAYOUT/p[11]", "#STORAGE-PAGE-LAYOUT/p[12]", "#STORAGE-PAGE-LAYOUT/p[13]", "#STORAGE-PAGE-LAYOUT/p[14]", "#STORAGE-PAGE-LAYOUT/p[15]", "#STORAGE-PAGE-LAYOUT/p[2]", "#STORAGE-PAGE-LAYOUT/p[3]", "#STORAGE-PAGE-LAYOUT/p[4]", "#STORAGE-PAGE-LAYOUT/p[5]"]}], "language": "zh", "original_text": {"/versions/17/description/0": "This section provides an overview of the page format used within PostgreSQL tables and indexes. [17] Sequences and TOAST tables are formatted just like a regular table.", "/versions/17/facts/0/label": "Definition scope", "/versions/17/facts/0/value": "Same-version core physical storage documentation", "/versions/17/tables/0/title": "Overall Page Layout", "/versions/17/tables/1/title": "PageHeaderData Layout", "/versions/17/tables/2/title": "HeapTupleHeaderData Layout", "/versions/17/related/1/label": "Storage Parameters", "/versions/17/tables/0/rows/0/c1": "24 bytes long. Contains general information about the page, including free space pointers.", "/versions/17/tables/0/rows/1/c1": "Array of item identifiers pointing to the actual items. Each entry is an (offset,length) pair. 4 bytes per item.", "/versions/17/tables/0/rows/2/c0": "Free space", "/versions/17/tables/0/rows/2/c1": "The unallocated space. New item identifiers are allocated from the start of this area, new items from the end.", "/versions/17/tables/0/rows/3/c0": "Items", "/versions/17/tables/0/rows/3/c1": "The actual items themselves.", "/versions/17/tables/0/rows/4/c0": "Special space", "/versions/17/tables/0/rows/4/c1": "Index access method specific data. Different methods store different data. Empty in ordinary tables.", "/versions/17/tables/1/rows/0/c2": "8 bytes", "/versions/17/tables/1/rows/0/c3": "LSN: next byte after last byte of WAL record for last change to this page", "/versions/17/tables/1/rows/1/c2": "2 bytes", "/versions/17/tables/1/rows/1/c3": "Page checksum", "/versions/17/tables/1/rows/2/c2": "2 bytes", "/versions/17/tables/1/rows/2/c3": "Flag bits", "/versions/17/tables/1/rows/3/c2": "2 bytes", "/versions/17/tables/1/rows/3/c3": "Offset to start of free space", "/versions/17/tables/1/rows/4/c2": "2 bytes", "/versions/17/tables/1/rows/4/c3": "Offset to end of free space", "/versions/17/tables/1/rows/5/c2": "2 bytes", "/versions/17/tables/1/rows/5/c3": "Offset to start of special space", "/versions/17/tables/1/rows/6/c2": "2 bytes", "/versions/17/tables/1/rows/6/c3": "Page size and layout version number information", "/versions/17/tables/1/rows/7/c2": "4 bytes", "/versions/17/tables/1/rows/7/c3": "Oldest unpruned XMAX on page, or zero if none", "/versions/17/tables/2/rows/0/c2": "4 bytes", "/versions/17/tables/2/rows/0/c3": "insert XID stamp", "/versions/17/tables/2/rows/1/c2": "4 bytes", "/versions/17/tables/2/rows/1/c3": "delete XID stamp", "/versions/17/tables/2/rows/2/c2": "4 bytes", "/versions/17/tables/2/rows/2/c3": "insert and/or delete CID stamp (overlays with t_xvac)", "/versions/17/tables/2/rows/3/c2": "4 bytes", "/versions/17/tables/2/rows/3/c3": "XID for VACUUM operation moving a row version", "/versions/17/tables/2/rows/4/c2": "6 bytes", "/versions/17/tables/2/rows/4/c3": "current TID of this or newer row version", "/versions/17/tables/2/rows/5/c2": "2 bytes", "/versions/17/tables/2/rows/5/c3": "number of attributes, plus various flag bits", "/versions/17/tables/2/rows/6/c2": "2 bytes", "/versions/17/tables/2/rows/6/c3": "various flag bits", "/versions/17/tables/2/rows/7/c2": "1 byte", "/versions/17/tables/2/rows/7/c3": "offset to user data", "/versions/17/tables/0/columns/0/label": "Item", "/versions/17/tables/0/columns/1/label": "Description", "/versions/17/tables/1/columns/0/label": "Field", "/versions/17/tables/1/columns/1/label": "Type", "/versions/17/tables/1/columns/2/label": "Length", "/versions/17/tables/1/columns/3/label": "Description", "/versions/17/tables/2/columns/0/label": "Field", "/versions/17/tables/2/columns/1/label": "Type", "/versions/17/tables/2/columns/2/label": "Length", "/versions/17/tables/2/columns/3/label": "Description"}, "fallback_fields": [], "source_language": "en", "original_snapshot_sha256": "90fb380a8dbeaba5e015588c92a9e9640d55323231b75b8be33abfcdb77b0a5b"}, "comparison_data": {"layouts": [{"key": "layout-0", "rows": [{"c0": "PageHeaderData", "c1": "24 bytes long. Contains general information about the page, including free space pointers."}, {"c0": "ItemIdData", "c1": "Array of item identifiers pointing to the actual items. Each entry is an (offset,length) pair. 4 bytes per item."}, {"c0": "Free space", "c1": "The unallocated space. New item identifiers are allocated from the start of this area, new items from the end."}, {"c0": "Items", "c1": "The actual items themselves."}, {"c0": "Special space", "c1": "Index access method specific data. Different methods store different data. Empty in ordinary tables."}], "title": "Overall Page Layout", "columns": [{"key": "c0", "label": "Item"}, {"key": "c1", "label": "Description"}]}, {"key": "layout-1", "rows": [{"c0": "pd_lsn", "c1": "PageXLogRecPtr", "c2": "8 bytes", "c3": "LSN: next byte after last byte of WAL record for last change to this page"}, {"c0": "pd_checksum", "c1": "uint16", "c2": "2 bytes", "c3": "Page checksum"}, {"c0": "pd_flags", "c1": "uint16", "c2": "2 bytes", "c3": "Flag bits"}, {"c0": "pd_lower", "c1": "LocationIndex", "c2": "2 bytes", "c3": "Offset to start of free space"}, {"c0": "pd_upper", "c1": "LocationIndex", "c2": "2 bytes", "c3": "Offset to end of free space"}, {"c0": "pd_special", "c1": "LocationIndex", "c2": "2 bytes", "c3": "Offset to start of special space"}, {"c0": "pd_pagesize_version", "c1": "uint16", "c2": "2 bytes", "c3": "Page size and layout version number information"}, {"c0": "pd_prune_xid", "c1": "TransactionId", "c2": "4 bytes", "c3": "Oldest unpruned XMAX on page, or zero if none"}], "title": "PageHeaderData Layout", "columns": [{"key": "c0", "label": "Field"}, {"key": "c1", "label": "Type"}, {"key": "c2", "label": "Length"}, {"key": "c3", "label": "Description"}]}, {"key": "layout-2", "rows": [{"c0": "t_xmin", "c1": "TransactionId", "c2": "4 bytes", "c3": "insert XID stamp"}, {"c0": "t_xmax", "c1": "TransactionId", "c2": "4 bytes", "c3": "delete XID stamp"}, {"c0": "t_cid", "c1": "CommandId", "c2": "4 bytes", "c3": "insert and/or delete CID stamp (overlays with t_xvac)"}, {"c0": "t_xvac", "c1": "TransactionId", "c2": "4 bytes", "c3": "XID for VACUUM operation moving a row version"}, {"c0": "t_ctid", "c1": "ItemPointerData", "c2": "6 bytes", "c3": "current TID of this or newer row version"}, {"c0": "t_infomask2", "c1": "uint16", "c2": "2 bytes", "c3": "number of attributes, plus various flag bits"}, {"c0": "t_infomask", "c1": "uint16", "c2": "2 bytes", "c3": "various flag bits"}, {"c0": "t_hoff", "c1": "uint8", "c2": "1 byte", "c3": "offset to user data"}], "title": "HeapTupleHeaderData Layout", "columns": [{"key": "c0", "label": "Field"}, {"key": "c1", "label": "Type"}, {"key": "c2", "label": "Length"}, {"key": "c3", "label": "Description"}]}]}, "comparison_hash": "b621fa85b3be27a0eb0d82986e9524f2ef0a776761901f0d429826eec4822d0a", "manual_language": "zh"}, "18": {"facts": [{"label": "\u5b9a\u4e49\u8303\u56f4", "value": "\u540c\u7248\u672c\u6838\u5fc3\u7269\u7406\u5b58\u50a8\u6587\u6863"}], "tables": [{"key": "layout-0", "rows": [{"c0": "PageHeaderData", "c1": "\u957f 24 \u5b57\u8282\uff0c\u5305\u542b\u9875\u9762\u7684\u901a\u7528\u4fe1\u606f\uff0c\u4f8b\u5982\u7a7a\u95f2\u7a7a\u95f4\u6307\u9488\u3002"}, {"c0": "ItemIdData", "c1": "\u6307\u5411\u5b9e\u9645\u6570\u636e\u9879\u7684\u884c\u6307\u9488\u6570\u7ec4\u3002\u6bcf\u9879\u4e3a\u4e00\u4e2a\uff08\u504f\u79fb\uff0c\u957f\u5ea6\uff09\u5bf9\uff0c\u5360 4 \u5b57\u8282\u3002"}, {"c0": "\u7a7a\u95f2\u7a7a\u95f4", "c1": "\u5c1a\u672a\u5206\u914d\u7684\u7a7a\u95f4\u3002\u65b0\u884c\u6307\u9488\u4ece\u8be5\u533a\u57df\u7684\u8d77\u59cb\u5904\u5206\u914d\uff0c\u65b0\u6570\u636e\u9879\u4ece\u672b\u5c3e\u5904\u5206\u914d\u3002"}, {"c0": "\u9879", "c1": "\u5b9e\u9645\u7684\u6570\u636e\u9879\u672c\u8eab\u3002"}, {"c0": "\u7279\u6b8a\u7a7a\u95f4", "c1": "\u7d22\u5f15\u8bbf\u95ee\u65b9\u6cd5\u4e13\u7528\u6570\u636e\u3002\u4e0d\u540c\u65b9\u6cd5\u5b58\u50a8\u7684\u5185\u5bb9\u4e0d\u540c\uff0c\u666e\u901a\u8868\u4e2d\u6b64\u533a\u57df\u4e3a\u7a7a\u3002"}], "title": "\u9875\u9762\u603b\u4f53\u5e03\u5c40", "columns": [{"key": "c0", "label": "\u9879\u76ee"}, {"key": "c1", "label": "\u8bf4\u660e"}]}, {"key": "layout-1", "rows": [{"c0": "pd_lsn", "c1": "PageXLogRecPtr", "c2": "8 \u5b57\u8282", "c3": "LSN\uff1a\u8be5\u9875\u6700\u540e\u4e00\u6b21\u53d8\u5316\u6240\u5bf9\u5e94 WAL \u8bb0\u5f55\u7684\u6700\u540e\u4e00\u4e2a\u5b57\u8282\u4e4b\u540e\u7684\u4f4d\u7f6e\u3002"}, {"c0": "pd_checksum", "c1": "uint16", "c2": "2 \u5b57\u8282", "c3": "\u9875\u9762\u6821\u9a8c\u548c"}, {"c0": "pd_flags", "c1": "uint16", "c2": "2 \u5b57\u8282", "c3": "\u6807\u5fd7\u4f4d"}, {"c0": "pd_lower", "c1": "LocationIndex", "c2": "2 \u5b57\u8282", "c3": "\u7a7a\u95f2\u7a7a\u95f4\u8d77\u59cb\u4f4d\u7f6e\u7684\u504f\u79fb\u91cf"}, {"c0": "pd_upper", "c1": "LocationIndex", "c2": "2 \u5b57\u8282", "c3": "\u7a7a\u95f2\u7a7a\u95f4\u7ed3\u675f\u4f4d\u7f6e\u7684\u504f\u79fb\u91cf"}, {"c0": "pd_special", "c1": "LocationIndex", "c2": "2 \u5b57\u8282", "c3": "\u7279\u6b8a\u7a7a\u95f4\u8d77\u59cb\u4f4d\u7f6e\u7684\u504f\u79fb\u91cf"}, {"c0": "pd_pagesize_version", "c1": "uint16", "c2": "2 \u5b57\u8282", "c3": "\u9875\u9762\u5927\u5c0f\u4e0e\u5e03\u5c40\u7248\u672c\u53f7\u4fe1\u606f"}, {"c0": "pd_prune_xid", "c1": "TransactionId", "c2": "4 \u5b57\u8282", "c3": "\u9875\u9762\u4e0a\u6700\u65e9\u7684\u5c1a\u672a\u4fee\u526a\u7684 XMAX\uff1b\u6ca1\u6709\u5219\u4e3a\u96f6"}], "title": "PageHeaderData \u5e03\u5c40", "columns": [{"key": "c0", "label": "\u5b57\u6bb5"}, {"key": "c1", "label": "\u7c7b\u578b"}, {"key": "c2", "label": "\u957f\u5ea6"}, {"key": "c3", "label": "\u8bf4\u660e"}]}, {"key": "layout-2", "rows": [{"c0": "t_xmin", "c1": "TransactionId", "c2": "4 \u5b57\u8282", "c3": "\u63d2\u5165\u4e8b\u52a1\u7684 XID"}, {"c0": "t_xmax", "c1": "TransactionId", "c2": "4 \u5b57\u8282", "c3": "\u5220\u9664\u4e8b\u52a1\u7684 XID"}, {"c0": "t_cid", "c1": "CommandId", "c2": "4 \u5b57\u8282", "c3": "\u63d2\u5165\u548c\uff0f\u6216\u5220\u9664\u547d\u4ee4\u7684 CID\uff0c\u4e0e t_xvac \u5171\u7528\u5b58\u50a8\u4f4d\u7f6e"}, {"c0": "t_xvac", "c1": "TransactionId", "c2": "4 \u5b57\u8282", "c3": "VACUUM \u64cd\u4f5c\u79fb\u52a8\u884c\u7248\u672c\u65f6\u4f7f\u7528\u7684 XID"}, {"c0": "t_ctid", "c1": "ItemPointerData", "c2": "6 \u5b57\u8282", "c3": "\u672c\u884c\u7248\u672c\u6216\u8f83\u65b0\u884c\u7248\u672c\u7684\u5f53\u524d TID"}, {"c0": "t_infomask2", "c1": "uint16", "c2": "2 \u5b57\u8282", "c3": "\u5c5e\u6027\u6570\u91cf\u53ca\u5404\u79cd\u6807\u5fd7\u4f4d"}, {"c0": "t_infomask", "c1": "uint16", "c2": "2 \u5b57\u8282", "c3": "\u5404\u79cd\u6807\u5fd7\u4f4d"}, {"c0": "t_hoff", "c1": "uint8", "c2": "1 \u5b57\u8282", "c3": "\u7528\u6237\u6570\u636e\u7684\u504f\u79fb\u91cf"}], "title": "HeapTupleHeaderData \u5e03\u5c40", "columns": [{"key": "c0", "label": "\u5b57\u6bb5"}, {"key": "c1", "label": "\u7c7b\u578b"}, {"key": "c2", "label": "\u957f\u5ea6"}, {"key": "c3", "label": "\u8bf4\u660e"}]}], "diagram": "page-layout", "related": [{"url": "/wiki/tableam/?v=18", "label": "Table AM"}, {"url": "/wiki/relopts/?v=18", "label": "\u5b58\u50a8\u53c2\u6570"}], "release": {"ref": "https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2", "label": "18.6", "major": "18", "channel": "stable", "revision": "555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f"}, "sources": [{"url": "https://pg.center/docs/18/storage-page-layout.html", "path": "storage-page-layout.html", "label": "PostgreSQL 18 English manual", "sha256": "0d9f99e4cef5ea0a6741a74cab87052b929f7001730853c85d5e60d72179d355", "language": "en", "original_url": "/docs/18/storage-page-layout.html"}], "sections": [], "signature": "", "description": ["\u672c\u8282\u6982\u8ff0 PostgreSQL \u8868\u548c\u7d22\u5f15\u5185\u90e8\u6240\u4f7f\u7528\u7684\u9875\u9762\u683c\u5f0f\u3002 [19] \u5e8f\u5217\u548c TOAST \u8868\u7684\u683c\u5f0f\u4e0e\u666e\u901a\u8868\u76f8\u540c\u3002"], "manual_html": "<div class=\"sect1\">\n<div class=\"titlepage\">\n<div>\n<div>\n<h2 class=\"title\" lang=\"zh\">\n<div>\n<div>\n<h2 class=\"title\" style=\"clear: both\">66.6.\u00a0\u6570\u636e\u5e93\u9875\u9762\u5e03\u5c40 </h2>\n</div>\n</div>\n</h2>\n</div>\n</div>\n</div>\n<p lang=\"zh\">\u672c\u8282\u6982\u8ff0 <span class=\"productname\">PostgreSQL</span> \u8868\u548c\u7d22\u5f15\u5185\u90e8\u6240\u4f7f\u7528\u7684\u9875\u9762\u683c\u5f0f\u3002<a class=\"footnote\" href=\"/docs/18/storage-page-layout.html#ftn.id-1.10.18.8.2.2\"><sup class=\"footnote\" id=\"id-1.10.18.8.2.2\">[19]</sup></a> \u5e8f\u5217\u548c <acronym class=\"acronym\">TOAST</acronym> \u8868\u7684\u683c\u5f0f\u4e0e\u666e\u901a\u8868\u76f8\u540c\u3002</p>\n<p lang=\"zh\">\u5728\u4e0b\u9762\u7684\u8bf4\u660e\u4e2d\uff0c\u5047\u5b9a\u4e00\u4e2a<em class=\"firstterm\">\u5b57\u8282</em>\u5305\u542b 8 \u4e2a\u4f4d\u3002\u53e6\u5916\uff0c\u672f\u8bed<em class=\"firstterm\">\u9879</em>\u6307\u7684\u662f\u5b58\u50a8\u5728\u9875\u9762\u4e0a\u7684\u5355\u4e2a\u6570\u636e\u503c\u3002\u5728\u8868\u4e2d\uff0c\u9879\u662f\u4e00\u884c\uff1b\u5728\u7d22\u5f15\u4e2d\uff0c\u9879\u662f\u4e00\u6761\u7d22\u5f15\u6761\u76ee\u3002</p>\n<p lang=\"zh\">\u6bcf\u4e2a\u8868\u548c\u7d22\u5f15\u90fd\u5b58\u50a8\u4e3a\u56fa\u5b9a\u5927\u5c0f\u7684<em class=\"firstterm\">\u9875\u9762</em>\u6570\u7ec4\uff08\u901a\u5e38\u4e3a 8 kB\uff0c\u4e0d\u8fc7\u5728\u7f16\u8bd1\u670d\u52a1\u5668\u65f6\u53ef\u4ee5\u9009\u62e9\u4e0d\u540c\u7684\u9875\u9762\u5927\u5c0f\uff09\u3002\u5728\u8868\u4e2d\uff0c\u6240\u6709\u9875\u9762\u5728\u903b\u8f91\u4e0a\u90fd\u662f\u7b49\u4ef7\u7684\uff0c\u56e0\u6b64\u67d0\u4e2a\u7279\u5b9a\u9879\uff08\u884c\uff09\u53ef\u4ee5\u5b58\u653e\u5728\u4efb\u610f\u9875\u9762\u4e2d\u3002\u5728\u7d22\u5f15\u4e2d\uff0c\u7b2c\u4e00\u9875\u901a\u5e38\u4fdd\u7559\u4e3a<em class=\"firstterm\">\u5143\u9875</em>\uff0c\u7528\u4e8e\u4fdd\u5b58\u63a7\u5236\u4fe1\u606f\uff1b\u5e76\u4e14\u6839\u636e\u7d22\u5f15\u8bbf\u95ee\u65b9\u6cd5\u7684\u4e0d\u540c\uff0c\u7d22\u5f15\u4e2d\u8fd8\u53ef\u80fd\u5b58\u5728\u4e0d\u540c\u7c7b\u578b\u7684\u9875\u9762\u3002</p>\n<p lang=\"zh\"><a class=\"xref\" href=\"/docs/18/storage-page-layout.html#PAGE-TABLE\" title=\"\u8868\u00a066.2.\u00a0\u603b\u4f53\u9875\u9762\u5e03\u5c40\">\u8868\u00a066.2</a>\u5c55\u793a\u4e86\u9875\u9762\u7684\u603b\u4f53\u5e03\u5c40\u3002\u6bcf\u4e2a\u9875\u9762\u5305\u542b\u4e94\u4e2a\u90e8\u5206\u3002</p>\n<div class=\"table\">\n<p class=\"title\" lang=\"zh\"><strong>\u8868\u00a066.2.\u00a0\u603b\u4f53\u9875\u9762\u5e03\u5c40</strong></p>\n<div class=\"table-contents\">\n<table class=\"table\">\n<thead>\n<tr>\n<th lang=\"zh\">\u9879\u76ee</th>\n<th lang=\"zh\">\u8bf4\u660e</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>PageHeaderData</td>\n<td lang=\"zh\">\u957f 24 \u5b57\u8282\uff0c\u5305\u542b\u9875\u9762\u7684\u901a\u7528\u4fe1\u606f\uff0c\u4f8b\u5982\u7a7a\u95f2\u7a7a\u95f4\u6307\u9488\u3002</td>\n</tr>\n<tr>\n<td>ItemIdData</td>\n<td lang=\"zh\">\u6307\u5411\u5b9e\u9645\u6570\u636e\u9879\u7684\u884c\u6307\u9488\u6570\u7ec4\u3002\u6bcf\u9879\u4e3a\u4e00\u4e2a\uff08\u504f\u79fb\uff0c\u957f\u5ea6\uff09\u5bf9\uff0c\u5360 4 \u5b57\u8282\u3002</td>\n</tr>\n<tr>\n<td lang=\"zh\">\u7a7a\u95f2\u7a7a\u95f4</td>\n<td lang=\"zh\">\u5c1a\u672a\u5206\u914d\u7684\u7a7a\u95f4\u3002\u65b0\u884c\u6307\u9488\u4ece\u8be5\u533a\u57df\u7684\u8d77\u59cb\u5904\u5206\u914d\uff0c\u65b0\u6570\u636e\u9879\u4ece\u672b\u5c3e\u5904\u5206\u914d\u3002</td>\n</tr>\n<tr>\n<td lang=\"zh\">\u9879</td>\n<td lang=\"zh\">\u5b9e\u9645\u7684\u6570\u636e\u9879\u672c\u8eab\u3002</td>\n</tr>\n<tr>\n<td lang=\"zh\">\u7279\u6b8a\u7a7a\u95f4</td>\n<td lang=\"zh\">\u7d22\u5f15\u8bbf\u95ee\u65b9\u6cd5\u4e13\u7528\u6570\u636e\u3002\u4e0d\u540c\u65b9\u6cd5\u5b58\u50a8\u7684\u5185\u5bb9\u4e0d\u540c\uff0c\u666e\u901a\u8868\u4e2d\u6b64\u533a\u57df\u4e3a\u7a7a\u3002</td>\n</tr>\n</tbody>\n</table>\n</div>\n</div><br class=\"table-break\"/>\n<p lang=\"zh\">\u6bcf\u9875\u7684\u524d 24 \u5b57\u8282\u662f\u9875\u9996\u90e8 PageHeaderData\uff0c\u8be6\u7ec6\u683c\u5f0f\u89c1\u8868 66.3\u3002\u7b2c\u4e00\u4e2a\u5b57\u6bb5\u8ddf\u8e2a\u4e0e\u8be5\u9875\u76f8\u5173\u7684\u6700\u8fd1\u4e00\u6761 WAL \u8bb0\u5f55\uff1b\u7b2c\u4e8c\u4e2a\u5b57\u6bb5\u5728\u542f\u7528\u6570\u636e\u6821\u9a8c\u548c\u65f6\u4fdd\u5b58\u9875\u9762\u6821\u9a8c\u548c\u3002\u4e4b\u540e\u662f\u4e00\u4e2a\u5305\u542b\u6807\u5fd7\u4f4d\u7684 2 \u5b57\u8282\u5b57\u6bb5\uff0c\u518d\u540e\u9762\u662f\u4e09\u4e2a 2 \u5b57\u8282\u6574\u6570 pd_lower\u3001pd_upper \u548c pd_special\uff0c\u5206\u522b\u8bb0\u5f55\u4ece\u9875\u8d77\u70b9\u5230\u672a\u5206\u914d\u7a7a\u95f4\u8d77\u70b9\u3001\u672a\u5206\u914d\u7a7a\u95f4\u7ec8\u70b9\u53ca\u7279\u6b8a\u7a7a\u95f4\u8d77\u70b9\u7684\u5b57\u8282\u504f\u79fb\u91cf\u3002\u63a5\u4e0b\u6765\u7684 2 \u5b57\u8282 pd_pagesize_version \u540c\u65f6\u4fdd\u5b58\u9875\u5927\u5c0f\u548c\u7248\u672c\u6807\u8bc6\u3002PostgreSQL 8.3 \u8d77\u7248\u672c\u53f7\u4e3a 4\uff1b8.1 \u4e0e 8.2 \u4f7f\u7528 3\uff1b8.0 \u4f7f\u7528 2\uff1b7.3 \u4e0e 7.4 \u4f7f\u7528 1\uff1b\u66f4\u65e9\u7248\u672c\u4f7f\u7528 0\u3002\u591a\u6570\u7248\u672c\u7684\u57fa\u672c\u9875\u9762\u5e03\u5c40\u548c\u9996\u90e8\u683c\u5f0f\u5e76\u672a\u53d8\u5316\uff0c\u4f46\u5806\u884c\u9996\u90e8\u5e03\u5c40\u6709\u53d8\u5316\u3002\u9875\u5927\u5c0f\u57fa\u672c\u53ea\u7528\u4e8e\u4ea4\u53c9\u68c0\u67e5\uff1b\u540c\u4e00\u5b89\u88c5\u4e0d\u652f\u6301\u591a\u79cd\u9875\u5927\u5c0f\u3002\u6700\u540e\u4e00\u4e2a\u5b57\u6bb5\u63d0\u793a\u4fee\u526a\u8be5\u9875\u662f\u5426\u53ef\u80fd\u6709\u76ca\uff0c\u8bb0\u5f55\u8be5\u9875\u6700\u65e9\u7684\u5c1a\u672a\u4fee\u526a\u7684 XMAX\u3002</p>\n<div class=\"table\">\n<p class=\"title\" lang=\"zh\"><strong>\u8868\u00a066.3.\u00a0PageHeaderData \u5e03\u5c40</strong></p>\n<div class=\"table-contents\">\n<table class=\"table\">\n<thead>\n<tr>\n<th lang=\"zh\">\u5b57\u6bb5</th>\n<th lang=\"zh\">\u7c7b\u578b</th>\n<th lang=\"zh\">\u957f\u5ea6</th>\n<th lang=\"zh\">\u8bf4\u660e</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>pd_lsn</td>\n<td>PageXLogRecPtr</td>\n<td lang=\"zh\">8 \u5b57\u8282</td>\n<td lang=\"zh\">LSN\uff1a\u8be5\u9875\u6700\u540e\u4e00\u6b21\u53d8\u5316\u6240\u5bf9\u5e94 WAL \u8bb0\u5f55\u7684\u6700\u540e\u4e00\u4e2a\u5b57\u8282\u4e4b\u540e\u7684\u4f4d\u7f6e\u3002</td>\n</tr>\n<tr>\n<td>pd_checksum</td>\n<td>uint16</td>\n<td lang=\"zh\">2 \u5b57\u8282</td>\n<td lang=\"zh\">\u9875\u9762\u6821\u9a8c\u548c</td>\n</tr>\n<tr>\n<td>pd_flags</td>\n<td>uint16</td>\n<td lang=\"zh\">2 \u5b57\u8282</td>\n<td lang=\"zh\">\u6807\u5fd7\u4f4d</td>\n</tr>\n<tr>\n<td>pd_lower</td>\n<td>LocationIndex</td>\n<td lang=\"zh\">2 \u5b57\u8282</td>\n<td lang=\"zh\">\u7a7a\u95f2\u7a7a\u95f4\u8d77\u59cb\u4f4d\u7f6e\u7684\u504f\u79fb\u91cf</td>\n</tr>\n<tr>\n<td>pd_upper</td>\n<td>LocationIndex</td>\n<td lang=\"zh\">2 \u5b57\u8282</td>\n<td lang=\"zh\">\u7a7a\u95f2\u7a7a\u95f4\u7ed3\u675f\u4f4d\u7f6e\u7684\u504f\u79fb\u91cf</td>\n</tr>\n<tr>\n<td>pd_special</td>\n<td>LocationIndex</td>\n<td lang=\"zh\">2 \u5b57\u8282</td>\n<td lang=\"zh\">\u7279\u6b8a\u7a7a\u95f4\u8d77\u59cb\u4f4d\u7f6e\u7684\u504f\u79fb\u91cf</td>\n</tr>\n<tr>\n<td>pd_pagesize_version</td>\n<td>uint16</td>\n<td lang=\"zh\">2 \u5b57\u8282</td>\n<td lang=\"zh\">\u9875\u9762\u5927\u5c0f\u4e0e\u5e03\u5c40\u7248\u672c\u53f7\u4fe1\u606f</td>\n</tr>\n<tr>\n<td>pd_prune_xid</td>\n<td>TransactionId</td>\n<td lang=\"zh\">4 \u5b57\u8282</td>\n<td lang=\"zh\">\u9875\u9762\u4e0a\u6700\u65e9\u7684\u5c1a\u672a\u4fee\u526a\u7684 XMAX\uff1b\u6ca1\u6709\u5219\u4e3a\u96f6</td>\n</tr>\n</tbody>\n</table>\n</div>\n</div><br class=\"table-break\"/>\n<p lang=\"zh\">\u6240\u6709\u7ec6\u8282\u90fd\u53ef\u4ee5\u5728 <code class=\"filename\">src/include/storage/bufpage.h</code> \u4e2d\u627e\u5230\u3002</p>\n<p lang=\"zh\">\u9875\u5934\u4e4b\u540e\u662f\u9879\u6807\u8bc6\u7b26\uff08<code class=\"type\">ItemIdData</code>\uff09\uff0c\u6bcf\u4e2a\u9700\u8981\u56db\u4e2a\u5b57\u8282\u3002\u4e00\u4e2a\u9879\u6807\u8bc6\u7b26\u5305\u542b\u9879\u8d77\u59cb\u4f4d\u7f6e\u7684\u5b57\u8282\u504f\u79fb\u91cf\u3001\u5176\u5b57\u8282\u957f\u5ea6\uff0c\u4ee5\u53ca\u82e5\u5e72\u5f71\u54cd\u89e3\u91ca\u65b9\u5f0f\u7684\u5c5e\u6027\u4f4d\u3002\u65b0\u7684\u9879\u6807\u8bc6\u7b26\u4f1a\u6839\u636e\u9700\u8981\u4ece\u672a\u5206\u914d\u7a7a\u95f4\u7684\u8d77\u59cb\u5904\u5206\u914d\u3002\u5f53\u524d\u5df2\u6709\u591a\u5c11\u4e2a\u9879\u6807\u8bc6\u7b26\uff0c\u53ef\u4ee5\u901a\u8fc7\u67e5\u770b <code class=\"structfield\">pd_lower</code> \u5f97\u77e5\uff1b\u5206\u914d\u65b0\u6807\u8bc6\u7b26\u65f6\u5b83\u4f1a\u589e\u52a0\u3002\u56e0\u4e3a\u4e00\u4e2a\u9879\u6807\u8bc6\u7b26\u5728\u88ab\u91ca\u653e\u4e4b\u524d\u6c38\u8fdc\u4e0d\u4f1a\u79fb\u52a8\uff0c\u6240\u4ee5\u5373\u4f7f\u9879\u672c\u8eab\u4e3a\u4e86\u6574\u7406\u7a7a\u95f2\u7a7a\u95f4\u800c\u5728\u9875\u9762\u5185\u79fb\u52a8\uff0c\u5176\u7d22\u5f15\u4ecd\u7136\u53ef\u4ee5\u88ab\u957f\u671f\u7528\u6765\u5f15\u7528\u8be5\u9879\u3002\u4e8b\u5b9e\u4e0a\uff0c\u6bcf\u4e2a\u6307\u5411\u9879\u7684\u6307\u9488\uff08<code class=\"type\">ItemPointer</code>\uff0c\u4e5f\u79f0 <code class=\"type\">CTID</code>\uff09\u5728 <span class=\"productname\">PostgreSQL</span> \u4e2d\u90fd\u7531\u9875\u53f7\u548c\u9879\u6807\u8bc6\u7b26\u7d22\u5f15\u6784\u6210\u3002</p>\n<p lang=\"zh\">\u9879\u672c\u8eab\u5b58\u50a8\u5728\u4ece\u672a\u5206\u914d\u7a7a\u95f4\u672b\u5c3e\u5f00\u59cb\u3001\u5411\u540e\u5206\u914d\u7684\u533a\u57df\u4e2d\u3002\u5176\u786e\u5207\u7ed3\u6784\u53d6\u51b3\u4e8e\u8868\u8981\u5305\u542b\u4ec0\u4e48\u5185\u5bb9\u3002\u8868\u548c\u5e8f\u5217\u90fd\u4f7f\u7528\u4e00\u79cd\u540d\u4e3a <code class=\"type\">HeapTupleHeaderData</code> \u7684\u7ed3\u6784\u4f53\uff0c\u5982\u4e0b\u6240\u8ff0\u3002</p>\n<p lang=\"zh\">\u6700\u540e\u4e00\u90e8\u5206\u662f<span class=\"quote\">\u201c<span class=\"quote\">\u7279\u6b8a\u90e8\u5206</span>\u201d</span>\uff0c\u5176\u4e2d\u53ef\u4ee5\u5b58\u653e\u8bbf\u95ee\u65b9\u6cd5\u5e0c\u671b\u4fdd\u5b58\u7684\u4efb\u4f55\u5185\u5bb9\u3002\u4f8b\u5982\uff0cB-\u6811\u7d22\u5f15\u4f1a\u5728\u8fd9\u91cc\u4fdd\u5b58\u6307\u5411\u9875\u9762\u5de6\u3001\u53f3\u5144\u5f1f\u7684\u94fe\u63a5\uff0c\u4ee5\u53ca\u5176\u4ed6\u4e00\u4e9b\u4e0e\u7d22\u5f15\u7ed3\u6784\u76f8\u5173\u7684\u6570\u636e\u3002\u666e\u901a\u8868\u5b8c\u5168\u4e0d\u4f7f\u7528\u7279\u6b8a\u90e8\u5206\uff08\u901a\u8fc7\u5c06 <code class=\"structfield\">pd_special</code> \u8bbe\u4e3a\u9875\u9762\u5927\u5c0f\u6765\u8868\u793a\uff09\u3002</p>\n<p lang=\"zh\"><a class=\"xref\" href=\"/docs/18/storage-page-layout.html#STORAGE-PAGE-LAYOUT-FIGURE\" title=\"\u56fe\u00a066.1.\u00a0\u9875\u9762\u5e03\u5c40\">\u56fe\u00a066.1</a>\u5c55\u793a\u4e86\u8fd9\u4e9b\u90e8\u5206\u5728\u9875\u9762\u4e2d\u7684\u5e03\u5c40\u65b9\u5f0f\u3002</p>\n<div class=\"figure col-xl-8 col-lg-10 col-md-12\">\n<p class=\"title\" lang=\"zh\">\n<p class=\"title\"><strong>\u56fe\u00a066.1.\u00a0\u9875\u9762\u5e03\u5c40</strong></p>\n<div class=\"figure-contents\">\n<div class=\"mediaobject\">\n<object data=\"pagelayout.svg\" type=\"image/svg+xml\" width=\"100%\">\n</object>\n</div>\n</div>\n</p>\n<div class=\"figure-contents\">\n<div class=\"mediaobject\">\n</div>\n</div>\n</div><br class=\"figure-break\"/>\n<div class=\"sect2\">\n<div class=\"titlepage\">\n<div>\n<div>\n<h3 class=\"title\" lang=\"zh\">\n<dl class=\"toc\">\n<dt><span class=\"sect2\"><a href=\"/docs/18/storage-page-layout.html#STORAGE-TUPLE-LAYOUT\">66.6.1. \u8868\u884c\u5e03\u5c40</a></span></dt>\n</dl>\n</h3>\n</div>\n</div>\n</div>\n<p lang=\"zh\">\u6240\u6709\u8868\u884c\u7684\u7ed3\u6784\u90fd\u76f8\u540c\u3002\u5b83\u4eec\u90fd\u6709\u4e00\u4e2a\u56fa\u5b9a\u5927\u5c0f\u7684\u5934\u90e8\uff08\u5728\u5927\u591a\u6570\u673a\u5668\u4e0a\u5360 23 \u5b57\u8282\uff09\uff0c\u540e\u9762\u8ddf\u7740\u53ef\u9009\u7684\u7a7a\u503c\u4f4d\u56fe\u3001\u53ef\u9009\u7684\u5bf9\u8c61 ID \u5b57\u6bb5\u4ee5\u53ca\u7528\u6237\u6570\u636e\u3002\u5934\u90e8\u7684\u8be6\u7ec6\u683c\u5f0f\u89c1<a class=\"xref\" href=\"/docs/18/storage-page-layout.html#HEAPTUPLEHEADERDATA-TABLE\" title=\"\u8868\u00a066.4.\u00a0HeapTupleHeaderData \u5e03\u5c40\">\u8868\u00a066.4</a>\u3002\u5b9e\u9645\u7528\u6237\u6570\u636e\uff08\u884c\u7684\u5404\u5217\uff09\u4ece <code class=\"structfield\">t_hoff</code> \u6307\u793a\u7684\u504f\u79fb\u4f4d\u7f6e\u5f00\u59cb\uff0c\u5b83\u5fc5\u987b\u59cb\u7ec8\u662f\u8be5\u5e73\u53f0 MAXALIGN \u5bf9\u9f50\u5355\u4f4d\u7684\u6574\u6570\u500d\u3002\u53ea\u6709\u5f53 <em class=\"firstterm\">HEAP_HASNULL</em> \u4f4d\u5728 <code class=\"structfield\">t_infomask</code> \u4e2d\u88ab\u7f6e\u4f4d\u65f6\uff0c\u7a7a\u503c\u4f4d\u56fe\u624d\u5b58\u5728\u3002\u82e5\u5b58\u5728\uff0c\u5b83\u7d27\u968f\u56fa\u5b9a\u5934\u90e8\u4e4b\u540e\uff0c\u5e76\u5360\u7528\u8db3\u591f\u591a\u7684\u5b57\u8282\uff0c\u4ee5\u4fbf\u4e3a\u6bcf\u4e2a\u6570\u636e\u5217\u63d0\u4f9b\u4e00\u4f4d\uff08\u4e5f\u5c31\u662f\u8bf4\uff0c\u5176\u4f4d\u6570\u7b49\u4e8e <code class=\"structfield\">t_infomask2</code> \u4e2d\u7684\u5c5e\u6027\u4e2a\u6570\uff09\u3002\u5728\u8fd9\u4e2a\u4f4d\u56fe\u4e2d\uff0c1 \u8868\u793a\u975e\u7a7a\uff0c0 \u8868\u793a\u7a7a\u503c\u3002\u5f53\u4f4d\u56fe\u4e0d\u5b58\u5728\u65f6\uff0c\u5047\u5b9a\u6240\u6709\u5217\u90fd\u975e\u7a7a\u3002\u53ea\u6709\u5f53 <em class=\"firstterm\">HEAP_HASOID_OLD</em> \u4f4d\u5728 <code class=\"structfield\">t_infomask</code> \u4e2d\u88ab\u7f6e\u4f4d\u65f6\uff0c\u5bf9\u8c61 ID \u624d\u5b58\u5728\u3002\u82e5\u5b58\u5728\uff0c\u5b83\u4f4d\u4e8e <code class=\"structfield\">t_hoff</code> \u8fb9\u754c\u4e4b\u524d\u3002\u4e3a\u4e86\u8ba9 <code class=\"structfield\">t_hoff</code> \u6210\u4e3a MAXALIGN \u7684\u6574\u6570\u500d\u6240\u9700\u7684\u4efb\u4f55\u586b\u5145\uff0c\u90fd\u4f1a\u51fa\u73b0\u5728\u7a7a\u503c\u4f4d\u56fe\u4e0e\u5bf9\u8c61 ID \u4e4b\u95f4\u3002\uff08\u8fd9\u53c8\u53cd\u8fc7\u6765\u4fdd\u8bc1\u4e86\u5bf9\u8c61 ID \u7684\u5bf9\u9f50\u662f\u5408\u9002\u7684\u3002\uff09</p>\n<div class=\"table\">\n<p class=\"title\" lang=\"zh\"><strong>\u8868\u00a066.4.\u00a0HeapTupleHeaderData \u5e03\u5c40</strong></p>\n<div class=\"table-contents\">\n<table class=\"table\">\n<thead>\n<tr>\n<th lang=\"zh\">\u5b57\u6bb5</th>\n<th lang=\"zh\">\u7c7b\u578b</th>\n<th lang=\"zh\">\u957f\u5ea6</th>\n<th lang=\"zh\">\u8bf4\u660e</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>t_xmin</td>\n<td>TransactionId</td>\n<td lang=\"zh\">4 \u5b57\u8282</td>\n<td lang=\"zh\">\u63d2\u5165\u4e8b\u52a1\u7684 XID</td>\n</tr>\n<tr>\n<td>t_xmax</td>\n<td>TransactionId</td>\n<td lang=\"zh\">4 \u5b57\u8282</td>\n<td lang=\"zh\">\u5220\u9664\u4e8b\u52a1\u7684 XID</td>\n</tr>\n<tr>\n<td>t_cid</td>\n<td>CommandId</td>\n<td lang=\"zh\">4 \u5b57\u8282</td>\n<td lang=\"zh\">\u63d2\u5165\u548c\uff0f\u6216\u5220\u9664\u547d\u4ee4\u7684 CID\uff0c\u4e0e t_xvac \u5171\u7528\u5b58\u50a8\u4f4d\u7f6e</td>\n</tr>\n<tr>\n<td>t_xvac</td>\n<td>TransactionId</td>\n<td lang=\"zh\">4 \u5b57\u8282</td>\n<td lang=\"zh\">VACUUM \u64cd\u4f5c\u79fb\u52a8\u884c\u7248\u672c\u65f6\u4f7f\u7528\u7684 XID</td>\n</tr>\n<tr>\n<td>t_ctid</td>\n<td>ItemPointerData</td>\n<td lang=\"zh\">6 \u5b57\u8282</td>\n<td lang=\"zh\">\u672c\u884c\u7248\u672c\u6216\u8f83\u65b0\u884c\u7248\u672c\u7684\u5f53\u524d TID</td>\n</tr>\n<tr>\n<td>t_infomask2</td>\n<td>uint16</td>\n<td lang=\"zh\">2 \u5b57\u8282</td>\n<td lang=\"zh\">\u5c5e\u6027\u6570\u91cf\u53ca\u5404\u79cd\u6807\u5fd7\u4f4d</td>\n</tr>\n<tr>\n<td>t_infomask</td>\n<td>uint16</td>\n<td lang=\"zh\">2 \u5b57\u8282</td>\n<td lang=\"zh\">\u5404\u79cd\u6807\u5fd7\u4f4d</td>\n</tr>\n<tr>\n<td>t_hoff</td>\n<td>uint8</td>\n<td lang=\"zh\">1 \u5b57\u8282</td>\n<td lang=\"zh\">\u7528\u6237\u6570\u636e\u7684\u504f\u79fb\u91cf</td>\n</tr>\n</tbody>\n</table>\n</div>\n</div><br class=\"table-break\"/>\n<p lang=\"zh\">\u6240\u6709\u7ec6\u8282\u90fd\u53ef\u4ee5\u5728 <code class=\"filename\">src/include/access/htup_details.h</code> \u4e2d\u627e\u5230\u3002</p>\n<p lang=\"zh\">\u8981\u89e3\u91ca\u5b9e\u9645\u6570\u636e\uff0c\u5fc5\u987b\u501f\u52a9\u4ece\u5176\u4ed6\u8868\u4e2d\u83b7\u5f97\u7684\u4fe1\u606f\uff0c\u5176\u4e2d\u5927\u90e8\u5206\u6765\u81ea <code class=\"structname\">pg_attribute</code>\u3002\u8bc6\u522b\u5b57\u6bb5\u4f4d\u7f6e\u6240\u9700\u7684\u5173\u952e\u503c\u662f <code class=\"structfield\">attlen</code> \u548c <code class=\"structfield\">attalign</code>\u3002\u9664\u975e\u6240\u6709\u5b57\u6bb5\u90fd\u662f\u5b9a\u5bbd\u4e14\u6ca1\u6709\u7a7a\u503c\uff0c\u5426\u5219\u6ca1\u6709\u529e\u6cd5\u76f4\u63a5\u53d6\u5f97\u67d0\u4e2a\u7279\u5b9a\u5c5e\u6027\u3002\u6240\u6709\u8fd9\u4e9b\u6280\u5de7\u90fd\u5c01\u88c5\u5728 <em class=\"firstterm\">heap_getattr</em>\u3001<em class=\"firstterm\">fastgetattr</em> \u548c <em class=\"firstterm\">heap_getsysattr</em> \u8fd9\u4e9b\u51fd\u6570\u4e2d\u3002</p>\n<p lang=\"zh\">\u8bfb\u53d6\u6570\u636e\u65f6\uff0c\u9700\u8981\u4f9d\u6b21\u68c0\u67e5\u6bcf\u4e2a\u5c5e\u6027\u3002\u9996\u5148\u6839\u636e\u7a7a\u503c\u4f4d\u56fe\u5224\u65ad\u8be5\u5b57\u6bb5\u662f\u5426\u4e3a NULL\u3002\u5982\u679c\u662f\uff0c\u5c31\u7ee7\u7eed\u4e0b\u4e00\u4e2a\u3002\u7136\u540e\u786e\u8ba4\u5bf9\u9f50\u662f\u5426\u6b63\u786e\u3002\u5982\u679c\u5b57\u6bb5\u662f\u5b9a\u5bbd\u5b57\u6bb5\uff0c\u90a3\u4e48\u5b83\u7684\u6240\u6709\u5b57\u8282\u90fd\u662f\u76f4\u63a5\u6446\u653e\u7684\uff1b\u5982\u679c\u5b83\u662f\u53d8\u957f\u5b57\u6bb5\uff08attlen = -1\uff09\uff0c\u60c5\u51b5\u5c31\u4f1a\u7a0d\u590d\u6742\u4e00\u4e9b\u3002\u6240\u6709\u53d8\u957f\u6570\u636e\u7c7b\u578b\u90fd\u5171\u4eab\u4e00\u4e2a\u901a\u7528\u5934\u90e8\u7ed3\u6784\u4f53 <code class=\"type\">struct varlena</code>\uff0c\u5176\u4e2d\u5305\u542b\u5df2\u5b58\u50a8\u503c\u7684\u603b\u957f\u5ea6\u4ee5\u53ca\u4e00\u4e9b\u6807\u5fd7\u4f4d\u3002\u6839\u636e\u8fd9\u4e9b\u6807\u5fd7\uff0c\u6570\u636e\u53ef\u80fd\u662f\u884c\u5185\u5b58\u50a8\u7684\uff0c\u4e5f\u53ef\u80fd\u4f4d\u4e8e <acronym class=\"acronym\">TOAST</acronym> \u8868\u4e2d\uff1b\u5b83\u4e5f\u53ef\u80fd\u662f\u7ecf\u8fc7\u538b\u7f29\u7684\uff08\u89c1<a class=\"xref\" href=\"/docs/18/storage-toast.html\" title=\"66.2.\u00a0TOAST\">\u7b2c\u00a066.2\u00a0\u8282</a>\uff09\u3002</p>\n</div>\n<div class=\"footnotes\">\n<br/>\n<hr/>\n<div class=\"footnote\">\n<p lang=\"zh\">\n<br/>\n<hr style=\"width:100; text-align:left;margin-left: 0\"/>\n<div class=\"footnote\" id=\"ftn.id-1.10.18.8.2.2\">\n<p><a class=\"para\" href=\"/docs/18/storage-page-layout.html#id-1.10.18.8.2.2\"><sup class=\"para\">[19]</sup></a> \u5b9e\u9645\u4e0a\uff0c\u8868\u8bbf\u95ee\u65b9\u6cd5\u548c\u7d22\u5f15\u8bbf\u95ee\u65b9\u6cd5\u90fd\u4e0d\u8981\u6c42\u5fc5\u987b\u4f7f\u7528\u8fd9\u79cd\u9875\u9762\u683c\u5f0f\u3002<code class=\"literal\">heap</code> \u8868\u8bbf\u95ee\u65b9\u6cd5\u59cb\u7ec8\u4f7f\u7528\u8fd9\u79cd\u683c\u5f0f\u3002\u73b0\u6709\u7684\u6240\u6709\u7d22\u5f15\u65b9\u6cd5\u4e5f\u90fd\u4f7f\u7528\u8fd9\u79cd\u57fa\u672c\u683c\u5f0f\uff0c\u4f46\u7d22\u5f15\u5143\u9875\u4e2d\u4fdd\u5b58\u7684\u6570\u636e\u901a\u5e38\u5e76\u4e0d\u9075\u5faa\u9879\u5e03\u5c40\u89c4\u5219\u3002</p>\n</div>\n</p>\n</div>\n</div>\n</div>", "manual_path": "/docs/18/storage-page-layout.html", "localization": {"status": "complete", "sources": [{"url": "/docs/18/storage-page-layout.html", "method": "same-major semantic node", "sha256": "e504ff90f2cabf6f71046d80f1cc8d49664ba2f2f4bce0ef26e955d6c5580ab2", "language": "zh", "matched_nodes": ["#STORAGE-PAGE-LAYOUT/div[0]", "#STORAGE-PAGE-LAYOUT/div[16]", "#STORAGE-PAGE-LAYOUT/div[18]/div[2]/p[0]", "#STORAGE-PAGE-LAYOUT/div[18]/p[1]", "#STORAGE-PAGE-LAYOUT/div[18]/p[4]", "#STORAGE-PAGE-LAYOUT/div[18]/p[5]", "#STORAGE-PAGE-LAYOUT/div[18]/p[6]", "#STORAGE-PAGE-LAYOUT/div[19]", "#STORAGE-PAGE-LAYOUT/div[1]", "#STORAGE-PAGE-LAYOUT/div[6]/div[1]/table[0]/tbody[2]/tr[3]/td[0]", "#STORAGE-PAGE-LAYOUT/div[6]/p[0]", "#STORAGE-PAGE-LAYOUT/div[9]/div[1]/table[0]/tbody[2]/tr[0]/td[2]", "#STORAGE-PAGE-LAYOUT/div[9]/p[0]", "#STORAGE-PAGE-LAYOUT/p[11]", "#STORAGE-PAGE-LAYOUT/p[12]", "#STORAGE-PAGE-LAYOUT/p[13]", "#STORAGE-PAGE-LAYOUT/p[14]", "#STORAGE-PAGE-LAYOUT/p[15]", "#STORAGE-PAGE-LAYOUT/p[2]", "#STORAGE-PAGE-LAYOUT/p[3]", "#STORAGE-PAGE-LAYOUT/p[4]", "#STORAGE-PAGE-LAYOUT/p[5]"]}], "language": "zh", "original_text": {"/versions/18/description/0": "This section provides an overview of the page format used within PostgreSQL tables and indexes. [19] Sequences and TOAST tables are formatted just like a regular table.", "/versions/18/facts/0/label": "Definition scope", "/versions/18/facts/0/value": "Same-version core physical storage documentation", "/versions/18/tables/0/title": "Overall Page Layout", "/versions/18/tables/1/title": "PageHeaderData Layout", "/versions/18/tables/2/title": "HeapTupleHeaderData Layout", "/versions/18/related/1/label": "Storage Parameters", "/versions/18/tables/0/rows/0/c1": "24 bytes long. Contains general information about the page, including free space pointers.", "/versions/18/tables/0/rows/1/c1": "Array of item identifiers pointing to the actual items. Each entry is an (offset,length) pair. 4 bytes per item.", "/versions/18/tables/0/rows/2/c0": "Free space", "/versions/18/tables/0/rows/2/c1": "The unallocated space. New item identifiers are allocated from the start of this area, new items from the end.", "/versions/18/tables/0/rows/3/c0": "Items", "/versions/18/tables/0/rows/3/c1": "The actual items themselves.", "/versions/18/tables/0/rows/4/c0": "Special space", "/versions/18/tables/0/rows/4/c1": "Index access method specific data. Different methods store different data. Empty in ordinary tables.", "/versions/18/tables/1/rows/0/c2": "8 bytes", "/versions/18/tables/1/rows/0/c3": "LSN: next byte after last byte of WAL record for last change to this page", "/versions/18/tables/1/rows/1/c2": "2 bytes", "/versions/18/tables/1/rows/1/c3": "Page checksum", "/versions/18/tables/1/rows/2/c2": "2 bytes", "/versions/18/tables/1/rows/2/c3": "Flag bits", "/versions/18/tables/1/rows/3/c2": "2 bytes", "/versions/18/tables/1/rows/3/c3": "Offset to start of free space", "/versions/18/tables/1/rows/4/c2": "2 bytes", "/versions/18/tables/1/rows/4/c3": "Offset to end of free space", "/versions/18/tables/1/rows/5/c2": "2 bytes", "/versions/18/tables/1/rows/5/c3": "Offset to start of special space", "/versions/18/tables/1/rows/6/c2": "2 bytes", "/versions/18/tables/1/rows/6/c3": "Page size and layout version number information", "/versions/18/tables/1/rows/7/c2": "4 bytes", "/versions/18/tables/1/rows/7/c3": "Oldest unpruned XMAX on page, or zero if none", "/versions/18/tables/2/rows/0/c2": "4 bytes", "/versions/18/tables/2/rows/0/c3": "insert XID stamp", "/versions/18/tables/2/rows/1/c2": "4 bytes", "/versions/18/tables/2/rows/1/c3": "delete XID stamp", "/versions/18/tables/2/rows/2/c2": "4 bytes", "/versions/18/tables/2/rows/2/c3": "insert and/or delete CID stamp (overlays with t_xvac)", "/versions/18/tables/2/rows/3/c2": "4 bytes", "/versions/18/tables/2/rows/3/c3": "XID for VACUUM operation moving a row version", "/versions/18/tables/2/rows/4/c2": "6 bytes", "/versions/18/tables/2/rows/4/c3": "current TID of this or newer row version", "/versions/18/tables/2/rows/5/c2": "2 bytes", "/versions/18/tables/2/rows/5/c3": "number of attributes, plus various flag bits", "/versions/18/tables/2/rows/6/c2": "2 bytes", "/versions/18/tables/2/rows/6/c3": "various flag bits", "/versions/18/tables/2/rows/7/c2": "1 byte", "/versions/18/tables/2/rows/7/c3": "offset to user data", "/versions/18/tables/0/columns/0/label": "Item", "/versions/18/tables/0/columns/1/label": "Description", "/versions/18/tables/1/columns/0/label": "Field", "/versions/18/tables/1/columns/1/label": "Type", "/versions/18/tables/1/columns/2/label": "Length", "/versions/18/tables/1/columns/3/label": "Description", "/versions/18/tables/2/columns/0/label": "Field", "/versions/18/tables/2/columns/1/label": "Type", "/versions/18/tables/2/columns/2/label": "Length", "/versions/18/tables/2/columns/3/label": "Description"}, "fallback_fields": [], "source_language": "en", "original_snapshot_sha256": "a9dda740e83f3772422bb1b41e492854b00998da5004f5a0e1f65588f2beaebd"}, "comparison_data": {"layouts": [{"key": "layout-0", "rows": [{"c0": "PageHeaderData", "c1": "24 bytes long. Contains general information about the page, including free space pointers."}, {"c0": "ItemIdData", "c1": "Array of item identifiers pointing to the actual items. Each entry is an (offset,length) pair. 4 bytes per item."}, {"c0": "Free space", "c1": "The unallocated space. New item identifiers are allocated from the start of this area, new items from the end."}, {"c0": "Items", "c1": "The actual items themselves."}, {"c0": "Special space", "c1": "Index access method specific data. Different methods store different data. Empty in ordinary tables."}], "title": "Overall Page Layout", "columns": [{"key": "c0", "label": "Item"}, {"key": "c1", "label": "Description"}]}, {"key": "layout-1", "rows": [{"c0": "pd_lsn", "c1": "PageXLogRecPtr", "c2": "8 bytes", "c3": "LSN: next byte after last byte of WAL record for last change to this page"}, {"c0": "pd_checksum", "c1": "uint16", "c2": "2 bytes", "c3": "Page checksum"}, {"c0": "pd_flags", "c1": "uint16", "c2": "2 bytes", "c3": "Flag bits"}, {"c0": "pd_lower", "c1": "LocationIndex", "c2": "2 bytes", "c3": "Offset to start of free space"}, {"c0": "pd_upper", "c1": "LocationIndex", "c2": "2 bytes", "c3": "Offset to end of free space"}, {"c0": "pd_special", "c1": "LocationIndex", "c2": "2 bytes", "c3": "Offset to start of special space"}, {"c0": "pd_pagesize_version", "c1": "uint16", "c2": "2 bytes", "c3": "Page size and layout version number information"}, {"c0": "pd_prune_xid", "c1": "TransactionId", "c2": "4 bytes", "c3": "Oldest unpruned XMAX on page, or zero if none"}], "title": "PageHeaderData Layout", "columns": [{"key": "c0", "label": "Field"}, {"key": "c1", "label": "Type"}, {"key": "c2", "label": "Length"}, {"key": "c3", "label": "Description"}]}, {"key": "layout-2", "rows": [{"c0": "t_xmin", "c1": "TransactionId", "c2": "4 bytes", "c3": "insert XID stamp"}, {"c0": "t_xmax", "c1": "TransactionId", "c2": "4 bytes", "c3": "delete XID stamp"}, {"c0": "t_cid", "c1": "CommandId", "c2": "4 bytes", "c3": "insert and/or delete CID stamp (overlays with t_xvac)"}, {"c0": "t_xvac", "c1": "TransactionId", "c2": "4 bytes", "c3": "XID for VACUUM operation moving a row version"}, {"c0": "t_ctid", "c1": "ItemPointerData", "c2": "6 bytes", "c3": "current TID of this or newer row version"}, {"c0": "t_infomask2", "c1": "uint16", "c2": "2 bytes", "c3": "number of attributes, plus various flag bits"}, {"c0": "t_infomask", "c1": "uint16", "c2": "2 bytes", "c3": "various flag bits"}, {"c0": "t_hoff", "c1": "uint8", "c2": "1 byte", "c3": "offset to user data"}], "title": "HeapTupleHeaderData Layout", "columns": [{"key": "c0", "label": "Field"}, {"key": "c1", "label": "Type"}, {"key": "c2", "label": "Length"}, {"key": "c3", "label": "Description"}]}]}, "comparison_hash": "b621fa85b3be27a0eb0d82986e9524f2ef0a776761901f0d429826eec4822d0a", "manual_language": "zh"}, "19": {"facts": [{"label": "\u5b9a\u4e49\u8303\u56f4", "value": "\u540c\u7248\u672c\u6838\u5fc3\u7269\u7406\u5b58\u50a8\u6587\u6863"}], "tables": [{"key": "layout-0", "rows": [{"c0": "PageHeaderData", "c1": "\u957f 24 \u5b57\u8282\uff0c\u5305\u542b\u9875\u9762\u7684\u901a\u7528\u4fe1\u606f\uff0c\u4f8b\u5982\u7a7a\u95f2\u7a7a\u95f4\u6307\u9488\u3002"}, {"c0": "ItemIdData", "c1": "\u6307\u5411\u5b9e\u9645\u6570\u636e\u9879\u7684\u884c\u6307\u9488\u6570\u7ec4\u3002\u6bcf\u9879\u4e3a\u4e00\u4e2a\uff08\u504f\u79fb\uff0c\u957f\u5ea6\uff09\u5bf9\uff0c\u5360 4 \u5b57\u8282\u3002"}, {"c0": "\u7a7a\u95f2\u7a7a\u95f4", "c1": "\u5c1a\u672a\u5206\u914d\u7684\u7a7a\u95f4\u3002\u65b0\u884c\u6307\u9488\u4ece\u8be5\u533a\u57df\u7684\u8d77\u59cb\u5904\u5206\u914d\uff0c\u65b0\u6570\u636e\u9879\u4ece\u672b\u5c3e\u5904\u5206\u914d\u3002"}, {"c0": "\u9879", "c1": "\u5b9e\u9645\u7684\u6570\u636e\u9879\u672c\u8eab\u3002"}, {"c0": "\u7279\u6b8a\u7a7a\u95f4", "c1": "\u7d22\u5f15\u8bbf\u95ee\u65b9\u6cd5\u4e13\u7528\u6570\u636e\u3002\u4e0d\u540c\u65b9\u6cd5\u5b58\u50a8\u7684\u5185\u5bb9\u4e0d\u540c\uff0c\u666e\u901a\u8868\u4e2d\u6b64\u533a\u57df\u4e3a\u7a7a\u3002"}], "title": "\u9875\u9762\u603b\u4f53\u5e03\u5c40", "columns": [{"key": "c0", "label": "\u9879\u76ee"}, {"key": "c1", "label": "\u8bf4\u660e"}]}, {"key": "layout-1", "rows": [{"c0": "pd_lsn", "c1": "PageXLogRecPtr", "c2": "8 \u5b57\u8282", "c3": "LSN\uff1a\u8be5\u9875\u6700\u540e\u4e00\u6b21\u53d8\u5316\u6240\u5bf9\u5e94 WAL \u8bb0\u5f55\u7684\u6700\u540e\u4e00\u4e2a\u5b57\u8282\u4e4b\u540e\u7684\u4f4d\u7f6e\u3002"}, {"c0": "pd_checksum", "c1": "uint16", "c2": "2 \u5b57\u8282", "c3": "\u9875\u9762\u6821\u9a8c\u548c"}, {"c0": "pd_flags", "c1": "uint16", "c2": "2 \u5b57\u8282", "c3": "\u6807\u5fd7\u4f4d"}, {"c0": "pd_lower", "c1": "LocationIndex", "c2": "2 \u5b57\u8282", "c3": "\u7a7a\u95f2\u7a7a\u95f4\u8d77\u59cb\u4f4d\u7f6e\u7684\u504f\u79fb\u91cf"}, {"c0": "pd_upper", "c1": "LocationIndex", "c2": "2 \u5b57\u8282", "c3": "\u7a7a\u95f2\u7a7a\u95f4\u7ed3\u675f\u4f4d\u7f6e\u7684\u504f\u79fb\u91cf"}, {"c0": "pd_special", "c1": "LocationIndex", "c2": "2 \u5b57\u8282", "c3": "\u7279\u6b8a\u7a7a\u95f4\u8d77\u59cb\u4f4d\u7f6e\u7684\u504f\u79fb\u91cf"}, {"c0": "pd_pagesize_version", "c1": "uint16", "c2": "2 \u5b57\u8282", "c3": "\u9875\u9762\u5927\u5c0f\u4e0e\u5e03\u5c40\u7248\u672c\u53f7\u4fe1\u606f"}, {"c0": "pd_prune_xid", "c1": "TransactionId", "c2": "4 \u5b57\u8282", "c3": "\u9875\u9762\u4e0a\u6700\u65e9\u7684\u5c1a\u672a\u4fee\u526a\u7684 XMAX\uff1b\u6ca1\u6709\u5219\u4e3a\u96f6"}], "title": "PageHeaderData \u5e03\u5c40", "columns": [{"key": "c0", "label": "\u5b57\u6bb5"}, {"key": "c1", "label": "\u7c7b\u578b"}, {"key": "c2", "label": "\u957f\u5ea6"}, {"key": "c3", "label": "\u8bf4\u660e"}]}, {"key": "layout-2", "rows": [{"c0": "t_xmin", "c1": "TransactionId", "c2": "4 \u5b57\u8282", "c3": "\u63d2\u5165\u4e8b\u52a1\u7684 XID"}, {"c0": "t_xmax", "c1": "TransactionId", "c2": "4 \u5b57\u8282", "c3": "\u5220\u9664\u4e8b\u52a1\u7684 XID"}, {"c0": "t_cid", "c1": "CommandId", "c2": "4 \u5b57\u8282", "c3": "\u63d2\u5165\u548c\uff0f\u6216\u5220\u9664\u547d\u4ee4\u7684 CID\uff0c\u4e0e t_xvac \u5171\u7528\u5b58\u50a8\u4f4d\u7f6e"}, {"c0": "t_xvac", "c1": "TransactionId", "c2": "4 \u5b57\u8282", "c3": "VACUUM \u64cd\u4f5c\u79fb\u52a8\u884c\u7248\u672c\u65f6\u4f7f\u7528\u7684 XID"}, {"c0": "t_ctid", "c1": "ItemPointerData", "c2": "6 \u5b57\u8282", "c3": "\u672c\u884c\u7248\u672c\u6216\u8f83\u65b0\u884c\u7248\u672c\u7684\u5f53\u524d TID"}, {"c0": "t_infomask2", "c1": "uint16", "c2": "2 \u5b57\u8282", "c3": "\u5c5e\u6027\u6570\u91cf\u53ca\u5404\u79cd\u6807\u5fd7\u4f4d"}, {"c0": "t_infomask", "c1": "uint16", "c2": "2 \u5b57\u8282", "c3": "\u5404\u79cd\u6807\u5fd7\u4f4d"}, {"c0": "t_hoff", "c1": "uint8", "c2": "1 \u5b57\u8282", "c3": "\u7528\u6237\u6570\u636e\u7684\u504f\u79fb\u91cf"}], "title": "HeapTupleHeaderData \u5e03\u5c40", "columns": [{"key": "c0", "label": "\u5b57\u6bb5"}, {"key": "c1", "label": "\u7c7b\u578b"}, {"key": "c2", "label": "\u957f\u5ea6"}, {"key": "c3", "label": "\u8bf4\u660e"}]}], "diagram": "page-layout", "related": [{"url": "/wiki/tableam/?v=19", "label": "Table AM"}, {"url": "/wiki/relopts/?v=19", "label": "\u5b58\u50a8\u53c2\u6570"}], "release": {"ref": "https://ftp.postgresql.org/pub/source/v19beta4/postgresql-19beta4.tar.bz2", "label": "19beta4", "major": "19", "channel": "preview", "revision": "83157ee9c599d03b2f7a3d73ef3a56ec24e0e79cc2b3501a64d1364f56398c86"}, "sources": [{"url": "https://pg.center/docs/19/storage-page-layout.html", "path": "storage-page-layout.html", "label": "PostgreSQL 19 English manual", "sha256": "4ef53402590510fe17440d51323824cca73b5cd6a17df88b2ef076c204de2126", "language": "en", "original_url": "/docs/19/storage-page-layout.html"}], "sections": [], "signature": "", "description": ["\u672c\u8282\u6982\u8ff0 PostgreSQL \u8868\u548c\u7d22\u5f15\u5185\u90e8\u6240\u4f7f\u7528\u7684\u9875\u9762\u683c\u5f0f\u3002 [20] \u5e8f\u5217\u548c TOAST \u8868\u7684\u683c\u5f0f\u4e0e\u666e\u901a\u8868\u76f8\u540c\u3002"], "manual_html": "<div class=\"sect1\">\n<div class=\"titlepage\">\n<div>\n<div>\n<h2 class=\"title\" lang=\"zh\">\n<div>\n<div>\n<h2 class=\"title\" style=\"clear: both\">66.6.\u00a0\u6570\u636e\u5e93\u9875\u9762\u5e03\u5c40 </h2>\n</div>\n</div>\n</h2>\n</div>\n</div>\n</div>\n<p lang=\"zh\">\u672c\u8282\u6982\u8ff0 <span class=\"productname\">PostgreSQL</span> \u8868\u548c\u7d22\u5f15\u5185\u90e8\u6240\u4f7f\u7528\u7684\u9875\u9762\u683c\u5f0f\u3002<a class=\"footnote\" href=\"/docs/19/storage-page-layout.html#ftn.id-1.10.18.8.2.2\"><sup class=\"footnote\" id=\"id-1.10.18.8.2.2\">[20]</sup></a> \u5e8f\u5217\u548c <acronym class=\"acronym\">TOAST</acronym> \u8868\u7684\u683c\u5f0f\u4e0e\u666e\u901a\u8868\u76f8\u540c\u3002</p>\n<p lang=\"zh\">\u5728\u4e0b\u9762\u7684\u8bf4\u660e\u4e2d\uff0c\u5047\u5b9a\u4e00\u4e2a<em class=\"firstterm\">\u5b57\u8282</em>\u5305\u542b 8 \u4e2a\u4f4d\u3002\u53e6\u5916\uff0c\u672f\u8bed<em class=\"firstterm\">\u9879</em>\u6307\u7684\u662f\u5b58\u50a8\u5728\u9875\u9762\u4e0a\u7684\u5355\u4e2a\u6570\u636e\u503c\u3002\u5728\u8868\u4e2d\uff0c\u9879\u662f\u4e00\u884c\uff1b\u5728\u7d22\u5f15\u4e2d\uff0c\u9879\u662f\u4e00\u6761\u7d22\u5f15\u6761\u76ee\u3002</p>\n<p lang=\"zh\">\u6bcf\u4e2a\u8868\u548c\u7d22\u5f15\u90fd\u5b58\u50a8\u4e3a\u56fa\u5b9a\u5927\u5c0f\u7684<em class=\"firstterm\">\u9875\u9762</em>\u6570\u7ec4\uff08\u901a\u5e38\u4e3a 8 kB\uff0c\u4e0d\u8fc7\u5728\u7f16\u8bd1\u670d\u52a1\u5668\u65f6\u53ef\u4ee5\u9009\u62e9\u4e0d\u540c\u7684\u9875\u9762\u5927\u5c0f\uff09\u3002\u5728\u8868\u4e2d\uff0c\u6240\u6709\u9875\u9762\u5728\u903b\u8f91\u4e0a\u90fd\u662f\u7b49\u4ef7\u7684\uff0c\u56e0\u6b64\u67d0\u4e2a\u7279\u5b9a\u9879\uff08\u884c\uff09\u53ef\u4ee5\u5b58\u653e\u5728\u4efb\u610f\u9875\u9762\u4e2d\u3002\u5728\u7d22\u5f15\u4e2d\uff0c\u7b2c\u4e00\u9875\u901a\u5e38\u4fdd\u7559\u4e3a<em class=\"firstterm\">\u5143\u9875</em>\uff0c\u7528\u4e8e\u4fdd\u5b58\u63a7\u5236\u4fe1\u606f\uff1b\u5e76\u4e14\u6839\u636e\u7d22\u5f15\u8bbf\u95ee\u65b9\u6cd5\u7684\u4e0d\u540c\uff0c\u7d22\u5f15\u4e2d\u8fd8\u53ef\u80fd\u5b58\u5728\u4e0d\u540c\u7c7b\u578b\u7684\u9875\u9762\u3002</p>\n<p lang=\"zh\"><a class=\"xref\" href=\"/docs/19/storage-page-layout.html#PAGE-TABLE\" title=\"\u8868\u00a066.2.\u00a0\u603b\u4f53\u9875\u9762\u5e03\u5c40\">\u8868\u00a066.2</a>\u5c55\u793a\u4e86\u9875\u9762\u7684\u603b\u4f53\u5e03\u5c40\u3002\u6bcf\u4e2a\u9875\u9762\u5305\u542b\u4e94\u4e2a\u90e8\u5206\u3002</p>\n<div class=\"table\">\n<p class=\"title\" lang=\"zh\"><strong>\u8868\u00a066.2.\u00a0\u603b\u4f53\u9875\u9762\u5e03\u5c40</strong></p>\n<div class=\"table-contents\">\n<table class=\"table\">\n<thead>\n<tr>\n<th lang=\"zh\">\u9879\u76ee</th>\n<th lang=\"zh\">\u8bf4\u660e</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>PageHeaderData</td>\n<td lang=\"zh\">\u957f 24 \u5b57\u8282\uff0c\u5305\u542b\u9875\u9762\u7684\u901a\u7528\u4fe1\u606f\uff0c\u4f8b\u5982\u7a7a\u95f2\u7a7a\u95f4\u6307\u9488\u3002</td>\n</tr>\n<tr>\n<td>ItemIdData</td>\n<td lang=\"zh\">\u6307\u5411\u5b9e\u9645\u6570\u636e\u9879\u7684\u884c\u6307\u9488\u6570\u7ec4\u3002\u6bcf\u9879\u4e3a\u4e00\u4e2a\uff08\u504f\u79fb\uff0c\u957f\u5ea6\uff09\u5bf9\uff0c\u5360 4 \u5b57\u8282\u3002</td>\n</tr>\n<tr>\n<td lang=\"zh\">\u7a7a\u95f2\u7a7a\u95f4</td>\n<td lang=\"zh\">\u5c1a\u672a\u5206\u914d\u7684\u7a7a\u95f4\u3002\u65b0\u884c\u6307\u9488\u4ece\u8be5\u533a\u57df\u7684\u8d77\u59cb\u5904\u5206\u914d\uff0c\u65b0\u6570\u636e\u9879\u4ece\u672b\u5c3e\u5904\u5206\u914d\u3002</td>\n</tr>\n<tr>\n<td lang=\"zh\">\u9879</td>\n<td lang=\"zh\">\u5b9e\u9645\u7684\u6570\u636e\u9879\u672c\u8eab\u3002</td>\n</tr>\n<tr>\n<td lang=\"zh\">\u7279\u6b8a\u7a7a\u95f4</td>\n<td lang=\"zh\">\u7d22\u5f15\u8bbf\u95ee\u65b9\u6cd5\u4e13\u7528\u6570\u636e\u3002\u4e0d\u540c\u65b9\u6cd5\u5b58\u50a8\u7684\u5185\u5bb9\u4e0d\u540c\uff0c\u666e\u901a\u8868\u4e2d\u6b64\u533a\u57df\u4e3a\u7a7a\u3002</td>\n</tr>\n</tbody>\n</table>\n</div>\n</div><br class=\"table-break\"/>\n<p lang=\"zh\">\u6bcf\u9875\u7684\u524d 24 \u5b57\u8282\u662f\u9875\u9996\u90e8 PageHeaderData\uff0c\u8be6\u7ec6\u683c\u5f0f\u89c1\u8868 66.3\u3002\u7b2c\u4e00\u4e2a\u5b57\u6bb5\u8ddf\u8e2a\u4e0e\u8be5\u9875\u76f8\u5173\u7684\u6700\u8fd1\u4e00\u6761 WAL \u8bb0\u5f55\uff1b\u7b2c\u4e8c\u4e2a\u5b57\u6bb5\u5728\u542f\u7528\u6570\u636e\u6821\u9a8c\u548c\u65f6\u4fdd\u5b58\u9875\u9762\u6821\u9a8c\u548c\u3002\u4e4b\u540e\u662f\u4e00\u4e2a\u5305\u542b\u6807\u5fd7\u4f4d\u7684 2 \u5b57\u8282\u5b57\u6bb5\uff0c\u518d\u540e\u9762\u662f\u4e09\u4e2a 2 \u5b57\u8282\u6574\u6570 pd_lower\u3001pd_upper \u548c pd_special\uff0c\u5206\u522b\u8bb0\u5f55\u4ece\u9875\u8d77\u70b9\u5230\u672a\u5206\u914d\u7a7a\u95f4\u8d77\u70b9\u3001\u672a\u5206\u914d\u7a7a\u95f4\u7ec8\u70b9\u53ca\u7279\u6b8a\u7a7a\u95f4\u8d77\u70b9\u7684\u5b57\u8282\u504f\u79fb\u91cf\u3002\u63a5\u4e0b\u6765\u7684 2 \u5b57\u8282 pd_pagesize_version \u540c\u65f6\u4fdd\u5b58\u9875\u5927\u5c0f\u548c\u7248\u672c\u6807\u8bc6\u3002PostgreSQL 8.3 \u8d77\u7248\u672c\u53f7\u4e3a 4\uff1b8.1 \u4e0e 8.2 \u4f7f\u7528 3\uff1b8.0 \u4f7f\u7528 2\uff1b7.3 \u4e0e 7.4 \u4f7f\u7528 1\uff1b\u66f4\u65e9\u7248\u672c\u4f7f\u7528 0\u3002\u591a\u6570\u7248\u672c\u7684\u57fa\u672c\u9875\u9762\u5e03\u5c40\u548c\u9996\u90e8\u683c\u5f0f\u5e76\u672a\u53d8\u5316\uff0c\u4f46\u5806\u884c\u9996\u90e8\u5e03\u5c40\u6709\u53d8\u5316\u3002\u9875\u5927\u5c0f\u57fa\u672c\u53ea\u7528\u4e8e\u4ea4\u53c9\u68c0\u67e5\uff1b\u540c\u4e00\u5b89\u88c5\u4e0d\u652f\u6301\u591a\u79cd\u9875\u5927\u5c0f\u3002\u6700\u540e\u4e00\u4e2a\u5b57\u6bb5\u63d0\u793a\u4fee\u526a\u8be5\u9875\u662f\u5426\u53ef\u80fd\u6709\u76ca\uff0c\u8bb0\u5f55\u8be5\u9875\u6700\u65e9\u7684\u5c1a\u672a\u4fee\u526a\u7684 XMAX\u3002</p>\n<div class=\"table\">\n<p class=\"title\" lang=\"zh\"><strong>\u8868\u00a066.3.\u00a0PageHeaderData \u5e03\u5c40</strong></p>\n<div class=\"table-contents\">\n<table class=\"table\">\n<thead>\n<tr>\n<th lang=\"zh\">\u5b57\u6bb5</th>\n<th lang=\"zh\">\u7c7b\u578b</th>\n<th lang=\"zh\">\u957f\u5ea6</th>\n<th lang=\"zh\">\u8bf4\u660e</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>pd_lsn</td>\n<td>PageXLogRecPtr</td>\n<td lang=\"zh\">8 \u5b57\u8282</td>\n<td lang=\"zh\">LSN\uff1a\u8be5\u9875\u6700\u540e\u4e00\u6b21\u53d8\u5316\u6240\u5bf9\u5e94 WAL \u8bb0\u5f55\u7684\u6700\u540e\u4e00\u4e2a\u5b57\u8282\u4e4b\u540e\u7684\u4f4d\u7f6e\u3002</td>\n</tr>\n<tr>\n<td>pd_checksum</td>\n<td>uint16</td>\n<td lang=\"zh\">2 \u5b57\u8282</td>\n<td lang=\"zh\">\u9875\u9762\u6821\u9a8c\u548c</td>\n</tr>\n<tr>\n<td>pd_flags</td>\n<td>uint16</td>\n<td lang=\"zh\">2 \u5b57\u8282</td>\n<td lang=\"zh\">\u6807\u5fd7\u4f4d</td>\n</tr>\n<tr>\n<td>pd_lower</td>\n<td>LocationIndex</td>\n<td lang=\"zh\">2 \u5b57\u8282</td>\n<td lang=\"zh\">\u7a7a\u95f2\u7a7a\u95f4\u8d77\u59cb\u4f4d\u7f6e\u7684\u504f\u79fb\u91cf</td>\n</tr>\n<tr>\n<td>pd_upper</td>\n<td>LocationIndex</td>\n<td lang=\"zh\">2 \u5b57\u8282</td>\n<td lang=\"zh\">\u7a7a\u95f2\u7a7a\u95f4\u7ed3\u675f\u4f4d\u7f6e\u7684\u504f\u79fb\u91cf</td>\n</tr>\n<tr>\n<td>pd_special</td>\n<td>LocationIndex</td>\n<td lang=\"zh\">2 \u5b57\u8282</td>\n<td lang=\"zh\">\u7279\u6b8a\u7a7a\u95f4\u8d77\u59cb\u4f4d\u7f6e\u7684\u504f\u79fb\u91cf</td>\n</tr>\n<tr>\n<td>pd_pagesize_version</td>\n<td>uint16</td>\n<td lang=\"zh\">2 \u5b57\u8282</td>\n<td lang=\"zh\">\u9875\u9762\u5927\u5c0f\u4e0e\u5e03\u5c40\u7248\u672c\u53f7\u4fe1\u606f</td>\n</tr>\n<tr>\n<td>pd_prune_xid</td>\n<td>TransactionId</td>\n<td lang=\"zh\">4 \u5b57\u8282</td>\n<td lang=\"zh\">\u9875\u9762\u4e0a\u6700\u65e9\u7684\u5c1a\u672a\u4fee\u526a\u7684 XMAX\uff1b\u6ca1\u6709\u5219\u4e3a\u96f6</td>\n</tr>\n</tbody>\n</table>\n</div>\n</div><br class=\"table-break\"/>\n<p lang=\"zh\">\u6240\u6709\u7ec6\u8282\u90fd\u53ef\u4ee5\u5728 <code class=\"filename\">src/include/storage/bufpage.h</code> \u4e2d\u627e\u5230\u3002</p>\n<p lang=\"zh\">\u9875\u5934\u4e4b\u540e\u662f\u9879\u6807\u8bc6\u7b26\uff08<code class=\"type\">ItemIdData</code>\uff09\uff0c\u6bcf\u4e2a\u9700\u8981\u56db\u4e2a\u5b57\u8282\u3002\u4e00\u4e2a\u9879\u6807\u8bc6\u7b26\u5305\u542b\u9879\u8d77\u59cb\u4f4d\u7f6e\u7684\u5b57\u8282\u504f\u79fb\u91cf\u3001\u5176\u5b57\u8282\u957f\u5ea6\uff0c\u4ee5\u53ca\u82e5\u5e72\u5f71\u54cd\u89e3\u91ca\u65b9\u5f0f\u7684\u5c5e\u6027\u4f4d\u3002\u65b0\u7684\u9879\u6807\u8bc6\u7b26\u4f1a\u6839\u636e\u9700\u8981\u4ece\u672a\u5206\u914d\u7a7a\u95f4\u7684\u8d77\u59cb\u5904\u5206\u914d\u3002\u5f53\u524d\u5df2\u6709\u591a\u5c11\u4e2a\u9879\u6807\u8bc6\u7b26\uff0c\u53ef\u4ee5\u901a\u8fc7\u67e5\u770b <code class=\"structfield\">pd_lower</code> \u5f97\u77e5\uff1b\u5206\u914d\u65b0\u6807\u8bc6\u7b26\u65f6\u5b83\u4f1a\u589e\u52a0\u3002\u56e0\u4e3a\u4e00\u4e2a\u9879\u6807\u8bc6\u7b26\u5728\u88ab\u91ca\u653e\u4e4b\u524d\u6c38\u8fdc\u4e0d\u4f1a\u79fb\u52a8\uff0c\u6240\u4ee5\u5373\u4f7f\u9879\u672c\u8eab\u4e3a\u4e86\u6574\u7406\u7a7a\u95f2\u7a7a\u95f4\u800c\u5728\u9875\u9762\u5185\u79fb\u52a8\uff0c\u5176\u7d22\u5f15\u4ecd\u7136\u53ef\u4ee5\u88ab\u957f\u671f\u7528\u6765\u5f15\u7528\u8be5\u9879\u3002\u4e8b\u5b9e\u4e0a\uff0c\u6bcf\u4e2a\u6307\u5411\u9879\u7684\u6307\u9488\uff08<code class=\"type\">ItemPointer</code>\uff0c\u4e5f\u79f0 <code class=\"type\">CTID</code>\uff09\u5728 <span class=\"productname\">PostgreSQL</span> \u4e2d\u90fd\u7531\u9875\u53f7\u548c\u9879\u6807\u8bc6\u7b26\u7d22\u5f15\u6784\u6210\u3002</p>\n<p lang=\"zh\">\u9879\u672c\u8eab\u5b58\u50a8\u5728\u4ece\u672a\u5206\u914d\u7a7a\u95f4\u672b\u5c3e\u5f00\u59cb\u3001\u5411\u540e\u5206\u914d\u7684\u533a\u57df\u4e2d\u3002\u5176\u786e\u5207\u7ed3\u6784\u53d6\u51b3\u4e8e\u8868\u8981\u5305\u542b\u4ec0\u4e48\u5185\u5bb9\u3002\u8868\u548c\u5e8f\u5217\u90fd\u4f7f\u7528\u4e00\u79cd\u540d\u4e3a <code class=\"type\">HeapTupleHeaderData</code> \u7684\u7ed3\u6784\u4f53\uff0c\u5982\u4e0b\u6240\u8ff0\u3002</p>\n<p lang=\"zh\">\u6700\u540e\u4e00\u90e8\u5206\u662f<span class=\"quote\">\u201c<span class=\"quote\">\u7279\u6b8a\u90e8\u5206</span>\u201d</span>\uff0c\u5176\u4e2d\u53ef\u4ee5\u5b58\u653e\u8bbf\u95ee\u65b9\u6cd5\u5e0c\u671b\u4fdd\u5b58\u7684\u4efb\u4f55\u5185\u5bb9\u3002\u4f8b\u5982\uff0cB-\u6811\u7d22\u5f15\u4f1a\u5728\u8fd9\u91cc\u4fdd\u5b58\u6307\u5411\u9875\u9762\u5de6\u3001\u53f3\u5144\u5f1f\u7684\u94fe\u63a5\uff0c\u4ee5\u53ca\u5176\u4ed6\u4e00\u4e9b\u4e0e\u7d22\u5f15\u7ed3\u6784\u76f8\u5173\u7684\u6570\u636e\u3002\u666e\u901a\u8868\u5b8c\u5168\u4e0d\u4f7f\u7528\u7279\u6b8a\u90e8\u5206\uff08\u901a\u8fc7\u5c06 <code class=\"structfield\">pd_special</code> \u8bbe\u4e3a\u9875\u9762\u5927\u5c0f\u6765\u8868\u793a\uff09\u3002</p>\n<p lang=\"zh\"><a class=\"xref\" href=\"/docs/19/storage-page-layout.html#STORAGE-PAGE-LAYOUT-FIGURE\" title=\"\u56fe\u00a066.1.\u00a0\u9875\u9762\u5e03\u5c40\">\u56fe\u00a066.1</a>\u5c55\u793a\u4e86\u8fd9\u4e9b\u90e8\u5206\u5728\u9875\u9762\u4e2d\u7684\u5e03\u5c40\u65b9\u5f0f\u3002</p>\n<div class=\"figure col-xl-8 col-lg-10 col-md-12\">\n<p class=\"title\" lang=\"zh\">\n<p class=\"title\"><strong>\u56fe\u00a066.1.\u00a0\u9875\u9762\u5e03\u5c40</strong></p>\n<div class=\"figure-contents\">\n<div class=\"mediaobject\">\n<object data=\"pagelayout.svg\" type=\"image/svg+xml\" width=\"100%\">\n</object>\n</div>\n</div>\n</p>\n<div class=\"figure-contents\">\n<div class=\"mediaobject\">\n</div>\n</div>\n</div><br class=\"figure-break\"/>\n<div class=\"sect2\">\n<div class=\"titlepage\">\n<div>\n<div>\n<h3 class=\"title\" lang=\"zh\">\n<dl class=\"toc\">\n<dt><span class=\"sect2\"><a href=\"/docs/19/storage-page-layout.html#STORAGE-TUPLE-LAYOUT\">66.6.1. \u8868\u884c\u5e03\u5c40</a></span></dt>\n</dl>\n</h3>\n</div>\n</div>\n</div>\n<p lang=\"zh\">\u6240\u6709\u8868\u884c\u7684\u7ed3\u6784\u90fd\u76f8\u540c\u3002\u5b83\u4eec\u90fd\u6709\u4e00\u4e2a\u56fa\u5b9a\u5927\u5c0f\u7684\u5934\u90e8\uff08\u5728\u5927\u591a\u6570\u673a\u5668\u4e0a\u5360 23 \u5b57\u8282\uff09\uff0c\u540e\u9762\u8ddf\u7740\u53ef\u9009\u7684\u7a7a\u503c\u4f4d\u56fe\u3001\u53ef\u9009\u7684\u5bf9\u8c61 ID \u5b57\u6bb5\u4ee5\u53ca\u7528\u6237\u6570\u636e\u3002\u5934\u90e8\u7684\u8be6\u7ec6\u683c\u5f0f\u89c1<a class=\"xref\" href=\"/docs/19/storage-page-layout.html#HEAPTUPLEHEADERDATA-TABLE\" title=\"\u8868\u00a066.4.\u00a0HeapTupleHeaderData \u5e03\u5c40\">\u8868\u00a066.4</a>\u3002\u5b9e\u9645\u7528\u6237\u6570\u636e\uff08\u884c\u7684\u5404\u5217\uff09\u4ece <code class=\"structfield\">t_hoff</code> \u6307\u793a\u7684\u504f\u79fb\u4f4d\u7f6e\u5f00\u59cb\uff0c\u5b83\u5fc5\u987b\u59cb\u7ec8\u662f\u8be5\u5e73\u53f0 MAXALIGN \u5bf9\u9f50\u5355\u4f4d\u7684\u6574\u6570\u500d\u3002\u53ea\u6709\u5f53 <em class=\"firstterm\">HEAP_HASNULL</em> \u4f4d\u5728 <code class=\"structfield\">t_infomask</code> \u4e2d\u88ab\u7f6e\u4f4d\u65f6\uff0c\u7a7a\u503c\u4f4d\u56fe\u624d\u5b58\u5728\u3002\u82e5\u5b58\u5728\uff0c\u5b83\u7d27\u968f\u56fa\u5b9a\u5934\u90e8\u4e4b\u540e\uff0c\u5e76\u5360\u7528\u8db3\u591f\u591a\u7684\u5b57\u8282\uff0c\u4ee5\u4fbf\u4e3a\u6bcf\u4e2a\u6570\u636e\u5217\u63d0\u4f9b\u4e00\u4f4d\uff08\u4e5f\u5c31\u662f\u8bf4\uff0c\u5176\u4f4d\u6570\u7b49\u4e8e <code class=\"structfield\">t_infomask2</code> \u4e2d\u7684\u5c5e\u6027\u4e2a\u6570\uff09\u3002\u5728\u8fd9\u4e2a\u4f4d\u56fe\u4e2d\uff0c1 \u8868\u793a\u975e\u7a7a\uff0c0 \u8868\u793a\u7a7a\u503c\u3002\u5f53\u4f4d\u56fe\u4e0d\u5b58\u5728\u65f6\uff0c\u5047\u5b9a\u6240\u6709\u5217\u90fd\u975e\u7a7a\u3002\u53ea\u6709\u5f53 <em class=\"firstterm\">HEAP_HASOID_OLD</em> \u4f4d\u5728 <code class=\"structfield\">t_infomask</code> \u4e2d\u88ab\u7f6e\u4f4d\u65f6\uff0c\u5bf9\u8c61 ID \u624d\u5b58\u5728\u3002\u82e5\u5b58\u5728\uff0c\u5b83\u4f4d\u4e8e <code class=\"structfield\">t_hoff</code> \u8fb9\u754c\u4e4b\u524d\u3002\u4e3a\u4e86\u8ba9 <code class=\"structfield\">t_hoff</code> \u6210\u4e3a MAXALIGN \u7684\u6574\u6570\u500d\u6240\u9700\u7684\u4efb\u4f55\u586b\u5145\uff0c\u90fd\u4f1a\u51fa\u73b0\u5728\u7a7a\u503c\u4f4d\u56fe\u4e0e\u5bf9\u8c61 ID \u4e4b\u95f4\u3002\uff08\u8fd9\u53c8\u53cd\u8fc7\u6765\u4fdd\u8bc1\u4e86\u5bf9\u8c61 ID \u7684\u5bf9\u9f50\u662f\u5408\u9002\u7684\u3002\uff09</p>\n<div class=\"table\">\n<p class=\"title\" lang=\"zh\"><strong>\u8868\u00a066.4.\u00a0HeapTupleHeaderData \u5e03\u5c40</strong></p>\n<div class=\"table-contents\">\n<table class=\"table\">\n<thead>\n<tr>\n<th lang=\"zh\">\u5b57\u6bb5</th>\n<th lang=\"zh\">\u7c7b\u578b</th>\n<th lang=\"zh\">\u957f\u5ea6</th>\n<th lang=\"zh\">\u8bf4\u660e</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>t_xmin</td>\n<td>TransactionId</td>\n<td lang=\"zh\">4 \u5b57\u8282</td>\n<td lang=\"zh\">\u63d2\u5165\u4e8b\u52a1\u7684 XID</td>\n</tr>\n<tr>\n<td>t_xmax</td>\n<td>TransactionId</td>\n<td lang=\"zh\">4 \u5b57\u8282</td>\n<td lang=\"zh\">\u5220\u9664\u4e8b\u52a1\u7684 XID</td>\n</tr>\n<tr>\n<td>t_cid</td>\n<td>CommandId</td>\n<td lang=\"zh\">4 \u5b57\u8282</td>\n<td lang=\"zh\">\u63d2\u5165\u548c\uff0f\u6216\u5220\u9664\u547d\u4ee4\u7684 CID\uff0c\u4e0e t_xvac \u5171\u7528\u5b58\u50a8\u4f4d\u7f6e</td>\n</tr>\n<tr>\n<td>t_xvac</td>\n<td>TransactionId</td>\n<td lang=\"zh\">4 \u5b57\u8282</td>\n<td lang=\"zh\">VACUUM \u64cd\u4f5c\u79fb\u52a8\u884c\u7248\u672c\u65f6\u4f7f\u7528\u7684 XID</td>\n</tr>\n<tr>\n<td>t_ctid</td>\n<td>ItemPointerData</td>\n<td lang=\"zh\">6 \u5b57\u8282</td>\n<td lang=\"zh\">\u672c\u884c\u7248\u672c\u6216\u8f83\u65b0\u884c\u7248\u672c\u7684\u5f53\u524d TID</td>\n</tr>\n<tr>\n<td>t_infomask2</td>\n<td>uint16</td>\n<td lang=\"zh\">2 \u5b57\u8282</td>\n<td lang=\"zh\">\u5c5e\u6027\u6570\u91cf\u53ca\u5404\u79cd\u6807\u5fd7\u4f4d</td>\n</tr>\n<tr>\n<td>t_infomask</td>\n<td>uint16</td>\n<td lang=\"zh\">2 \u5b57\u8282</td>\n<td lang=\"zh\">\u5404\u79cd\u6807\u5fd7\u4f4d</td>\n</tr>\n<tr>\n<td>t_hoff</td>\n<td>uint8</td>\n<td lang=\"zh\">1 \u5b57\u8282</td>\n<td lang=\"zh\">\u7528\u6237\u6570\u636e\u7684\u504f\u79fb\u91cf</td>\n</tr>\n</tbody>\n</table>\n</div>\n</div><br class=\"table-break\"/>\n<p lang=\"zh\">\u6240\u6709\u7ec6\u8282\u90fd\u53ef\u4ee5\u5728 <code class=\"filename\">src/include/access/htup_details.h</code> \u4e2d\u627e\u5230\u3002</p>\n<p lang=\"zh\">\u8981\u89e3\u91ca\u5b9e\u9645\u6570\u636e\uff0c\u5fc5\u987b\u501f\u52a9\u4ece\u5176\u4ed6\u8868\u4e2d\u83b7\u5f97\u7684\u4fe1\u606f\uff0c\u5176\u4e2d\u5927\u90e8\u5206\u6765\u81ea <code class=\"structname\">pg_attribute</code>\u3002\u8bc6\u522b\u5b57\u6bb5\u4f4d\u7f6e\u6240\u9700\u7684\u5173\u952e\u503c\u662f <code class=\"structfield\">attlen</code> \u548c <code class=\"structfield\">attalign</code>\u3002\u9664\u975e\u6240\u6709\u5b57\u6bb5\u90fd\u662f\u5b9a\u5bbd\u4e14\u6ca1\u6709\u7a7a\u503c\uff0c\u5426\u5219\u6ca1\u6709\u529e\u6cd5\u76f4\u63a5\u53d6\u5f97\u67d0\u4e2a\u7279\u5b9a\u5c5e\u6027\u3002\u6240\u6709\u8fd9\u4e9b\u6280\u5de7\u90fd\u5c01\u88c5\u5728 <em class=\"firstterm\">heap_getattr</em>\u3001<em class=\"firstterm\">fastgetattr</em> \u548c <em class=\"firstterm\">heap_getsysattr</em> \u8fd9\u4e9b\u51fd\u6570\u4e2d\u3002</p>\n<p lang=\"zh\">\u8bfb\u53d6\u6570\u636e\u65f6\uff0c\u9700\u8981\u4f9d\u6b21\u68c0\u67e5\u6bcf\u4e2a\u5c5e\u6027\u3002\u9996\u5148\u6839\u636e\u7a7a\u503c\u4f4d\u56fe\u5224\u65ad\u8be5\u5b57\u6bb5\u662f\u5426\u4e3a NULL\u3002\u5982\u679c\u662f\uff0c\u5c31\u7ee7\u7eed\u4e0b\u4e00\u4e2a\u3002\u7136\u540e\u786e\u8ba4\u5bf9\u9f50\u662f\u5426\u6b63\u786e\u3002\u5982\u679c\u5b57\u6bb5\u662f\u5b9a\u5bbd\u5b57\u6bb5\uff0c\u90a3\u4e48\u5b83\u7684\u6240\u6709\u5b57\u8282\u90fd\u662f\u76f4\u63a5\u6446\u653e\u7684\uff1b\u5982\u679c\u5b83\u662f\u53d8\u957f\u5b57\u6bb5\uff08attlen = -1\uff09\uff0c\u60c5\u51b5\u5c31\u4f1a\u7a0d\u590d\u6742\u4e00\u4e9b\u3002\u6240\u6709\u53d8\u957f\u6570\u636e\u7c7b\u578b\u90fd\u5171\u4eab\u4e00\u4e2a\u901a\u7528\u5934\u90e8\u7ed3\u6784\u4f53 <code class=\"type\">varlena</code>\uff0c\u5176\u4e2d\u5305\u542b\u5df2\u5b58\u50a8\u503c\u7684\u603b\u957f\u5ea6\u4ee5\u53ca\u4e00\u4e9b\u6807\u5fd7\u4f4d\u3002\u6839\u636e\u8fd9\u4e9b\u6807\u5fd7\uff0c\u6570\u636e\u53ef\u80fd\u662f\u884c\u5185\u5b58\u50a8\u7684\uff0c\u4e5f\u53ef\u80fd\u4f4d\u4e8e <acronym class=\"acronym\">TOAST</acronym> \u8868\u4e2d\uff1b\u5b83\u4e5f\u53ef\u80fd\u662f\u7ecf\u8fc7\u538b\u7f29\u7684\uff08\u89c1<a class=\"xref\" href=\"/docs/19/storage-toast.html\" title=\"66.2.\u00a0TOAST\">\u7b2c\u00a066.2\u00a0\u8282</a>\uff09\u3002</p>\n</div>\n<div class=\"footnotes\">\n<br/>\n<hr/>\n<div class=\"footnote\">\n<p lang=\"zh\">\n<br/>\n<hr style=\"width:100; text-align:left;margin-left: 0\"/>\n<div class=\"footnote\" id=\"ftn.id-1.10.18.8.2.2\">\n<p><a class=\"para\" href=\"/docs/19/storage-page-layout.html#id-1.10.18.8.2.2\"><sup class=\"para\">[20]</sup></a> \u5b9e\u9645\u4e0a\uff0c\u8868\u8bbf\u95ee\u65b9\u6cd5\u548c\u7d22\u5f15\u8bbf\u95ee\u65b9\u6cd5\u90fd\u4e0d\u8981\u6c42\u5fc5\u987b\u4f7f\u7528\u8fd9\u79cd\u9875\u9762\u683c\u5f0f\u3002<code class=\"literal\">heap</code> \u8868\u8bbf\u95ee\u65b9\u6cd5\u59cb\u7ec8\u4f7f\u7528\u8fd9\u79cd\u683c\u5f0f\u3002\u73b0\u6709\u7684\u6240\u6709\u7d22\u5f15\u65b9\u6cd5\u4e5f\u90fd\u4f7f\u7528\u8fd9\u79cd\u57fa\u672c\u683c\u5f0f\uff0c\u4f46\u7d22\u5f15\u5143\u9875\u4e2d\u4fdd\u5b58\u7684\u6570\u636e\u901a\u5e38\u5e76\u4e0d\u9075\u5faa\u9879\u5e03\u5c40\u89c4\u5219\u3002</p>\n</div>\n</p>\n</div>\n</div>\n</div>", "manual_path": "/docs/19/storage-page-layout.html", "localization": {"status": "complete", "sources": [{"url": "/docs/19/storage-page-layout.html", "method": "same-major semantic node", "sha256": "449d5df50770072a5159075c211dd18f895edeaeb7ea22ba5936d469b017017c", "language": "zh", "matched_nodes": ["#STORAGE-PAGE-LAYOUT/div[0]", "#STORAGE-PAGE-LAYOUT/div[16]", "#STORAGE-PAGE-LAYOUT/div[18]/div[2]/p[0]", "#STORAGE-PAGE-LAYOUT/div[18]/p[1]", "#STORAGE-PAGE-LAYOUT/div[18]/p[4]", "#STORAGE-PAGE-LAYOUT/div[18]/p[5]", "#STORAGE-PAGE-LAYOUT/div[18]/p[6]", "#STORAGE-PAGE-LAYOUT/div[19]", "#STORAGE-PAGE-LAYOUT/div[1]", "#STORAGE-PAGE-LAYOUT/div[6]/div[1]/table[0]/tbody[2]/tr[3]/td[0]", "#STORAGE-PAGE-LAYOUT/div[6]/p[0]", "#STORAGE-PAGE-LAYOUT/div[9]/div[1]/table[0]/tbody[2]/tr[0]/td[2]", "#STORAGE-PAGE-LAYOUT/div[9]/p[0]", "#STORAGE-PAGE-LAYOUT/p[11]", "#STORAGE-PAGE-LAYOUT/p[12]", "#STORAGE-PAGE-LAYOUT/p[13]", "#STORAGE-PAGE-LAYOUT/p[14]", "#STORAGE-PAGE-LAYOUT/p[15]", "#STORAGE-PAGE-LAYOUT/p[2]", "#STORAGE-PAGE-LAYOUT/p[3]", "#STORAGE-PAGE-LAYOUT/p[4]", "#STORAGE-PAGE-LAYOUT/p[5]"]}], "language": "zh", "original_text": {"/versions/19/description/0": "This section provides an overview of the page format used within PostgreSQL tables and indexes. [20] Sequences and TOAST tables are formatted just like a regular table.", "/versions/19/facts/0/label": "Definition scope", "/versions/19/facts/0/value": "Same-version core physical storage documentation", "/versions/19/tables/0/title": "Overall Page Layout", "/versions/19/tables/1/title": "PageHeaderData Layout", "/versions/19/tables/2/title": "HeapTupleHeaderData Layout", "/versions/19/related/1/label": "Storage Parameters", "/versions/19/tables/0/rows/0/c1": "24 bytes long. Contains general information about the page, including free space pointers.", "/versions/19/tables/0/rows/1/c1": "Array of item identifiers pointing to the actual items. Each entry is an (offset,length) pair. 4 bytes per item.", "/versions/19/tables/0/rows/2/c0": "Free space", "/versions/19/tables/0/rows/2/c1": "The unallocated space. New item identifiers are allocated from the start of this area, new items from the end.", "/versions/19/tables/0/rows/3/c0": "Items", "/versions/19/tables/0/rows/3/c1": "The actual items themselves.", "/versions/19/tables/0/rows/4/c0": "Special space", "/versions/19/tables/0/rows/4/c1": "Index access method specific data. Different methods store different data. Empty in ordinary tables.", "/versions/19/tables/1/rows/0/c2": "8 bytes", "/versions/19/tables/1/rows/0/c3": "LSN: next byte after last byte of WAL record for last change to this page", "/versions/19/tables/1/rows/1/c2": "2 bytes", "/versions/19/tables/1/rows/1/c3": "Page checksum", "/versions/19/tables/1/rows/2/c2": "2 bytes", "/versions/19/tables/1/rows/2/c3": "Flag bits", "/versions/19/tables/1/rows/3/c2": "2 bytes", "/versions/19/tables/1/rows/3/c3": "Offset to start of free space", "/versions/19/tables/1/rows/4/c2": "2 bytes", "/versions/19/tables/1/rows/4/c3": "Offset to end of free space", "/versions/19/tables/1/rows/5/c2": "2 bytes", "/versions/19/tables/1/rows/5/c3": "Offset to start of special space", "/versions/19/tables/1/rows/6/c2": "2 bytes", "/versions/19/tables/1/rows/6/c3": "Page size and layout version number information", "/versions/19/tables/1/rows/7/c2": "4 bytes", "/versions/19/tables/1/rows/7/c3": "Oldest unpruned XMAX on page, or zero if none", "/versions/19/tables/2/rows/0/c2": "4 bytes", "/versions/19/tables/2/rows/0/c3": "insert XID stamp", "/versions/19/tables/2/rows/1/c2": "4 bytes", "/versions/19/tables/2/rows/1/c3": "delete XID stamp", "/versions/19/tables/2/rows/2/c2": "4 bytes", "/versions/19/tables/2/rows/2/c3": "insert and/or delete CID stamp (overlays with t_xvac)", "/versions/19/tables/2/rows/3/c2": "4 bytes", "/versions/19/tables/2/rows/3/c3": "XID for VACUUM operation moving a row version", "/versions/19/tables/2/rows/4/c2": "6 bytes", "/versions/19/tables/2/rows/4/c3": "current TID of this or newer row version", "/versions/19/tables/2/rows/5/c2": "2 bytes", "/versions/19/tables/2/rows/5/c3": "number of attributes, plus various flag bits", "/versions/19/tables/2/rows/6/c2": "2 bytes", "/versions/19/tables/2/rows/6/c3": "various flag bits", "/versions/19/tables/2/rows/7/c2": "1 byte", "/versions/19/tables/2/rows/7/c3": "offset to user data", "/versions/19/tables/0/columns/0/label": "Item", "/versions/19/tables/0/columns/1/label": "Description", "/versions/19/tables/1/columns/0/label": "Field", "/versions/19/tables/1/columns/1/label": "Type", "/versions/19/tables/1/columns/2/label": "Length", "/versions/19/tables/1/columns/3/label": "Description", "/versions/19/tables/2/columns/0/label": "Field", "/versions/19/tables/2/columns/1/label": "Type", "/versions/19/tables/2/columns/2/label": "Length", "/versions/19/tables/2/columns/3/label": "Description"}, "fallback_fields": [], "source_language": "en", "original_snapshot_sha256": "7e6443cdab6729b56b1bd619702d97b644e3d515cb923b22627c21986c31cb9e"}, "comparison_data": {"layouts": [{"key": "layout-0", "rows": [{"c0": "PageHeaderData", "c1": "24 bytes long. Contains general information about the page, including free space pointers."}, {"c0": "ItemIdData", "c1": "Array of item identifiers pointing to the actual items. Each entry is an (offset,length) pair. 4 bytes per item."}, {"c0": "Free space", "c1": "The unallocated space. New item identifiers are allocated from the start of this area, new items from the end."}, {"c0": "Items", "c1": "The actual items themselves."}, {"c0": "Special space", "c1": "Index access method specific data. Different methods store different data. Empty in ordinary tables."}], "title": "Overall Page Layout", "columns": [{"key": "c0", "label": "Item"}, {"key": "c1", "label": "Description"}]}, {"key": "layout-1", "rows": [{"c0": "pd_lsn", "c1": "PageXLogRecPtr", "c2": "8 bytes", "c3": "LSN: next byte after last byte of WAL record for last change to this page"}, {"c0": "pd_checksum", "c1": "uint16", "c2": "2 bytes", "c3": "Page checksum"}, {"c0": "pd_flags", "c1": "uint16", "c2": "2 bytes", "c3": "Flag bits"}, {"c0": "pd_lower", "c1": "LocationIndex", "c2": "2 bytes", "c3": "Offset to start of free space"}, {"c0": "pd_upper", "c1": "LocationIndex", "c2": "2 bytes", "c3": "Offset to end of free space"}, {"c0": "pd_special", "c1": "LocationIndex", "c2": "2 bytes", "c3": "Offset to start of special space"}, {"c0": "pd_pagesize_version", "c1": "uint16", "c2": "2 bytes", "c3": "Page size and layout version number information"}, {"c0": "pd_prune_xid", "c1": "TransactionId", "c2": "4 bytes", "c3": "Oldest unpruned XMAX on page, or zero if none"}], "title": "PageHeaderData Layout", "columns": [{"key": "c0", "label": "Field"}, {"key": "c1", "label": "Type"}, {"key": "c2", "label": "Length"}, {"key": "c3", "label": "Description"}]}, {"key": "layout-2", "rows": [{"c0": "t_xmin", "c1": "TransactionId", "c2": "4 bytes", "c3": "insert XID stamp"}, {"c0": "t_xmax", "c1": "TransactionId", "c2": "4 bytes", "c3": "delete XID stamp"}, {"c0": "t_cid", "c1": "CommandId", "c2": "4 bytes", "c3": "insert and/or delete CID stamp (overlays with t_xvac)"}, {"c0": "t_xvac", "c1": "TransactionId", "c2": "4 bytes", "c3": "XID for VACUUM operation moving a row version"}, {"c0": "t_ctid", "c1": "ItemPointerData", "c2": "6 bytes", "c3": "current TID of this or newer row version"}, {"c0": "t_infomask2", "c1": "uint16", "c2": "2 bytes", "c3": "number of attributes, plus various flag bits"}, {"c0": "t_infomask", "c1": "uint16", "c2": "2 bytes", "c3": "various flag bits"}, {"c0": "t_hoff", "c1": "uint8", "c2": "1 byte", "c3": "offset to user data"}], "title": "HeapTupleHeaderData Layout", "columns": [{"key": "c0", "label": "Field"}, {"key": "c1", "label": "Type"}, {"key": "c2", "label": "Length"}, {"key": "c3", "label": "Description"}]}]}, "comparison_hash": "b621fa85b3be27a0eb0d82986e9524f2ef0a776761901f0d429826eec4822d0a", "manual_language": "zh"}, "20": {"facts": [{"label": "\u5b9a\u4e49\u8303\u56f4", "value": "\u540c\u7248\u672c\u6838\u5fc3\u7269\u7406\u5b58\u50a8\u6587\u6863"}], "tables": [{"key": "layout-0", "rows": [{"c0": "PageHeaderData", "c1": "\u957f 24 \u5b57\u8282\uff0c\u5305\u542b\u9875\u9762\u7684\u901a\u7528\u4fe1\u606f\uff0c\u4f8b\u5982\u7a7a\u95f2\u7a7a\u95f4\u6307\u9488\u3002"}, {"c0": "ItemIdData", "c1": "\u6307\u5411\u5b9e\u9645\u6570\u636e\u9879\u7684\u884c\u6307\u9488\u6570\u7ec4\u3002\u6bcf\u9879\u4e3a\u4e00\u4e2a\uff08\u504f\u79fb\uff0c\u957f\u5ea6\uff09\u5bf9\uff0c\u5360 4 \u5b57\u8282\u3002"}, {"c0": "\u7a7a\u95f2\u7a7a\u95f4", "c1": "\u5c1a\u672a\u5206\u914d\u7684\u7a7a\u95f4\u3002\u65b0\u884c\u6307\u9488\u4ece\u8be5\u533a\u57df\u7684\u8d77\u59cb\u5904\u5206\u914d\uff0c\u65b0\u6570\u636e\u9879\u4ece\u672b\u5c3e\u5904\u5206\u914d\u3002"}, {"c0": "\u9879", "c1": "\u5b9e\u9645\u7684\u6570\u636e\u9879\u672c\u8eab\u3002"}, {"c0": "\u7279\u6b8a\u7a7a\u95f4", "c1": "\u7d22\u5f15\u8bbf\u95ee\u65b9\u6cd5\u4e13\u7528\u6570\u636e\u3002\u4e0d\u540c\u65b9\u6cd5\u5b58\u50a8\u7684\u5185\u5bb9\u4e0d\u540c\uff0c\u666e\u901a\u8868\u4e2d\u6b64\u533a\u57df\u4e3a\u7a7a\u3002"}], "title": "\u9875\u9762\u603b\u4f53\u5e03\u5c40", "columns": [{"key": "c0", "label": "\u9879\u76ee"}, {"key": "c1", "label": "\u8bf4\u660e"}]}, {"key": "layout-1", "rows": [{"c0": "pd_lsn", "c1": "PageXLogRecPtr", "c2": "8 \u5b57\u8282", "c3": "LSN\uff1a\u8be5\u9875\u6700\u540e\u4e00\u6b21\u53d8\u5316\u6240\u5bf9\u5e94 WAL \u8bb0\u5f55\u7684\u6700\u540e\u4e00\u4e2a\u5b57\u8282\u4e4b\u540e\u7684\u4f4d\u7f6e\u3002"}, {"c0": "pd_checksum", "c1": "uint16", "c2": "2 \u5b57\u8282", "c3": "\u9875\u9762\u6821\u9a8c\u548c"}, {"c0": "pd_flags", "c1": "uint16", "c2": "2 \u5b57\u8282", "c3": "\u6807\u5fd7\u4f4d"}, {"c0": "pd_lower", "c1": "LocationIndex", "c2": "2 \u5b57\u8282", "c3": "\u7a7a\u95f2\u7a7a\u95f4\u8d77\u59cb\u4f4d\u7f6e\u7684\u504f\u79fb\u91cf"}, {"c0": "pd_upper", "c1": "LocationIndex", "c2": "2 \u5b57\u8282", "c3": "\u7a7a\u95f2\u7a7a\u95f4\u7ed3\u675f\u4f4d\u7f6e\u7684\u504f\u79fb\u91cf"}, {"c0": "pd_special", "c1": "LocationIndex", "c2": "2 \u5b57\u8282", "c3": "\u7279\u6b8a\u7a7a\u95f4\u8d77\u59cb\u4f4d\u7f6e\u7684\u504f\u79fb\u91cf"}, {"c0": "pd_pagesize_version", "c1": "uint16", "c2": "2 \u5b57\u8282", "c3": "\u9875\u9762\u5927\u5c0f\u4e0e\u5e03\u5c40\u7248\u672c\u53f7\u4fe1\u606f"}, {"c0": "pd_prune_xid", "c1": "TransactionId", "c2": "4 \u5b57\u8282", "c3": "\u9875\u9762\u4e0a\u6700\u65e9\u7684\u5c1a\u672a\u4fee\u526a\u7684 XMAX\uff1b\u6ca1\u6709\u5219\u4e3a\u96f6"}], "title": "PageHeaderData \u5e03\u5c40", "columns": [{"key": "c0", "label": "\u5b57\u6bb5"}, {"key": "c1", "label": "\u7c7b\u578b"}, {"key": "c2", "label": "\u957f\u5ea6"}, {"key": "c3", "label": "\u8bf4\u660e"}]}, {"key": "layout-2", "rows": [{"c0": "t_xmin", "c1": "TransactionId", "c2": "4 \u5b57\u8282", "c3": "\u63d2\u5165\u4e8b\u52a1\u7684 XID"}, {"c0": "t_xmax", "c1": "TransactionId", "c2": "4 \u5b57\u8282", "c3": "\u5220\u9664\u4e8b\u52a1\u7684 XID"}, {"c0": "t_cid", "c1": "CommandId", "c2": "4 \u5b57\u8282", "c3": "\u63d2\u5165\u548c\uff0f\u6216\u5220\u9664\u547d\u4ee4\u7684 CID\uff0c\u4e0e t_xvac \u5171\u7528\u5b58\u50a8\u4f4d\u7f6e"}, {"c0": "t_xvac", "c1": "TransactionId", "c2": "4 \u5b57\u8282", "c3": "VACUUM \u64cd\u4f5c\u79fb\u52a8\u884c\u7248\u672c\u65f6\u4f7f\u7528\u7684 XID"}, {"c0": "t_ctid", "c1": "ItemPointerData", "c2": "6 \u5b57\u8282", "c3": "\u672c\u884c\u7248\u672c\u6216\u8f83\u65b0\u884c\u7248\u672c\u7684\u5f53\u524d TID"}, {"c0": "t_infomask2", "c1": "uint16", "c2": "2 \u5b57\u8282", "c3": "\u5c5e\u6027\u6570\u91cf\u53ca\u5404\u79cd\u6807\u5fd7\u4f4d"}, {"c0": "t_infomask", "c1": "uint16", "c2": "2 \u5b57\u8282", "c3": "\u5404\u79cd\u6807\u5fd7\u4f4d"}, {"c0": "t_hoff", "c1": "uint8", "c2": "1 \u5b57\u8282", "c3": "\u7528\u6237\u6570\u636e\u7684\u504f\u79fb\u91cf"}], "title": "HeapTupleHeaderData \u5e03\u5c40", "columns": [{"key": "c0", "label": "\u5b57\u6bb5"}, {"key": "c1", "label": "\u7c7b\u578b"}, {"key": "c2", "label": "\u957f\u5ea6"}, {"key": "c3", "label": "\u8bf4\u660e"}]}], "diagram": "page-layout", "related": [{"url": "/wiki/tableam/?v=20", "label": "Table AM"}, {"url": "/wiki/relopts/?v=20", "label": "\u5b58\u50a8\u53c2\u6570"}], "release": {"ref": "https://ftp.postgresql.org/pub/snapshot/dev/postgresql-snapshot.tar.bz2", "label": "20devel", "major": "20", "channel": "devel", "revision": "4d3346909b201ac1648232cf290462a7070c119326f56196f1f0253ed80fae41"}, "sources": [{"url": "https://pg.center/docs/devel/storage-page-layout.html", "path": "storage-page-layout.html", "label": "PostgreSQL 20 English manual", "sha256": "4e487a076f789ae63b2d33f89a8b13837d6589937dd3f00bf0a30e9eb9e2ec13", "language": "en", "original_url": "/docs/devel/storage-page-layout.html"}], "sections": [], "signature": "", "description": ["\u672c\u8282\u6982\u8ff0 PostgreSQL \u8868\u548c\u7d22\u5f15\u5185\u90e8\u6240\u4f7f\u7528\u7684\u9875\u9762\u683c\u5f0f\u3002 [20] \u5e8f\u5217\u548c TOAST \u8868\u7684\u683c\u5f0f\u4e0e\u666e\u901a\u8868\u76f8\u540c\u3002"], "manual_html": "<div class=\"sect1\">\n<div class=\"titlepage\">\n<div>\n<div>\n<h2 class=\"title\" lang=\"zh\">\n<div>\n<div>\n<h2 class=\"title\" style=\"clear: both\">66.6.\u00a0\u6570\u636e\u5e93\u9875\u9762\u5e03\u5c40 </h2>\n</div>\n</div>\n</h2>\n</div>\n</div>\n</div>\n<p lang=\"zh\">\u672c\u8282\u6982\u8ff0 <span class=\"productname\">PostgreSQL</span> \u8868\u548c\u7d22\u5f15\u5185\u90e8\u6240\u4f7f\u7528\u7684\u9875\u9762\u683c\u5f0f\u3002<a class=\"footnote\" href=\"/docs/devel/storage-page-layout.html#ftn.id-1.10.18.8.2.2\"><sup class=\"footnote\" id=\"id-1.10.18.8.2.2\">[20]</sup></a> \u5e8f\u5217\u548c <acronym class=\"acronym\">TOAST</acronym> \u8868\u7684\u683c\u5f0f\u4e0e\u666e\u901a\u8868\u76f8\u540c\u3002</p>\n<p lang=\"zh\">\u5728\u4e0b\u9762\u7684\u8bf4\u660e\u4e2d\uff0c\u5047\u5b9a\u4e00\u4e2a<em class=\"firstterm\">\u5b57\u8282</em>\u5305\u542b 8 \u4e2a\u4f4d\u3002\u53e6\u5916\uff0c\u672f\u8bed<em class=\"firstterm\">\u9879</em>\u6307\u7684\u662f\u5b58\u50a8\u5728\u9875\u9762\u4e0a\u7684\u5355\u4e2a\u6570\u636e\u503c\u3002\u5728\u8868\u4e2d\uff0c\u9879\u662f\u4e00\u884c\uff1b\u5728\u7d22\u5f15\u4e2d\uff0c\u9879\u662f\u4e00\u6761\u7d22\u5f15\u6761\u76ee\u3002</p>\n<p lang=\"zh\">\u6bcf\u4e2a\u8868\u548c\u7d22\u5f15\u90fd\u5b58\u50a8\u4e3a\u56fa\u5b9a\u5927\u5c0f\u7684<em class=\"firstterm\">\u9875\u9762</em>\u6570\u7ec4\uff08\u901a\u5e38\u4e3a 8 kB\uff0c\u4e0d\u8fc7\u5728\u7f16\u8bd1\u670d\u52a1\u5668\u65f6\u53ef\u4ee5\u9009\u62e9\u4e0d\u540c\u7684\u9875\u9762\u5927\u5c0f\uff09\u3002\u5728\u8868\u4e2d\uff0c\u6240\u6709\u9875\u9762\u5728\u903b\u8f91\u4e0a\u90fd\u662f\u7b49\u4ef7\u7684\uff0c\u56e0\u6b64\u67d0\u4e2a\u7279\u5b9a\u9879\uff08\u884c\uff09\u53ef\u4ee5\u5b58\u653e\u5728\u4efb\u610f\u9875\u9762\u4e2d\u3002\u5728\u7d22\u5f15\u4e2d\uff0c\u7b2c\u4e00\u9875\u901a\u5e38\u4fdd\u7559\u4e3a<em class=\"firstterm\">\u5143\u9875</em>\uff0c\u7528\u4e8e\u4fdd\u5b58\u63a7\u5236\u4fe1\u606f\uff1b\u5e76\u4e14\u6839\u636e\u7d22\u5f15\u8bbf\u95ee\u65b9\u6cd5\u7684\u4e0d\u540c\uff0c\u7d22\u5f15\u4e2d\u8fd8\u53ef\u80fd\u5b58\u5728\u4e0d\u540c\u7c7b\u578b\u7684\u9875\u9762\u3002</p>\n<p lang=\"zh\"><a class=\"xref\" href=\"/docs/devel/storage-page-layout.html#PAGE-TABLE\" title=\"\u8868\u00a066.2.\u00a0\u603b\u4f53\u9875\u9762\u5e03\u5c40\">\u8868\u00a066.2</a>\u5c55\u793a\u4e86\u9875\u9762\u7684\u603b\u4f53\u5e03\u5c40\u3002\u6bcf\u4e2a\u9875\u9762\u5305\u542b\u4e94\u4e2a\u90e8\u5206\u3002</p>\n<div class=\"table\">\n<p class=\"title\" lang=\"zh\"><strong>\u8868\u00a066.2.\u00a0\u603b\u4f53\u9875\u9762\u5e03\u5c40</strong></p>\n<div class=\"table-contents\">\n<table class=\"table\">\n<thead>\n<tr>\n<th lang=\"zh\">\u9879\u76ee</th>\n<th lang=\"zh\">\u8bf4\u660e</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>PageHeaderData</td>\n<td lang=\"zh\">\u957f 24 \u5b57\u8282\uff0c\u5305\u542b\u9875\u9762\u7684\u901a\u7528\u4fe1\u606f\uff0c\u4f8b\u5982\u7a7a\u95f2\u7a7a\u95f4\u6307\u9488\u3002</td>\n</tr>\n<tr>\n<td>ItemIdData</td>\n<td lang=\"zh\">\u6307\u5411\u5b9e\u9645\u6570\u636e\u9879\u7684\u884c\u6307\u9488\u6570\u7ec4\u3002\u6bcf\u9879\u4e3a\u4e00\u4e2a\uff08\u504f\u79fb\uff0c\u957f\u5ea6\uff09\u5bf9\uff0c\u5360 4 \u5b57\u8282\u3002</td>\n</tr>\n<tr>\n<td lang=\"zh\">\u7a7a\u95f2\u7a7a\u95f4</td>\n<td lang=\"zh\">\u5c1a\u672a\u5206\u914d\u7684\u7a7a\u95f4\u3002\u65b0\u884c\u6307\u9488\u4ece\u8be5\u533a\u57df\u7684\u8d77\u59cb\u5904\u5206\u914d\uff0c\u65b0\u6570\u636e\u9879\u4ece\u672b\u5c3e\u5904\u5206\u914d\u3002</td>\n</tr>\n<tr>\n<td lang=\"zh\">\u9879</td>\n<td lang=\"zh\">\u5b9e\u9645\u7684\u6570\u636e\u9879\u672c\u8eab\u3002</td>\n</tr>\n<tr>\n<td lang=\"zh\">\u7279\u6b8a\u7a7a\u95f4</td>\n<td lang=\"zh\">\u7d22\u5f15\u8bbf\u95ee\u65b9\u6cd5\u4e13\u7528\u6570\u636e\u3002\u4e0d\u540c\u65b9\u6cd5\u5b58\u50a8\u7684\u5185\u5bb9\u4e0d\u540c\uff0c\u666e\u901a\u8868\u4e2d\u6b64\u533a\u57df\u4e3a\u7a7a\u3002</td>\n</tr>\n</tbody>\n</table>\n</div>\n</div><br class=\"table-break\"/>\n<p lang=\"zh\">\u6bcf\u9875\u7684\u524d 24 \u5b57\u8282\u662f\u9875\u9996\u90e8 PageHeaderData\uff0c\u8be6\u7ec6\u683c\u5f0f\u89c1\u8868 66.3\u3002\u7b2c\u4e00\u4e2a\u5b57\u6bb5\u8ddf\u8e2a\u4e0e\u8be5\u9875\u76f8\u5173\u7684\u6700\u8fd1\u4e00\u6761 WAL \u8bb0\u5f55\uff1b\u7b2c\u4e8c\u4e2a\u5b57\u6bb5\u5728\u542f\u7528\u6570\u636e\u6821\u9a8c\u548c\u65f6\u4fdd\u5b58\u9875\u9762\u6821\u9a8c\u548c\u3002\u4e4b\u540e\u662f\u4e00\u4e2a\u5305\u542b\u6807\u5fd7\u4f4d\u7684 2 \u5b57\u8282\u5b57\u6bb5\uff0c\u518d\u540e\u9762\u662f\u4e09\u4e2a 2 \u5b57\u8282\u6574\u6570 pd_lower\u3001pd_upper \u548c pd_special\uff0c\u5206\u522b\u8bb0\u5f55\u4ece\u9875\u8d77\u70b9\u5230\u672a\u5206\u914d\u7a7a\u95f4\u8d77\u70b9\u3001\u672a\u5206\u914d\u7a7a\u95f4\u7ec8\u70b9\u53ca\u7279\u6b8a\u7a7a\u95f4\u8d77\u70b9\u7684\u5b57\u8282\u504f\u79fb\u91cf\u3002\u63a5\u4e0b\u6765\u7684 2 \u5b57\u8282 pd_pagesize_version \u540c\u65f6\u4fdd\u5b58\u9875\u5927\u5c0f\u548c\u7248\u672c\u6807\u8bc6\u3002PostgreSQL 8.3 \u8d77\u7248\u672c\u53f7\u4e3a 4\uff1b8.1 \u4e0e 8.2 \u4f7f\u7528 3\uff1b8.0 \u4f7f\u7528 2\uff1b7.3 \u4e0e 7.4 \u4f7f\u7528 1\uff1b\u66f4\u65e9\u7248\u672c\u4f7f\u7528 0\u3002\u591a\u6570\u7248\u672c\u7684\u57fa\u672c\u9875\u9762\u5e03\u5c40\u548c\u9996\u90e8\u683c\u5f0f\u5e76\u672a\u53d8\u5316\uff0c\u4f46\u5806\u884c\u9996\u90e8\u5e03\u5c40\u6709\u53d8\u5316\u3002\u9875\u5927\u5c0f\u57fa\u672c\u53ea\u7528\u4e8e\u4ea4\u53c9\u68c0\u67e5\uff1b\u540c\u4e00\u5b89\u88c5\u4e0d\u652f\u6301\u591a\u79cd\u9875\u5927\u5c0f\u3002\u6700\u540e\u4e00\u4e2a\u5b57\u6bb5\u63d0\u793a\u4fee\u526a\u8be5\u9875\u662f\u5426\u53ef\u80fd\u6709\u76ca\uff0c\u8bb0\u5f55\u8be5\u9875\u6700\u65e9\u7684\u5c1a\u672a\u4fee\u526a\u7684 XMAX\u3002</p>\n<div class=\"table\">\n<p class=\"title\" lang=\"zh\"><strong>\u8868\u00a066.3.\u00a0PageHeaderData \u5e03\u5c40</strong></p>\n<div class=\"table-contents\">\n<table class=\"table\">\n<thead>\n<tr>\n<th lang=\"zh\">\u5b57\u6bb5</th>\n<th lang=\"zh\">\u7c7b\u578b</th>\n<th lang=\"zh\">\u957f\u5ea6</th>\n<th lang=\"zh\">\u8bf4\u660e</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>pd_lsn</td>\n<td>PageXLogRecPtr</td>\n<td lang=\"zh\">8 \u5b57\u8282</td>\n<td lang=\"zh\">LSN\uff1a\u8be5\u9875\u6700\u540e\u4e00\u6b21\u53d8\u5316\u6240\u5bf9\u5e94 WAL \u8bb0\u5f55\u7684\u6700\u540e\u4e00\u4e2a\u5b57\u8282\u4e4b\u540e\u7684\u4f4d\u7f6e\u3002</td>\n</tr>\n<tr>\n<td>pd_checksum</td>\n<td>uint16</td>\n<td lang=\"zh\">2 \u5b57\u8282</td>\n<td lang=\"zh\">\u9875\u9762\u6821\u9a8c\u548c</td>\n</tr>\n<tr>\n<td>pd_flags</td>\n<td>uint16</td>\n<td lang=\"zh\">2 \u5b57\u8282</td>\n<td lang=\"zh\">\u6807\u5fd7\u4f4d</td>\n</tr>\n<tr>\n<td>pd_lower</td>\n<td>LocationIndex</td>\n<td lang=\"zh\">2 \u5b57\u8282</td>\n<td lang=\"zh\">\u7a7a\u95f2\u7a7a\u95f4\u8d77\u59cb\u4f4d\u7f6e\u7684\u504f\u79fb\u91cf</td>\n</tr>\n<tr>\n<td>pd_upper</td>\n<td>LocationIndex</td>\n<td lang=\"zh\">2 \u5b57\u8282</td>\n<td lang=\"zh\">\u7a7a\u95f2\u7a7a\u95f4\u7ed3\u675f\u4f4d\u7f6e\u7684\u504f\u79fb\u91cf</td>\n</tr>\n<tr>\n<td>pd_special</td>\n<td>LocationIndex</td>\n<td lang=\"zh\">2 \u5b57\u8282</td>\n<td lang=\"zh\">\u7279\u6b8a\u7a7a\u95f4\u8d77\u59cb\u4f4d\u7f6e\u7684\u504f\u79fb\u91cf</td>\n</tr>\n<tr>\n<td>pd_pagesize_version</td>\n<td>uint16</td>\n<td lang=\"zh\">2 \u5b57\u8282</td>\n<td lang=\"zh\">\u9875\u9762\u5927\u5c0f\u4e0e\u5e03\u5c40\u7248\u672c\u53f7\u4fe1\u606f</td>\n</tr>\n<tr>\n<td>pd_prune_xid</td>\n<td>TransactionId</td>\n<td lang=\"zh\">4 \u5b57\u8282</td>\n<td lang=\"zh\">\u9875\u9762\u4e0a\u6700\u65e9\u7684\u5c1a\u672a\u4fee\u526a\u7684 XMAX\uff1b\u6ca1\u6709\u5219\u4e3a\u96f6</td>\n</tr>\n</tbody>\n</table>\n</div>\n</div><br class=\"table-break\"/>\n<p lang=\"zh\">\u6240\u6709\u7ec6\u8282\u90fd\u53ef\u4ee5\u5728 <code class=\"filename\">src/include/storage/bufpage.h</code> \u4e2d\u627e\u5230\u3002</p>\n<p lang=\"zh\">\u9875\u5934\u4e4b\u540e\u662f\u9879\u6807\u8bc6\u7b26\uff08<code class=\"type\">ItemIdData</code>\uff09\uff0c\u6bcf\u4e2a\u9700\u8981\u56db\u4e2a\u5b57\u8282\u3002\u4e00\u4e2a\u9879\u6807\u8bc6\u7b26\u5305\u542b\u9879\u8d77\u59cb\u4f4d\u7f6e\u7684\u5b57\u8282\u504f\u79fb\u91cf\u3001\u5176\u5b57\u8282\u957f\u5ea6\uff0c\u4ee5\u53ca\u82e5\u5e72\u5f71\u54cd\u89e3\u91ca\u65b9\u5f0f\u7684\u5c5e\u6027\u4f4d\u3002\u65b0\u7684\u9879\u6807\u8bc6\u7b26\u4f1a\u6839\u636e\u9700\u8981\u4ece\u672a\u5206\u914d\u7a7a\u95f4\u7684\u8d77\u59cb\u5904\u5206\u914d\u3002\u5f53\u524d\u5df2\u6709\u591a\u5c11\u4e2a\u9879\u6807\u8bc6\u7b26\uff0c\u53ef\u4ee5\u901a\u8fc7\u67e5\u770b <code class=\"structfield\">pd_lower</code> \u5f97\u77e5\uff1b\u5206\u914d\u65b0\u6807\u8bc6\u7b26\u65f6\u5b83\u4f1a\u589e\u52a0\u3002\u56e0\u4e3a\u4e00\u4e2a\u9879\u6807\u8bc6\u7b26\u5728\u88ab\u91ca\u653e\u4e4b\u524d\u6c38\u8fdc\u4e0d\u4f1a\u79fb\u52a8\uff0c\u6240\u4ee5\u5373\u4f7f\u9879\u672c\u8eab\u4e3a\u4e86\u6574\u7406\u7a7a\u95f2\u7a7a\u95f4\u800c\u5728\u9875\u9762\u5185\u79fb\u52a8\uff0c\u5176\u7d22\u5f15\u4ecd\u7136\u53ef\u4ee5\u88ab\u957f\u671f\u7528\u6765\u5f15\u7528\u8be5\u9879\u3002\u4e8b\u5b9e\u4e0a\uff0c\u6bcf\u4e2a\u6307\u5411\u9879\u7684\u6307\u9488\uff08<code class=\"type\">ItemPointer</code>\uff0c\u4e5f\u79f0 <code class=\"type\">CTID</code>\uff09\u5728 <span class=\"productname\">PostgreSQL</span> \u4e2d\u90fd\u7531\u9875\u53f7\u548c\u9879\u6807\u8bc6\u7b26\u7d22\u5f15\u6784\u6210\u3002</p>\n<p lang=\"zh\">\u9879\u672c\u8eab\u5b58\u50a8\u5728\u4ece\u672a\u5206\u914d\u7a7a\u95f4\u672b\u5c3e\u5f00\u59cb\u3001\u5411\u540e\u5206\u914d\u7684\u533a\u57df\u4e2d\u3002\u5176\u786e\u5207\u7ed3\u6784\u53d6\u51b3\u4e8e\u8868\u8981\u5305\u542b\u4ec0\u4e48\u5185\u5bb9\u3002\u8868\u548c\u5e8f\u5217\u90fd\u4f7f\u7528\u4e00\u79cd\u540d\u4e3a <code class=\"type\">HeapTupleHeaderData</code> \u7684\u7ed3\u6784\u4f53\uff0c\u5982\u4e0b\u6240\u8ff0\u3002</p>\n<p lang=\"zh\">\u6700\u540e\u4e00\u90e8\u5206\u662f<span class=\"quote\">\u201c<span class=\"quote\">\u7279\u6b8a\u90e8\u5206</span>\u201d</span>\uff0c\u5176\u4e2d\u53ef\u4ee5\u5b58\u653e\u8bbf\u95ee\u65b9\u6cd5\u5e0c\u671b\u4fdd\u5b58\u7684\u4efb\u4f55\u5185\u5bb9\u3002\u4f8b\u5982\uff0cB-\u6811\u7d22\u5f15\u4f1a\u5728\u8fd9\u91cc\u4fdd\u5b58\u6307\u5411\u9875\u9762\u5de6\u3001\u53f3\u5144\u5f1f\u7684\u94fe\u63a5\uff0c\u4ee5\u53ca\u5176\u4ed6\u4e00\u4e9b\u4e0e\u7d22\u5f15\u7ed3\u6784\u76f8\u5173\u7684\u6570\u636e\u3002\u666e\u901a\u8868\u5b8c\u5168\u4e0d\u4f7f\u7528\u7279\u6b8a\u90e8\u5206\uff08\u901a\u8fc7\u5c06 <code class=\"structfield\">pd_special</code> \u8bbe\u4e3a\u9875\u9762\u5927\u5c0f\u6765\u8868\u793a\uff09\u3002</p>\n<p lang=\"zh\"><a class=\"xref\" href=\"/docs/devel/storage-page-layout.html#STORAGE-PAGE-LAYOUT-FIGURE\" title=\"\u56fe\u00a066.1.\u00a0\u9875\u9762\u5e03\u5c40\">\u56fe\u00a066.1</a>\u5c55\u793a\u4e86\u8fd9\u4e9b\u90e8\u5206\u5728\u9875\u9762\u4e2d\u7684\u5e03\u5c40\u65b9\u5f0f\u3002</p>\n<div class=\"figure col-xl-8 col-lg-10 col-md-12\">\n<p class=\"title\" lang=\"zh\">\n<p class=\"title\"><strong>\u56fe\u00a066.1.\u00a0\u9875\u9762\u5e03\u5c40</strong></p>\n<div class=\"figure-contents\">\n<div class=\"mediaobject\">\n<object data=\"pagelayout.svg\" type=\"image/svg+xml\" width=\"100%\">\n</object>\n</div>\n</div>\n</p>\n<div class=\"figure-contents\">\n<div class=\"mediaobject\">\n</div>\n</div>\n</div><br class=\"figure-break\"/>\n<div class=\"sect2\">\n<div class=\"titlepage\">\n<div>\n<div>\n<h3 class=\"title\" lang=\"zh\">\n<dl class=\"toc\">\n<dt><span class=\"sect2\"><a href=\"/docs/devel/storage-page-layout.html#STORAGE-TUPLE-LAYOUT\">66.6.1. \u8868\u884c\u5e03\u5c40</a></span></dt>\n</dl>\n</h3>\n</div>\n</div>\n</div>\n<p lang=\"zh\">\u6240\u6709\u8868\u884c\u7684\u7ed3\u6784\u90fd\u76f8\u540c\u3002\u5b83\u4eec\u90fd\u6709\u4e00\u4e2a\u56fa\u5b9a\u5927\u5c0f\u7684\u5934\u90e8\uff08\u5728\u5927\u591a\u6570\u673a\u5668\u4e0a\u5360 23 \u5b57\u8282\uff09\uff0c\u540e\u9762\u8ddf\u7740\u53ef\u9009\u7684\u7a7a\u503c\u4f4d\u56fe\u3001\u53ef\u9009\u7684\u5bf9\u8c61 ID \u5b57\u6bb5\u4ee5\u53ca\u7528\u6237\u6570\u636e\u3002\u5934\u90e8\u7684\u8be6\u7ec6\u683c\u5f0f\u89c1<a class=\"xref\" href=\"/docs/devel/storage-page-layout.html#HEAPTUPLEHEADERDATA-TABLE\" title=\"\u8868\u00a066.4.\u00a0HeapTupleHeaderData \u5e03\u5c40\">\u8868\u00a066.4</a>\u3002\u5b9e\u9645\u7528\u6237\u6570\u636e\uff08\u884c\u7684\u5404\u5217\uff09\u4ece <code class=\"structfield\">t_hoff</code> \u6307\u793a\u7684\u504f\u79fb\u4f4d\u7f6e\u5f00\u59cb\uff0c\u5b83\u5fc5\u987b\u59cb\u7ec8\u662f\u8be5\u5e73\u53f0 MAXALIGN \u5bf9\u9f50\u5355\u4f4d\u7684\u6574\u6570\u500d\u3002\u53ea\u6709\u5f53 <em class=\"firstterm\">HEAP_HASNULL</em> \u4f4d\u5728 <code class=\"structfield\">t_infomask</code> \u4e2d\u88ab\u7f6e\u4f4d\u65f6\uff0c\u7a7a\u503c\u4f4d\u56fe\u624d\u5b58\u5728\u3002\u82e5\u5b58\u5728\uff0c\u5b83\u7d27\u968f\u56fa\u5b9a\u5934\u90e8\u4e4b\u540e\uff0c\u5e76\u5360\u7528\u8db3\u591f\u591a\u7684\u5b57\u8282\uff0c\u4ee5\u4fbf\u4e3a\u6bcf\u4e2a\u6570\u636e\u5217\u63d0\u4f9b\u4e00\u4f4d\uff08\u4e5f\u5c31\u662f\u8bf4\uff0c\u5176\u4f4d\u6570\u7b49\u4e8e <code class=\"structfield\">t_infomask2</code> \u4e2d\u7684\u5c5e\u6027\u4e2a\u6570\uff09\u3002\u5728\u8fd9\u4e2a\u4f4d\u56fe\u4e2d\uff0c1 \u8868\u793a\u975e\u7a7a\uff0c0 \u8868\u793a\u7a7a\u503c\u3002\u5f53\u4f4d\u56fe\u4e0d\u5b58\u5728\u65f6\uff0c\u5047\u5b9a\u6240\u6709\u5217\u90fd\u975e\u7a7a\u3002\u53ea\u6709\u5f53 <em class=\"firstterm\">HEAP_HASOID_OLD</em> \u4f4d\u5728 <code class=\"structfield\">t_infomask</code> \u4e2d\u88ab\u7f6e\u4f4d\u65f6\uff0c\u5bf9\u8c61 ID \u624d\u5b58\u5728\u3002\u82e5\u5b58\u5728\uff0c\u5b83\u4f4d\u4e8e <code class=\"structfield\">t_hoff</code> \u8fb9\u754c\u4e4b\u524d\u3002\u4e3a\u4e86\u8ba9 <code class=\"structfield\">t_hoff</code> \u6210\u4e3a MAXALIGN \u7684\u6574\u6570\u500d\u6240\u9700\u7684\u4efb\u4f55\u586b\u5145\uff0c\u90fd\u4f1a\u51fa\u73b0\u5728\u7a7a\u503c\u4f4d\u56fe\u4e0e\u5bf9\u8c61 ID \u4e4b\u95f4\u3002\uff08\u8fd9\u53c8\u53cd\u8fc7\u6765\u4fdd\u8bc1\u4e86\u5bf9\u8c61 ID \u7684\u5bf9\u9f50\u662f\u5408\u9002\u7684\u3002\uff09</p>\n<div class=\"table\">\n<p class=\"title\" lang=\"zh\"><strong>\u8868\u00a066.4.\u00a0HeapTupleHeaderData \u5e03\u5c40</strong></p>\n<div class=\"table-contents\">\n<table class=\"table\">\n<thead>\n<tr>\n<th lang=\"zh\">\u5b57\u6bb5</th>\n<th lang=\"zh\">\u7c7b\u578b</th>\n<th lang=\"zh\">\u957f\u5ea6</th>\n<th lang=\"zh\">\u8bf4\u660e</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>t_xmin</td>\n<td>TransactionId</td>\n<td lang=\"zh\">4 \u5b57\u8282</td>\n<td lang=\"zh\">\u63d2\u5165\u4e8b\u52a1\u7684 XID</td>\n</tr>\n<tr>\n<td>t_xmax</td>\n<td>TransactionId</td>\n<td lang=\"zh\">4 \u5b57\u8282</td>\n<td lang=\"zh\">\u5220\u9664\u4e8b\u52a1\u7684 XID</td>\n</tr>\n<tr>\n<td>t_cid</td>\n<td>CommandId</td>\n<td lang=\"zh\">4 \u5b57\u8282</td>\n<td lang=\"zh\">\u63d2\u5165\u548c\uff0f\u6216\u5220\u9664\u547d\u4ee4\u7684 CID\uff0c\u4e0e t_xvac \u5171\u7528\u5b58\u50a8\u4f4d\u7f6e</td>\n</tr>\n<tr>\n<td>t_xvac</td>\n<td>TransactionId</td>\n<td lang=\"zh\">4 \u5b57\u8282</td>\n<td lang=\"zh\">VACUUM \u64cd\u4f5c\u79fb\u52a8\u884c\u7248\u672c\u65f6\u4f7f\u7528\u7684 XID</td>\n</tr>\n<tr>\n<td>t_ctid</td>\n<td>ItemPointerData</td>\n<td lang=\"zh\">6 \u5b57\u8282</td>\n<td lang=\"zh\">\u672c\u884c\u7248\u672c\u6216\u8f83\u65b0\u884c\u7248\u672c\u7684\u5f53\u524d TID</td>\n</tr>\n<tr>\n<td>t_infomask2</td>\n<td>uint16</td>\n<td lang=\"zh\">2 \u5b57\u8282</td>\n<td lang=\"zh\">\u5c5e\u6027\u6570\u91cf\u53ca\u5404\u79cd\u6807\u5fd7\u4f4d</td>\n</tr>\n<tr>\n<td>t_infomask</td>\n<td>uint16</td>\n<td lang=\"zh\">2 \u5b57\u8282</td>\n<td lang=\"zh\">\u5404\u79cd\u6807\u5fd7\u4f4d</td>\n</tr>\n<tr>\n<td>t_hoff</td>\n<td>uint8</td>\n<td lang=\"zh\">1 \u5b57\u8282</td>\n<td lang=\"zh\">\u7528\u6237\u6570\u636e\u7684\u504f\u79fb\u91cf</td>\n</tr>\n</tbody>\n</table>\n</div>\n</div><br class=\"table-break\"/>\n<p lang=\"zh\">\u6240\u6709\u7ec6\u8282\u90fd\u53ef\u4ee5\u5728 <code class=\"filename\">src/include/access/htup_details.h</code> \u4e2d\u627e\u5230\u3002</p>\n<p lang=\"zh\">\u8981\u89e3\u91ca\u5b9e\u9645\u6570\u636e\uff0c\u5fc5\u987b\u501f\u52a9\u4ece\u5176\u4ed6\u8868\u4e2d\u83b7\u5f97\u7684\u4fe1\u606f\uff0c\u5176\u4e2d\u5927\u90e8\u5206\u6765\u81ea <code class=\"structname\">pg_attribute</code>\u3002\u8bc6\u522b\u5b57\u6bb5\u4f4d\u7f6e\u6240\u9700\u7684\u5173\u952e\u503c\u662f <code class=\"structfield\">attlen</code> \u548c <code class=\"structfield\">attalign</code>\u3002\u9664\u975e\u6240\u6709\u5b57\u6bb5\u90fd\u662f\u5b9a\u5bbd\u4e14\u6ca1\u6709\u7a7a\u503c\uff0c\u5426\u5219\u6ca1\u6709\u529e\u6cd5\u76f4\u63a5\u53d6\u5f97\u67d0\u4e2a\u7279\u5b9a\u5c5e\u6027\u3002\u6240\u6709\u8fd9\u4e9b\u6280\u5de7\u90fd\u5c01\u88c5\u5728 <em class=\"firstterm\">heap_getattr</em>\u3001<em class=\"firstterm\">fastgetattr</em> \u548c <em class=\"firstterm\">heap_getsysattr</em> \u8fd9\u4e9b\u51fd\u6570\u4e2d\u3002</p>\n<p lang=\"zh\">\u8bfb\u53d6\u6570\u636e\u65f6\uff0c\u9700\u8981\u4f9d\u6b21\u68c0\u67e5\u6bcf\u4e2a\u5c5e\u6027\u3002\u9996\u5148\u6839\u636e\u7a7a\u503c\u4f4d\u56fe\u5224\u65ad\u8be5\u5b57\u6bb5\u662f\u5426\u4e3a NULL\u3002\u5982\u679c\u662f\uff0c\u5c31\u7ee7\u7eed\u4e0b\u4e00\u4e2a\u3002\u7136\u540e\u786e\u8ba4\u5bf9\u9f50\u662f\u5426\u6b63\u786e\u3002\u5982\u679c\u5b57\u6bb5\u662f\u5b9a\u5bbd\u5b57\u6bb5\uff0c\u90a3\u4e48\u5b83\u7684\u6240\u6709\u5b57\u8282\u90fd\u662f\u76f4\u63a5\u6446\u653e\u7684\uff1b\u5982\u679c\u5b83\u662f\u53d8\u957f\u5b57\u6bb5\uff08attlen = -1\uff09\uff0c\u60c5\u51b5\u5c31\u4f1a\u7a0d\u590d\u6742\u4e00\u4e9b\u3002\u6240\u6709\u53d8\u957f\u6570\u636e\u7c7b\u578b\u90fd\u5171\u4eab\u4e00\u4e2a\u901a\u7528\u5934\u90e8\u7ed3\u6784\u4f53 <code class=\"type\">varlena</code>\uff0c\u5176\u4e2d\u5305\u542b\u5df2\u5b58\u50a8\u503c\u7684\u603b\u957f\u5ea6\u4ee5\u53ca\u4e00\u4e9b\u6807\u5fd7\u4f4d\u3002\u6839\u636e\u8fd9\u4e9b\u6807\u5fd7\uff0c\u6570\u636e\u53ef\u80fd\u662f\u884c\u5185\u5b58\u50a8\u7684\uff0c\u4e5f\u53ef\u80fd\u4f4d\u4e8e <acronym class=\"acronym\">TOAST</acronym> \u8868\u4e2d\uff1b\u5b83\u4e5f\u53ef\u80fd\u662f\u7ecf\u8fc7\u538b\u7f29\u7684\uff08\u89c1<a class=\"xref\" href=\"/docs/devel/storage-toast.html\" title=\"66.2.\u00a0TOAST\">\u7b2c\u00a066.2\u00a0\u8282</a>\uff09\u3002</p>\n</div>\n<div class=\"footnotes\">\n<br/>\n<hr/>\n<div class=\"footnote\">\n<p lang=\"zh\">\n<br/>\n<hr style=\"width:100; text-align:left;margin-left: 0\"/>\n<div class=\"footnote\" id=\"ftn.id-1.10.18.8.2.2\">\n<p><a class=\"para\" href=\"/docs/devel/storage-page-layout.html#id-1.10.18.8.2.2\"><sup class=\"para\">[20]</sup></a> \u5b9e\u9645\u4e0a\uff0c\u8868\u8bbf\u95ee\u65b9\u6cd5\u548c\u7d22\u5f15\u8bbf\u95ee\u65b9\u6cd5\u90fd\u4e0d\u8981\u6c42\u5fc5\u987b\u4f7f\u7528\u8fd9\u79cd\u9875\u9762\u683c\u5f0f\u3002<code class=\"literal\">heap</code> \u8868\u8bbf\u95ee\u65b9\u6cd5\u59cb\u7ec8\u4f7f\u7528\u8fd9\u79cd\u683c\u5f0f\u3002\u73b0\u6709\u7684\u6240\u6709\u7d22\u5f15\u65b9\u6cd5\u4e5f\u90fd\u4f7f\u7528\u8fd9\u79cd\u57fa\u672c\u683c\u5f0f\uff0c\u4f46\u7d22\u5f15\u5143\u9875\u4e2d\u4fdd\u5b58\u7684\u6570\u636e\u901a\u5e38\u5e76\u4e0d\u9075\u5faa\u9879\u5e03\u5c40\u89c4\u5219\u3002</p>\n</div>\n</p>\n</div>\n</div>\n</div>", "manual_path": "/docs/devel/storage-page-layout.html", "localization": {"status": "complete", "sources": [{"url": "/docs/devel/storage-page-layout.html", "method": "same-major semantic node", "sha256": "e6342ac6dbc18d88c4c1a9a53b24c520b5ce2b76d9de4170ad8f151e1699e445", "language": "zh", "matched_nodes": ["#STORAGE-PAGE-LAYOUT/div[0]", "#STORAGE-PAGE-LAYOUT/div[16]", "#STORAGE-PAGE-LAYOUT/div[18]/div[2]/p[0]", "#STORAGE-PAGE-LAYOUT/div[18]/p[1]", "#STORAGE-PAGE-LAYOUT/div[18]/p[4]", "#STORAGE-PAGE-LAYOUT/div[18]/p[5]", "#STORAGE-PAGE-LAYOUT/div[18]/p[6]", "#STORAGE-PAGE-LAYOUT/div[19]", "#STORAGE-PAGE-LAYOUT/div[1]", "#STORAGE-PAGE-LAYOUT/div[6]/div[1]/table[0]/tbody[2]/tr[3]/td[0]", "#STORAGE-PAGE-LAYOUT/div[6]/p[0]", "#STORAGE-PAGE-LAYOUT/div[9]/div[1]/table[0]/tbody[2]/tr[0]/td[2]", "#STORAGE-PAGE-LAYOUT/div[9]/p[0]", "#STORAGE-PAGE-LAYOUT/p[11]", "#STORAGE-PAGE-LAYOUT/p[12]", "#STORAGE-PAGE-LAYOUT/p[13]", "#STORAGE-PAGE-LAYOUT/p[14]", "#STORAGE-PAGE-LAYOUT/p[15]", "#STORAGE-PAGE-LAYOUT/p[2]", "#STORAGE-PAGE-LAYOUT/p[3]", "#STORAGE-PAGE-LAYOUT/p[4]", "#STORAGE-PAGE-LAYOUT/p[5]"]}], "language": "zh", "original_text": {"/summary": "This section provides an overview of the page format used within PostgreSQL tables and indexes. [20] Sequences and TOAST tables are formatted just like a regular table.", "/category": "Physical structures", "/versions/20/description/0": "This section provides an overview of the page format used within PostgreSQL tables and indexes. [20] Sequences and TOAST tables are formatted just like a regular table.", "/versions/20/facts/0/label": "Definition scope", "/versions/20/facts/0/value": "Same-version core physical storage documentation", "/versions/20/tables/0/title": "Overall Page Layout", "/versions/20/tables/1/title": "PageHeaderData Layout", "/versions/20/tables/2/title": "HeapTupleHeaderData Layout", "/versions/20/related/1/label": "Storage Parameters", "/versions/20/tables/0/rows/0/c1": "24 bytes long. Contains general information about the page, including free space pointers.", "/versions/20/tables/0/rows/1/c1": "Array of item identifiers pointing to the actual items. Each entry is an (offset,length) pair. 4 bytes per item.", "/versions/20/tables/0/rows/2/c0": "Free space", "/versions/20/tables/0/rows/2/c1": "The unallocated space. New item identifiers are allocated from the start of this area, new items from the end.", "/versions/20/tables/0/rows/3/c0": "Items", "/versions/20/tables/0/rows/3/c1": "The actual items themselves.", "/versions/20/tables/0/rows/4/c0": "Special space", "/versions/20/tables/0/rows/4/c1": "Index access method specific data. Different methods store different data. Empty in ordinary tables.", "/versions/20/tables/1/rows/0/c2": "8 bytes", "/versions/20/tables/1/rows/0/c3": "LSN: next byte after last byte of WAL record for last change to this page", "/versions/20/tables/1/rows/1/c2": "2 bytes", "/versions/20/tables/1/rows/1/c3": "Page checksum", "/versions/20/tables/1/rows/2/c2": "2 bytes", "/versions/20/tables/1/rows/2/c3": "Flag bits", "/versions/20/tables/1/rows/3/c2": "2 bytes", "/versions/20/tables/1/rows/3/c3": "Offset to start of free space", "/versions/20/tables/1/rows/4/c2": "2 bytes", "/versions/20/tables/1/rows/4/c3": "Offset to end of free space", "/versions/20/tables/1/rows/5/c2": "2 bytes", "/versions/20/tables/1/rows/5/c3": "Offset to start of special space", "/versions/20/tables/1/rows/6/c2": "2 bytes", "/versions/20/tables/1/rows/6/c3": "Page size and layout version number information", "/versions/20/tables/1/rows/7/c2": "4 bytes", "/versions/20/tables/1/rows/7/c3": "Oldest unpruned XMAX on page, or zero if none", "/versions/20/tables/2/rows/0/c2": "4 bytes", "/versions/20/tables/2/rows/0/c3": "insert XID stamp", "/versions/20/tables/2/rows/1/c2": "4 bytes", "/versions/20/tables/2/rows/1/c3": "delete XID stamp", "/versions/20/tables/2/rows/2/c2": "4 bytes", "/versions/20/tables/2/rows/2/c3": "insert and/or delete CID stamp (overlays with t_xvac)", "/versions/20/tables/2/rows/3/c2": "4 bytes", "/versions/20/tables/2/rows/3/c3": "XID for VACUUM operation moving a row version", "/versions/20/tables/2/rows/4/c2": "6 bytes", "/versions/20/tables/2/rows/4/c3": "current TID of this or newer row version", "/versions/20/tables/2/rows/5/c2": "2 bytes", "/versions/20/tables/2/rows/5/c3": "number of attributes, plus various flag bits", "/versions/20/tables/2/rows/6/c2": "2 bytes", "/versions/20/tables/2/rows/6/c3": "various flag bits", "/versions/20/tables/2/rows/7/c2": "1 byte", "/versions/20/tables/2/rows/7/c3": "offset to user data", "/versions/20/tables/0/columns/0/label": "Item", "/versions/20/tables/0/columns/1/label": "Description", "/versions/20/tables/1/columns/0/label": "Field", "/versions/20/tables/1/columns/1/label": "Type", "/versions/20/tables/1/columns/2/label": "Length", "/versions/20/tables/1/columns/3/label": "Description", "/versions/20/tables/2/columns/0/label": "Field", "/versions/20/tables/2/columns/1/label": "Type", "/versions/20/tables/2/columns/2/label": "Length", "/versions/20/tables/2/columns/3/label": "Description"}, "fallback_fields": [], "source_language": "en", "original_snapshot_sha256": "8100a1ceb56722f11830a1e832ee2be5508fb6d606b7fcf568da7bd4135bdb30"}, "comparison_data": {"layouts": [{"key": "layout-0", "rows": [{"c0": "PageHeaderData", "c1": "24 bytes long. Contains general information about the page, including free space pointers."}, {"c0": "ItemIdData", "c1": "Array of item identifiers pointing to the actual items. Each entry is an (offset,length) pair. 4 bytes per item."}, {"c0": "Free space", "c1": "The unallocated space. New item identifiers are allocated from the start of this area, new items from the end."}, {"c0": "Items", "c1": "The actual items themselves."}, {"c0": "Special space", "c1": "Index access method specific data. Different methods store different data. Empty in ordinary tables."}], "title": "Overall Page Layout", "columns": [{"key": "c0", "label": "Item"}, {"key": "c1", "label": "Description"}]}, {"key": "layout-1", "rows": [{"c0": "pd_lsn", "c1": "PageXLogRecPtr", "c2": "8 bytes", "c3": "LSN: next byte after last byte of WAL record for last change to this page"}, {"c0": "pd_checksum", "c1": "uint16", "c2": "2 bytes", "c3": "Page checksum"}, {"c0": "pd_flags", "c1": "uint16", "c2": "2 bytes", "c3": "Flag bits"}, {"c0": "pd_lower", "c1": "LocationIndex", "c2": "2 bytes", "c3": "Offset to start of free space"}, {"c0": "pd_upper", "c1": "LocationIndex", "c2": "2 bytes", "c3": "Offset to end of free space"}, {"c0": "pd_special", "c1": "LocationIndex", "c2": "2 bytes", "c3": "Offset to start of special space"}, {"c0": "pd_pagesize_version", "c1": "uint16", "c2": "2 bytes", "c3": "Page size and layout version number information"}, {"c0": "pd_prune_xid", "c1": "TransactionId", "c2": "4 bytes", "c3": "Oldest unpruned XMAX on page, or zero if none"}], "title": "PageHeaderData Layout", "columns": [{"key": "c0", "label": "Field"}, {"key": "c1", "label": "Type"}, {"key": "c2", "label": "Length"}, {"key": "c3", "label": "Description"}]}, {"key": "layout-2", "rows": [{"c0": "t_xmin", "c1": "TransactionId", "c2": "4 bytes", "c3": "insert XID stamp"}, {"c0": "t_xmax", "c1": "TransactionId", "c2": "4 bytes", "c3": "delete XID stamp"}, {"c0": "t_cid", "c1": "CommandId", "c2": "4 bytes", "c3": "insert and/or delete CID stamp (overlays with t_xvac)"}, {"c0": "t_xvac", "c1": "TransactionId", "c2": "4 bytes", "c3": "XID for VACUUM operation moving a row version"}, {"c0": "t_ctid", "c1": "ItemPointerData", "c2": "6 bytes", "c3": "current TID of this or newer row version"}, {"c0": "t_infomask2", "c1": "uint16", "c2": "2 bytes", "c3": "number of attributes, plus various flag bits"}, {"c0": "t_infomask", "c1": "uint16", "c2": "2 bytes", "c3": "various flag bits"}, {"c0": "t_hoff", "c1": "uint8", "c2": "1 byte", "c3": "offset to user data"}], "title": "HeapTupleHeaderData Layout", "columns": [{"key": "c0", "label": "Field"}, {"key": "c1", "label": "Type"}, {"key": "c2", "label": "Length"}, {"key": "c3", "label": "Description"}]}]}, "comparison_hash": "b621fa85b3be27a0eb0d82986e9524f2ef0a776761901f0d429826eec4822d0a", "manual_language": "zh"}}}, "snapshot": {"facts": [{"label": "\u5b9a\u4e49\u8303\u56f4", "value": "\u540c\u7248\u672c\u6838\u5fc3\u7269\u7406\u5b58\u50a8\u6587\u6863"}], "tables": [{"key": "layout-0", "rows": [{"c0": "PageHeaderData", "c1": "\u957f 24 \u5b57\u8282\uff0c\u5305\u542b\u9875\u9762\u7684\u901a\u7528\u4fe1\u606f\uff0c\u4f8b\u5982\u7a7a\u95f2\u7a7a\u95f4\u6307\u9488\u3002"}, {"c0": "ItemIdData", "c1": "\u6307\u5411\u5b9e\u9645\u6570\u636e\u9879\u7684\u884c\u6307\u9488\u6570\u7ec4\u3002\u6bcf\u9879\u4e3a\u4e00\u4e2a\uff08\u504f\u79fb\uff0c\u957f\u5ea6\uff09\u5bf9\uff0c\u5360 4 \u5b57\u8282\u3002"}, {"c0": "\u7a7a\u95f2\u7a7a\u95f4", "c1": "\u5c1a\u672a\u5206\u914d\u7684\u7a7a\u95f4\u3002\u65b0\u884c\u6307\u9488\u4ece\u8be5\u533a\u57df\u7684\u8d77\u59cb\u5904\u5206\u914d\uff0c\u65b0\u6570\u636e\u9879\u4ece\u672b\u5c3e\u5904\u5206\u914d\u3002"}, {"c0": "\u9879", "c1": "\u5b9e\u9645\u7684\u6570\u636e\u9879\u672c\u8eab\u3002"}, {"c0": "\u7279\u6b8a\u7a7a\u95f4", "c1": "\u7d22\u5f15\u8bbf\u95ee\u65b9\u6cd5\u4e13\u7528\u6570\u636e\u3002\u4e0d\u540c\u65b9\u6cd5\u5b58\u50a8\u7684\u5185\u5bb9\u4e0d\u540c\uff0c\u666e\u901a\u8868\u4e2d\u6b64\u533a\u57df\u4e3a\u7a7a\u3002"}], "title": "\u9875\u9762\u603b\u4f53\u5e03\u5c40", "columns": [{"key": "c0", "label": "\u9879\u76ee"}, {"key": "c1", "label": "\u8bf4\u660e"}]}, {"key": "layout-1", "rows": [{"c0": "pd_lsn", "c1": "PageXLogRecPtr", "c2": "8 \u5b57\u8282", "c3": "LSN\uff1a\u8be5\u9875\u6700\u540e\u4e00\u6b21\u53d8\u5316\u6240\u5bf9\u5e94 WAL \u8bb0\u5f55\u7684\u6700\u540e\u4e00\u4e2a\u5b57\u8282\u4e4b\u540e\u7684\u4f4d\u7f6e\u3002"}, {"c0": "pd_checksum", "c1": "uint16", "c2": "2 \u5b57\u8282", "c3": "\u9875\u9762\u6821\u9a8c\u548c"}, {"c0": "pd_flags", "c1": "uint16", "c2": "2 \u5b57\u8282", "c3": "\u6807\u5fd7\u4f4d"}, {"c0": "pd_lower", "c1": "LocationIndex", "c2": "2 \u5b57\u8282", "c3": "\u7a7a\u95f2\u7a7a\u95f4\u8d77\u59cb\u4f4d\u7f6e\u7684\u504f\u79fb\u91cf"}, {"c0": "pd_upper", "c1": "LocationIndex", "c2": "2 \u5b57\u8282", "c3": "\u7a7a\u95f2\u7a7a\u95f4\u7ed3\u675f\u4f4d\u7f6e\u7684\u504f\u79fb\u91cf"}, {"c0": "pd_special", "c1": "LocationIndex", "c2": "2 \u5b57\u8282", "c3": "\u7279\u6b8a\u7a7a\u95f4\u8d77\u59cb\u4f4d\u7f6e\u7684\u504f\u79fb\u91cf"}, {"c0": "pd_pagesize_version", "c1": "uint16", "c2": "2 \u5b57\u8282", "c3": "\u9875\u9762\u5927\u5c0f\u4e0e\u5e03\u5c40\u7248\u672c\u53f7\u4fe1\u606f"}, {"c0": "pd_prune_xid", "c1": "TransactionId", "c2": "4 \u5b57\u8282", "c3": "\u9875\u9762\u4e0a\u6700\u65e9\u7684\u5c1a\u672a\u4fee\u526a\u7684 XMAX\uff1b\u6ca1\u6709\u5219\u4e3a\u96f6"}], "title": "PageHeaderData \u5e03\u5c40", "columns": [{"key": "c0", "label": "\u5b57\u6bb5"}, {"key": "c1", "label": "\u7c7b\u578b"}, {"key": "c2", "label": "\u957f\u5ea6"}, {"key": "c3", "label": "\u8bf4\u660e"}]}, {"key": "layout-2", "rows": [{"c0": "t_xmin", "c1": "TransactionId", "c2": "4 \u5b57\u8282", "c3": "\u63d2\u5165\u4e8b\u52a1\u7684 XID"}, {"c0": "t_xmax", "c1": "TransactionId", "c2": "4 \u5b57\u8282", "c3": "\u5220\u9664\u4e8b\u52a1\u7684 XID"}, {"c0": "t_cid", "c1": "CommandId", "c2": "4 \u5b57\u8282", "c3": "\u63d2\u5165\u548c\uff0f\u6216\u5220\u9664\u547d\u4ee4\u7684 CID\uff0c\u4e0e t_xvac \u5171\u7528\u5b58\u50a8\u4f4d\u7f6e"}, {"c0": "t_xvac", "c1": "TransactionId", "c2": "4 \u5b57\u8282", "c3": "VACUUM \u64cd\u4f5c\u79fb\u52a8\u884c\u7248\u672c\u65f6\u4f7f\u7528\u7684 XID"}, {"c0": "t_ctid", "c1": "ItemPointerData", "c2": "6 \u5b57\u8282", "c3": "\u672c\u884c\u7248\u672c\u6216\u8f83\u65b0\u884c\u7248\u672c\u7684\u5f53\u524d TID"}, {"c0": "t_infomask2", "c1": "uint16", "c2": "2 \u5b57\u8282", "c3": "\u5c5e\u6027\u6570\u91cf\u53ca\u5404\u79cd\u6807\u5fd7\u4f4d"}, {"c0": "t_infomask", "c1": "uint16", "c2": "2 \u5b57\u8282", "c3": "\u5404\u79cd\u6807\u5fd7\u4f4d"}, {"c0": "t_hoff", "c1": "uint8", "c2": "1 \u5b57\u8282", "c3": "\u7528\u6237\u6570\u636e\u7684\u504f\u79fb\u91cf"}], "title": "HeapTupleHeaderData \u5e03\u5c40", "columns": [{"key": "c0", "label": "\u5b57\u6bb5"}, {"key": "c1", "label": "\u7c7b\u578b"}, {"key": "c2", "label": "\u957f\u5ea6"}, {"key": "c3", "label": "\u8bf4\u660e"}]}], "diagram": "page-layout", "related": [{"url": "/wiki/tableam/?v=18", "label": "Table AM"}, {"url": "/wiki/relopts/?v=18", "label": "\u5b58\u50a8\u53c2\u6570"}], "release": {"ref": "https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2", "label": "18.6", "major": "18", "channel": "stable", "revision": "555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f"}, "sources": [{"url": "https://pg.center/docs/18/storage-page-layout.html", "path": "storage-page-layout.html", "label": "PostgreSQL 18 English manual", "sha256": "0d9f99e4cef5ea0a6741a74cab87052b929f7001730853c85d5e60d72179d355", "language": "en", "original_url": "/docs/18/storage-page-layout.html"}], "sections": [], "signature": "", "description": ["\u672c\u8282\u6982\u8ff0 PostgreSQL \u8868\u548c\u7d22\u5f15\u5185\u90e8\u6240\u4f7f\u7528\u7684\u9875\u9762\u683c\u5f0f\u3002 [19] \u5e8f\u5217\u548c TOAST \u8868\u7684\u683c\u5f0f\u4e0e\u666e\u901a\u8868\u76f8\u540c\u3002"], "manual_html": "<div class=\"sect1\">\n<div class=\"titlepage\">\n<div>\n<div>\n<h2 class=\"title\" lang=\"zh\">\n<div>\n<div>\n<h2 class=\"title\" style=\"clear: both\">66.6.\u00a0\u6570\u636e\u5e93\u9875\u9762\u5e03\u5c40 </h2>\n</div>\n</div>\n</h2>\n</div>\n</div>\n</div>\n<p lang=\"zh\">\u672c\u8282\u6982\u8ff0 <span class=\"productname\">PostgreSQL</span> \u8868\u548c\u7d22\u5f15\u5185\u90e8\u6240\u4f7f\u7528\u7684\u9875\u9762\u683c\u5f0f\u3002<a class=\"footnote\" href=\"/docs/18/storage-page-layout.html#ftn.id-1.10.18.8.2.2\"><sup class=\"footnote\" id=\"id-1.10.18.8.2.2\">[19]</sup></a> \u5e8f\u5217\u548c <acronym class=\"acronym\">TOAST</acronym> \u8868\u7684\u683c\u5f0f\u4e0e\u666e\u901a\u8868\u76f8\u540c\u3002</p>\n<p lang=\"zh\">\u5728\u4e0b\u9762\u7684\u8bf4\u660e\u4e2d\uff0c\u5047\u5b9a\u4e00\u4e2a<em class=\"firstterm\">\u5b57\u8282</em>\u5305\u542b 8 \u4e2a\u4f4d\u3002\u53e6\u5916\uff0c\u672f\u8bed<em class=\"firstterm\">\u9879</em>\u6307\u7684\u662f\u5b58\u50a8\u5728\u9875\u9762\u4e0a\u7684\u5355\u4e2a\u6570\u636e\u503c\u3002\u5728\u8868\u4e2d\uff0c\u9879\u662f\u4e00\u884c\uff1b\u5728\u7d22\u5f15\u4e2d\uff0c\u9879\u662f\u4e00\u6761\u7d22\u5f15\u6761\u76ee\u3002</p>\n<p lang=\"zh\">\u6bcf\u4e2a\u8868\u548c\u7d22\u5f15\u90fd\u5b58\u50a8\u4e3a\u56fa\u5b9a\u5927\u5c0f\u7684<em class=\"firstterm\">\u9875\u9762</em>\u6570\u7ec4\uff08\u901a\u5e38\u4e3a 8 kB\uff0c\u4e0d\u8fc7\u5728\u7f16\u8bd1\u670d\u52a1\u5668\u65f6\u53ef\u4ee5\u9009\u62e9\u4e0d\u540c\u7684\u9875\u9762\u5927\u5c0f\uff09\u3002\u5728\u8868\u4e2d\uff0c\u6240\u6709\u9875\u9762\u5728\u903b\u8f91\u4e0a\u90fd\u662f\u7b49\u4ef7\u7684\uff0c\u56e0\u6b64\u67d0\u4e2a\u7279\u5b9a\u9879\uff08\u884c\uff09\u53ef\u4ee5\u5b58\u653e\u5728\u4efb\u610f\u9875\u9762\u4e2d\u3002\u5728\u7d22\u5f15\u4e2d\uff0c\u7b2c\u4e00\u9875\u901a\u5e38\u4fdd\u7559\u4e3a<em class=\"firstterm\">\u5143\u9875</em>\uff0c\u7528\u4e8e\u4fdd\u5b58\u63a7\u5236\u4fe1\u606f\uff1b\u5e76\u4e14\u6839\u636e\u7d22\u5f15\u8bbf\u95ee\u65b9\u6cd5\u7684\u4e0d\u540c\uff0c\u7d22\u5f15\u4e2d\u8fd8\u53ef\u80fd\u5b58\u5728\u4e0d\u540c\u7c7b\u578b\u7684\u9875\u9762\u3002</p>\n<p lang=\"zh\"><a class=\"xref\" href=\"/docs/18/storage-page-layout.html#PAGE-TABLE\" title=\"\u8868\u00a066.2.\u00a0\u603b\u4f53\u9875\u9762\u5e03\u5c40\">\u8868\u00a066.2</a>\u5c55\u793a\u4e86\u9875\u9762\u7684\u603b\u4f53\u5e03\u5c40\u3002\u6bcf\u4e2a\u9875\u9762\u5305\u542b\u4e94\u4e2a\u90e8\u5206\u3002</p>\n<div class=\"table\">\n<p class=\"title\" lang=\"zh\"><strong>\u8868\u00a066.2.\u00a0\u603b\u4f53\u9875\u9762\u5e03\u5c40</strong></p>\n<div class=\"table-contents\">\n<table class=\"table\">\n<thead>\n<tr>\n<th lang=\"zh\">\u9879\u76ee</th>\n<th lang=\"zh\">\u8bf4\u660e</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>PageHeaderData</td>\n<td lang=\"zh\">\u957f 24 \u5b57\u8282\uff0c\u5305\u542b\u9875\u9762\u7684\u901a\u7528\u4fe1\u606f\uff0c\u4f8b\u5982\u7a7a\u95f2\u7a7a\u95f4\u6307\u9488\u3002</td>\n</tr>\n<tr>\n<td>ItemIdData</td>\n<td lang=\"zh\">\u6307\u5411\u5b9e\u9645\u6570\u636e\u9879\u7684\u884c\u6307\u9488\u6570\u7ec4\u3002\u6bcf\u9879\u4e3a\u4e00\u4e2a\uff08\u504f\u79fb\uff0c\u957f\u5ea6\uff09\u5bf9\uff0c\u5360 4 \u5b57\u8282\u3002</td>\n</tr>\n<tr>\n<td lang=\"zh\">\u7a7a\u95f2\u7a7a\u95f4</td>\n<td lang=\"zh\">\u5c1a\u672a\u5206\u914d\u7684\u7a7a\u95f4\u3002\u65b0\u884c\u6307\u9488\u4ece\u8be5\u533a\u57df\u7684\u8d77\u59cb\u5904\u5206\u914d\uff0c\u65b0\u6570\u636e\u9879\u4ece\u672b\u5c3e\u5904\u5206\u914d\u3002</td>\n</tr>\n<tr>\n<td lang=\"zh\">\u9879</td>\n<td lang=\"zh\">\u5b9e\u9645\u7684\u6570\u636e\u9879\u672c\u8eab\u3002</td>\n</tr>\n<tr>\n<td lang=\"zh\">\u7279\u6b8a\u7a7a\u95f4</td>\n<td lang=\"zh\">\u7d22\u5f15\u8bbf\u95ee\u65b9\u6cd5\u4e13\u7528\u6570\u636e\u3002\u4e0d\u540c\u65b9\u6cd5\u5b58\u50a8\u7684\u5185\u5bb9\u4e0d\u540c\uff0c\u666e\u901a\u8868\u4e2d\u6b64\u533a\u57df\u4e3a\u7a7a\u3002</td>\n</tr>\n</tbody>\n</table>\n</div>\n</div><br class=\"table-break\"/>\n<p lang=\"zh\">\u6bcf\u9875\u7684\u524d 24 \u5b57\u8282\u662f\u9875\u9996\u90e8 PageHeaderData\uff0c\u8be6\u7ec6\u683c\u5f0f\u89c1\u8868 66.3\u3002\u7b2c\u4e00\u4e2a\u5b57\u6bb5\u8ddf\u8e2a\u4e0e\u8be5\u9875\u76f8\u5173\u7684\u6700\u8fd1\u4e00\u6761 WAL \u8bb0\u5f55\uff1b\u7b2c\u4e8c\u4e2a\u5b57\u6bb5\u5728\u542f\u7528\u6570\u636e\u6821\u9a8c\u548c\u65f6\u4fdd\u5b58\u9875\u9762\u6821\u9a8c\u548c\u3002\u4e4b\u540e\u662f\u4e00\u4e2a\u5305\u542b\u6807\u5fd7\u4f4d\u7684 2 \u5b57\u8282\u5b57\u6bb5\uff0c\u518d\u540e\u9762\u662f\u4e09\u4e2a 2 \u5b57\u8282\u6574\u6570 pd_lower\u3001pd_upper \u548c pd_special\uff0c\u5206\u522b\u8bb0\u5f55\u4ece\u9875\u8d77\u70b9\u5230\u672a\u5206\u914d\u7a7a\u95f4\u8d77\u70b9\u3001\u672a\u5206\u914d\u7a7a\u95f4\u7ec8\u70b9\u53ca\u7279\u6b8a\u7a7a\u95f4\u8d77\u70b9\u7684\u5b57\u8282\u504f\u79fb\u91cf\u3002\u63a5\u4e0b\u6765\u7684 2 \u5b57\u8282 pd_pagesize_version \u540c\u65f6\u4fdd\u5b58\u9875\u5927\u5c0f\u548c\u7248\u672c\u6807\u8bc6\u3002PostgreSQL 8.3 \u8d77\u7248\u672c\u53f7\u4e3a 4\uff1b8.1 \u4e0e 8.2 \u4f7f\u7528 3\uff1b8.0 \u4f7f\u7528 2\uff1b7.3 \u4e0e 7.4 \u4f7f\u7528 1\uff1b\u66f4\u65e9\u7248\u672c\u4f7f\u7528 0\u3002\u591a\u6570\u7248\u672c\u7684\u57fa\u672c\u9875\u9762\u5e03\u5c40\u548c\u9996\u90e8\u683c\u5f0f\u5e76\u672a\u53d8\u5316\uff0c\u4f46\u5806\u884c\u9996\u90e8\u5e03\u5c40\u6709\u53d8\u5316\u3002\u9875\u5927\u5c0f\u57fa\u672c\u53ea\u7528\u4e8e\u4ea4\u53c9\u68c0\u67e5\uff1b\u540c\u4e00\u5b89\u88c5\u4e0d\u652f\u6301\u591a\u79cd\u9875\u5927\u5c0f\u3002\u6700\u540e\u4e00\u4e2a\u5b57\u6bb5\u63d0\u793a\u4fee\u526a\u8be5\u9875\u662f\u5426\u53ef\u80fd\u6709\u76ca\uff0c\u8bb0\u5f55\u8be5\u9875\u6700\u65e9\u7684\u5c1a\u672a\u4fee\u526a\u7684 XMAX\u3002</p>\n<div class=\"table\">\n<p class=\"title\" lang=\"zh\"><strong>\u8868\u00a066.3.\u00a0PageHeaderData \u5e03\u5c40</strong></p>\n<div class=\"table-contents\">\n<table class=\"table\">\n<thead>\n<tr>\n<th lang=\"zh\">\u5b57\u6bb5</th>\n<th lang=\"zh\">\u7c7b\u578b</th>\n<th lang=\"zh\">\u957f\u5ea6</th>\n<th lang=\"zh\">\u8bf4\u660e</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>pd_lsn</td>\n<td>PageXLogRecPtr</td>\n<td lang=\"zh\">8 \u5b57\u8282</td>\n<td lang=\"zh\">LSN\uff1a\u8be5\u9875\u6700\u540e\u4e00\u6b21\u53d8\u5316\u6240\u5bf9\u5e94 WAL \u8bb0\u5f55\u7684\u6700\u540e\u4e00\u4e2a\u5b57\u8282\u4e4b\u540e\u7684\u4f4d\u7f6e\u3002</td>\n</tr>\n<tr>\n<td>pd_checksum</td>\n<td>uint16</td>\n<td lang=\"zh\">2 \u5b57\u8282</td>\n<td lang=\"zh\">\u9875\u9762\u6821\u9a8c\u548c</td>\n</tr>\n<tr>\n<td>pd_flags</td>\n<td>uint16</td>\n<td lang=\"zh\">2 \u5b57\u8282</td>\n<td lang=\"zh\">\u6807\u5fd7\u4f4d</td>\n</tr>\n<tr>\n<td>pd_lower</td>\n<td>LocationIndex</td>\n<td lang=\"zh\">2 \u5b57\u8282</td>\n<td lang=\"zh\">\u7a7a\u95f2\u7a7a\u95f4\u8d77\u59cb\u4f4d\u7f6e\u7684\u504f\u79fb\u91cf</td>\n</tr>\n<tr>\n<td>pd_upper</td>\n<td>LocationIndex</td>\n<td lang=\"zh\">2 \u5b57\u8282</td>\n<td lang=\"zh\">\u7a7a\u95f2\u7a7a\u95f4\u7ed3\u675f\u4f4d\u7f6e\u7684\u504f\u79fb\u91cf</td>\n</tr>\n<tr>\n<td>pd_special</td>\n<td>LocationIndex</td>\n<td lang=\"zh\">2 \u5b57\u8282</td>\n<td lang=\"zh\">\u7279\u6b8a\u7a7a\u95f4\u8d77\u59cb\u4f4d\u7f6e\u7684\u504f\u79fb\u91cf</td>\n</tr>\n<tr>\n<td>pd_pagesize_version</td>\n<td>uint16</td>\n<td lang=\"zh\">2 \u5b57\u8282</td>\n<td lang=\"zh\">\u9875\u9762\u5927\u5c0f\u4e0e\u5e03\u5c40\u7248\u672c\u53f7\u4fe1\u606f</td>\n</tr>\n<tr>\n<td>pd_prune_xid</td>\n<td>TransactionId</td>\n<td lang=\"zh\">4 \u5b57\u8282</td>\n<td lang=\"zh\">\u9875\u9762\u4e0a\u6700\u65e9\u7684\u5c1a\u672a\u4fee\u526a\u7684 XMAX\uff1b\u6ca1\u6709\u5219\u4e3a\u96f6</td>\n</tr>\n</tbody>\n</table>\n</div>\n</div><br class=\"table-break\"/>\n<p lang=\"zh\">\u6240\u6709\u7ec6\u8282\u90fd\u53ef\u4ee5\u5728 <code class=\"filename\">src/include/storage/bufpage.h</code> \u4e2d\u627e\u5230\u3002</p>\n<p lang=\"zh\">\u9875\u5934\u4e4b\u540e\u662f\u9879\u6807\u8bc6\u7b26\uff08<code class=\"type\">ItemIdData</code>\uff09\uff0c\u6bcf\u4e2a\u9700\u8981\u56db\u4e2a\u5b57\u8282\u3002\u4e00\u4e2a\u9879\u6807\u8bc6\u7b26\u5305\u542b\u9879\u8d77\u59cb\u4f4d\u7f6e\u7684\u5b57\u8282\u504f\u79fb\u91cf\u3001\u5176\u5b57\u8282\u957f\u5ea6\uff0c\u4ee5\u53ca\u82e5\u5e72\u5f71\u54cd\u89e3\u91ca\u65b9\u5f0f\u7684\u5c5e\u6027\u4f4d\u3002\u65b0\u7684\u9879\u6807\u8bc6\u7b26\u4f1a\u6839\u636e\u9700\u8981\u4ece\u672a\u5206\u914d\u7a7a\u95f4\u7684\u8d77\u59cb\u5904\u5206\u914d\u3002\u5f53\u524d\u5df2\u6709\u591a\u5c11\u4e2a\u9879\u6807\u8bc6\u7b26\uff0c\u53ef\u4ee5\u901a\u8fc7\u67e5\u770b <code class=\"structfield\">pd_lower</code> \u5f97\u77e5\uff1b\u5206\u914d\u65b0\u6807\u8bc6\u7b26\u65f6\u5b83\u4f1a\u589e\u52a0\u3002\u56e0\u4e3a\u4e00\u4e2a\u9879\u6807\u8bc6\u7b26\u5728\u88ab\u91ca\u653e\u4e4b\u524d\u6c38\u8fdc\u4e0d\u4f1a\u79fb\u52a8\uff0c\u6240\u4ee5\u5373\u4f7f\u9879\u672c\u8eab\u4e3a\u4e86\u6574\u7406\u7a7a\u95f2\u7a7a\u95f4\u800c\u5728\u9875\u9762\u5185\u79fb\u52a8\uff0c\u5176\u7d22\u5f15\u4ecd\u7136\u53ef\u4ee5\u88ab\u957f\u671f\u7528\u6765\u5f15\u7528\u8be5\u9879\u3002\u4e8b\u5b9e\u4e0a\uff0c\u6bcf\u4e2a\u6307\u5411\u9879\u7684\u6307\u9488\uff08<code class=\"type\">ItemPointer</code>\uff0c\u4e5f\u79f0 <code class=\"type\">CTID</code>\uff09\u5728 <span class=\"productname\">PostgreSQL</span> \u4e2d\u90fd\u7531\u9875\u53f7\u548c\u9879\u6807\u8bc6\u7b26\u7d22\u5f15\u6784\u6210\u3002</p>\n<p lang=\"zh\">\u9879\u672c\u8eab\u5b58\u50a8\u5728\u4ece\u672a\u5206\u914d\u7a7a\u95f4\u672b\u5c3e\u5f00\u59cb\u3001\u5411\u540e\u5206\u914d\u7684\u533a\u57df\u4e2d\u3002\u5176\u786e\u5207\u7ed3\u6784\u53d6\u51b3\u4e8e\u8868\u8981\u5305\u542b\u4ec0\u4e48\u5185\u5bb9\u3002\u8868\u548c\u5e8f\u5217\u90fd\u4f7f\u7528\u4e00\u79cd\u540d\u4e3a <code class=\"type\">HeapTupleHeaderData</code> \u7684\u7ed3\u6784\u4f53\uff0c\u5982\u4e0b\u6240\u8ff0\u3002</p>\n<p lang=\"zh\">\u6700\u540e\u4e00\u90e8\u5206\u662f<span class=\"quote\">\u201c<span class=\"quote\">\u7279\u6b8a\u90e8\u5206</span>\u201d</span>\uff0c\u5176\u4e2d\u53ef\u4ee5\u5b58\u653e\u8bbf\u95ee\u65b9\u6cd5\u5e0c\u671b\u4fdd\u5b58\u7684\u4efb\u4f55\u5185\u5bb9\u3002\u4f8b\u5982\uff0cB-\u6811\u7d22\u5f15\u4f1a\u5728\u8fd9\u91cc\u4fdd\u5b58\u6307\u5411\u9875\u9762\u5de6\u3001\u53f3\u5144\u5f1f\u7684\u94fe\u63a5\uff0c\u4ee5\u53ca\u5176\u4ed6\u4e00\u4e9b\u4e0e\u7d22\u5f15\u7ed3\u6784\u76f8\u5173\u7684\u6570\u636e\u3002\u666e\u901a\u8868\u5b8c\u5168\u4e0d\u4f7f\u7528\u7279\u6b8a\u90e8\u5206\uff08\u901a\u8fc7\u5c06 <code class=\"structfield\">pd_special</code> \u8bbe\u4e3a\u9875\u9762\u5927\u5c0f\u6765\u8868\u793a\uff09\u3002</p>\n<p lang=\"zh\"><a class=\"xref\" href=\"/docs/18/storage-page-layout.html#STORAGE-PAGE-LAYOUT-FIGURE\" title=\"\u56fe\u00a066.1.\u00a0\u9875\u9762\u5e03\u5c40\">\u56fe\u00a066.1</a>\u5c55\u793a\u4e86\u8fd9\u4e9b\u90e8\u5206\u5728\u9875\u9762\u4e2d\u7684\u5e03\u5c40\u65b9\u5f0f\u3002</p>\n<div class=\"figure col-xl-8 col-lg-10 col-md-12\">\n<p class=\"title\" lang=\"zh\">\n<p class=\"title\"><strong>\u56fe\u00a066.1.\u00a0\u9875\u9762\u5e03\u5c40</strong></p>\n<div class=\"figure-contents\">\n<div class=\"mediaobject\">\n<object data=\"pagelayout.svg\" type=\"image/svg+xml\" width=\"100%\">\n</object>\n</div>\n</div>\n</p>\n<div class=\"figure-contents\">\n<div class=\"mediaobject\">\n</div>\n</div>\n</div><br class=\"figure-break\"/>\n<div class=\"sect2\">\n<div class=\"titlepage\">\n<div>\n<div>\n<h3 class=\"title\" lang=\"zh\">\n<dl class=\"toc\">\n<dt><span class=\"sect2\"><a href=\"/docs/18/storage-page-layout.html#STORAGE-TUPLE-LAYOUT\">66.6.1. \u8868\u884c\u5e03\u5c40</a></span></dt>\n</dl>\n</h3>\n</div>\n</div>\n</div>\n<p lang=\"zh\">\u6240\u6709\u8868\u884c\u7684\u7ed3\u6784\u90fd\u76f8\u540c\u3002\u5b83\u4eec\u90fd\u6709\u4e00\u4e2a\u56fa\u5b9a\u5927\u5c0f\u7684\u5934\u90e8\uff08\u5728\u5927\u591a\u6570\u673a\u5668\u4e0a\u5360 23 \u5b57\u8282\uff09\uff0c\u540e\u9762\u8ddf\u7740\u53ef\u9009\u7684\u7a7a\u503c\u4f4d\u56fe\u3001\u53ef\u9009\u7684\u5bf9\u8c61 ID \u5b57\u6bb5\u4ee5\u53ca\u7528\u6237\u6570\u636e\u3002\u5934\u90e8\u7684\u8be6\u7ec6\u683c\u5f0f\u89c1<a class=\"xref\" href=\"/docs/18/storage-page-layout.html#HEAPTUPLEHEADERDATA-TABLE\" title=\"\u8868\u00a066.4.\u00a0HeapTupleHeaderData \u5e03\u5c40\">\u8868\u00a066.4</a>\u3002\u5b9e\u9645\u7528\u6237\u6570\u636e\uff08\u884c\u7684\u5404\u5217\uff09\u4ece <code class=\"structfield\">t_hoff</code> \u6307\u793a\u7684\u504f\u79fb\u4f4d\u7f6e\u5f00\u59cb\uff0c\u5b83\u5fc5\u987b\u59cb\u7ec8\u662f\u8be5\u5e73\u53f0 MAXALIGN \u5bf9\u9f50\u5355\u4f4d\u7684\u6574\u6570\u500d\u3002\u53ea\u6709\u5f53 <em class=\"firstterm\">HEAP_HASNULL</em> \u4f4d\u5728 <code class=\"structfield\">t_infomask</code> \u4e2d\u88ab\u7f6e\u4f4d\u65f6\uff0c\u7a7a\u503c\u4f4d\u56fe\u624d\u5b58\u5728\u3002\u82e5\u5b58\u5728\uff0c\u5b83\u7d27\u968f\u56fa\u5b9a\u5934\u90e8\u4e4b\u540e\uff0c\u5e76\u5360\u7528\u8db3\u591f\u591a\u7684\u5b57\u8282\uff0c\u4ee5\u4fbf\u4e3a\u6bcf\u4e2a\u6570\u636e\u5217\u63d0\u4f9b\u4e00\u4f4d\uff08\u4e5f\u5c31\u662f\u8bf4\uff0c\u5176\u4f4d\u6570\u7b49\u4e8e <code class=\"structfield\">t_infomask2</code> \u4e2d\u7684\u5c5e\u6027\u4e2a\u6570\uff09\u3002\u5728\u8fd9\u4e2a\u4f4d\u56fe\u4e2d\uff0c1 \u8868\u793a\u975e\u7a7a\uff0c0 \u8868\u793a\u7a7a\u503c\u3002\u5f53\u4f4d\u56fe\u4e0d\u5b58\u5728\u65f6\uff0c\u5047\u5b9a\u6240\u6709\u5217\u90fd\u975e\u7a7a\u3002\u53ea\u6709\u5f53 <em class=\"firstterm\">HEAP_HASOID_OLD</em> \u4f4d\u5728 <code class=\"structfield\">t_infomask</code> \u4e2d\u88ab\u7f6e\u4f4d\u65f6\uff0c\u5bf9\u8c61 ID \u624d\u5b58\u5728\u3002\u82e5\u5b58\u5728\uff0c\u5b83\u4f4d\u4e8e <code class=\"structfield\">t_hoff</code> \u8fb9\u754c\u4e4b\u524d\u3002\u4e3a\u4e86\u8ba9 <code class=\"structfield\">t_hoff</code> \u6210\u4e3a MAXALIGN \u7684\u6574\u6570\u500d\u6240\u9700\u7684\u4efb\u4f55\u586b\u5145\uff0c\u90fd\u4f1a\u51fa\u73b0\u5728\u7a7a\u503c\u4f4d\u56fe\u4e0e\u5bf9\u8c61 ID \u4e4b\u95f4\u3002\uff08\u8fd9\u53c8\u53cd\u8fc7\u6765\u4fdd\u8bc1\u4e86\u5bf9\u8c61 ID \u7684\u5bf9\u9f50\u662f\u5408\u9002\u7684\u3002\uff09</p>\n<div class=\"table\">\n<p class=\"title\" lang=\"zh\"><strong>\u8868\u00a066.4.\u00a0HeapTupleHeaderData \u5e03\u5c40</strong></p>\n<div class=\"table-contents\">\n<table class=\"table\">\n<thead>\n<tr>\n<th lang=\"zh\">\u5b57\u6bb5</th>\n<th lang=\"zh\">\u7c7b\u578b</th>\n<th lang=\"zh\">\u957f\u5ea6</th>\n<th lang=\"zh\">\u8bf4\u660e</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>t_xmin</td>\n<td>TransactionId</td>\n<td lang=\"zh\">4 \u5b57\u8282</td>\n<td lang=\"zh\">\u63d2\u5165\u4e8b\u52a1\u7684 XID</td>\n</tr>\n<tr>\n<td>t_xmax</td>\n<td>TransactionId</td>\n<td lang=\"zh\">4 \u5b57\u8282</td>\n<td lang=\"zh\">\u5220\u9664\u4e8b\u52a1\u7684 XID</td>\n</tr>\n<tr>\n<td>t_cid</td>\n<td>CommandId</td>\n<td lang=\"zh\">4 \u5b57\u8282</td>\n<td lang=\"zh\">\u63d2\u5165\u548c\uff0f\u6216\u5220\u9664\u547d\u4ee4\u7684 CID\uff0c\u4e0e t_xvac \u5171\u7528\u5b58\u50a8\u4f4d\u7f6e</td>\n</tr>\n<tr>\n<td>t_xvac</td>\n<td>TransactionId</td>\n<td lang=\"zh\">4 \u5b57\u8282</td>\n<td lang=\"zh\">VACUUM \u64cd\u4f5c\u79fb\u52a8\u884c\u7248\u672c\u65f6\u4f7f\u7528\u7684 XID</td>\n</tr>\n<tr>\n<td>t_ctid</td>\n<td>ItemPointerData</td>\n<td lang=\"zh\">6 \u5b57\u8282</td>\n<td lang=\"zh\">\u672c\u884c\u7248\u672c\u6216\u8f83\u65b0\u884c\u7248\u672c\u7684\u5f53\u524d TID</td>\n</tr>\n<tr>\n<td>t_infomask2</td>\n<td>uint16</td>\n<td lang=\"zh\">2 \u5b57\u8282</td>\n<td lang=\"zh\">\u5c5e\u6027\u6570\u91cf\u53ca\u5404\u79cd\u6807\u5fd7\u4f4d</td>\n</tr>\n<tr>\n<td>t_infomask</td>\n<td>uint16</td>\n<td lang=\"zh\">2 \u5b57\u8282</td>\n<td lang=\"zh\">\u5404\u79cd\u6807\u5fd7\u4f4d</td>\n</tr>\n<tr>\n<td>t_hoff</td>\n<td>uint8</td>\n<td lang=\"zh\">1 \u5b57\u8282</td>\n<td lang=\"zh\">\u7528\u6237\u6570\u636e\u7684\u504f\u79fb\u91cf</td>\n</tr>\n</tbody>\n</table>\n</div>\n</div><br class=\"table-break\"/>\n<p lang=\"zh\">\u6240\u6709\u7ec6\u8282\u90fd\u53ef\u4ee5\u5728 <code class=\"filename\">src/include/access/htup_details.h</code> \u4e2d\u627e\u5230\u3002</p>\n<p lang=\"zh\">\u8981\u89e3\u91ca\u5b9e\u9645\u6570\u636e\uff0c\u5fc5\u987b\u501f\u52a9\u4ece\u5176\u4ed6\u8868\u4e2d\u83b7\u5f97\u7684\u4fe1\u606f\uff0c\u5176\u4e2d\u5927\u90e8\u5206\u6765\u81ea <code class=\"structname\">pg_attribute</code>\u3002\u8bc6\u522b\u5b57\u6bb5\u4f4d\u7f6e\u6240\u9700\u7684\u5173\u952e\u503c\u662f <code class=\"structfield\">attlen</code> \u548c <code class=\"structfield\">attalign</code>\u3002\u9664\u975e\u6240\u6709\u5b57\u6bb5\u90fd\u662f\u5b9a\u5bbd\u4e14\u6ca1\u6709\u7a7a\u503c\uff0c\u5426\u5219\u6ca1\u6709\u529e\u6cd5\u76f4\u63a5\u53d6\u5f97\u67d0\u4e2a\u7279\u5b9a\u5c5e\u6027\u3002\u6240\u6709\u8fd9\u4e9b\u6280\u5de7\u90fd\u5c01\u88c5\u5728 <em class=\"firstterm\">heap_getattr</em>\u3001<em class=\"firstterm\">fastgetattr</em> \u548c <em class=\"firstterm\">heap_getsysattr</em> \u8fd9\u4e9b\u51fd\u6570\u4e2d\u3002</p>\n<p lang=\"zh\">\u8bfb\u53d6\u6570\u636e\u65f6\uff0c\u9700\u8981\u4f9d\u6b21\u68c0\u67e5\u6bcf\u4e2a\u5c5e\u6027\u3002\u9996\u5148\u6839\u636e\u7a7a\u503c\u4f4d\u56fe\u5224\u65ad\u8be5\u5b57\u6bb5\u662f\u5426\u4e3a NULL\u3002\u5982\u679c\u662f\uff0c\u5c31\u7ee7\u7eed\u4e0b\u4e00\u4e2a\u3002\u7136\u540e\u786e\u8ba4\u5bf9\u9f50\u662f\u5426\u6b63\u786e\u3002\u5982\u679c\u5b57\u6bb5\u662f\u5b9a\u5bbd\u5b57\u6bb5\uff0c\u90a3\u4e48\u5b83\u7684\u6240\u6709\u5b57\u8282\u90fd\u662f\u76f4\u63a5\u6446\u653e\u7684\uff1b\u5982\u679c\u5b83\u662f\u53d8\u957f\u5b57\u6bb5\uff08attlen = -1\uff09\uff0c\u60c5\u51b5\u5c31\u4f1a\u7a0d\u590d\u6742\u4e00\u4e9b\u3002\u6240\u6709\u53d8\u957f\u6570\u636e\u7c7b\u578b\u90fd\u5171\u4eab\u4e00\u4e2a\u901a\u7528\u5934\u90e8\u7ed3\u6784\u4f53 <code class=\"type\">struct varlena</code>\uff0c\u5176\u4e2d\u5305\u542b\u5df2\u5b58\u50a8\u503c\u7684\u603b\u957f\u5ea6\u4ee5\u53ca\u4e00\u4e9b\u6807\u5fd7\u4f4d\u3002\u6839\u636e\u8fd9\u4e9b\u6807\u5fd7\uff0c\u6570\u636e\u53ef\u80fd\u662f\u884c\u5185\u5b58\u50a8\u7684\uff0c\u4e5f\u53ef\u80fd\u4f4d\u4e8e <acronym class=\"acronym\">TOAST</acronym> \u8868\u4e2d\uff1b\u5b83\u4e5f\u53ef\u80fd\u662f\u7ecf\u8fc7\u538b\u7f29\u7684\uff08\u89c1<a class=\"xref\" href=\"/docs/18/storage-toast.html\" title=\"66.2.\u00a0TOAST\">\u7b2c\u00a066.2\u00a0\u8282</a>\uff09\u3002</p>\n</div>\n<div class=\"footnotes\">\n<br/>\n<hr/>\n<div class=\"footnote\">\n<p lang=\"zh\">\n<br/>\n<hr style=\"width:100; text-align:left;margin-left: 0\"/>\n<div class=\"footnote\" id=\"ftn.id-1.10.18.8.2.2\">\n<p><a class=\"para\" href=\"/docs/18/storage-page-layout.html#id-1.10.18.8.2.2\"><sup class=\"para\">[19]</sup></a> \u5b9e\u9645\u4e0a\uff0c\u8868\u8bbf\u95ee\u65b9\u6cd5\u548c\u7d22\u5f15\u8bbf\u95ee\u65b9\u6cd5\u90fd\u4e0d\u8981\u6c42\u5fc5\u987b\u4f7f\u7528\u8fd9\u79cd\u9875\u9762\u683c\u5f0f\u3002<code class=\"literal\">heap</code> \u8868\u8bbf\u95ee\u65b9\u6cd5\u59cb\u7ec8\u4f7f\u7528\u8fd9\u79cd\u683c\u5f0f\u3002\u73b0\u6709\u7684\u6240\u6709\u7d22\u5f15\u65b9\u6cd5\u4e5f\u90fd\u4f7f\u7528\u8fd9\u79cd\u57fa\u672c\u683c\u5f0f\uff0c\u4f46\u7d22\u5f15\u5143\u9875\u4e2d\u4fdd\u5b58\u7684\u6570\u636e\u901a\u5e38\u5e76\u4e0d\u9075\u5faa\u9879\u5e03\u5c40\u89c4\u5219\u3002</p>\n</div>\n</p>\n</div>\n</div>\n</div>", "manual_path": "/docs/18/storage-page-layout.html", "localization": {"status": "complete", "sources": [{"url": "/docs/18/storage-page-layout.html", "method": "same-major semantic node", "sha256": "e504ff90f2cabf6f71046d80f1cc8d49664ba2f2f4bce0ef26e955d6c5580ab2", "language": "zh", "matched_nodes": ["#STORAGE-PAGE-LAYOUT/div[0]", "#STORAGE-PAGE-LAYOUT/div[16]", "#STORAGE-PAGE-LAYOUT/div[18]/div[2]/p[0]", "#STORAGE-PAGE-LAYOUT/div[18]/p[1]", "#STORAGE-PAGE-LAYOUT/div[18]/p[4]", "#STORAGE-PAGE-LAYOUT/div[18]/p[5]", "#STORAGE-PAGE-LAYOUT/div[18]/p[6]", "#STORAGE-PAGE-LAYOUT/div[19]", "#STORAGE-PAGE-LAYOUT/div[1]", "#STORAGE-PAGE-LAYOUT/div[6]/div[1]/table[0]/tbody[2]/tr[3]/td[0]", "#STORAGE-PAGE-LAYOUT/div[6]/p[0]", "#STORAGE-PAGE-LAYOUT/div[9]/div[1]/table[0]/tbody[2]/tr[0]/td[2]", "#STORAGE-PAGE-LAYOUT/div[9]/p[0]", "#STORAGE-PAGE-LAYOUT/p[11]", "#STORAGE-PAGE-LAYOUT/p[12]", "#STORAGE-PAGE-LAYOUT/p[13]", "#STORAGE-PAGE-LAYOUT/p[14]", "#STORAGE-PAGE-LAYOUT/p[15]", "#STORAGE-PAGE-LAYOUT/p[2]", "#STORAGE-PAGE-LAYOUT/p[3]", "#STORAGE-PAGE-LAYOUT/p[4]", "#STORAGE-PAGE-LAYOUT/p[5]"]}], "language": "zh", "original_text": {"/versions/18/description/0": "This section provides an overview of the page format used within PostgreSQL tables and indexes. [19] Sequences and TOAST tables are formatted just like a regular table.", "/versions/18/facts/0/label": "Definition scope", "/versions/18/facts/0/value": "Same-version core physical storage documentation", "/versions/18/tables/0/title": "Overall Page Layout", "/versions/18/tables/1/title": "PageHeaderData Layout", "/versions/18/tables/2/title": "HeapTupleHeaderData Layout", "/versions/18/related/1/label": "Storage Parameters", "/versions/18/tables/0/rows/0/c1": "24 bytes long. Contains general information about the page, including free space pointers.", "/versions/18/tables/0/rows/1/c1": "Array of item identifiers pointing to the actual items. Each entry is an (offset,length) pair. 4 bytes per item.", "/versions/18/tables/0/rows/2/c0": "Free space", "/versions/18/tables/0/rows/2/c1": "The unallocated space. New item identifiers are allocated from the start of this area, new items from the end.", "/versions/18/tables/0/rows/3/c0": "Items", "/versions/18/tables/0/rows/3/c1": "The actual items themselves.", "/versions/18/tables/0/rows/4/c0": "Special space", "/versions/18/tables/0/rows/4/c1": "Index access method specific data. Different methods store different data. Empty in ordinary tables.", "/versions/18/tables/1/rows/0/c2": "8 bytes", "/versions/18/tables/1/rows/0/c3": "LSN: next byte after last byte of WAL record for last change to this page", "/versions/18/tables/1/rows/1/c2": "2 bytes", "/versions/18/tables/1/rows/1/c3": "Page checksum", "/versions/18/tables/1/rows/2/c2": "2 bytes", "/versions/18/tables/1/rows/2/c3": "Flag bits", "/versions/18/tables/1/rows/3/c2": "2 bytes", "/versions/18/tables/1/rows/3/c3": "Offset to start of free space", "/versions/18/tables/1/rows/4/c2": "2 bytes", "/versions/18/tables/1/rows/4/c3": "Offset to end of free space", "/versions/18/tables/1/rows/5/c2": "2 bytes", "/versions/18/tables/1/rows/5/c3": "Offset to start of special space", "/versions/18/tables/1/rows/6/c2": "2 bytes", "/versions/18/tables/1/rows/6/c3": "Page size and layout version number information", "/versions/18/tables/1/rows/7/c2": "4 bytes", "/versions/18/tables/1/rows/7/c3": "Oldest unpruned XMAX on page, or zero if none", "/versions/18/tables/2/rows/0/c2": "4 bytes", "/versions/18/tables/2/rows/0/c3": "insert XID stamp", "/versions/18/tables/2/rows/1/c2": "4 bytes", "/versions/18/tables/2/rows/1/c3": "delete XID stamp", "/versions/18/tables/2/rows/2/c2": "4 bytes", "/versions/18/tables/2/rows/2/c3": "insert and/or delete CID stamp (overlays with t_xvac)", "/versions/18/tables/2/rows/3/c2": "4 bytes", "/versions/18/tables/2/rows/3/c3": "XID for VACUUM operation moving a row version", "/versions/18/tables/2/rows/4/c2": "6 bytes", "/versions/18/tables/2/rows/4/c3": "current TID of this or newer row version", "/versions/18/tables/2/rows/5/c2": "2 bytes", "/versions/18/tables/2/rows/5/c3": "number of attributes, plus various flag bits", "/versions/18/tables/2/rows/6/c2": "2 bytes", "/versions/18/tables/2/rows/6/c3": "various flag bits", "/versions/18/tables/2/rows/7/c2": "1 byte", "/versions/18/tables/2/rows/7/c3": "offset to user data", "/versions/18/tables/0/columns/0/label": "Item", "/versions/18/tables/0/columns/1/label": "Description", "/versions/18/tables/1/columns/0/label": "Field", "/versions/18/tables/1/columns/1/label": "Type", "/versions/18/tables/1/columns/2/label": "Length", "/versions/18/tables/1/columns/3/label": "Description", "/versions/18/tables/2/columns/0/label": "Field", "/versions/18/tables/2/columns/1/label": "Type", "/versions/18/tables/2/columns/2/label": "Length", "/versions/18/tables/2/columns/3/label": "Description"}, "fallback_fields": [], "source_language": "en", "original_snapshot_sha256": "a9dda740e83f3772422bb1b41e492854b00998da5004f5a0e1f65588f2beaebd"}, "comparison_data": {"layouts": [{"key": "layout-0", "rows": [{"c0": "PageHeaderData", "c1": "24 bytes long. Contains general information about the page, including free space pointers."}, {"c0": "ItemIdData", "c1": "Array of item identifiers pointing to the actual items. Each entry is an (offset,length) pair. 4 bytes per item."}, {"c0": "Free space", "c1": "The unallocated space. New item identifiers are allocated from the start of this area, new items from the end."}, {"c0": "Items", "c1": "The actual items themselves."}, {"c0": "Special space", "c1": "Index access method specific data. Different methods store different data. Empty in ordinary tables."}], "title": "Overall Page Layout", "columns": [{"key": "c0", "label": "Item"}, {"key": "c1", "label": "Description"}]}, {"key": "layout-1", "rows": [{"c0": "pd_lsn", "c1": "PageXLogRecPtr", "c2": "8 bytes", "c3": "LSN: next byte after last byte of WAL record for last change to this page"}, {"c0": "pd_checksum", "c1": "uint16", "c2": "2 bytes", "c3": "Page checksum"}, {"c0": "pd_flags", "c1": "uint16", "c2": "2 bytes", "c3": "Flag bits"}, {"c0": "pd_lower", "c1": "LocationIndex", "c2": "2 bytes", "c3": "Offset to start of free space"}, {"c0": "pd_upper", "c1": "LocationIndex", "c2": "2 bytes", "c3": "Offset to end of free space"}, {"c0": "pd_special", "c1": "LocationIndex", "c2": "2 bytes", "c3": "Offset to start of special space"}, {"c0": "pd_pagesize_version", "c1": "uint16", "c2": "2 bytes", "c3": "Page size and layout version number information"}, {"c0": "pd_prune_xid", "c1": "TransactionId", "c2": "4 bytes", "c3": "Oldest unpruned XMAX on page, or zero if none"}], "title": "PageHeaderData Layout", "columns": [{"key": "c0", "label": "Field"}, {"key": "c1", "label": "Type"}, {"key": "c2", "label": "Length"}, {"key": "c3", "label": "Description"}]}, {"key": "layout-2", "rows": [{"c0": "t_xmin", "c1": "TransactionId", "c2": "4 bytes", "c3": "insert XID stamp"}, {"c0": "t_xmax", "c1": "TransactionId", "c2": "4 bytes", "c3": "delete XID stamp"}, {"c0": "t_cid", "c1": "CommandId", "c2": "4 bytes", "c3": "insert and/or delete CID stamp (overlays with t_xvac)"}, {"c0": "t_xvac", "c1": "TransactionId", "c2": "4 bytes", "c3": "XID for VACUUM operation moving a row version"}, {"c0": "t_ctid", "c1": "ItemPointerData", "c2": "6 bytes", "c3": "current TID of this or newer row version"}, {"c0": "t_infomask2", "c1": "uint16", "c2": "2 bytes", "c3": "number of attributes, plus various flag bits"}, {"c0": "t_infomask", "c1": "uint16", "c2": "2 bytes", "c3": "various flag bits"}, {"c0": "t_hoff", "c1": "uint8", "c2": "1 byte", "c3": "offset to user data"}], "title": "HeapTupleHeaderData Layout", "columns": [{"key": "c0", "label": "Field"}, {"key": "c1", "label": "Type"}, {"key": "c2", "label": "Length"}, {"key": "c3", "label": "Description"}]}]}, "comparison_hash": "b621fa85b3be27a0eb0d82986e9524f2ef0a776761901f0d429826eec4822d0a", "manual_language": "zh"}, "comparison": {"left": "17", "right": "18", "status": "unchanged", "diff": ""}}