Bitmap heap scan (PostgreSQL)
A PostgreSQL bitmap heap scan retrieves visible table tuples selected by a bitmap and performs any required predicate rechecks.
Selection: Exact bitmap entries retain tuple offsets, while lossy entries retain candidate pages. Heap access applies snapshot visibility; an index location is not itself a visible result row. [2] [5]
Rechecks: Exact locations do not guarantee exact predicate matches. An exact page has a separate recheck flag; intersecting exact offsets with a lossy page can retain the offsets but require predicate verification. Increasing work_mem does not eliminate an index access method's approximate matches. [2] [1]
Reading EXPLAIN: Recheck Cond displays a planned condition, not a count of evaluations. Rows Removed by Index Recheck counts failed rechecks, not every rechecked tuple; Rows Removed by Filter describes a separate filter. Zero recheck removals does not prove no recheck ran. [3] [4]
Units: Removal counts are rounded per-loop averages; exact/lossy Heap Blocks counters are not divided by loops. Neither measures unique physical-device reads. These fields describe candidate processing, not full TOAST-value verification. [4] [6]
Relations
Citations
- PostgreSQL 18: Using EXPLAIN
- PostgreSQL REL_18_0: TID bitmap precision, recheck flags and intersections
- PostgreSQL REL_18_0: bitmap heap scan predicate rechecks
- PostgreSQL REL_18_0: EXPLAIN instrumentation and loop denominators
- PostgreSQL REL_18_0: heap bitmap visibility and tuple retrieval
- PostgreSQL 18: TOAST and deferred external-value retrieval
Sources & caveats
- Counter details refer to PostgreSQL REL_18_0. Documentary comparison with the separate PostgreSQL 16.15 TOAST experiment does not extend its measured coverage.