Avoid displaying unnecessary "Recheck Cond" in EXPLAIN ANALYZE output if the bitmap is non-lossy
Hackorum builds and tests every patch posted to the lists, not only commitfest submissions. This is Hackorum's own CI rather than the PostgreSQL project's, and it is still under testing - please report anything that looks wrong.
You can run a PostgreSQL built from this patch straight from Docker, with no checkout and no build:
docker run --rm -p 5432:5432 ghcr.io/hackorum-dev/postgres-patch:t42833psql -h localhost -U postgresBuilt from patchset v1 (message #1), July 27, 2026 at 06:48 PM.
Every patchset is also pushed to a branch of our PostgreSQL fork, so you can check out the same tree CI built. Without a PostgreSQL checkout:
git clone --branch t42833_1 https://github.com/hackorum-dev/postgres.gitIn a checkout you already have, add the fork once:
git remote add hackorum https://github.com/hackorum-dev/postgres.gitthen, for this patchset and every later one:
git fetch hackorum t42833_1 && git checkout t42833_1Patchset v1 (message #1) is on t42833_1
Hi,
As specified in $subject, if the bitmap constructed by bitmap index
scan is non-lossy i.e. row-level bitmap, then showing "Recheck Cond"
in EXPLAIN ANALYZE output is pointless. However in EXPLAIN without
ANALYZE we can't say the bitmap is actually a non-lossy one, as we
don't actually construct the "original" bitmap, so showing "Recheck
Cond" in this case makes sense.
Attaching a small patch that corrects EXPLAIN ANALYZE output for bitmap scans.
Note: $subject is identified in [1]https://www.youtube.com/watch?v=UXKYAZOWDgk ---> at 13:50 (mm:ss).
Thoughts?
[1]: https://www.youtube.com/watch?v=UXKYAZOWDgk ---> at 13:50 (mm:ss)
With Regards,
Bharath Rupireddy.
EnterpriseDB: http://www.enterprisedb.com
Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com> writes:
As specified in $subject, if the bitmap constructed by bitmap index
scan is non-lossy i.e. row-level bitmap, then showing "Recheck Cond"
in EXPLAIN ANALYZE output is pointless. However in EXPLAIN without
ANALYZE we can't say the bitmap is actually a non-lossy one, as we
don't actually construct the "original" bitmap, so showing "Recheck
Cond" in this case makes sense.
I do not think this change makes even a little bit of sense.
The recheck condition is part of the plan structure, it is not
execution statistics.
I compare this proposal to having EXPLAIN suppress plan tree nodes
entirely if they weren't executed. We don't do that and it
wouldn't be an improvement. Especially not for non-text output
formats, where the schema of fields that are presented ought to
be fixed for any given plan tree.
regards, tom lane