The actual application of MySQL SHOW index syntax

Source: Internet
Author: User

The following article mainly describes the actual operation of the MySQL show index syntax and its actual view of the index State (syntax) description of the specific content, if you are curious about this technology, the following article will uncover its mystery.

    1. SHOW INDEX from Tbl_name [from Db_name]

MySQL SHOW Index returns table indexing information. Its format is similar to the SQLStatistics call in ODBC.

MySQL SHOW Index Returns the following fields:

Table

The name of the table.

Non_unique

0 if the index cannot include a repeating word. 1 if it is possible.

Key_name

The name of the index.

Seq_in_index

The column sequence number in the index, starting at 1.

column_name

The column name.

Collation

The column is stored in the index in what way. In the Mysqlshow index syntax, there is a value of ' A ' (ascending) or null (no classification).

Cardinality

An estimate of the number of unique values in the index. You can update by running analyze table or myisamchk-a. The cardinality is counted according to the statistics stored as integers, so even for small tables, this value is not necessarily accurate. The larger the cardinality, the greater the chance that MySQL will use the index when it is federated.

Sub_part

The number of characters that are indexed if the column is only partially indexed. Null if the entire column is indexed.

Packed

Indicates how the keyword is 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 indexed methods (BTREE, Fulltext, HASH, RTREE).

Comment

Various commentaries.

You can use Db_name.tbl_name as another form of the tbl_name from db_name syntax. The two statements are equivalent:

    1. MySQL> SHOW INDEX from mytable from MyDB;
    2. MySQL> SHOW INDEX from Mydb.mytable;

Show keys is a synonym for MySQL show index. You can also use the mysqlshow-k db_name tbl_name command to enumerate the indexes of a table.

SHOW INNODB Status syntax

    1. SHOW INNODB STATUS

In MySQL 5.1, this is a synonym for show ENGINE INNODB status, but is deprecated.

The actual application of MySQL SHOW index syntax

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.