当前位置:网站首页>[HBZ sharing] InnoDB principle of MySQL
[HBZ sharing] InnoDB principle of MySQL
2022-06-29 11:37:00 【hbz-】
When the primary key is not configured Mysql Of InnoDB how ?
- Mysql I will use my own rowid A primary key
InnoDB What is the underlying data structure of ?
- B+Tree
BTree Characteristics (MyISAM)
- Nonclustered indexes , namely 【 Indexes 】 and 【 Corresponding data 】 Are two separate files .
- Find the corresponding data , Node key With data below data, It's a 16 It's binary , This data It means that key The corresponding position in the data file , Then I will take this 16 It's binary data Go to the data file to find the corresponding data
B+Tree Characteristics (InnoDB)
- Clustered index , namely 【 Indexes 】 and 【 Corresponding data 】 It's together , In a file
- Find the corresponding by index key after , The content of this data is actually the same as key It's together , Just retrieve the data directly , No need to hold data Go to another file to find , This is a little
- B+Tree The leaf node of key, The primary key id Is ordered , From small to arranged , In other words, it is also very good for range search
- Range lookup , such as id > 15, Leaves key=15 All the following data are required , because id Are arranged in order ,15 Back node , Must be greater than 15 Of
Why? InnoDB The engine needs a primary key , And it is recommended to use integer ?
- B+Tree The bottom layer may perform some value comparison operations , At this time, the integer will highlight the advantage , such as id > 15.
- If you do not use integers , While using uuid, If range query is used later , That can only pass through time , Cannot pass primary key id
边栏推荐
- Go 单元测试入门实践
- (JS) array methods: slice and slice
- 直击产业落地!飞桨重磅推出业界首个模型选型工具
- Adding sharding sphere5.0.0 sub tables to the ruoyi framework (adding custom sub table policies through SPI)
- The first "cyborg" in the world died, and he only transformed himself to "change his life against the sky"
- 那些大佬经常在bash 命令行终端不经意间666飞起的必备操作
- MySQL query table field information
- 中国计算语言学大会、全国知识图谱与语义计算大会赛题火热进行中
- 【HBZ分享】AQS + CAS +LockSupport 实现ReentrantLock的原理
- The former security director of Uber faced fraud allegations and concealed the data leakage event
猜你喜欢

喜报|海泰方圆通过CMMI-3资质认证,研发能力获国际认可

Qt学习01 GUI程序原理分析

Specific method and example program of Siemens s7-200smart control stepping motor

毕业季·进击的技术er - 职场打工人
![Leetcode 535 encryption and decryption of tinyurl [map] the leetcode road of heroding](/img/76/709bbbbd8eb01f32683a96c4abddb9.png)
Leetcode 535 encryption and decryption of tinyurl [map] the leetcode road of heroding

【每日3题(1)】判断国际象棋棋盘中一个格子的颜色

Modbustcp protocol WiFi wireless learning single channel infrared module (small shell version)

又拍雲 Redis 的改進之路

Modbustcp protocol WiFi wireless learning single channel infrared module (round shell version)

关于IP定位查询接口的测评Ⅱ
随机推荐
【无标题】我在密谋一件大事
【每日3题(2)】生成交替二进制字符串的最少操作数
MySQL开启慢查询
(JS) iterator mode
Go 单元测试入门实践
Qt学习04 Hello Qt
Nuc980 started successfully
微博评论架构设计
(JS) array methods: slice and slice
Pipeline aggregations pipeline aggregation-sibling-1
行业分析| 快对讲,楼宇对讲
软件工程导论——第五章——总体设计
Getting started with the lvgl Library - Animation
CTO专访:合见工软深化产品布局 加速国产EDA技术革新
Unity学习笔记--Vector3怎么设置默认参数
[digital signal modulation] realize signal modulation and demodulation based on am+fm+dsb+ssb, including Matlab source code
(JS) handwritten bind function
Pipeline aggregations pipeline aggregations - parent-2
(JS) pure function in array
Today in history: musk was born; Microsoft launches office 365; The inventor of Chua's circuit was born