{
  "status": "shipping",
  "advantages": [],
  "limitations": [],
  "supersedes": [],
  "supersededBy": [],
  "firstSeen": null,
  "lastSeen": null,
  "updated": "2026-11-18",
  "slug": "postgresql-bitmap-index-scan",
  "term": "Bitmap index scan (PostgreSQL)",
  "aliases": [
    "PostgreSQL bitmap index scan"
  ],
  "definition": "A PostgreSQL bitmap index scan builds an in-memory bitmap of candidate table locations from an index search.",
  "note": "Plan stage: A Bitmap Index Scan can search an ordinary B-tree index. Its name describes how candidate locations are returned, not a persistent bitmap-index storage format. BitmapAnd and BitmapOr can combine several searches before table access. [pg-bitmap] [pg-bitmap-index]\n\nOrder: The following heap scan visits candidate pages in physical order, losing the original index-key order. An ORDER BY may therefore require a separate sort. Building and combining bitmaps adds work, so additional usable indexes do not guarantee this plan is cheaper. [pg-bitmap]\n\nPrecision: Exact bitmap entries retain tuple offsets; lossy entries retain only candidate pages. A work_mem-derived budget can trigger loss of offset precision. BRIN can supply lossy page candidates from its range summaries independently of this memory pressure. [pg-tidbitmap] [pg-bitmap-index] [pg-brin-bitmap]\n\nBoundary: Candidate addresses do not establish snapshot visibility or complete predicate satisfaction. Exact entries can carry a recheck flag; the heap scan handles visibility and required rechecks. [pg-tidbitmap] [pg-heap-bitmap]",
  "related": [
    "postgresql-bitmap-heap-scan",
    "bitmap-index"
  ],
  "citations": [
    {
      "id": "pg-bitmap",
      "title": "PostgreSQL 18: Combining Multiple Indexes",
      "url": "https://www.postgresql.org/docs/18/indexes-bitmap-scans.html",
      "accessed": "2026-11-18"
    },
    {
      "id": "pg-tidbitmap",
      "title": "PostgreSQL REL_18_0: TID bitmap precision, recheck flags and intersections",
      "url": "https://github.com/postgres/postgres/blob/REL_18_0/src/backend/nodes/tidbitmap.c",
      "accessed": "2026-11-18"
    },
    {
      "id": "pg-bitmap-index",
      "title": "PostgreSQL REL_18_0: bitmap index scan and work_mem budget",
      "url": "https://github.com/postgres/postgres/blob/REL_18_0/src/backend/executor/nodeBitmapIndexscan.c",
      "accessed": "2026-11-18"
    },
    {
      "id": "pg-brin-bitmap",
      "title": "PostgreSQL 18: BRIN candidate pages and lossy scans",
      "url": "https://www.postgresql.org/docs/18/brin.html",
      "accessed": "2026-11-18"
    },
    {
      "id": "pg-heap-bitmap",
      "title": "PostgreSQL REL_18_0: heap bitmap visibility and tuple retrieval",
      "url": "https://github.com/postgres/postgres/blob/REL_18_0/src/backend/access/heap/heapam_handler.c",
      "accessed": "2026-11-18"
    }
  ],
  "provenance": [
    "PostgreSQL 18 documentation and REL_18_0 source synthesis; no new database execution or performance measurement."
  ]
}
