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

From Peter Geoghegan
Subject Re: Returning nbtree posting list TIDs in DESC order during backwards scans
Date
Msg-id CAH2-WzmqUpoVVZEu51SOpcxf9OvueLnzr1yE0ZMmcNHarDdFPw@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
On Wed, Dec 10, 2025 at 5:33 PM Peter Geoghegan <pg@bowt.ie> wrote:
> I did have a comment like that at one point, but I felt that it didn't
> quite make sense to keep it. Such a comment would address how things
> used to work, not how they work now (also how they really should have
> worked all along).

On second thought, you (Victor) had this right: we really should have
such a comment.

I must have forgotten that the loop in _bt_killitems doesn't iterate
through so->currPos.items[] directly; it iterates through
killedItems[]. Earlier versions of the patch (that fully got rid of
killedItems) *directly* looped over so->currPos.items[], but the
committed version doesn't work that way.

I pushed a commit just now that adds a comment to clarify the
situation. It specifically mentions posting list tuples, per your
suggestion. (The commit also adds a documenting assertion to verify
leaf page order within the _bt_killitems loop.)

Thanks
--
Peter Geoghegan



pgsql-hackers by date:

Previous
From: "Euler Taveira"
Date:
Subject: Re: not translating backend types for ps and log_line_prefix
Next
From: "Euler Taveira"
Date:
Subject: Re: log_min_messages per backend type