Re: Returning nbtree posting list TIDs in DESC order during backwards scans - Mailing list pgsql-hackers

From Victor Yegorov
Subject Re: Returning nbtree posting list TIDs in DESC order during backwards scans
Date
Msg-id CAGnEboj3=DaCoar=CSiHLwxFP1GhAOsAhhkj0=6JjvgE=q54gQ@mail.gmail.com
Whole thread Raw
In response to Re: Returning nbtree posting list TIDs in DESC order during backwards scans  (Peter Geoghegan <pg@bowt.ie>)
List pgsql-hackers
ср, 3 дек. 2025 г. в 06:09, Peter Geoghegan <pg@bowt.ie>:
Coming back to this patch now, after several months of work on index
prefetching.

I decided that it wasn't such a great idea to reuse/steal an unused
"itemDead" bit from the BTScanPosItem.itemOffset field after all. That
forces _bt_killitems to iterate through every so->currPos.item[], not
just those that are known to require LP_DEAD marking.

Tomas Vondra suggested that I keep killedItems as a separate
allocation (as it is on master), while using a Bitmapset to represent
killedItems (unlike on master, where it is represented using a simple
array). This has all of the same advantages as my previous approach,
but doesn't have the aforementioned disadvantages within _bt_killitems
(plus we no longer need to change BTScanPosItem in any way).

Attached is v4, which does it that way.

My plan is to commit this improved version in the next couple of days.

--
Peter Geoghegan

Patch looks fine, applies and compiles cleanly, passes tests.

I'd like to point out a missing space after the dot in the 2nd para of the commit message,
falls out of style.

--
Victor Yegorov

pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: Cleanup shadows variable warnings, round 1
Next
From: Mircea Cadariu
Date:
Subject: Re: Returning nbtree posting list TIDs in DESC order during backwards scans