Optimize tables on a daily base that are written very often

This commit is contained in:
Michael Vogel 2015-11-28 13:19:09 +01:00
parent 5fe8ae514b
commit c3068c8925

View file

@ -189,6 +189,14 @@ function cron_run(&$argv, &$argc){
q('DELETE FROM `photo` WHERE `uid` = 0 AND `resource-id` LIKE "pic:%%" AND `created` < NOW() - INTERVAL %d SECOND', $cachetime);
}
// Optimize some tables that are written often
q("OPTIMIZE TABLE `cache`");
q("OPTIMIZE TABLE `session`");
q("OPTIMIZE TABLE `config`");
q("OPTIMIZE TABLE `pconfig`");
q("OPTIMIZE TABLE `photo`");
q("OPTIMIZE TABLE `workerqueue`");
set_config('system','cache_last_cleared', time());
}