当前位置:网站首页>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 .
边栏推荐
- 好友新书发布,祝贺(送福利)
- Detailed explanation of common configurations in redis configuration file [easy to understand]
- 【日常训练】326. 3 的幂
- redis配置文件中常用配置详解[通俗易懂]
- Understanding of inverted residuals
- Understanding of indexes in MySQL
- Origin2018安装教程「建议收藏」
- There is no signal in HDMI in computer games caused by memory, so it crashes
- Appium自动化测试基础 — APPium安装(一)
- Cloud Vulnerability Global Database
猜你喜欢
使用 EMQX Cloud 实现物联网设备一机一密验证
Hide the creation and use of users
Kubernetes create service access pod
447 Bili Bili noodles warp 1
【无标题】
Appium automation test foundation - appium installation (I)
14年本科毕业,3个月转行软件测试月薪13.5k,32的岁我终于找对了方向
Turn -- use setjmp and longjmp in C language to realize exception capture and collaboration
Favorite transaction code management tool in SAP GUI
104. SAP ui5 table control supports multi select and how to select multiple table row items at a time with code
随机推荐
Pytorch nn. functional. Simple understanding and usage of unfold()
There is no signal in HDMI in computer games caused by memory, so it crashes
台积电全球员工薪酬中位数约46万,CEO约899万;苹果上调日本的 iPhone 售价 ;Vim 9.0 发布|极客头条
Deep learning -- data operation
447-哔哩哔哩面经1
SAP intelligent robot process automation (IRPA) solution sharing
Measurement of reference loop gain and phase margin
3DE resources have nothing or nothing wrong
pytorch训练自己网络后可视化特征图谱的代码
Stimulate new kinetic energy and promote digital economy in multiple places
Intelligent computing architecture design of Internet
Electron学习(三)之简单交互操作
效率提升 - 鼓捣个性化容器开发环境
redis配置文件中常用配置详解[通俗易懂]
Favorite transaction code management tool in SAP GUI
Resttemplate remote call tool class
Fiori 应用通过 Adaptation Project 的增强方式分享
Appium自动化测试基础 — APPium安装(一)
死锁的处理策略—预防死锁、避免死锁、检测和解除死锁
Turn -- bring it and use it: share a gadget for checking memory leaks