Create view for indexes
mysql>
mysql> CREATE OR REPLACE VIEW INDEXES
-> (INDEX_CREATOR, INDEX_NAME, CREATE_TIMESTAMP,
-> TABLE_CREATOR, TABLE_NAME, UNIQUE_ID, INDEX_TYPE) AS
-> SELECT DISTINCT UPPER(I.INDEX_SCHEMA), UPPER(I.INDEX_NAME),
-> T.CREATE_TIME, UPPER(I.TABLE_SCHEMA),
-> UPPER(I.TABLE_NAME),
-> CASE
-> WHEN I.NON_UNIQUE = 0 THEN 'YES'
-> ELSE 'NO'
-> END,
-> I.INDEX_TYPE
-> FROM INFORMATION_SCHEMA.STATISTICS AS I,
-> INFORMATION_SCHEMA.TABLES AS T
-> WHERE I.TABLE_NAME = T.TABLE_NAME
-> AND I.TABLE_SCHEMA = T.TABLE_SCHEMA;
Query OK, 0 rows affected (0.00 sec)
mysql>
Related examples in the same category