{"Entry":{"collection":"storage","key":"storage-vm","name":"Visibility Map","aliases":[],"metadata":{"aliases":[],"category":"Physical structures","content_hash":"d437137bb8fcfdb4a82465c408863dafd81704854b7bde4b6e182a103757f979","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."],"facts":[{"label":"Definition scope","value":"Same-version core physical storage documentation"}],"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":[],"signature":"","sources":[{"label":"PostgreSQL 18 English manual","path":"storage-vm.html","sha256":"26b3512091ad6215922297afdfbf457448a1d6dee9b2df2c69ed5b25cd3df5e0","url":"/docs/18/storage-vm.html"}],"tables":[]},"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":"zh-Hans","Fallback":true,"Versions":["10","11","12","13","14","15","16","17","18","19","20"],"Locales":["en"],"Signatures":null,"Spellings":null,"SQLState":null,"Evidence":null}
