Re: Bug in nbtree optimization to skip > operator comparisons (or < comparisons in backwards scans) - Mailing list pgsql-hackers

From Alexander Korotkov
Subject Re: Bug in nbtree optimization to skip > operator comparisons (or < comparisons in backwards scans)
Date
Msg-id CAPpHfdtVwQioxmmUvWMHZVdRtGV=_uocMfM5Bqvt3R00Tm8n7w@mail.gmail.com
Whole thread Raw
In response to Re: Bug in nbtree optimization to skip > operator comparisons (or < comparisons in backwards scans)  (Peter Geoghegan <pg@bowt.ie>)
Responses Re: Bug in nbtree optimization to skip > operator comparisons (or < comparisons in backwards scans)
Re: Bug in nbtree optimization to skip > operator comparisons (or < comparisons in backwards scans)
List pgsql-hackers
Hi, Peter!

On Wed, Dec 6, 2023 at 3:46 AM Peter Geoghegan <pg@bowt.ie> wrote:
> On Tue, Dec 5, 2023 at 4:41 PM Peter Geoghegan <pg@bowt.ie> wrote:
> > "In general, when inequality keys are present, the initial-positioning
> > code only promises to position before the first possible match, not
> > exactly at the first match, for a forward scan; or after the last
> > match for a backward scan."
> >
> > My test case mostly just demonstrates how to reproduce the scenario
> > described by this sentence.
>
> I just realized that my test case wasn't quite minimized correctly. It
> depended on a custom function that was no longer created.
>
> Attached is a revised version that uses btint84cmp instead.

Thank you for raising this issue.  Preprocessing of btree scan keys is
normally removing the redundant scan keys.  However, redundant scan
keys aren't removed when they have arguments of different types.
Please give me a bit of time to figure out how to workaround this.

------
Regards,
Alexander Korotkov



pgsql-hackers by date:

Previous
From: Junwang Zhao
Date:
Subject: Re: Make COPY format extendable: Extract COPY TO format implementations
Next
From: vignesh C
Date:
Subject: Re: [PoC] pg_upgrade: allow to upgrade publisher node