show/view indexes in database MySQL
I'm using MySQL.
Is there any way to see all the indexes in a list on 开发者_StackOverflow中文版a particular database ?SELECT *
FROM information_schema.STATISTICS
WHERE TABLE_SCHEMA = DATABASE()
For all indexes of a database you have to read from information_schema.STATISTICS:
SELECT *
FROM information_schema.STATISTICS
WHERE TABLE_SCHEMA = DATABASE()
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
I got this
SELECT DISTINCT TABLE_NAME, INDEX_NAME
FROM INFORMATION_SCHEMA.STATISTICS
WHERE TABLE_SCHEMA = 'your_schema';
精彩评论