Index logic in MySQL& B- tree algorithm
2015-06-05 09:58
507 查看
This blog is about some basic ideas about index logic in the Database engine in MySQL, along with the simple explanation of its supporting algorithm: B- tress algorithm.
B-tree Algorithm
Index logic
**
1. B- tree algorithm
http://en.wikipedia.org/wiki/B-tree
**
The lower and upper bounds on the number of child nodes are typically fixed for a particular implementation. For example, in a 2-3 B-tree (often simply referred to as a 2-3 tree), each internal node may have only 2 or 3 child nodes.
Each internal node of a B-tree will contain a number of keys. The keys act as separation values which divide its subtrees.
Usually, the number of keys is chosen to vary between d and 2d, where d is the minimum number of keys, and d+1 is the minimum degree or branching factor of the tree.
Figure1.1 B-tree of order 2
Deleting the key would make the internal node have d-1 keys; joining the neighbor would add d keys plus one more key brought down from the neighbor’s parent. The result is an entirely full node of 2d keys.
**
2. Index logic
**
Figure2.1 B-tree index of MySQL5.1
where inner nodes store the pages hierarchy and the leaf nodes store pointers to indexed data information.
B-tree Algorithm
Index logic
**
1. B- tree algorithm
http://en.wikipedia.org/wiki/B-tree
**
The lower and upper bounds on the number of child nodes are typically fixed for a particular implementation. For example, in a 2-3 B-tree (often simply referred to as a 2-3 tree), each internal node may have only 2 or 3 child nodes.
Each internal node of a B-tree will contain a number of keys. The keys act as separation values which divide its subtrees.
Usually, the number of keys is chosen to vary between d and 2d, where d is the minimum number of keys, and d+1 is the minimum degree or branching factor of the tree.
Figure1.1 B-tree of order 2
Deleting the key would make the internal node have d-1 keys; joining the neighbor would add d keys plus one more key brought down from the neighbor’s parent. The result is an entirely full node of 2d keys.
**
2. Index logic
**
Figure2.1 B-tree index of MySQL5.1
where inner nodes store the pages hierarchy and the leaf nodes store pointers to indexed data information.
相关文章推荐
- Lua中强大的元方法__index详解
- Lua中__index和__newindex之间的沉默与合作
- MySQL Index Condition Pushdown(ICP)性能优化方法实例
- Jquery index()方法 获取相应元素索引值
- JQuery使用index方法获取Jquery对象数组下标的方法
- JQuery index()方法使用代码
- jQuery中index()的用法分析
- Notice: Undefined index: page in E:\PHP\test.php on line 14
- php Undefined index和Undefined variable的解决方法
- MySQL里Create Index 能否创建主键 Primary Key
- PHP Undefined index报错的修复方法
- mysql截取的字符串函数substring_index的用法
- 使用use index优化sql查询的详细介绍
- Oracle中实现MySQL show index from table命令SQL脚本分享
- Lua中的__index和__newindex实例
- php Undefined index的问题
- 基于solr实现hbase的二级索引
- 一文读懂MySQL - MySQL必须掌握的技术点(上)
- oracle监控索引的使用情况
- excel中index和match的用法