有个选项
innodb_ll_factor
用于定义
InnoDB page
的填充率,默认值是
100
,但其实
最高只能填充约
15KB
的数据,因为
InnoDB
会预留
1/16
的空闲空间。在
InnoDB
文档
中,有这么一段话
An innodb_ll_factor setting of 100 leaves 1/16 of the space in clustered index
pages free for future index growth.
另外,文档中还有这样一段话
When new records are inserted into an InnoDB clustered index, InnoDB tries to
leave 1/16 of the page free for future insertions and updates of the index
records. If index records are inserted in a sequential order (ascending or
descending), the resulting index pages are about 15/16 full. If records are
inserted in a random order, the pages are from 1/2 to 15/16 full.
上面这两段话,综合起来理解,就是
即便
innodb_ll_factor=100
,也会预留
1/16
的空闲空间,用于现存记录长度扩展用
在最佳的顺序写入数据模式下,
page
填充率有可能可以达到
15/16
在随机写入新数据模式下,
page
填充率约为
1/2 ~ 15/16
预留
1/16
这个规则,只针对聚集索引的叶子节点有效。对于聚集索引的非叶子节点以及
辅助索引(叶子及非叶子)节点都没有这个规则
不过
innodb_ll_factor
选项对叶子节点及非叶子节点都有效,但对存储
text/blob
溢出
列的
page
无效
评论