mysql b+ tree 3阶索引能存多少数据

Consider InnoDB whose page size is 16KB and suppose we have an index on a integer column of size 4bytes, so a node can contain at most 16 * 1024 / 4 = 4096 keys, and a node can have at most 4097 children.node

So for a B+tree of height 1, the root node has 4096 keys and the nodes at height 1 (the leaf nodes) have 4096 * 4097 = 16781312 key values.linux

InnoDB的性能ide

MySQL(默认使用InnoDB引擎),将记录按照页的方式进行管理,每页大小默认为16K(这个值能够修改).linux 默认页大小为4K性能

 

linux内存页的默认大小是4k.net

3阶,包含2层索引,每一个索引节点4bytes,最后一层要存数据,假设数据大小也是4bytes,最后一层一个叶子节点是 4+4 = 8 bytes orm

(4 * 1024 /4 ) * (4 * 1024 /4 )  * (4 * 1024 / 8) = 500 000 000 约为5亿key/value数据blog

相关文章
相关标签/搜索