How to automatically optimize the mysql specified table every day-PHP Chinese website Q&A-How to automatically optimize the mysql specified table every day-PHP Chinese website Q&A
CREATE EVENT `optimize_table_event` ON SCHEDULE EVERY 1 DAY STARTS '2017-03-06 00:00:00' ON COMPLETION NOT PRESERVE ENABLE COMMENT '自动优化表' DO CALL p_optimize_table()
How to automatically optimize the mysql specified table every day-PHP Chinese website Q&A-How to automatically optimize the mysql specified table every day-PHP Chinese website Q&A
Just watch and learn.
要想定时的花,mysql有自带的定时事件EVENT;例子:每天凌晨0点定时执行存储过程p_optimize_table
这只是一个定时事件,通过调用存储过程p_optimize_table,你要做的优化表工作就在这个存储过程里做。
话说,
因为搜索太多,缓存太多,所以优化表?OPTIMIZE TABLE?
好奇你要怎么优化。