B+树插入 - 理论问题
我一直在尝试了解 B+ 树是如何工作的,并尝试解决示例。
在此处列出的一份此类文件中,在第 8 页给出的示例 1 中。它描述了 B+ 树结构,其中每个节点的 'n' 个搜索关键字值的数量为 4。
一切都按照规则进行,直到第三步,但突然在第四步你看到根节点被分裂,并且其他分裂出现。我明白为什么节点 17,19,21 被分割(这显然没有在文本中显示)。但我很惊讶为什么根会分开。任何人都可以向我澄清这一点,或者提出一个更好的例子,该例子非常复杂,但具有更独特和逐步的方法。
I have been trying to know how B+ Tree works and been trying to solve the examples.
In one such document listed here, in the Example 1 given on page 8. It describes a B+ tree construction, where 'n' number of search key values per node - is given as 4.
Everything goes according to the rules till the third step, but suddenly in the 4th step you see the root node being split, and other splits coming up. I understood why the node 17,19,21 is split(this is apparently not shown in the text). But I'm surprised why the root is split up. Can anyone clarify this to me or suggest a better example which is quite complicated but with a more distinctive and step-by-step approach.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这就是 B 树的工作原理:叶节点被填充,并且在溢出时它们分裂,向上发送 1 个键值。上面的节点也可以分裂,一直到根。
这个例子有点弱,通常除了根之外的所有节点都至少是半满的。但3的一半是1,所以这不是太明显。
This is how B-Trees work: Leaf nodes are filled and on overflow they Split, sending 1 keyvalue up. The node above could then also split, all the way up to the root.
The example is a little weak, normally all nodes except the root are at least half-full. But half of 3 is 1, so this is not too obvious.