<code>檢視表上的索引狀态:</code>
<code></code>
<code>SHOW INDEX</code> returns table index information.
<code>SHOW KEYS</code> and <code>SHOW INDEXES</code> are synonyms for <code>SHOW INDEX</code>.
文法:
show {index|indexes} from table_name [ from db_name ] [where expr]
The following fields are returned by <code>SHOW INDEX</code>.
Field
Description
Table
Table name
Non_unique
<code>1</code> if the index permits duplicate values, <code>0</code> if values must be unique.
Key_name
Index name. The primary key is always named <code>PRIMARY</code>.
Seq_in_index
The column's sequence in the index, beginning with <code>1</code>.
Column_name
Column name.
Collation
Either <code>A</code>, if the column is sorted in ascending order in the index, or <code>NULL</code> if it's not sorted.
Cardinality
Estimated number of unique values in the index. The cardinality statistics are calculated at various times, and can help the optimizer make improved decisions.
Sub_part
<code>NULL</code> if the entire column is included in the index, or the number of included characters if not.
Packed
<code>NULL</code> if the index is not packed, otherwise how the index is packed.
Null
<code>NULL</code> if <code>NULL</code> values are permitted in the column, an empty string if <code>NULL</code>'s are not permitted.
Index_type
Comment
Other information, such as whether the index is disabled.
Index_comment
Contents of the <code>COMMENT</code> attribute when the index was created.
本文轉自 wangergui 51CTO部落格,原文連結:http://blog.51cto.com/wangergui/2074486,如需轉載請自行聯系原作者