{"Entry":{"collection":"storage","key":"storage-vm","name":"Visibility Map","aliases":[],"metadata":{"aliases":[],"category":"Physical structures","content_hash":"d437137bb8fcfdb4a82465c408863dafd81704854b7bde4b6e182a103757f979","derived_content_hash":"a1ca8f0022ee9aff6846f2a2dacd2b77ae14e795d79c4ce2faff4cc42726f726","imported_at":"2026-09-30T00:40:47.11807+08:00","name":"Visibility Map","name_zh":"","slug":"storage-vm","summary":"Each heap relation has a Visibility Map (VM) to keep track of which pages contain only tuples that are known to be visible to all active transactions; it also keeps track of which pages contain only frozen tuples. It's stored alongside the main relation data in a separate relation fork, named after the filenode number of the relation, plus a _vm suffix. For example, if the filenode of a relation is 12345, the VM is stored in a file called 12345_vm , in the same directory as the main relation file. Note that indexes do not have VMs."}},"Definition":{"Collection":"storage","Key":"storage-vm","SourceDatabase":"center","Version":"18","SourceTable":"storage_structure","SourceKey":"storage-vm","SourceRevision":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f","Facts":{"comparison_data":{"layouts":[]},"comparison_hash":"27341929154bfb55531f03501322b65af719c5561f3c4ddc9528a14aa4df69b5","description":["Each heap relation has a Visibility Map (VM) to keep track of which pages contain only tuples that are known to be visible to all active transactions; it also keeps track of which pages contain only frozen tuples. It's stored alongside the main relation data in a separate relation fork, named after the filenode number of the relation, plus a _vm suffix. For example, if the filenode of a relation is 12345, the VM is stored in a file called 12345_vm , in the same directory as the main relation file. Note that indexes do not have VMs."],"description_zh":"每个堆关系都有一个可见性映射（VM），用于跟踪哪些页面只包含已知对所有活动事务都可见的元组；它还会跟踪哪些页面只包含已冻结的元组。它与主关系数据并列存放在一个独立的关系分支中，名称由关系的文件节点编号加上 _vm 后缀构成。例如，如果某关系的文件节点是 12345，那么 VM 会存储在名为 12345_vm 的文件中，与主关系文件位于同一目录。请注意，索引没有 VM。 可见性映射为每个堆页面存储两个位。第一位若被置位，表示该页面是全部可见（all-visible），换句话说，该页面不包含任何需要被清理的元组。这些信息还可以被 仅索引扫描 用来只依据索引元组回答查询。第二位若被置位，则表示页面上的所有元组都已经被冻结。这意味着，即使是防回卷清理也不必重新访问该页面。 这个映射是保守的，也就是说，只要某个位被置位，我们就能确定相应条件确实成立；但如果某个位没有置位，该条件既可能为真，也可能不为真。可见性映射位只会由 VACUUM 设置，但页面上的任何数据修改操作都会把它们清除。 pg_visibility 模块可用于检查可见性映射中存储的信息。","description_zh_html":"\u003cp\u003e存储结构 storage-vm。\u003c/p\u003e\u003ch3\u003e同版本中文手册节选\u003c/h3\u003e\u003cp\u003e\n每个堆关系都有一个可见性映射（VM），用于跟踪哪些页面只包含已知对所有活动事务都可见的元组；它还会跟踪哪些页面只包含已冻结的元组。它与主关系数据并列存放在一个独立的关系分支中，名称由关系的文件节点编号加上 \u003ccode class=\"literal\"\u003e_vm\u003c/code\u003e 后缀构成。例如，如果某关系的文件节点是 12345，那么 VM 会存储在名为 \u003ccode class=\"filename\"\u003e12345_vm\u003c/code\u003e 的文件中，与主关系文件位于同一目录。请注意，索引没有 VM。\n\u003c/p\u003e\u003cp\u003e\n可见性映射为每个堆页面存储两个位。第一位若被置位，表示该页面是全部可见（all-visible），换句话说，该页面不包含任何需要被清理的元组。这些信息还可以被\u003ca class=\"link\" href=\"/zh/docs/18/indexes-index-only-scans.html\"\u003e\u003cem class=\"firstterm\"\u003e仅索引扫描\u003c/em\u003e\u003c/a\u003e用来只依据索引元组回答查询。第二位若被置位，则表示页面上的所有元组都已经被冻结。这意味着，即使是防回卷清理也不必重新访问该页面。\n\u003c/p\u003e\u003cp\u003e\n这个映射是保守的，也就是说，只要某个位被置位，我们就能确定相应条件确实成立；但如果某个位没有置位，该条件既可能为真，也可能不为真。可见性映射位只会由\nVACUUM 设置，但页面上的任何数据修改操作都会把它们清除。\n\u003c/p\u003e\u003cp\u003e\n\u003ca class=\"xref\" href=\"/zh/docs/18/pgvisibility.html\"\u003epg_visibility\u003c/a\u003e 模块可用于检查可见性映射中存储的信息。\n\u003c/p\u003e\u003cp\u003e\u003ca href=\"/zh/docs/18/storage-vm.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.4. Visibility Map \u003c/h2\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\u003cp\u003eEach heap relation has a Visibility Map (VM) to keep track of which pages contain only tuples that are known to be visible to all active transactions; it also keeps track of which pages contain only frozen tuples. 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_vm\u003c/code\u003e suffix. For example, if the filenode of a relation is 12345, the VM is stored in a file called \u003ccode class=\"filename\"\u003e12345_vm\u003c/code\u003e, in the same directory as the main relation file. Note that indexes do not have VMs.\u003c/p\u003e\n\u003cp\u003eThe visibility map stores two bits per heap page. The first bit, if set, indicates that the page is all-visible, or in other words that the page does not contain any tuples that need to be vacuumed. This information can also be used by \u003ca class=\"link\" href=\"/docs/18/indexes-index-only-scans.html\" title=\"11.9. Index-Only Scans and Covering Indexes\"\u003e\u003cem class=\"firstterm\"\u003eindex-only scans\u003c/em\u003e\u003c/a\u003e to answer queries using only the index tuple. The second bit, if set, means that all tuples on the page have been frozen. That means that even an anti-wraparound vacuum need not revisit the page.\u003c/p\u003e\n\u003cp\u003eThe map is conservative in the sense that we make sure that whenever a bit is set, we know the condition is true, but if a bit is not set, it might or might not be true. Visibility map bits are only set by vacuum, but are cleared by any data-modifying operations on a page.\u003c/p\u003e\n\u003cp\u003eThe \u003ca class=\"xref\" href=\"/docs/18/pgvisibility.html\" title=\"F.36. pg_visibility — visibility map information and utilities\"\u003epg_visibility\u003c/a\u003e module can be used to examine the information stored in the visibility map.\u003c/p\u003e\n\u003c/div\u003e","manual_path":"/docs/18/storage-vm.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-vm.html","sha256":"26b3512091ad6215922297afdfbf457448a1d6dee9b2df2c69ed5b25cd3df5e0","url":"/docs/18/storage-vm.html"}],"tables":[],"tables_zh":[],"zh_from":{"authored_translation":"source-derived-identity","body_sha256":"2d88da811c1a747af1d7507eab645cd6482eb035b909bf59e873f40766c9e48c","kind":"same-version-chinese-manual-with-source-derived-identity","manual":{"anchor":"","build_id":107,"extraction":"concept-introduction","fragment_sha256":"890c28888be9f2fe36ae509f1e884ecb26862ca6a2ae47b80d2023295fd43dc1","locale":"zh-Hans","page_key":"storage-vm.html","source_hash":"569d48a296e4e78eb68cc45822d94be42f95c8a8c94601f63812e473178422a0","source_revision":"unknown:rendered-translation-baseline","translated_from_revision":null,"translation_revision":"git:b1b500221dbe5437cfca004d6b04d3f6e422765d;html-sha256:08e987a66af27b98444a8057c256314eafa13611a3fb9e888214fc436824244b","url":"/zh/docs/18/storage-vm.html","version":"18"},"runtime_rerun":false,"source_facts_revision":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f"}},"ManualEvidence":{"manual_path":"/docs/18/storage-vm.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-vm.html","sha256":"26b3512091ad6215922297afdfbf457448a1d6dee9b2df2c69ed5b25cd3df5e0","url":"/docs/18/storage-vm.html"}]},"MeasuredEvidence":{}},"Text":{"Collection":"storage","Key":"storage-vm","SourceDatabase":"center","Version":"18","Locale":"en","Title":"Visibility Map","Summary":"Each heap relation has a Visibility Map (VM) to keep track of which pages contain only tuples that are known to be visible to all active transactions; it also keeps track of which pages contain only frozen tuples. It's stored alongside the main relation data in a separate relation fork, named after the filenode number of the relation, plus a _vm suffix. For example, if the filenode of a relation is 12345, the VM is stored in a file called 12345_vm , in the same directory as the main relation file. Note that indexes do not have VMs.","BodyHTML":"\u003cdiv\u003e\n\u003cdiv\u003e\n\u003cdiv\u003e\n\u003cdiv\u003e\n\u003ch2\u003e66.4. Visibility Map \u003c/h2\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\u003cp\u003eEach heap relation has a Visibility Map (VM) to keep track of which pages contain only tuples that are known to be visible to all active transactions; it also keeps track of which pages contain only frozen tuples. 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_vm\u003c/code\u003e suffix. For example, if the filenode of a relation is 12345, the VM is stored in a file called \u003ccode\u003e12345_vm\u003c/code\u003e, in the same directory as the main relation file. Note that indexes do not have VMs.\u003c/p\u003e\n\u003cp\u003eThe visibility map stores two bits per heap page. The first bit, if set, indicates that the page is all-visible, or in other words that the page does not contain any tuples that need to be vacuumed. This information can also be used by \u003ca href=\"/docs/18/indexes-index-only-scans.html\" rel=\"nofollow\"\u003e\u003cem\u003eindex-only scans\u003c/em\u003e\u003c/a\u003e to answer queries using only the index tuple. The second bit, if set, means that all tuples on the page have been frozen. That means that even an anti-wraparound vacuum need not revisit the page.\u003c/p\u003e\n\u003cp\u003eThe map is conservative in the sense that we make sure that whenever a bit is set, we know the condition is true, but if a bit is not set, it might or might not be true. Visibility map bits are only set by vacuum, but are cleared by any data-modifying operations on a page.\u003c/p\u003e\n\u003cp\u003eThe \u003ca href=\"/docs/18/pgvisibility.html\" rel=\"nofollow\"\u003epg_visibility\u003c/a\u003e module can be used to examine the information stored in the visibility map.\u003c/p\u003e\n\u003c/div\u003e","SourceRevision":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f","ContentHash":"8beb510a1b2da74d1c7780556a98e81d6c4bc17c2c63cdc75b1998886db30a0f","Payload":{"description":["Each heap relation has a Visibility Map (VM) to keep track of which pages contain only tuples that are known to be visible to all active transactions; it also keeps track of which pages contain only frozen tuples. It's stored alongside the main relation data in a separate relation fork, named after the filenode number of the relation, plus a _vm suffix. For example, if the filenode of a relation is 12345, the VM is stored in a file called 12345_vm , in the same directory as the main relation file. Note that indexes do not have VMs."],"manual_html":"\u003cdiv class=\"sect1\"\u003e\n\u003cdiv class=\"titlepage\"\u003e\n\u003cdiv\u003e\n\u003cdiv\u003e\n\u003ch2 class=\"title\"\u003e66.4. Visibility Map \u003c/h2\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\u003cp\u003eEach heap relation has a Visibility Map (VM) to keep track of which pages contain only tuples that are known to be visible to all active transactions; it also keeps track of which pages contain only frozen tuples. 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_vm\u003c/code\u003e suffix. For example, if the filenode of a relation is 12345, the VM is stored in a file called \u003ccode class=\"filename\"\u003e12345_vm\u003c/code\u003e, in the same directory as the main relation file. Note that indexes do not have VMs.\u003c/p\u003e\n\u003cp\u003eThe visibility map stores two bits per heap page. The first bit, if set, indicates that the page is all-visible, or in other words that the page does not contain any tuples that need to be vacuumed. This information can also be used by \u003ca class=\"link\" href=\"/docs/18/indexes-index-only-scans.html\" title=\"11.9. Index-Only Scans and Covering Indexes\"\u003e\u003cem class=\"firstterm\"\u003eindex-only scans\u003c/em\u003e\u003c/a\u003e to answer queries using only the index tuple. The second bit, if set, means that all tuples on the page have been frozen. That means that even an anti-wraparound vacuum need not revisit the page.\u003c/p\u003e\n\u003cp\u003eThe map is conservative in the sense that we make sure that whenever a bit is set, we know the condition is true, but if a bit is not set, it might or might not be true. Visibility map bits are only set by vacuum, but are cleared by any data-modifying operations on a page.\u003c/p\u003e\n\u003cp\u003eThe \u003ca class=\"xref\" href=\"/docs/18/pgvisibility.html\" title=\"F.36. pg_visibility — visibility map information and utilities\"\u003epg_visibility\u003c/a\u003e module can be used to examine the information stored in the visibility map.\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}
