当前位置:网站首页>MySQL -- index of InnoDB storage engine
MySQL -- index of InnoDB storage engine
2022-07-01 22:54:00 【Xiao Xian.】
Recommended links :
summary ——》【Java】
summary ——》【Mysql】
summary ——》【Spring】
summary ——》【SpringBoot】
Mysql——》Innodb Index of storage engine
One 、 file
frm: Table structure file
ibd: Data is index
Q: Why do you mean InnoDB Index is data , Data is index ?
A: stay InnoDB Inside , It uses primary key as index to organize data storage , So the index file and the data file are the same
Pieces of , All in .ibd In the document . stay InnoDB On the leaf node of the primary key index , It stores our data directly .
Q: a sheet InnoDB Your table may have many multiple indexes , There must be only one copy of the data , Which index leaf node is the data on ?
A: There is a clustered index / Cluster index
Two 、 Clustered index / Cluster index / primary key
If a table has both primary key indexes and other indexes :
primary key : It's a clustered index , Determine the physical storage order of data rows , Leaf nodes store data
Other indexes : It's a secondary index / Secondary index , The leaf node stores the value of the primary key
Definition : The logical order of index key values is consistent with the physical storage order of table data rows .
Example : The list of dictionaries is sorted by pinyin , The content is also sorted by Pinyin , This kind of directory sorted by pinyin is called clustered index .
3、 ... and 、 Secondary indexes / Secondary index
When I People use name Cable lead check Inquiry One strip remember record , it Meeting stay Two level Cable lead Of leaf Son section spot look for To name=bobo, Get the primary key value id=1, Then go to the leaf node of the primary key index to get the data .
From this perspective , Because the primary key index scans one tree less than the secondary index B+Tree, Its speed will be relatively faster .

Four 、 If there is no primary key or index in the table , Where is the data stored ?
Reference link :【 Official website 】innodb-index-types
1、 If we define a primary key (PRIMARY KEY), that InnoDB Will choose the primary key as the clustered index .
2、 If the primary key is not explicitly defined , be InnoDB Will choose the first one that does not contain NULL The unique index of the value is used as the primary key index
lead .
3、 If there is no such unique index , be InnoDB Will choose built-in 6 Byte long ROWID As a hidden clustered index ,
It will increase the primary key as the row record is written .
边栏推荐
- Resttemplate remote call tool class
- MySQL -- index of MyISAM storage engine
- There is no signal in HDMI in computer games caused by memory, so it crashes
- Talk about what parameters ZABBIX monitors
- Mysql5.7 set password policy (etc. three-level password transformation)
- [daily training] 326 Power of 3
- Friendly serial assistant tutorial_ How to configure friendly serial port debugging assistant - tutorial on using friendly serial port debugging assistant
- Appium自动化测试基础 — 补充:Desired Capabilities参数介绍
- 447 Bili Bili noodles warp 1
- MySQL view exercise
猜你喜欢

14年本科毕业,3个月转行软件测试月薪13.5k,32的岁我终于找对了方向

104. SAP UI5 表格控件的支持复选(Multi-Select)以及如何用代码一次选中多个表格行项目

Vsphere+ and vsan+ are coming! VMware hybrid cloud focus: native, fast migration, mixed load

Reprint CSDN article operation

Slope compensation
![[jetcache] how to use jetcache](/img/fa/5b3abe53bb7e9db6af2dbb1cb76a31.png)
[jetcache] how to use jetcache

陈天奇的机器学习编译课(免费)

切面条 C语言

转载csdn文章操作

转--利用C语言中的setjmp和longjmp,来实现异常捕获和协程
随机推荐
FFMpeg学习笔记
Friendly serial assistant tutorial_ How to configure friendly serial port debugging assistant - tutorial on using friendly serial port debugging assistant
Cloud Vulnerability Global Database
每日刷题记录 (十)
阿洛迷茫后的思考
[daily training] 326 Power of 3
What class loading mechanisms does the JVM have?
旅游管理系统
Understanding of transactions in MySQL
死锁的处理策略—预防死锁、避免死锁、检测和解除死锁
Vsphere+ and vsan+ are coming! VMware hybrid cloud focus: native, fast migration, mixed load
Mixconv code
【日常训练】66. 加一
Niuke monthly race - logarithmic sum in groups
Fiori applications are shared through the enhancement of adaptation project
rxjs Observable of 操作符的单步调试分析
Operation category read is not supported in state standby
ESP自动下载电路设计
Intelligent computing architecture design of Internet
nn.Parameter】Pytorch特征融合自适应权重设置(可学习权重使用)