mysql 查看索引
2015-03-25 10:56
716 查看
SHOW INDEX returns table index information. The format resembles that of the SQLStatisticscall in ODBC. This statement requires some privilege for any column in the table.
SHOW INDEX returns the following fields:
• Table The name of the table.
• Non_unique 0 if the index cannot contain duplicates, 1 if it can.
• Key_name The name of the index. If the index is the primary key, the name is always PRIMARY.
• Seq_in_index The column sequence number in the index, starting with 1.
• Column_name The column name.
• Collation How the column is sorted in the index. In MySQL, this can have values “A”(Ascending) or NULL(Not sorted).
• Cardinality An estimate of the number of unique values in the index. This is updated by running ANALYZE TABLE
or myisamchk -a. Cardinalityis counted based on statistics stored as integers, so the value is not
necessarily exact even for small tables. The higher the cardinality, the greater the chance that MySQL
uses the index when doing joins.
• Sub_part The number of indexed characters if the column is only partly indexed, NULLif the entire column is indexed.
• Packed Indicates how the key is packed. NULLif it is not.
• Null Contains YESif the column may contain NULLvalues and ''if not.
• Index_type The index method used (BTREE, FULLTEXT, HASH, RTREE).
• Comment Information about the index not described in its own column, such as disabledif the index is disabled.
• Index_comment Any comment provided for the index with a COMMENTattribute when the index was created
查看索引
mysql> show index from tblname;
mysql> show keys from tblname;
· Table 表的名称。
· Non_unique 如果索引不能包括重复词,则为0。如果可以,则为1。
· Key_name 索引的名称,例如,PRIMARY。
· Seq_in_index
索引中的列序列号,从1开始。
· Column_name 列名称。
· Collation 列以什么方式存储在索引中。在MySQL中,有值‘A’(升序)或NULL(无分类)。
· Cardinality 索引中唯一值的数目的估计值。通过运行ANALYZE TABLE或myisamchk -a可以更新。基数根据被存储为整数的统计数据来计数,所以即使对于
小型表,该值也没有必要是精确的。基数越大,当进行联合时,MySQL使用该索引的机 会就越大。
· Sub_part 如果列只是被部分地编入索引,则为被编入索引的字符的数目。如果整列被编入索引,则为NULL。
· Packed 指示关键字如何被压缩。如果没有被压缩,则为NULL。
· Null 如果列含有NULL,则含有YES。如果没有,则该列含有NO。
· Index_type 用过的索引方法(BTREE, FULLTEXT, HASH, RTREE)。
· Comment
SHOW INDEX returns the following fields:
• Table The name of the table.
• Non_unique 0 if the index cannot contain duplicates, 1 if it can.
• Key_name The name of the index. If the index is the primary key, the name is always PRIMARY.
• Seq_in_index The column sequence number in the index, starting with 1.
• Column_name The column name.
• Collation How the column is sorted in the index. In MySQL, this can have values “A”(Ascending) or NULL(Not sorted).
• Cardinality An estimate of the number of unique values in the index. This is updated by running ANALYZE TABLE
or myisamchk -a. Cardinalityis counted based on statistics stored as integers, so the value is not
necessarily exact even for small tables. The higher the cardinality, the greater the chance that MySQL
uses the index when doing joins.
• Sub_part The number of indexed characters if the column is only partly indexed, NULLif the entire column is indexed.
• Packed Indicates how the key is packed. NULLif it is not.
• Null Contains YESif the column may contain NULLvalues and ''if not.
• Index_type The index method used (BTREE, FULLTEXT, HASH, RTREE).
• Comment Information about the index not described in its own column, such as disabledif the index is disabled.
• Index_comment Any comment provided for the index with a COMMENTattribute when the index was created
查看索引
mysql> show index from tblname;
mysql> show keys from tblname;
· Table 表的名称。
· Non_unique 如果索引不能包括重复词,则为0。如果可以,则为1。
· Key_name 索引的名称,例如,PRIMARY。
· Seq_in_index
索引中的列序列号,从1开始。
· Column_name 列名称。
· Collation 列以什么方式存储在索引中。在MySQL中,有值‘A’(升序)或NULL(无分类)。
· Cardinality 索引中唯一值的数目的估计值。通过运行ANALYZE TABLE或myisamchk -a可以更新。基数根据被存储为整数的统计数据来计数,所以即使对于
小型表,该值也没有必要是精确的。基数越大,当进行联合时,MySQL使用该索引的机 会就越大。
· Sub_part 如果列只是被部分地编入索引,则为被编入索引的字符的数目。如果整列被编入索引,则为NULL。
· Packed 指示关键字如何被压缩。如果没有被压缩,则为NULL。
· Null 如果列含有NULL,则含有YES。如果没有,则该列含有NO。
· Index_type 用过的索引方法(BTREE, FULLTEXT, HASH, RTREE)。
· Comment
相关文章推荐
- mysql查看数据库大小,索引大小
- MySQL索引的查看创建和删除
- MySQL索引的创建、删除和查看
- mysql中索引的查看创建和删除
- MySQL索引的创建、删除和查看
- mysql 查看索引使用情况
- MySQl创建、删除、重建和查看索引命令
- mysql查看索引与存储过程
- MySQL索引的查看创建和删除
- MySQL索引的创建、删除和查看
- MySQL索引的查看创建和删除
- MySQL索引的查看创建和删除
- 如何查看MySQL索引
- 使用和管理(查看,创建,删除)MySQL索引
- mysql 表空间及索引的查看方法
- MySQL索引的查看创建和删除
- 如何查看MySQL索引
- mysql 表空间及索引的查看
- Mysql之执行计划 查看索引利用情况 explain
- mysql索引创建 删除 查看 检测