知识卡片
二级索引的间接寻址
存放物理地址的二级索引可直接取得数据,但记录搬迁时,各索引里保存的地址可能都要改。二级索引只保存主键则能保持引用稳定,读取时需再按主键查一次。可同时保存地址和主键,先验证地址是否有效,失效时回退到主索引并更新缓存地址。读多、写多和二级索引的数量都会改变取舍。
参见 [[聚簇描述记录顺序]]。
这张卡片看不懂?
这张卡片已通过人工审查,不再接受失败反馈。
已有反馈 · 0 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- Chapter 1. Introduction and Overview Index Files · 查看原书依据
Both approaches have their pros and cons and are better discussed in the scope of a complete implementation. By referencing data directly, we can reduce the number of disk seeks, but have to pay a cost
参考来源
- 位置:《Database Internals》Chapter 1. Introduction and Overview(book-source:extracted/Database Internals A deep-dive into how distributed data systems work (Alex Petrov)/_epub-src/OEBPS/ch01.html#idm46104533744232,段 118)
- 结论依据:原文对照直接寻址和主索引间接寻址,并给出两者混用的做法。
- 原始内容:Both approaches have their pros and cons and are better discussed in the scope of a complete implementation. By referencing data directly, we can reduce the number of disk seeks, but have to pay a cost