当前位置:网站首页>【HBZ分享】Mysql的InnoDB原理
【HBZ分享】Mysql的InnoDB原理
2022-06-29 10:29:00 【hbz-】
没有配置主键时Mysql的InnoDB是如何做的?
- Mysql会使用自带的rowid作为主键
InnoDB的底层数据结构是什么?
- B+Tree
BTree的特点(MyISAM)
- 非聚集索引,即【索引】和【对应数据】是分开的两个文件。
- 找到对应数据后,节点的key下面带有数据的data,是一个16进制的,这个data就标识着该key的内容在数据文件中对应的位置,然后会拿着这个16进制的data去数据文件找对应的数据
B+Tree的特点(InnoDB)
- 聚集索引,即【索引】和【对应数据】是在一起的,在一个文件中
- 通过索引找到对应key后,这条数据的内容其实和key是在一起的,直接取回数据即可,无需再拿着data去另一个文件找,这就是有点
- B+Tree的叶子节点的key,即主键id是有序的,从小到达排列的,也就是对范围查找又很大的好处
- 范围查找,比如id > 15, 即叶子key=15后面的所有数据都是要的,因为id是由顺序排列的,15后面的节点,一定都是大于15的
为什么InnoDB引擎需要主键,并且推荐使用整数?
- B+Tree底层可能会做一些值比较大小的操作,这个时候整数就突显优势了,比如id > 15.
- 如果不使用整数,而用uuid,如果后期用到范围查询,那只能通过时间了,不能通过主键id
边栏推荐
- 掌握一些shell 通配符巧妙的运用,会让我们写脚本事半功倍
- matlab基础 max 求一维或二维数组的最大值+sleep(pause)
- Nuc980 open source project 16- start from SPI flash (w25q128)
- TTL串口学习型红外遥控模块可扩展成网络控制
- By asp Net core downloading files according to the path
- The necessary operation for those big guys to fly 666 inadvertently at the bash command line terminal
- MySQL query table field information
- 中国计算语言学大会、全国知识图谱与语义计算大会赛题火热进行中
- LeetCode 535 TinyURL的加密与解密[map] HERODING的LeetCode之路
- Spark - one to one correspondence between task and partition and detailed explanation of parameters
猜你喜欢

Using EasyX configuration in clion

ModbusTCP协议网络学习型单路红外模块(双层板)

misc3~7

又拍雲 Redis 的改進之路

Spark - one to one correspondence between task and partition and detailed explanation of parameters

第12周实验---基于FPGA的VGA协议实现

How to test the performance of container platform, including stability, expansion efficiency and component performance

Google Earth engine (GEE) - Gedi L2a vector canopy top height (version 2) global ecosystem data set

When the "Ai x scientific computing" is in progress, Huawei's mindspore competition question is hot, waiting for you!

Lizuofan, co-founder of nonconvex: Taking quantification as his lifelong career
随机推荐
Xuetong denies that the theft of QQ number is related to it: it has been reported; IPhone 14 is ready for mass production: four models are launched simultaneously; Simple and elegant software has long
Modbus RTU protocol 485 learning 2-way infrared module
Course design for the end of the semester: product sales management system based on SSM
The last 48 hours! The cloud XR theme competition invites you to bloom together. See you at the competition!
什么?漫画居然能免费看全本了,这还不学起来一起做省钱小能手
Uboot for embedded driver development -- common command parameters in uboot
(JS)数组排平(flat)
Data analysis method and Thinking: funnel analysis
第12周实验---基于FPGA的VGA协议实现
(JS)手写深比较
在线SQL转HTMLTable工具
Encore une fois, le chemin de l'amélioration de redis Cloud
中科方德技术专家直播:如何基于 OpenStack、Ceph 构建私有云平台? | 第 27 期
【各种**问题系列】OLTP和OLAP是啥?
Multithreaded high concurrency server: three problems
Modbustcp protocol WiFi wireless learning single channel infrared module (small shell version)
9 款好用到爆的 JSON 处理工具,极大提高效率!
Using EasyX configuration in clion
(JS)数组方法:slice和splice
ModbusTCP协议网络学习型单路红外模块(双层板)