Mysql Command for querying table Indexes

Source: Internet
Author: User
Tags mysql index

MySQL queries table indexes in two command forms:

Mysql> SHOW index FROM 'tblname ';

Or:

Mysql> SHOW keys FROM 'tblname ';

The result obtained by running the preceding command is as follows. The meaning of each column in the result is described below.

The name of the Table.

Non_unique is 0 if the index cannot contain duplicate words. If yes, it is 1.

The name of the Key_name index.

The column serial number in the Seq_in_index index, starting from 1.

Column_name column name.

The way in which the Collation column is stored in the index. In MySQL, there are values 'A' (ascending) or NULL (unclassified ).

The number of unique values in the Cardinality index. You can update analyze table or myisamchk-a by running analyze table. The base number is counted based on the statistical data stored as an integer. Therefore, this value is not required to be accurate even for small tables. The larger the base, the larger the number of machines that MySQL uses the index when performing the union operation.

Sub_part: If a column is partially indexed, it is the number of indexed characters. If the entire column is indexed, the value is NULL.

Packed indicates how the keywords are compressed. If it is not compressed, It is NULL.

Null if the column contains NULL, YES is included. If NO, the column contains NO.

Index_type used index methods (BTREE, FULLTEXT, HASH, RTREE ).

Comment more comments.

Articles you may be interested in
  • MySQL index Operation Command (create index, re-index, query index, delete index) Summary
  • Note the following when querying strings with single quotes and inserting strings with single quotes in Mysql:
  • Summary of the causes and solutions for slow mysql Server Query
  • How to query data of mysql today, yesterday, last 7 days, last 30 days, last month, and last month
  • Rational use of MySQL database indexes to make the database run efficiently
  • Usage example of mysql union Query
  • Windows cannot start the hardware device because its configuration information (in the Registry) is incomplete or damaged. (Code 19) Solution
  • How many lines of files can be viewed in linux?

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.