]> git.mxchange.org Git - friendica.git/commitdiff
Optimize tables on a daily base that are written very often
authorMichael Vogel <icarus@dabo.de>
Sat, 28 Nov 2015 12:19:09 +0000 (13:19 +0100)
committerMichael Vogel <icarus@dabo.de>
Sat, 28 Nov 2015 12:19:09 +0000 (13:19 +0100)
include/cron.php

index 7b2244b55eda9a4c370ec5104479a11b57d796e6..46d56f077e63ba545da8f44b6d230224ad29d994 100644 (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());
        }