Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to view the index in mysql

2025-01-15 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article shows you how to view the index in mysql. The content is concise and easy to understand. It will definitely brighten your eyes. I hope you can get something through the detailed introduction of this article.

SHOW INDEX FROM tbl_name [FROM db_name]

SHOW INDEX returns table index information. The format is similar to the SQLStatistics call in ODBC.

SHOW INDEX returns the following fields:

Table-the name of the table.

Non_unique-0 if the index cannot include duplicate words. 1, if possible.

Key_name-the name of the index.

Seq_in_index-the column sequence number in the index, starting at 1.

Column_name-column name.

Collation-how columns are stored in the index. In MySQL, there is a value of'A'(ascending order) or NULL (no classification).

Cardinality-an estimate of the number of unique values in the index. By running ANALYZE TABLE or

Myisamchk-a can be updated. The cardinality is counted based on statistics stored as integers, so even for small tables, the value does not need to be accurate. The higher the cardinality, the greater the chance that MySQL will use the index when federating.

Sub_part-if the column is only partially indexed, the number of characters indexed. NULL if the entire column is indexed.

Packed-indicates how keywords are compressed. NULL if it is not compressed.

Null-if the column contains NULL, it contains YES. If not, the column contains NO.

Index_type-used indexing methods (BTREE, FULLTEXT, HASH, RTREE).

Comment-multiple commentaries.

You can use db_name.tbl_name as another form of tbl_name FROM db_name syntax. These two statements are equivalent:

Mysql > SHOW INDEX FROM mytable FROM mydb

Mysql > SHOW INDEX FROM mydb.mytable

SHOW KEYS is synonymous with SHOW INDEX. You can also use the mysqlshow-k db_name tbl_name command to enumerate the index of a table.

SHOW INNODB STATUS syntax

SHOW INNODB STATUS

In MySQL 5.1, this is synonymous with SHOW ENGINE INNODB STATUS, but it is not recommended.

Show full processlist-View connection

The above is how to view the index in mysql. Have you learned any knowledge or skills? If you want to learn more skills or enrich your knowledge reserve, you are welcome to follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report