知识卡片
用路径栈回传结构调整
下降到叶前常不知道是否会触发分裂或合并。每次下降可把当前父页标识和子入口下标压入栈。若叶结构改变,就从栈顶退回父级更新分隔和引用;父级溢出则继续弹栈直到不再传播或到根。这样可以省下跨操作维护每页的父指针。在并发修改时旧下标可能过期,需要确认仍指向目标子页。
这张卡片看不懂?
这张卡片已通过人工审查,不再接受失败反馈。
已有反馈 · 0 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- Chapter 4. Implementing B-Trees Propagating Splits and Merges · 查看原书依据
Breadcrumbs contain references to the nodes followed from the root and are used to backtrack them in reverse when propagating splits or merges. The most natural data structure for this is a stack.
参考来源
- 位置:《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#breadcrumbs,段 61)
- 结论依据:原文以 PostgreSQL 的 BTStack 说明每次下降留路标,随后强调原单元下标仍须有效。
- 原始内容:Breadcrumbs contain references to the nodes followed from the root and are used to backtrack them in reverse when propagating splits or merges. The most natural data structure for this is a stack.