当前位置:网站首页>Interview shock 56: what is the difference between clustered index and non clustered index?
Interview shock 56: what is the difference between clustered index and non clustered index?
2022-06-13 12:10:00 【InfoQ】
Cluster index
drop table if exists student;
create table student(
id int primary key,
name varchar(16),
class_id int not null,
index (class_id)
)engine=InnoDB;
-- Add test data
insert into student(id,name,class_id) values(1,' Zhang San ',100),
(2,' Li Si ',200),(3,' Wang Wu ',300);

Nonclustered index

summary
- The clustered index leaf node stores row data ; The non clustered index leaf node stores the clustered index ( It's usually the primary key ID).
- Cluster index query is more efficient , Non clustered indexes need to be queried back to the table , Therefore, the performance is not as good as that of clustered indexes .
- Cluster indexes are generally primary key indexes , A table can only have one primary key , Therefore, a clustered index can only have one table , Non clustered indexes are not limited in number .
边栏推荐
- Based on STM32F103 - DS1302 date time + serial port printing
- Envoyer un SMS - système de carte d'accès intelligent basé sur stm32f103 + as608 module d'empreintes digitales + clé matricielle 4x4 + sim900a
- Fuel scheme and product business modeling
- Lucene从入门到实战
- SMS sending + serial port printing based on stm32f103-sim900a
- Intelligent customer service system framework rasa
- 基于STM32F103——DS1302日期时间+串口打印
- Based on STM32F103 - matrix key + serial port printing
- 【TcaplusDB知识库】TcaplusDB-tcapsvrmgr工具介绍(二)
- 89C51 single chip microcomputer driving LCD based on dream
猜你喜欢

web开发项目,web单页开发

CPU的分支预测

Notes on the development of raspberry pie (16): Raspberry pie 4b+ install MariaDB database (MySQL open source branch) and test basic operations

What is the appropriate setting for the number of database connections?

7.5.4:Spire Office for .NET New Version

燃油方案和产品业务建模
![[tcaplusdb knowledge base] Introduction to tcaplusdb tcapulogmgr tool (I)](/img/46/e4a85bffa4b135fcd9a8923e10f69f.png)
[tcaplusdb knowledge base] Introduction to tcaplusdb tcapulogmgr tool (I)

UNIX环境高级编程(APUE,第三版)---环境搭建

全网最全,含面试题+答案

多系统对接的适配与包装模式应用
随机推荐
Design and implementation of database for banking system
Process of manually encrypting and burning the mass production firmware of ESP equipment
Product story | YuQue drawing board you don't know
[tcapulusdb knowledge base] Introduction to tcapulusdb tcapsvrmgr tool (III)
SMS sending + serial port printing based on stm32f103-sim900a
[tcaplusdb knowledge base] Introduction to tcaplusdb tcapulogmgr tool (I)
7.5.4:Spire Office for . NET New Version
002、torchserve调用官方库模型
break algorithm---dynamic planning(dp-arr)
Machine learning (III) - LDA (linear discriminant analysis) theory and code explanation
全网最全,含面试题+答案
北京市场监管局启动9类重点产品质量专项整治工作
Committed to R & D and manufacturing of ultra surface photonic chip products, Shanhe optoelectronics completed a round of pre-A financing of tens of millions of yuan
How to use dataX to update the data in the downstream Oracle database with the update semantics?
The answer to the subject of "Regulations" of the second construction company in 2022 has been provided. Please keep it
Auto.js 悬浮窗居中
Pulsar 消息的构成
基于三维GIS技术的行业发展及研究现状
基于STM32F103——DS1302日期时间+串口打印
【管理知多少】“风险登记册”本身的风险