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
| Argument | Required | Values | Default |
|---|---|---|---|
<table> | Yes | The exact table name, in any case | None |
<schema>. | No | The schema of the table, followed by a dot | The 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.
Related
- FIND INDEX, indexes by name
- SHOW PK
- DESCR, how the table name is found
Used in these how-tos
- How do I explore an unfamiliar database in fifteen minutes?
- How do I check that a deployment changed a table the same way in QA and production?
Last modified in release 5.5.0.
Found something wrong or unclear on this page? Tell us, with the page address.