Skip to content

Commit 091bd6b

Browse files
Update comments on nbtree stack struct.
Adjust the struct comment that describes how page splits use their descent stack to cascade up the tree from the leaf level. In passing, fix up some unrelated nbtree comments that had typos or were obsolete.
1 parent c45643d commit 091bd6b

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

src/backend/access/nbtree/nbtsort.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -953,7 +953,7 @@ _bt_buildadd(BTWriteState *wstate, BTPageState *state, IndexTuple itup)
953953
*
954954
* We don't try to bias our choice of split point to make it more
955955
* likely that _bt_truncate() can truncate away more attributes,
956-
* whereas the split point passed to _bt_split() is chosen much
956+
* whereas the split point used within _bt_split() is chosen much
957957
* more delicately. Suffix truncation is mostly useful because it
958958
* improves space utilization for workloads with random
959959
* insertions. It doesn't seem worthwhile to add logic for

src/backend/access/nbtree/nbtsplitloc.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -1060,7 +1060,7 @@ _bt_split_penalty(FindSplitData *state, SplitPoint *split)
10601060
}
10611061

10621062
/*
1063-
* Subroutine to get a lastleft IndexTuple for a spit point from page
1063+
* Subroutine to get a lastleft IndexTuple for a split point from page
10641064
*/
10651065
static inline IndexTuple
10661066
_bt_split_lastleft(FindSplitData *state, SplitPoint *split)
@@ -1076,7 +1076,7 @@ _bt_split_lastleft(FindSplitData *state, SplitPoint *split)
10761076
}
10771077

10781078
/*
1079-
* Subroutine to get a firstright IndexTuple for a spit point from page
1079+
* Subroutine to get a firstright IndexTuple for a split point from page
10801080
*/
10811081
static inline IndexTuple
10821082
_bt_split_firstright(FindSplitData *state, SplitPoint *split)

src/include/access/nbtree.h

+5-2
Original file line numberDiff line numberDiff line change
@@ -406,8 +406,11 @@ typedef struct BTMetaPageData
406406
* BTStackData -- As we descend a tree, we push the location of pivot
407407
* tuples whose downlink we are about to follow onto a private stack. If
408408
* we split a leaf, we use this stack to walk back up the tree and insert
409-
* data into its parent page at the correct location. We may also have to
410-
* recursively split a grandparent of the leaf page (and so on).
409+
* data into its parent page at the correct location. We also have to
410+
* recursively insert into the grandparent page if and when the parent page
411+
* splits. Our private stack can become stale due to concurrent page
412+
* splits and page deletions, but it should never give us an irredeemably
413+
* bad picture.
411414
*/
412415
typedef struct BTStackData
413416
{

0 commit comments

Comments
 (0)