From: Michael Date: Wed, 25 Jul 2012 20:50:06 +0000 (+0200) Subject: Further performance improvements X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=f140a6da8903e428dff3f9b702dac06a02f91219;p=friendica.git Further performance improvements --- diff --git a/database.sql b/database.sql index 13722d3c0c..684491685e 100644 --- a/database.sql +++ b/database.sql @@ -571,6 +571,7 @@ CREATE TABLE IF NOT EXISTS `item` ( KEY `author-name` (`author-name`), KEY `uid_commented` (`uid`, `commented`), KEY `uid_created` (`uid`, `created`), + KEY `uid_unseen` (`uid`, `unseen`), FULLTEXT KEY `title` (`title`), FULLTEXT KEY `body` (`body`), FULLTEXT KEY `allow_cid` (`allow_cid`), diff --git a/update.php b/update.php index 879d7017d4..2d80ee369d 100644 --- a/update.php +++ b/update.php @@ -1338,7 +1338,13 @@ function update_1152() { } function update_1153() { - $r = q("CREATE INDEX `uid_commented` ON `item` (`uid`, `commented`); CREATE INDEX `uid_created` ON `item` (`uid`, `created`)"); + $r = q("CREATE INDEX `uid_commented` ON `item` (`uid`, `commented`)"); + if(! $r) + return UPDATE_FAILED; + $r = q("CREATE INDEX `uid_created` ON `item` (`uid`, `created`)"); + if(! $r) + return UPDATE_FAILED; + $r = q("CREATE INDEX `uid_unseen` ON `item` (`uid`, `unseen`)"); if(! $r) return UPDATE_FAILED; return UPDATE_SUCCESS;