Plan nodes · Scans
BitmapAnd
Intersects bitmaps from several indexes.
Combines the bitmaps of two or more Bitmap Index Scans, keeping only pages and rows present in all of them, so one query can use separate indexes on two columns (WHERE a = 1 AND b = 2).
Example
SELECT * FROM tracks WHERE album_id < 300 AND ms < 70000
4 nodes
- Bitmap Heap Scan on tracksrows 32 (estimated 30) cost 63.08..167.48 buffers: 29 hit, 8 readrecheck
((album_id < 300) AND (ms < 70000))26 exact heap blocks- Bitmap Index Scan using tracks_albumrows 1,495 (estimated 1,443) cost 0..23.11 buffers: 2 hit, 2 readindex condition
(album_id < 300)1 index searches - Bitmap Index Scan using tracks_msrows 2,082 (estimated 2,054) cost 0..39.7 buffers: 1 hit, 6 readindex condition
(ms < 70000)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 Index Scan · Bitmap Heap Scan · 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