MySQL中索引信息说明

查看索引

show index from student;

Table

Non_unique

Key_name

Seq_in_index

Column_name

Collation

Cardinality

Sub_part

Packed

Null

Index_type

Comment

Index_comment

Visible

Expression

student

0

PRIMARY

1

id

A

167722

   

BTREE

  

YES

 

student

1

idx_student_class_id

1

class_id

A

2984

  

YES

BTREE

  

YES

 

student

1

idx_student_school_id

1

school_id

A

262

  

YES

BTREE

  

YES

 

student

1

idx_student_area

1

area

A

64

  

YES

BTREE

  

YES

 

student

1

idx_student_city

1

city

A

9

  

YES

BTREE

  

YES

 

student

1

idx_student_province

1

province

A

1

  

YES

BTREE

  

YES

 

student

1

idx_student_exclude

1

exclude

A

1

   

BTREE

  

YES

 

student

1

idx_student_subject_group

1

subject_group

A

11

  

YES

BTREE

  

YES

 

student

1

idx_student_subject_ids

1

subject_ids

A

82

  

YES

BTREE

  

YES

 

 

索引信息中的列的信息说明。

Table :表的名称。
Non_unique:如果索引不能包括重复词,则为0。如果可以,则为1。
Key_name:索引的名称。
Seq_in_index:索引中的列序列号,从1开始。
Column_name:列名称。
Collation:列以什么方式存储在索引中。在MySQLSHOW INDEX语法中,有值'A'(升序)或NULL(无分类)。
Cardinality:索引中唯一值的数目的估计值。通过运行ANALYZE TABLE或myisamchk -a可以更新。基数根据被存储为整数的统计数据来计数,所以即使对于小型表,该值也没有必要是精确的。基数越大,当进行联合时,MySQL使用该索引的机会就越大。
Sub_part:如果列只是被部分地编入索引,则为被编入索引的字符的数目。如果整列被编入索引,则为NULL。
Packed:指示关键字如何被压缩。如果没有被压缩,则为NULL。
Null:如果列含有NULL,则含有YES。如果没有,则为空。
Index_type:存储索引数据结构方法(BTREE, FULLTEXT, HASH, RTREE)

posted @ 2022-05-17 15:59  黑格  阅读(149)  评论(0编辑  收藏  举报