In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
This article will explain in detail the method of querying the index status of mysql for you. The editor thinks it is very practical, so I share it with you for reference. I hope you can get something after reading this article.
Mysql query index status: through the "SHOW INDEX" statement, the syntax format "SHOW INDEX FROM [FROM]"; through this statement you can check the name of the index, whether it is a unique index, the position of the field in the index, define the column field name of the index, and so on.
After the index is created, you can use the SQL statement to view the existing indexes. In MySQL, you can use the SHOW INDEX statement to view the indexes created in the table.
The syntax format for viewing the index is as follows:
SHOW INDEX FROM [FROM]
The syntax is as follows:
Specifies the name of the data table to view the index
Specifies the database in which the data table to view the index is located, which can be omitted For example, the SHOW INDEX FROM student FROM test; statement means to view the index of the student data table in the test database.
Example
The SQL statement and the result of the run are shown below.
Mysql > SHOW INDEX FROM tb_stu_info2\ gateway * 1. Row * * Table: tb_stu_info2 Non_unique: 0 Key_name: height Seq_in_index: 1 Column_name: height Collation: a Cardinality: 0 Sub_part: NULL Packed: NULL Null: YES Index_type: BTREE Comment:Index_comment:1 row in set (0.03 sec)
The main parameters are described as follows:
The parameter description Table represents the name of the data table in which the index was created, in this case the tb_stu_info2 data table. Non_unique indicates whether the index is unique. If it is not a unique index, the value of the column is 1; if it is a unique index, the value of the column is 0. Key_name represents the name of the index. Seq_in_index represents the position of the column in the index, and if the index is single, the value of the column is 1; if the index is a composite index, the value of the column is the order of each column in the index definition. Column_name represents the column field that defines the index. Collation indicates the order in which columns are stored in the index. In MySQL, ascending order displays the value "A" (ascending order), and if shown as NULL, there is no classification. An estimate of the number of unique values in the Cardinality index. The cardinality is counted according to the statistics stored as integers, so even for small tables, the value does not have to be accurate. The higher the cardinality, the greater the chance that MySQL will use the index when federating. Sub_part represents the number of characters indexed in the column. If the column is only partially indexed, the value of the column is the number of characters indexed; if the entire column is indexed, the value of the column is NULL. Packed indicates how keywords are compressed. If not compressed, the value is NULL. Null is used to show whether the index column contains NULL. If the column contains NULL, the value of the column is YES. If not, the value of the column is NO. Index_type displays the types and methods used by the index (BTREE, FULLTEXT, HASH, RTREE). Comment displays comments. On the mysql query index status method to share here, I hope that the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.