{"Entry":{"collection":"storage","key":"storage-fsm","name":"Free Space Map","aliases":[],"metadata":{"aliases":[],"category":"Physical structures","content_hash":"42ef3c4a3ac97a9c70027c04352e6eb5bb77dac0dbb131f198931b418dc4e1f5","derived_content_hash":"2eda00aa5680d98e9ec5daf1f8ed746ada5ba2c21cf9315bd9f53165e7ecd770","imported_at":"2026-09-30T00:40:47.091203+08:00","name":"Free Space Map","name_zh":"","slug":"storage-fsm","summary":"Each heap and index relation, except for hash indexes, has a Free Space Map ( FSM ) to keep track of available space in the relation. It's stored alongside the main relation data in a separate relation fork, named after the filenode number of the relation, plus a _fsm suffix. For example, if the filenode of a relation is 12345, the FSM is stored in a file called 12345_fsm , in the same directory as the main relation file."}},"Definition":{"Collection":"storage","Key":"storage-fsm","SourceDatabase":"center","Version":"18","SourceTable":"storage_structure","SourceKey":"storage-fsm","SourceRevision":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f","Facts":{"comparison_data":{"layouts":[]},"comparison_hash":"27341929154bfb55531f03501322b65af719c5561f3c4ddc9528a14aa4df69b5","description":["Each heap and index relation, except for hash indexes, has a Free Space Map ( FSM ) to keep track of available space in the relation. It's stored alongside the main relation data in a separate relation fork, named after the filenode number of the relation, plus a _fsm suffix. For example, if the filenode of a relation is 12345, the FSM is stored in a file called 12345_fsm , in the same directory as the main relation file."],"description_zh":"每个堆关系和索引关系（hash 索引除外）都有一个空闲空间映射（ FSM ），用于跟踪该关系中的可用空间。它与主关系数据并列存放在一个独立的关系分支中，其名称由该关系的文件节点编号加上 _fsm 后缀构成。例如，如果某关系的文件节点是 12345，那么 FSM 就存储在名为 12345_fsm 的文件中，与主关系文件位于同一目录。 空闲空间映射被组织成一棵由 FSM 页面构成的树。最底层的 FSM 页面存储每个堆页面（或索引页面）上的可用空闲空间，每个这样的页面用一个字节表示。上层页面则聚合来自下层的信息。 每个 FSM 页面内部都有一棵二叉树，以数组形式存储，每个节点占一个字节。每个叶子节点表示一个堆页面或下层 FSM 页面。每个非叶子节点中保存其子节点值中较大的那个，因此叶子节点中的最大值会保存在根节点。 请参见 src/backend/storage/freespace/README ，了解 FSM 的结构以及如何更新和搜索它的更多细节。 pg_freespacemap 模块可用于检查空闲空间映射中存储的信息。","description_zh_html":"\u003cp\u003e存储结构 storage-fsm。\u003c/p\u003e\u003ch3\u003e同版本中文手册节选\u003c/h3\u003e\u003cp\u003e\n每个堆关系和索引关系（hash 索引除外）都有一个空闲空间映射（\u003cacronym class=\"acronym\"\u003eFSM\u003c/acronym\u003e），用于跟踪该关系中的可用空间。它与主关系数据并列存放在一个独立的关系分支中，其名称由该关系的文件节点编号加上\n\u003ccode class=\"literal\"\u003e_fsm\u003c/code\u003e 后缀构成。例如，如果某关系的文件节点是 12345，那么 \u003cacronym class=\"acronym\"\u003eFSM\u003c/acronym\u003e 就存储在名为 \u003ccode class=\"filename\"\u003e12345_fsm\u003c/code\u003e\n的文件中，与主关系文件位于同一目录。\n\u003c/p\u003e\u003cp\u003e\n空闲空间映射被组织成一棵由 \u003cacronym class=\"acronym\"\u003eFSM\u003c/acronym\u003e 页面构成的树。最底层的\n\u003cacronym class=\"acronym\"\u003eFSM\u003c/acronym\u003e 页面存储每个堆页面（或索引页面）上的可用空闲空间，每个这样的页面用一个字节表示。上层页面则聚合来自下层的信息。\n\u003c/p\u003e\u003cp\u003e\n每个 \u003cacronym class=\"acronym\"\u003eFSM\u003c/acronym\u003e 页面内部都有一棵二叉树，以数组形式存储，每个节点占一个字节。每个叶子节点表示一个堆页面或下层 \u003cacronym class=\"acronym\"\u003eFSM\u003c/acronym\u003e 页面。每个非叶子节点中保存其子节点值中较大的那个，因此叶子节点中的最大值会保存在根节点。\n\u003c/p\u003e\u003cp\u003e\n请参见 \u003ccode class=\"filename\"\u003esrc/backend/storage/freespace/README\u003c/code\u003e，了解 \u003cacronym class=\"acronym\"\u003eFSM\u003c/acronym\u003e 的结构以及如何更新和搜索它的更多细节。\u003ca class=\"xref\" href=\"/zh/docs/18/pgfreespacemap.html\"\u003epg_freespacemap\u003c/a\u003e 模块可用于检查空闲空间映射中存储的信息。\n\u003c/p\u003e\u003cp\u003e\u003ca href=\"/zh/docs/18/storage-fsm.html\"\u003e查看完整中文手册与上下文\u003c/a\u003e。\u003c/p\u003e","facts":[{"label":"Definition scope","value":"Same-version core physical storage documentation"}],"facts_zh":[{"label":"定义范围","value":"同版本核心物理存储文档"}],"manual_html":"\u003cdiv class=\"sect1\"\u003e\n\u003cdiv class=\"titlepage\"\u003e\n\u003cdiv\u003e\n\u003cdiv\u003e\n\u003ch2 class=\"title\"\u003e66.3. Free Space Map \u003c/h2\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\u003cp\u003eEach heap and index relation, except for hash indexes, has a Free Space Map (FSM) to keep track of available space in the relation. It's stored alongside the main relation data in a separate relation fork, named after the filenode number of the relation, plus a \u003ccode class=\"literal\"\u003e_fsm\u003c/code\u003e suffix. For example, if the filenode of a relation is 12345, the FSM is stored in a file called \u003ccode class=\"filename\"\u003e12345_fsm\u003c/code\u003e, in the same directory as the main relation file.\u003c/p\u003e\n\u003cp\u003eThe Free Space Map is organized as a tree of FSM pages. The bottom level FSM pages store the free space available on each heap (or index) page, using one byte to represent each such page. The upper levels aggregate information from the lower levels.\u003c/p\u003e\n\u003cp\u003eWithin each FSM page is a binary tree, stored in an array with one byte per node. Each leaf node represents a heap page, or a lower level FSM page. In each non-leaf node, the higher of its children's values is stored. The maximum value in the leaf nodes is therefore stored at the root.\u003c/p\u003e\n\u003cp\u003eSee \u003ccode class=\"filename\"\u003esrc/backend/storage/freespace/README\u003c/code\u003e for more details on how the FSM is structured, and how it's updated and searched. The \u003ca class=\"xref\" href=\"/docs/18/pgfreespacemap.html\" title=\"F.27. pg_freespacemap — examine the free space map\"\u003epg_freespacemap\u003c/a\u003e module can be used to examine the information stored in free space maps.\u003c/p\u003e\n\u003c/div\u003e","manual_path":"/docs/18/storage-fsm.html","related":[{"label":"Table AM","url":"/wiki/tableam/?v=18"},{"label":"Storage Parameters","url":"/wiki/relopts/?v=18"}],"release":{"channel":"stable","label":"18.6","major":"18","ref":"https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2","revision":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f"},"sections":[],"sections_zh":[],"signature":"","sources":[{"label":"PostgreSQL 18 English manual","path":"storage-fsm.html","sha256":"34a44d3fed151d4552d4e195e24cd7057beae246905423bfd396f875f9f86388","url":"/docs/18/storage-fsm.html"}],"tables":[],"tables_zh":[],"zh_from":{"authored_translation":"source-derived-identity","body_sha256":"d6c7fa8561fc388cb5f795ecbd4e2f8dda692be8bf3db0c8b870254dacd31f69","kind":"same-version-chinese-manual-with-source-derived-identity","manual":{"anchor":"","build_id":107,"extraction":"concept-introduction","fragment_sha256":"e10167922f5bb2dc5ac13983722cf2f2146c4f6ecd8ffe84bf0fbb2d1f6691f0","locale":"zh-Hans","page_key":"storage-fsm.html","source_hash":"6ca37d67fdaa092ee1aa72661dacdc362b8f751c542dd3337f030afdfceae7c7","source_revision":"unknown:rendered-translation-baseline","translated_from_revision":null,"translation_revision":"git:b1b500221dbe5437cfca004d6b04d3f6e422765d;html-sha256:08e987a66af27b98444a8057c256314eafa13611a3fb9e888214fc436824244b","url":"/zh/docs/18/storage-fsm.html","version":"18"},"runtime_rerun":false,"source_facts_revision":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f"}},"ManualEvidence":{"manual_path":"/docs/18/storage-fsm.html","release":{"channel":"stable","label":"18.6","major":"18","ref":"https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2","revision":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f"},"sources":[{"label":"PostgreSQL 18 English manual","path":"storage-fsm.html","sha256":"34a44d3fed151d4552d4e195e24cd7057beae246905423bfd396f875f9f86388","url":"/docs/18/storage-fsm.html"}]},"MeasuredEvidence":{}},"Text":{"Collection":"storage","Key":"storage-fsm","SourceDatabase":"center","Version":"18","Locale":"en","Title":"Free Space Map","Summary":"Each heap and index relation, except for hash indexes, has a Free Space Map ( FSM ) to keep track of available space in the relation. It's stored alongside the main relation data in a separate relation fork, named after the filenode number of the relation, plus a _fsm suffix. For example, if the filenode of a relation is 12345, the FSM is stored in a file called 12345_fsm , in the same directory as the main relation file.","BodyHTML":"\u003cdiv\u003e\n\u003cdiv\u003e\n\u003cdiv\u003e\n\u003cdiv\u003e\n\u003ch2\u003e66.3. Free Space Map \u003c/h2\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\u003cp\u003eEach heap and index relation, except for hash indexes, has a Free Space Map (FSM) to keep track of available space in the relation. It\u0026#39;s stored alongside the main relation data in a separate relation fork, named after the filenode number of the relation, plus a \u003ccode\u003e_fsm\u003c/code\u003e suffix. For example, if the filenode of a relation is 12345, the FSM is stored in a file called \u003ccode\u003e12345_fsm\u003c/code\u003e, in the same directory as the main relation file.\u003c/p\u003e\n\u003cp\u003eThe Free Space Map is organized as a tree of FSM pages. The bottom level FSM pages store the free space available on each heap (or index) page, using one byte to represent each such page. The upper levels aggregate information from the lower levels.\u003c/p\u003e\n\u003cp\u003eWithin each FSM page is a binary tree, stored in an array with one byte per node. Each leaf node represents a heap page, or a lower level FSM page. In each non-leaf node, the higher of its children\u0026#39;s values is stored. The maximum value in the leaf nodes is therefore stored at the root.\u003c/p\u003e\n\u003cp\u003eSee \u003ccode\u003esrc/backend/storage/freespace/README\u003c/code\u003e for more details on how the FSM is structured, and how it\u0026#39;s updated and searched. The \u003ca href=\"/docs/18/pgfreespacemap.html\" rel=\"nofollow\"\u003epg_freespacemap\u003c/a\u003e module can be used to examine the information stored in free space maps.\u003c/p\u003e\n\u003c/div\u003e","SourceRevision":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f","ContentHash":"737a8fc4d96359e9dda36710e7b99d65d9b363307bd3837e48447cb429c5b40b","Payload":{"description":["Each heap and index relation, except for hash indexes, has a Free Space Map ( FSM ) to keep track of available space in the relation. It's stored alongside the main relation data in a separate relation fork, named after the filenode number of the relation, plus a _fsm suffix. For example, if the filenode of a relation is 12345, the FSM is stored in a file called 12345_fsm , in the same directory as the main relation file."],"manual_html":"\u003cdiv class=\"sect1\"\u003e\n\u003cdiv class=\"titlepage\"\u003e\n\u003cdiv\u003e\n\u003cdiv\u003e\n\u003ch2 class=\"title\"\u003e66.3. Free Space Map \u003c/h2\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\u003cp\u003eEach heap and index relation, except for hash indexes, has a Free Space Map (FSM) to keep track of available space in the relation. It's stored alongside the main relation data in a separate relation fork, named after the filenode number of the relation, plus a \u003ccode class=\"literal\"\u003e_fsm\u003c/code\u003e suffix. For example, if the filenode of a relation is 12345, the FSM is stored in a file called \u003ccode class=\"filename\"\u003e12345_fsm\u003c/code\u003e, in the same directory as the main relation file.\u003c/p\u003e\n\u003cp\u003eThe Free Space Map is organized as a tree of FSM pages. The bottom level FSM pages store the free space available on each heap (or index) page, using one byte to represent each such page. The upper levels aggregate information from the lower levels.\u003c/p\u003e\n\u003cp\u003eWithin each FSM page is a binary tree, stored in an array with one byte per node. Each leaf node represents a heap page, or a lower level FSM page. In each non-leaf node, the higher of its children's values is stored. The maximum value in the leaf nodes is therefore stored at the root.\u003c/p\u003e\n\u003cp\u003eSee \u003ccode class=\"filename\"\u003esrc/backend/storage/freespace/README\u003c/code\u003e for more details on how the FSM is structured, and how it's updated and searched. The \u003ca class=\"xref\" href=\"/docs/18/pgfreespacemap.html\" title=\"F.27. pg_freespacemap — examine the free space map\"\u003epg_freespacemap\u003c/a\u003e module can be used to examine the information stored in free space maps.\u003c/p\u003e\n\u003c/div\u003e","related":[{"label":"Table AM","url":"/wiki/tableam/?v=18"},{"label":"Storage Parameters","url":"/wiki/relopts/?v=18"}],"sections":[],"tables":[]}},"RequestedLocale":"en","Fallback":false,"Versions":["10","11","12","13","14","15","16","17","18","19","20"],"Locales":["en","zh-Hans"],"Signatures":null,"Spellings":null,"SQLState":null,"Evidence":null}
