MySQL索引的B-Tree节点中有多少条目? [英] How many entries are in a node of B-Tree of a MySQL Index?

查看:271
本文介绍了MySQL索引的B-Tree节点中有多少条目?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这个在线书籍描述了MySQL如何利用 B-Trees 。时间复杂度取决于每个节点的条目数。

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

MySQL在一个节点中保留了多少条目?

How many entries does MySQL hold in one node?

推荐答案

经验法则:100。

这适用于InnoDB数据BTrees和Index BTrees。但是,它可能相当遥远。

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

一个极端:节点中只有1个数据记录 - 由于行大小和/或活动(如<$ c) $ C>的DELETE 。另一种情况:具有1条记录的表仍将占用一个完整的16KB块。

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.

其他极端:节点中的500条索引记录 - 由于密钥小而缺乏将删除记录的活动。

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

这篇关于MySQL索引的B-Tree节点中有多少条目?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆