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

From: Peter Geoghegan <pg(at)bowt(dot)ie>
To: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Bug in nbtree SAOP scans with non-required arrays, truncated high key
Date: 2025-02-18 14:53:53
Message-ID: CAH2-Wz=F_xmrpK8uVDFO5h5vomfaeNAY=-HM05A+rUb+v4FPzA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Feb 18, 2025 at 8:34 AM Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Greg Sabino Mullane 2025-02-18 14:57:18 Re: [Feature Request] INSERT FROZEN to Optimize Large Cold Data Imports and Migrations
Previous Message Sami Imseih 2025-02-18 14:48:43 Re: pg_stat_statements and "IN" conditions