关于Mysql的Page Directory(或者slots 、 directory slots)

一下内容摘自Mysql的开发文档 地址见:https://dev.mysql.com/doc/internals/en/innodb-page-directory.html

Page Directory
The Page Directory part of a page has a variable number of record pointers. Sometimes the record pointers are called “slots” or “directory slots”. Unlike other DBMSs, InnoDB does not have a slot for every record in the page. Instead it keeps a sparse directory. In a fullish page, there will be one slot for every six records.
The slots track the records’ logical order (the order by key rather than the order by placement on the heap). Therefore, if the records are ‘A’‘B’‘F’‘D’ the slots will be (pointer to ‘A’) (pointer to ‘B’) (pointer to ‘D’) (pointer to ‘F’). Because the slots are in key order, and each slot has a fixed size, it’s easy to do a binary search of the records on the page via the slots.
(Since the Page Directory does not have a slot for every record, binary search can only give a rough position and then InnoDB must follow the “next” record pointers. InnoDB’s “sparse slots” policy also accounts for the n_owned field in the Extra Bytes part of a record: n_owned indicates how many more records must be gone through because they don’t have their own slots.)

关于slot,中文没有太多的文档。Mysql在定位到Page后在根据slot进行二分查找。但是这里的二分查找,并不是精确的,而是大概的。InnoDB does not have a slot for every record in the page. Instead it keeps a sparse directory.(InnoDB没有页面中每条记录的插槽。相反,它保留一个稀疏目录。)而且,slot的顺序是逻辑上的顺序,并不是物理上的,严格的顺序排列会涉及到较多的数据位移,性能较差。n_owned 是用来表示当前slot前面有多少个record与之相关

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值