top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

How can I list all indexes in a table in MYSQL?

0 votes
828 views
How can I list all indexes in a table in MYSQL?
posted Mar 28, 2017 by Deepa

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

3 Answers

0 votes

To see the index for a specific table use SHOW INDEX:

SHOW INDEX FROM yourtable;

To see indexes for all tables within a specific schema you can use the STATISTICS table from INFORMATION_SCHEMA:

SELECT DISTINCT
    TABLE_NAME,
    INDEX_NAME
FROM INFORMATION_SCHEMA.STATISTICS
WHERE TABLE_SCHEMA = 'your_schema';

Removing the where clause will show you all indexes in all schemas.

answer Mar 28, 2017 by Shivaranjini
0 votes

select * from mysql.statistics ;

answer Mar 29, 2017 by Aanchal Rastogi
0 votes

Hi
To see index of specific table you can use following query.

SHOW INDEX FROM tablename;
answer Nov 20, 2019 by Siddhi Patel
Similar Questions
0 votes

How can I insert data into one table from two other tables where i have three tables namely users, role and userrole.
Now I want to insert the data into userrole table from users table and role table with a single statement.

...