To show a composite index in MySQL, you can use the
SHOW INDEX statement. Here is the syntax:
SHOW INDEX FROM [table_name];
For example, if you have a table called
customers with a composite index, you can use the following command to show the index:
SHOW INDEX FROM customers;
This command will display information about all the indexes in the specified table, including the composite index.
The output will contain several columns, but the most important ones for determining if an index is composite are:
By checking the
Non_unique column, you can identify if an index is composite or not. If the value is 1, it means the index is non-unique (composite).