aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPeter Geoghegan <pg@bowt.ie>2019-08-21 13:50:27 -0700
committerPeter Geoghegan <pg@bowt.ie>2019-08-21 13:50:27 -0700
commit091bd6befcb71feb58b1478e1b976c85ae504822 (patch)
treec7f3375f08cac6501eec1d0897a71adfad5d1b31 /src
parentc45643d618e35ec2fe91438df15abd4f3c0d85ca (diff)
downloadpostgresql-091bd6befcb71feb58b1478e1b976c85ae504822.tar.gz
postgresql-091bd6befcb71feb58b1478e1b976c85ae504822.zip
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.
Diffstat (limited to 'src')
-rw-r--r--src/backend/access/nbtree/nbtsort.c2
-rw-r--r--src/backend/access/nbtree/nbtsplitloc.c4
-rw-r--r--src/include/access/nbtree.h7
3 files changed, 8 insertions, 5 deletions
diff --git a/src/backend/access/nbtree/nbtsort.c b/src/backend/access/nbtree/nbtsort.c
index e678690b18e..ab196920064 100644
--- a/src/backend/access/nbtree/nbtsort.c
+++ b/src/backend/access/nbtree/nbtsort.c
@@ -953,7 +953,7 @@ _bt_buildadd(BTWriteState *wstate, BTPageState *state, IndexTuple itup)
*
* We don't try to bias our choice of split point to make it more
* likely that _bt_truncate() can truncate away more attributes,
- * whereas the split point passed to _bt_split() is chosen much
+ * whereas the split point used within _bt_split() is chosen much
* more delicately. Suffix truncation is mostly useful because it
* improves space utilization for workloads with random
* insertions. It doesn't seem worthwhile to add logic for
diff --git a/src/backend/access/nbtree/nbtsplitloc.c b/src/backend/access/nbtree/nbtsplitloc.c
index a7882fd8742..1c1029b6c4d 100644
--- a/src/backend/access/nbtree/nbtsplitloc.c
+++ b/src/backend/access/nbtree/nbtsplitloc.c
@@ -1060,7 +1060,7 @@ _bt_split_penalty(FindSplitData *state, SplitPoint *split)
}
/*
- * Subroutine to get a lastleft IndexTuple for a spit point from page
+ * Subroutine to get a lastleft IndexTuple for a split point from page
*/
static inline IndexTuple
_bt_split_lastleft(FindSplitData *state, SplitPoint *split)
@@ -1076,7 +1076,7 @@ _bt_split_lastleft(FindSplitData *state, SplitPoint *split)
}
/*
- * Subroutine to get a firstright IndexTuple for a spit point from page
+ * Subroutine to get a firstright IndexTuple for a split point from page
*/
static inline IndexTuple
_bt_split_firstright(FindSplitData *state, SplitPoint *split)
diff --git a/src/include/access/nbtree.h b/src/include/access/nbtree.h
index 7e54c456f7d..52eafe6b000 100644
--- a/src/include/access/nbtree.h
+++ b/src/include/access/nbtree.h
@@ -406,8 +406,11 @@ typedef struct BTMetaPageData
* BTStackData -- As we descend a tree, we push the location of pivot
* tuples whose downlink we are about to follow onto a private stack. If
* we split a leaf, we use this stack to walk back up the tree and insert
- * data into its parent page at the correct location. We may also have to
- * recursively split a grandparent of the leaf page (and so on).
+ * data into its parent page at the correct location. We also have to
+ * recursively insert into the grandparent page if and when the parent page
+ * splits. Our private stack can become stale due to concurrent page
+ * splits and page deletions, but it should never give us an irredeemably
+ * bad picture.
*/
typedef struct BTStackData
{