Will optimize table locks the insert,update and DDLs - Percona MySQL 5.6.39

I am using Percona MySQL 5.6.39 and our application is processing 24*7.

Will running optimize table on a 64 GB table can lock the table from serving and endup in a downtime. I am planning to do this activity on a weekend when the hit is less.


Any suggestions please

Hello johnsonmjacobs optimize will lock the table, yes.

Percona Toolkit pt-online-schema-change might work for you? Please always TEST TEST TEST before using anything new in production to make sure that it works for you.


Also, you can search on our blog and website for more ideas/tips - there are quite a few articles that might help you minimize down time if you decide to go with optimize table.

Have a look at those resources and then if there’s any additional questions, come back here and I’ll see if I can get someone to resolve those (though we can’t help with anything that is particular to your environment, only generic points that apply to all).