Reputation: 17530
I'm using MySQL.
Is there any way to see all the indexes in a list on a particular database ?
Upvotes: 2
Views: 1521
Reputation: 17530
I got this
SELECT DISTINCT TABLE_NAME, INDEX_NAME
FROM INFORMATION_SCHEMA.STATISTICS
WHERE TABLE_SCHEMA = 'your_schema';
Upvotes: 0
Reputation: 5350
SELECT *
FROM information_schema.STATISTICS
WHERE TABLE_SCHEMA = DATABASE()
Upvotes: 6
Reputation: 11274
http://dev.mysql.com/doc/refman/5.0/en/show-index.html
To get all indexes for a given database use:
select * from information_schema.statistics
Upvotes: 1
Reputation: 13982
For all indexes of a database you have to read from information_schema.STATISTICS:
SELECT *
FROM information_schema.STATISTICS
WHERE TABLE_SCHEMA = DATABASE()
Upvotes: 1