Plan nodes · Scans
Bitmap Index Scan
Collects the locations of matching rows from an index into a bitmap.
The first half of a bitmap scan: reads the index and builds an in-memory bitmap of the heap pages (and row positions) that match, without touching the table. Its parent, a Bitmap Heap Scan, then reads those pages in physical order. Bitmaps from several indexes can be combined with BitmapAnd and BitmapOr.
Example
SELECT * FROM tracks WHERE ms BETWEEN 100000 AND 101000
2 nodes
- Bitmap Heap Scan on tracksrows 209 (estimated 219) cost 6.54..527.84 buffers: 209 hit, 3 readrecheck
((ms >= 100000) AND (ms <= 101000))209 exact heap blocks- Bitmap Index Scan using tracks_msrows 209 (estimated 219) cost 0..6.48 buffers: 0 hit, 3 readindex condition
((ms >= 100000) AND (ms <= 101000))1 index searches
Run with EXPLAIN (ANALYZE, BUFFERS, TIMING OFF, SUMMARY OFF) on the sample database, PostgreSQL 19.0. Open it in the EXPLAIN visualizer →
Related
Seq Scan · Index Scan · Index Only Scan · Bitmap Heap Scan · BitmapAnd · BitmapOr · Tid Scan · Tid Range Scan · Sample Scan · Subquery Scan · Function Scan · Table Function Scan · Values Scan · CTE Scan · WorkTable Scan · Named Tuplestore Scan · Foreign Scan · Custom Scan