diff options
Diffstat (limited to 'src/backend/access/nbtree/README')
-rw-r--r-- | src/backend/access/nbtree/README | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/backend/access/nbtree/README b/src/backend/access/nbtree/README index 2d0f8f4b79a..216d419841c 100644 --- a/src/backend/access/nbtree/README +++ b/src/backend/access/nbtree/README @@ -223,9 +223,10 @@ right to make this happen --- a scan moving in the opposite direction might miss the items if so.) Also, we *never* delete the rightmost page on a tree level (this restriction simplifies the traversal algorithms, as explained below). Page deletion always begins from an empty leaf page. An -internal page can only be deleted as part of a branch leading to a leaf -page, where each internal page has only one child and that child is also to -be deleted. +internal page can only be deleted as part of deleting an entire subtree. +This is always a "skinny" subtree consisting of a "chain" of internal pages +plus a single leaf page. There is one page on each level of the subtree, +and each level/page covers the same key space. Deleting a leaf page is a two-stage process. In the first stage, the page is unlinked from its parent, and marked as half-dead. The parent page must @@ -243,7 +244,12 @@ it, but it's still linked to its siblings. (Note: Lanin and Shasha prefer to make the key space move left, but their argument for doing so hinges on not having left-links, which we have -anyway. So we simplify the algorithm by moving the key space right.) +anyway. So we simplify the algorithm by moving the key space right. This +is only possible because we don't match on a separator key when ascending +the tree during a page split, unlike Lehman and Yao/Lanin and Shasha -- it +doesn't matter if the downlink is re-found in a pivot tuple whose separator +key does not match the one encountered when inserter initially descended +the tree.) To preserve consistency on the parent level, we cannot merge the key space of a page into its right sibling unless the right sibling is a child of |