Plan nodes · Scans
BitmapOr
Unites bitmaps from several indexes.
Combines bitmaps, keeping what is in any of them. This is how PostgreSQL uses indexes for an OR of conditions on different columns.
Example
SELECT * FROM tracks WHERE album_id = 5 OR ms = 123456
4 nodes
- Bitmap Heap Scan on tracksrows 6 (estimated 6) cost 8.63..31.29 buffers: 7 hit, 3 readrecheck
((album_id = 5) OR (ms = 123456))6 exact heap blocks- BitmapOrrows 0 (estimated 6) cost 8.63..8.63 buffers: 1 hit, 3 read
- Bitmap Index Scan using tracks_albumrows 5 (estimated 5) cost 0..4.33 buffers: 0 hit, 2 readindex condition
(album_id = 5)1 index searches - Bitmap Index Scan using tracks_msrows 1 (estimated 1) cost 0..4.3 buffers: 1 hit, 1 readindex condition
(ms = 123456)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 · BitmapAnd · 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