Re: Incorrect result of bitmap heap scan.

Andres Freund <andres@anarazel.de>

From: Andres Freund <andres@anarazel.de>
To: "Core Studios Inc." <corestudiosinc@gmail.com>
Cc: Matthias van de Meent <boekewurm+postgres@gmail.com>, Peter Geoghegan <pg@bowt.ie>, Tom Lane <tgl@sss.pgh.pa.us>, 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-09-16T15:25:14Z
Lists: pgsql-hackers
Hi,

On 2025-09-16 15:55:49 +0300, Core Studios Inc. wrote:
> Following up to correct my previous email: the query plan did not really
> change - we see Bitmap Heap Scans even before the upgrade. Therefore, the
> query plan doesn't seem to have changed after the upgrade.
> 
> However after the upgrade it seems that those queries are doing more disk IO
> (increased index_blocks_read in that table).

Without the query + plan I can't judge whether the query could even have
benefited from the, fairly narrow, optimization...

Greetings,

Andres



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.