Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb6558e4

Browse files
nbtree: Remove useless 'strat' local variable.
Remove a local variable that was used to avoid overwriting strat_totalwith the = operator strategy when a >= operator strategy key was alreadyincluded in the initial positioning/insertion scan keys by _bt_first(for backwards scans it would have to be a <= key that was included)._bt_first's strat_total local variable now simply tracks the operatorstrategy of the final scan key that was included in the scan's insertionscan key (barring the case where the !used_all_subkeys row compare pathadjusts strat_total in its own way)._bt_first already treated >= keys (or <= keys) as = keys for initialpositioning purposes. There is no good reason to remember that that waswhat happened; no later _bt_first step cares about the distinction.Note, in particular, that the insertion scan key's 'nextkey' and'backward' fields will be initialized the same way regardless.Author: Peter Geoghegan <pg@bowt.ie>Reviewed-By: Tomas Vondra <tomas@vondra.me>Discussion:https://postgr.es/m/CAH2-Wz=PKR6rB7qbx+Vnd7eqeB5VTcrW=iJvAsTsKbdG+kW_UA@mail.gmail.com
1 parent3c0fd64 commitb6558e4

File tree

1 file changed

+5
-13
lines changed

1 file changed

+5
-13
lines changed

‎src/backend/access/nbtree/nbtsearch.c

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -883,7 +883,6 @@ _bt_first(IndexScanDesc scan, ScanDirection dir)
883883
BTScanOpaqueso= (BTScanOpaque)scan->opaque;
884884
BTStackstack;
885885
OffsetNumberoffnum;
886-
StrategyNumberstrat;
887886
BTScanInsertDatainskey;
888887
ScanKeystartKeys[INDEX_MAX_KEYS];
889888
ScanKeyDatanotnullkeys[INDEX_MAX_KEYS];
@@ -1090,18 +1089,11 @@ _bt_first(IndexScanDesc scan, ScanDirection dir)
10901089
break;
10911090
startKeys[keysz++]=chosen;
10921091

1093-
/*
1094-
* Adjust strat_total, and quit if we have stored a > or <
1095-
* key.
1096-
*/
1097-
strat=chosen->sk_strategy;
1098-
if (strat!=BTEqualStrategyNumber)
1099-
{
1100-
strat_total=strat;
1101-
if (strat==BTGreaterStrategyNumber||
1102-
strat==BTLessStrategyNumber)
1103-
break;
1104-
}
1092+
/* Quit if we have stored a > or < key */
1093+
strat_total=chosen->sk_strategy;
1094+
if (strat_total==BTGreaterStrategyNumber||
1095+
strat_total==BTLessStrategyNumber)
1096+
break;
11051097

11061098
/*
11071099
* Done if that was the last attribute, or if next key is not

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp