Bitmap index scan (PostgreSQL)
A PostgreSQL bitmap index scan builds an in-memory bitmap of candidate table locations from an index search.
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. [1] [3]
Order: 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. [1]
Precision: 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. [2] [3] [4]
Boundary: 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. [2] [5]
Relations
Citations
- PostgreSQL 18: Combining Multiple Indexes
- PostgreSQL REL_18_0: TID bitmap precision, recheck flags and intersections
- PostgreSQL REL_18_0: bitmap index scan and work_mem budget
- PostgreSQL 18: BRIN candidate pages and lossy scans
- PostgreSQL REL_18_0: heap bitmap visibility and tuple retrieval
Sources & caveats
- PostgreSQL 18 documentation and REL_18_0 source synthesis; no new database execution or performance measurement.