I\'ve been working on my development database and have tweaked its performance.
However, to my surprise I can\'t find a way to export the indexes to my production da
I also have development and production servers with the same database structure.
I modified indexes on both of them so I wanted to merge all together. So I needed to compare data with Notepad+.
Here is how you export indexes for all tables, all databases and how to filter and compare them:
--- Single table:
SHOW INDEX FROM mydb.mytable;
SHOW INDEX FROM mytable;
--- Multi tables, databases:
USE information_schema;
SELECT * FROM `statistics` ORDER BY TABLE_SCHEMA ASC, TABLE_NAME ASC, INDEX_NAME ASC;
Now, phpMyAdmin -> Export to CSV-Excel:
add a header row -> delete all columns but leave "database_name table_name index column value"
Then, filter by database.
Copy all from database1 to a notepad+ screen 1, filter excel database2, copy all to notepad+ screen 2 -> COMPARE!