From: Michael Vogel Date: Sat, 28 Nov 2015 12:19:09 +0000 (+0100) Subject: Optimize tables on a daily base that are written very often X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=c3068c892514080d8bb1b1029bfb2182b6eac79a;p=friendica.git Optimize tables on a daily base that are written very often --- diff --git a/include/cron.php b/include/cron.php index 7b2244b55e..46d56f077e 100644 --- a/include/cron.php +++ b/include/cron.php @@ -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()); }