MySQL – Show Index
The Show Indexes statement can be used to obtain information about a table’s indexes. The following statement can be written as follows:
SHOW INDEXES FROM table_name;
According to the above syntax, if we wish to obtain the index of a table, we need to specify the table_name after the FROM keyword. It will return the index information of a table in the current database upon successful execution of the statement.
Example:
SHOW INDEXES FROM employee;
By specifying the database name with the Show Indexes statement, we are able to obtain the index information for a table in a different database and one to which you are not connected. Here is a more detailed explanation:
SHOW INDEXES FROM table_name IN database_name;
Example:
SHOW INDEXES FROM employee IN Demo;