Optimize tables on a daily base that are written very often
This commit is contained in:
parent
5fe8ae514b
commit
c3068c8925
1 changed files with 8 additions and 0 deletions
|
@ -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());
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue