Re: Incorrect result of bitmap heap scan.

Andres Freund <andres@anarazel.de>

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

Attachments

Hi,

On 2024-12-02 11:31:48 -0500, Andres Freund wrote:
> I think it'd be good if we added a test that shows the failure mechanism so
> that we don't re-introduce this in the future. Evidently this failure isn't
> immediately obvious...

Attached is an isolationtest that reliably shows wrong query results.

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.