Re: Incorrect result of bitmap heap scan.
Matthias van de Meent <boekewurm+postgres@gmail.com>
From: Matthias van de Meent <boekewurm+postgres@gmail.com>
To: Andres Freund <andres@anarazel.de>
Cc: vignesh C <vignesh21@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-04-02T19:35:06Z
Lists: pgsql-hackers
On Wed, 2 Apr 2025 at 19:48, Andres Freund <andres@anarazel.de> wrote: > > Hi, > > On 2025-04-02 18:58:11 +0200, Matthias van de Meent wrote: > > And here it is, v6 of the patchset, rebased up to master @ 764d501d. > > Thanks! > > Does anybody have an opinion about how non-invasive to be in the > back-branches? The minimal version is something like this diff: [...] > But it seems a bit weird to continue checking SO_NEED_TUPLES (which is what > need_tuples ends up as) in other parts of the code. But it's less work to > backpatch that way. Obviously we can't remove the relevant struct fields in > the backbranches. A minimal version seems fine to me. > Other notes: > > - 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? I'd prefer that, yes. > If so, I think we should not backpatch the test. If it turns out to not be > stable, it's a pain to fix test stability issues over multiple branches. That's fair. But if the reason for not adding a test is potential instability we could just as well add it now and remove it if it actually proves to be unstable. > - We have some superfluous includes in nodeBitmapHeapscan.c - but I think > that's not actually the fault of this patch. Seems the read-stream patch > should have removed the at least the includes of visibilitymap.h, bufmgr.h > and spccache.h? And b09ff53667f math.h... I have no strong opinion about this. Thank you for picking this up! Kind regards, Matthias van de Meent Neon (https://neon.tech)
Commits
-
Add test for HeapBitmapScan's broken skip_fetch optimization
- 24da5b239a4b 18.0 landed
-
Remove HeapBitmapScan's skip_fetch optimization
- 459e7bf8e2f8 18.0 landed
- b9ec8125d167 13.21 landed
- 4934d38759cd 14.18 landed
- 77d90d6d6334 15.13 landed
- 980727b84107 16.9 landed
- 78cb2466f752 17.5 landed
-
Allow bitmap scans to operate as index-only scans when possible.
- 7c70996ebf09 11.0 cited