pt-online-schema-change add ANALYZE TABLE

I found that after table swapping, new table key distribution remain NULL. It would be nice to add an ‘ANALYZE’ before table swapping on new table for next version. :slight_smile:

Thanks!!!

Did you somehow have innodb_stats_on_metadata=OFF during the ALTER?

I am using MyISAM. :cool: But now I am kind of hesitating to add that into a ‘must-do’ process, instead maybe to add that as an option. ANALYZE table on the newly created table will lock the table, so during analyzing table, any activities from trigger which set on the original table will be blocked and need to wait until the table lock release. It may be a problem of replication delay and also an interruption of the original table activities.