当前位置:网站首页>mysql中的索引show index from XXX每个参数的意义
mysql中的索引show index from XXX每个参数的意义
2022-06-12 11:03:00 【weixin_46855885】
- 介绍mysql中index(索引每个参数的意义)
- 语句
show index from tb_user
对应的结果
3. 下面我们来解释一下这张表中的索引每个参数的意义
1.Table: 表名
2.Non_unique: 如果索引不能包括重复值则为0,如果可以则为1。也就是平时所说的唯一索引。
3.Key_name 索引名称,如果名字相同则表明是同一个索引,而并不是重复,比如上图中的第四、五条数据,索引名称都是name,其实是一个联合索引。
4.Seq_in_index 索引中的列序列号,从1开始。上图中的四、五条数据,Seq_in_index一个是1一个是2,就是表明在联合索引中的顺序,我们就能推断出联合索引中索引的前后顺序。
5.Column_name 索引的列名。
6.Collation指的是列以什么方式存储在索引中,大概意思就是字符序。
7.Cardinality 是基数的意思,表示索引中唯一值的数目的估计值。我们知道某个字段的重复值越少越适合建索引,所以我们一般都是根据Cardinality来判断索引是否具有高选择性,如果这个值非常小,那就需要重新评估这个字段是否适合建立索引。
8.Sub_part 前置索引的意思,如果列只是被部分地编入索引,则为被编入索引的字符的数目。如果整列被编入索引,则为NULL。
9.Packed 指示关键字如何被压缩。如果没有被压缩,则为NULL。压缩一般包括压缩传输协议、压缩列解决方案和压缩表解决方案。
10.Null 如果列含有NULL,则含有YES。
11.Index_type表示索引类型,Mysql目前主要有以下几种索引类型:FULLTEXT,HASH,BTREE,RTREE。
12.Comment Index_comment 注释的意思。
总结下,这篇文章主要是探讨了MySQL SHOW INDEX 命令的使用,建议大家亲自运行下文中代码。
边栏推荐
猜你喜欢
随机推荐
M-arch (fanwai 12) gd32l233 evaluation -cau encryption and decryption (tease Xiaobian)
Building 64 bit wampserver and DVWA in win7 virtual machine
Handwritten common interview questions
Malicious code analysis practice - lab03-01 Exe basic dynamic analysis
Why check the @nonnull annotation at run time- Why @Nonnull annotation checked at runtime?
SOT23(Small Outline Transistor)
[machine learning] practice of logistic regression classification based on Iris data set
Principle analysis of vite HMR
Amélioration de la 3dsc par HSC
NLP data set download address for naturallanguageprocessing
AcWing 135. 最大子序和(前缀和 + 单调队列求定长区间最小值)
Common methods of string class
元宇宙系统搭建与构造
Solution to invalid small program scroll into view
This and final keywords
AcWing 1995. 见面与问候(模拟)
On 3dsc theory and application of 3D shape context feature
The solution of Lenovo notebook ThinkPad t440 WiFi dropping all the time
AcWing 128. 编辑器(对顶栈 实现序列内部指定位置高效修改)
file_ get_ Contents() JSON after reading_ Decode cannot be converted to array









