当前位置:网站首页>Deeply understand the underlying data structure and algorithm of MySQL index
Deeply understand the underlying data structure and algorithm of MySQL index
2022-07-27 03:23:00 【tea-Sir】
The essence of index
Sort the data in the database , Each time you query, you can quickly find the target data according to the conditions .
b-tree Trees
Leaf nodes have the same depth , And the pointer of the leaf node is null ;
Each node stores key-value, All indexes are not duplicate ;
The index is incremented from left to right ;

b+tree Trees
Only leaf nodes store key-value, Other nodes store key;
The leaf node contains all indexes ;
Leaf nodes are connected by pointers , Improve the access performance of the interval ;

MyISAM Storage engine index implementation
Nonclustered index : Index files and data files are stored separately .

InnoDB The index to achieve
Clustered index : The index and data are consistent , So you must have a primary key .
Adopted b+tree Tree structure storage , The leaf node contains all indexes and data .

Left most matching principle
The union index needs to match columns from left to right .
边栏推荐
猜你喜欢

索引最佳实践

安全员及环保员岗位职责

Detailed explanation of const usage in C language

延时队列的几种实现姿势?日常必备技能!

The diagram of user login verification process is well written!

Explain详解

spark:地区广告点击量排行统计(小案例)

Quick sequencing and optimization

Message rejected MQ

Activiti5.22.0 extension supports domestic databases, taking gbase database as an example
随机推荐
Jmeter分布式压测
day6
围圈报数(北理工机试题)(DAY 83)
将幕布文章OPML转换为Markdown的方法
二叉树(北京邮电大学机试题)(DAY 85)
自己梳理的LocalDateTime的工具类
Attention should be paid to the first parameter of setTimeout
周全的照护 解析LYRIQ锐歌电池安全设计
最大连续子序列(DAY 77)
An error in the fourth edition of the red book?
易灵思T35 FPGA驱动LVDS显示屏
数据湖(二十):Flink兼容Iceberg目前不足和Iceberg与Hudi对比
架构基本概念和架构本质
延时队列的几种实现姿势?日常必备技能!
《稻盛和夫给年轻人的忠告》阅读笔记
Source code analysis of warning notification for skywalking series learning
shell awk
Explain详解
Technology vane | interpretation of cloud native technology architecture maturity model
How to uniquely identify a user SQL in Youxuan database cluster