{
  "status": "shipping",
  "advantages": [],
  "limitations": [],
  "supersedes": [],
  "supersededBy": [],
  "firstSeen": null,
  "lastSeen": null,
  "updated": "2026-10-22",
  "slug": "postgresql-visibility-map",
  "term": "Visibility map (PostgreSQL)",
  "aliases": [
    "PostgreSQL visibility map"
  ],
  "definition": "A PostgreSQL visibility map records all-visible and all-frozen status for each heap page in a separate relation fork.",
  "note": "The all-visible bit supports skipping heap visibility checks during index-only scans. The all-frozen bit records that the page needs no further freezing until it changes. Indexes do not have their own visibility maps. [vm] [pgvisibility]\n\nThe map is conservative: a clear bit does not establish that the corresponding property is false. Ordinary data changes clear map bits, and vacuum establishes them. A tuple-header hint bit and the heap page's PD_ALL_VISIBLE flag are separate metadata, not alternative names for the map. [vm] [pgvisibility]\n\npg_visibility_map_summary counts marked pages from the map; it is not a comparison against every stored payload. Functions inspecting PD_ALL_VISIBLE also read heap pages. Choosing an inspection function therefore changes read coverage. Visibility metadata does not certify content integrity. [pgvisibility]\n\nVACUUM uses conservative transaction horizons when establishing all-visible status. The REL_16_15 implementation considers an assigned transaction ID as well as snapshot xmin; a null backend_xmin therefore does not alone exclude a session's effect. The controlled insert-only study separates BEGIN-only, retained-snapshot and assigned-XID states, without equating all-visible marking with content verification. [horizon-code] [vacuum-code] [horizon-study]",
  "related": [
    "postgresql-index-only-scan",
    "hint-bit",
    "postgresql-toast",
    "checksum"
  ],
  "citations": [
    {
      "id": "vm",
      "title": "PostgreSQL 16: Visibility Map",
      "url": "https://www.postgresql.org/docs/16/storage-vm.html",
      "accessed": "2026-10-21"
    },
    {
      "id": "pgvisibility",
      "title": "PostgreSQL 16: pg_visibility functions and page-level visibility",
      "url": "https://www.postgresql.org/docs/16/pgvisibility.html",
      "accessed": "2026-10-21"
    },
    {
      "id": "horizon-code",
      "title": "PostgreSQL REL_16_15: ComputeXidHorizons, snapshot and assigned-XID cutoffs",
      "url": "https://github.com/postgres/postgres/blob/7d3e000c5961a544302072058a1184e9a588837b/src/backend/storage/ipc/procarray.c",
      "accessed": "2026-10-22"
    },
    {
      "id": "vacuum-code",
      "title": "PostgreSQL REL_16_15: lazy_scan_prune, all-visible eligibility",
      "url": "https://github.com/postgres/postgres/blob/7d3e000c5961a544302072058a1184e9a588837b/src/backend/access/heap/vacuumlazy.c",
      "accessed": "2026-10-22"
    },
    {
      "id": "horizon-study",
      "title": "Hesela: PostgreSQL transaction horizons, three controlled 16.15 executions",
      "url": "https://hesela.dev/research/postgresql-snapshot-horizon/README.md",
      "accessed": "2026-10-22"
    }
  ],
  "provenance": [
    "Describes PostgreSQL 16 visibility metadata. A count of marked pages is distinct from validation of the map or expected application content."
  ]
}
