MySQL official recommendations for table defragmentation optimize table operations
1.MySQL The official recommendation is not to often (hourly or daily) defragmentation, generally according to the actual situation, only a weekly or monthly collation can be written as a scheduled task to do.
The 2.OPTIMIZE table works only on MYISAM,BDB and InnoDB tables, especially in MyISAM tables. In addition, not all tables need to be defragmented, generally only the tables containing the variable-length text data types described above can be collated.
3. mysql locks the table during optimize table operation.
4. By default, the Optimize table is used directly on the INNODB engine's data table, which may display "table does not support optimize, doing recreate + analyze instead" prompts. This time, we can
Restart MySQL with the mysqld--skip-new or mysqld--safe-mode command to enable other engines to support optimize TABLE.
Reference Documentation:
Https://www.cnblogs.com/jimmy-muyuan/p/5874410.html
http://blog.itpub.net/15498/viewspace-2124721/
MySQL about table defragmentation optimize table operation