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

Commit59ab3be

Browse files
Remove dead code from nbtsplitloc.c.
It doesn't make sense to consider the possibility that there will onlybe one candidate split point when choosing among split points to findthe split with the lowest penalty. This is a vestige of an earlierversion of the patch that became commitfab2502.Issue spotted while rereviewing coverage of the nbtree patch seriesusing gcov.
1 parentbd9396a commit59ab3be

File tree

1 file changed

+6
-14
lines changed

1 file changed

+6
-14
lines changed

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

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -520,13 +520,12 @@ _bt_splitcmp(const void *arg1, const void *arg2)
520520
}
521521

522522
/*
523-
* Subroutine to find the "best" split point among an array of acceptable
524-
* candidate split points that split without there being an excessively high
525-
* delta between the space left free on the left and right halves. The "best"
526-
* split point is the split point with the lowest penalty among split points
527-
* that fall within current/final split interval. Penalty is an abstract
528-
* score, with a definition that varies depending on whether we're splitting a
529-
* leaf page or an internal page. See _bt_split_penalty() for details.
523+
* Subroutine to find the "best" split point among candidate split points.
524+
* The best split point is the split point with the lowest penalty among split
525+
* points that fall within current/final split interval. Penalty is an
526+
* abstract score, with a definition that varies depending on whether we're
527+
* splitting a leaf page or an internal page. See _bt_split_penalty() for
528+
* details.
530529
*
531530
* "perfectpenalty" is assumed to be the lowest possible penalty among
532531
* candidate split points. This allows us to return early without wasting
@@ -545,13 +544,6 @@ _bt_bestsplitloc(FindSplitData *state, int perfectpenalty, bool *newitemonleft)
545544
lowsplit;
546545
inthighsplit=Min(state->interval,state->nsplits);
547546

548-
/* No point in calculating penalty when there's only one choice */
549-
if (state->nsplits==1)
550-
{
551-
*newitemonleft=state->splits[0].newitemonleft;
552-
returnstate->splits[0].firstoldonright;
553-
}
554-
555547
bestpenalty=INT_MAX;
556548
lowsplit=0;
557549
for (inti=lowsplit;i<highsplit;i++)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp