On this page

SHOW INDEXES

Core command SHOW INDEX SH IX SHIX

Shows the indexes of a table, their columns and whether they are unique.

Syntax

SHOW INDEXES [<schema>.]<table>

Arguments

ArgumentRequiredValuesDefault
<table>YesThe exact table name, in any caseNone
<schema>.NoThe schema of the table, followed by a dotThe current schema

Examples

SHOW INDEXES ORDERS;
SHOW INDEX SALES.ORDERS;

Details

Output

One row per column of each index: the index name, the column position within the index (#), the column, and UNIQUE or NON-UNIQUE. The rows of a composite index follow each other in index order.

  • Indexes created for primary keys and unique constraints are included, since they are real indexes.
  • Table statistics, which some JDBC drivers return together with indexes, are not shown.
  • For an index on an expression, the column shows the expression text when the driver reports it.

Table name and errors

The table is found as for DESCR. A table without an index is reported as such. The command fails when no table name is given, when the table does not exist or is ambiguous, or when the JDBC driver cannot provide index metadata.

Used in these how-tos

Last modified in release 5.5.0.

Found something wrong or unclear on this page? , with the page address.