pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter Geoghegan <pg@bowt.ie>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Clarify nbtree parallel scan _bt_endpoint contract.
Date: Mon, 04 Nov 2024 14:06:09 +0000
Message-ID: <E1t7xib-0008kG-9L@gemulon.postgresql.org> (raw)

Clarify nbtree parallel scan _bt_endpoint contract.

_bt_endpoint is a helper function for _bt_first that's called whenever
no useful insertion scan key can be used, and we need to lock and read
either the leftmost or rightmost leaf page in the index.  Simplify and
document its preconditions, relieving its _bt_first caller from having
to end the parallel scan when it returns false.

Also stop unnecessarily invalidating the current scan position in nearby
code in both _bt_first and _bt_endpoint.  This seems to have been
copy-pasted from _bt_readnextpage, where invalidating the scan's current
position really is necessary.

Follow-up to the refactoring work in commit 1bd4bc85.

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/62620b6aadcedf453989e6b426f6ef3284c64bed

Modified Files
--------------
src/backend/access/nbtree/nbtree.c    |  4 +++-
src/backend/access/nbtree/nbtsearch.c | 40 ++++++++++++-----------------------
2 files changed, 17 insertions(+), 27 deletions(-)



Message-ID: <E1t7xib-0008kG-9L@gemulon.postgresql.org>
Permalink:  ../E1t7xib-0008kG-9L@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1t7xib-0008kG-9L@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: pg@bowt.ie, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Clarify nbtree parallel scan _bt_endpoint contract.
  In-Reply-To: <E1t7xib-0008kG-9L@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox