How many entries are in a node of B-Tree of a MySQL Index?

三世轮回 提交于 2019-12-11 15:25:29

问题


This online book describes how MySQL leverages B-Trees for indexing data. Time complexity depends on the number of entries per node.

How many entries does MySQL hold in one node?


回答1:


Rule of Thumb: 100.

This applies to InnoDB data BTrees and Index BTrees. However, it can be quite far off.

One extreme: only 1 data record in a node -- due to large row size and/or activity such as DELETEs. Another case: A table with 1 record will still occupy a full 16KB block.

Other extreme: 500 index records in a node -- due to small size of key and lack of activity that would have deleted records.



来源:https://stackoverflow.com/questions/46364228/how-many-entries-are-in-a-node-of-b-tree-of-a-mysql-index

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!