Skip to content

Conversation

TKONIY
Copy link

@TKONIY TKONIY commented Mar 11, 2023

A balance splitting for a full node with m max entries is as follows:

For example the Inner Node, m must be even (to support preemptive splitting), thus the number of the key is count=m-1, while count is odd. The node is split into two nodes each with floor(count/2) node, and the center node is inserted into the parent.

In previous implementation, the inner node is split into nodes with count-ceil(count/2)-1 and ceil(count/2) keys. For example, when m=4, the full inner node with 3 keys is split into nodes with 3-ceil(3/2)-1 = 0 and ceil(3/2) = 2 keys. Which is imbalance and conflict with to BTree's definition, that "Every internal node has at least ⌈m/2⌉ children".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant