知识卡片
页内碎片怎样回收
删除变长单元后可以记下空洞的起点和长度,不急着移动其他记录。插入可选择第一个放得下的区段,也可找留下最少余量的区段。如果总空闲量足够却没有一个连续段够大,就重写存活单元并修改偏移,把分散空间聚成较大空白。压实后仍无处存时,再按数据与结构规则申请溢出页或重组树。
参见 [[槽页怎样保持引用]]。
这张卡片看不懂?
这张卡片已通过人工审查,不再接受失败反馈。
已有反馈 · 0 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- Chapter 3. File Formats Managing Variable-Size Data · 查看原书依据
If we cannot find enough consecutive bytes to fit the new cell but there are enough fragmented bytes available, live cells are read and rewritten, defragmenting the page and reclaiming space for new writes.
参考来源
- 位置:《Database Internals》Chapter 3. File Formats(book-source:extracted/Database Internals A deep-dive into how distributed data systems work (Alex Petrov)/_epub-src/OEBPS/ch03.html#idm46104533081832,段 121)
- 结论依据:原文按可用段、碎片压实以及压实后还不够时的溢出机制推进。
- 原始内容:If we cannot find enough consecutive bytes to fit the new cell but there are enough fragmented bytes available, live cells are read and rewritten, defragmenting the page and reclaiming space for new writes.