知识卡片
有序输入的树批量建造
若输入已按键排序,可直接把连续记录填入叶页并写出,再以叶页的边界键和页引用生成内部节点。逐级完成或保留当前写入路径上的父节点随时聚合,都可以避免像逐条插入一样先查找后分裂。用于批量导入和离线重建;可变树需要为未来改动适当留空,不可变树不需预留插入余量。
参见 [[单调键的右端追加]]。
这张卡片看不懂?
这张卡片已通过人工审查,不再接受失败反馈。
已有反馈 · 0 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- Chapter 4. Implementing B-Trees Right-Only Appends · 查看原书依据
In this case, we can avoid splits and merges altogether and compose the tree from the bottom up, writing it out level by level, or writing out higher-level nodes as soon as we have enough pointers to already written lower-level nodes.
参考来源
- 位置:《Database Internals》Chapter 4. Implementing B-Trees(book-source:extracted/Database Internals A deep-dive into how distributed data systems work (Alex Petrov)/_epub-src/OEBPS/ch04.html#idm46104532849240,段 78)
- 结论依据:原文提出从叶到根免分裂的构建方法,并延伸到两种写父层方式和不可变树。
- 原始内容:In this case, we can avoid splits and merges altogether and compose the tree from the bottom up, writing it out level by level, or writing out higher-level nodes as soon as we have enough pointers to already written lower-level nodes.