public inbox for [email protected]
help / color / mirror / Atom feedFrom: Yugo Nagata <[email protected]>
To: Pgsql Hackers <[email protected]>
Subject: Add a berief general comment on BTScanInsertData's nextkey and backward
Date: Tue, 18 Nov 2025 16:28:01 +0900
Message-ID: <[email protected]> (raw)
Hi,
While reading the nbtree codes, I noticed that the comments on
BTScanInsertData no longer describes the meaning of the nextkey and
backward fields. The comment curently only says:
* See comments in _bt_first for an explanation of the nextkey and backward
* fields.
Detailed comments used to exit here, but they were removed by
c9c0589fda0e, I guess, because the semantic changed when
the optimazation for backward scans was introduced. However, having
a brief, general description here is still useful for readers.
I've attached a patch that adds the following comment:
+ * nextkey determines how the scankey's boundary is interpreted, and backward
+ * indicates a backward scan. See comments in _bt_first for a more detailed
+ * explanation of these fields.
What do think?
Regards,
Yugo Nagata
--
Yugo Nagata <[email protected]>
Attachments:
[text/x-diff] add_brief_general_comment_on_BTScanInsertData_nextkey.patch (813B, 2-add_brief_general_comment_on_BTScanInsertData_nextkey.patch)
download | inline diff:
diff --git a/src/include/access/nbtree.h b/src/include/access/nbtree.h
index 16be5c7a9c1..581e200a3cf 100644
--- a/src/include/access/nbtree.h
+++ b/src/include/access/nbtree.h
@@ -774,8 +774,9 @@ typedef BTStackData *BTStack;
* bit, but may not when inserting into an INCLUDE index (tuple header value
* is affected by the NULL-ness of both key and non-key attributes).
*
- * See comments in _bt_first for an explanation of the nextkey and backward
- * fields.
+ * nextkey determines how the scankey's boundary is interpreted, and backward
+ * indicates a backward scan. See comments in _bt_first for a more detailed
+ * explanation of these fields.
*
* scantid is the heap TID that is used as a final tiebreaker attribute. It
* is set to NULL when index scan doesn't need to find a position for a
view thread (4+ messages) latest in thread
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: [email protected]
Cc: [email protected]
Subject: Re: Add a berief general comment on BTScanInsertData's nextkey and backward
In-Reply-To: <[email protected]>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox