According to mysqltunner.pl I have 177 Fragmented tables. I have over 5000 tables and 200 databases.

If I run optimize table on each of them, do you think I should take down the application to prevent reads and writes while I do this? I know that optimize locks the table, but if it is a pretty quick operation I don't know if it was cause any problems.


You can optimize a table without interrupting service by using pt-online-schema-change:

$ pt-online-schema-change --alter="ENGINE=InnoDB" --execute D=sakila,t=actor

Also, MySQL 5.6.17 supports OPTIMIZE as an online DDL change, allowing concurrent DML.

| improve this answer | |

IMHO when you maintain your DB in this invasive way, you must stop the application.

Send a communication to your customers so they be able to plan their activities.

You can't stop your application when the maintenance task are very fastes.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.