Re: Avoiding superfluous buffer locking during nbtree backwards scans - Mailing list pgsql-hackers

From Masahiro Ikeda
Subject Re: Avoiding superfluous buffer locking during nbtree backwards scans
Date
Msg-id 9a86af751108111db4a354bc3c912575@oss.nttdata.com
Whole thread Raw
In response to Avoiding superfluous buffer locking during nbtree backwards scans  (Peter Geoghegan <pg@bowt.ie>)
Responses Re: Avoiding superfluous buffer locking during nbtree backwards scans
List pgsql-hackers
On 2024-11-13 00:55, Peter Geoghegan wrote:
> On Sun, Nov 10, 2024 at 11:36 PM Masahiro Ikeda
> <ikedamsh@oss.nttdata.com> wrote:
>> Thanks! The change made it easier for me to understand.
> 
> As follow-up to all of the recent work in this area, I'd like to add
> this wrapper function to return the next item from so->currPos.
> 
> The wrapper function has extra assertions, compared to what we do
> already. It's slightly more defensive, and IMV slightly clearer.

Thanks, I agree with adding the function for refactoring and including
assertions for moreLeft or moreRight.

One thing I was concerned about is that "if (scan->xs_want_itup)" was
changed to "if (so->currTuples)". However, this isn’t an issue because
so->currTuples is only initialized if scan->xs_want_itup is set to
true in btrescan(), and it improves consistency with other functions
for index-only scans.

I also confirmed that make check-world passes with the patch.

Regards,
-- 
Masahiro Ikeda
NTT DATA CORPORATION



pgsql-hackers by date:

Previous
From: "Hayato Kuroda (Fujitsu)"
Date:
Subject: RE: Commit Timestamp and LSN Inversion issue
Next
From: vignesh C
Date:
Subject: Re: Skip collecting decoded changes of already-aborted transactions