Skip to content

Commit 7e62a53

Browse files
author
Commitfest Bot
committed
[CF 5973] v1 - Clarify comment in _bt_set_startikey
This branch was automatically generated by a robot using patches from an email thread registered at: https://commitfest.postgresql.org/patch/5973 The branch will be overwritten each time a new patch version is posted to the thread, and also periodically to check for bitrot caused by changes on the master branch. Patch(es): https://www.postgresql.org/message-id/[email protected] Author(s): Chao Li
2 parents 88824e6 + ad7d489 commit 7e62a53

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/backend/access/nbtree/nbtutils.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2435,9 +2435,12 @@ _bt_set_startikey(IndexScanDesc scan, BTReadPageState *pstate)
24352435
int32 result;
24362436

24372437
/*
2438-
* Determine if it's safe to set pstate.startikey to an offset to a
2439-
* key that comes after this key, by examining this key
2440-
*/
2438+
* Determine whether we can set pstate.startikey to a later key offset,
2439+
* ensuring that all earlier scan keys are satisfied by every tuple on
2440+
* the current page. This is done by comparing the key against the first
2441+
* and last tuples on the page.
2442+
*/
2443+
24412444
if (!(key->sk_flags & (SK_BT_REQFWD | SK_BT_REQBKWD)))
24422445
{
24432446
/* Scan key isn't marked required (corner case) */

0 commit comments

Comments
 (0)