Re: Incorrect result of bitmap heap scan.

Andres Freund <andres@anarazel.de>

From: Andres Freund <andres@anarazel.de>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Matthias van de Meent <boekewurm+postgres@gmail.com>, vignesh C <vignesh21@gmail.com>, Peter Geoghegan <pg@bowt.ie>, Andrew Dunstan <andrew@dunslane.net>, Melanie Plageman <melanieplageman@gmail.com>, Thomas Munro <thomas.munro@gmail.com>, Konstantin Knizhnik <knizhnik@garret.ru>, PostgreSQL Hackers <pgsql-hackers@postgresql.org>, Alexander Kuzmenkov <akuzmenkov@timescale.com>
Date: 2025-04-02T19:36:24Z
Lists: pgsql-hackers
Hi,

On 2025-04-02 14:17:01 -0400, Tom Lane wrote:
> Andres Freund <andres@anarazel.de> writes:
> > Does anybody have an opinion about how non-invasive to be in the
> > back-branches? The minimal version is something like this diff:
> 
> Minimal is good -- less chance of breaking anything.
> 
> > - Should we commit the test showing that the naive implementation of
> >   index-only-bitmap-heapscan is broken, in case somebody wants to re-introduce
> >   it?
> 
> Seems like a good idea.  Agreed on HEAD-only for that.

Pushed that way.

Thanks for the report and the fix!

Greetings,

Andres Freund



Commits

  1. Add test for HeapBitmapScan's broken skip_fetch optimization

  2. Remove HeapBitmapScan's skip_fetch optimization

  3. Allow bitmap scans to operate as index-only scans when possible.