博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
mysql b+ tree 3阶索引能存多少数据
阅读量:7079 次
发布时间:2019-06-28

本文共 630 字,大约阅读时间需要 2 分钟。

hot3.png

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.

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.

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

 

linux内存页的默认大小是

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

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

转载于:https://my.oschina.net/u/2935389/blog/3023068

你可能感兴趣的文章
1021 Deepest Root
查看>>
110. Balanced Binary Tree(平衡树)
查看>>
[C#][DevPress]省市县乡嵌套查询
查看>>
Centos 6.8 系统下安装RabbitMQ方法
查看>>
C语言编译过程
查看>>
python单元测试--深入理解unittest
查看>>
实现Map接口(hash原理)
查看>>
跟我学算法-图像识别之图像分类(上)(基础神经网络, 卷积神经网络(CNN), AlexNet,NIN, VGG)...
查看>>
面向对象程序设计第二单元总结
查看>>
hdu 4003 Find Metal Mineral
查看>>
当你和世界不一样
查看>>
APP数据运营的11个流程步骤
查看>>
linux 内核生成
查看>>
C#高级编程9 第18章 部署
查看>>
Sql语句常用关键字
查看>>
数据结构与算法面试总结
查看>>
note 0 Python介绍及Python IDE环境安装 Spyder with Anaconda
查看>>
LeetCode - Maximum Subarray
查看>>
数据库附加或还原后用户权限问题
查看>>
C# String.Format格式说明
查看>>