Re: Bug in nbtree SAOP scans with non-required arrays, truncated high key - Mailing list pgsql-hackers

From Peter Geoghegan
Subject Re: Bug in nbtree SAOP scans with non-required arrays, truncated high key
Date
Msg-id CAH2-Wz=F_xmrpK8uVDFO5h5vomfaeNAY=-HM05A+rUb+v4FPzA@mail.gmail.com
Whole thread Raw
In response to Re: Bug in nbtree SAOP scans with non-required arrays, truncated high key  (Laurenz Albe <laurenz.albe@cybertec.at>)
List pgsql-hackers
On Tue, Feb 18, 2025 at 8:34 AM Laurenz Albe <laurenz.albe@cybertec.at> wrote:
> Just for the record: a customer just ran into this bug.  REINDEX did
> not fix the bad query result, but update to 17.3 did.

That's surprising, since REINDEX definitely will "fix" my test case
when run on an unpatched server with the bug.

The issue that my repro highlighted hinged upon 2 low-order truncated
attributes. nbtsort.c (used by CREATE INDEX/REINDEX) doesn't care
about making suffix truncation as effective as reasonably possible,
unlike retail inserts + page splits, which use the nbtsplitloc.c logic
for this. This was also why index fillfactor was tuned by the test
case. Basically, the test case is very sensitive to various
parameters.

--
Peter Geoghegan



pgsql-hackers by date:

Previous
From: Sami Imseih
Date:
Subject: Re: pg_stat_statements and "IN" conditions
Next
From: Greg Sabino Mullane
Date:
Subject: Re: [Feature Request] INSERT FROZEN to Optimize Large Cold Data Imports and Migrations