当前位置:网站首页>MYSQL聚簇索引
MYSQL聚簇索引
2022-04-22 05:52:00 【肝铁侠】
首先我们要知道的,聚簇索引它并不是一种单纯的索引类型,而是一种数据存储方式。聚簇表示的意思是数据行和相邻的键值紧凑地存储在一起。不同的存储引擎所支持的索引是不同的,所以不是所有的存储引擎都支持聚簇索引。
如果你已经对MYSQL使用的索引数据结构为B+树并且知道了B+数的存储形式的话,就会知道B+树的叶子节点存储了我们想要的数据,而非叶子节点是不存储数据的,仅用作索引。而针对这个问题可能你在面试的时候会经常被问到:MYSQL的索引为什么使用B+树而不使用B树。
对于MYSQL而言,我们常用的数据存储引擎是INNODB,INNODB表就是基于聚簇索引建立的,所以主键索引一定是聚簇索引,而聚簇索引不一定是主键索引。当我们没有定义主键的时候,INNODB则会选择一个唯一的非空索引代替,如果没有这样的索引,INNODB会隐式定义一个主键来作为聚簇索引。
版权声明
本文为[肝铁侠]所创,转载请带上原文链接,感谢
https://blog.csdn.net/qq_51250453/article/details/122526670
边栏推荐
- mysql 外连接时where,on使用时机
- There is a @ Kyushu cloud offer waiting for you
- call与apply的作用与区别
- Hangzhou rail transit supervision platform edge cloud won the award and set a new benchmark in the industry
- es6模块化
- Evaluation of Molly x4-1u blade computing server
- 通过代码理解分布式事务:XA模式
- AQS和ReentrantLock源码解析
- Thinkphp6 download and install, use
- JS debugging detection and bypass method
猜你喜欢

Method of querying cumulative value in MySQL

mysql 基础知识2

并发专题详解
![[MySQL] multi table joint query, connection query and sub query](/img/32/37726e2d9330e6ea4803507fff48a8.png)
[MySQL] multi table joint query, connection query and sub query

树的的遍历

Outstanding | Kyushu cloud was selected as an excellent case and industry panorama of the first hybrid cloud conference

《通用数据保护条例》(GDPR)系列解读一:如何判断出海企业是否受GDPR管辖?

在PGConf.Asia-中文技术论坛,聆听腾讯云专家对数据库技术的深度理解

5分钟搞懂MySQL行转列

九州云通过EC Ready边缘云权威评测
随机推荐
Understanding distributed transactions through code: XA pattern
九州云入选2021中国信创500强
如何在代码中得知是否在JUNIT环境运行?
九州云Edge MEP作为典型产品入选《中国边缘云研究》报告
openssl自签名ca证书,以及签发服务端/客户端证书
[MySQL] multi table joint query, connection query and sub query
JS yesterday, the day before yesterday, etc
hash模式与history模式之间的区别
C语言实现哈希字典及笔记
Compilation and ABI of smart contract
Focusing on the innovation and practice of edge computing, Kyushu cloud attended the 2021 China Unicom 5g MEC seminar
PostgreSQL如何对URL进行解析
sort排序
倒计时一个月,PGConf.Asia2021亚洲大会最新前瞻,有哪些值得关注的亮点?
PostgreSQL 13.3、12.7、11.12、10.17和9.6.22发布了!
服务端打印jersey restful请求的request/response
数美科技社交行业未成年人保护解决方案:守护未成年人的“社交圈”
Redis cluster I. master-slave mode
There is a @ Kyushu cloud offer waiting for you
How can I know in the code whether it runs in JUnit environment?