From f140a6da8903e428dff3f9b702dac06a02f91219 Mon Sep 17 00:00:00 2001 From: Michael Date: Wed, 25 Jul 2012 22:50:06 +0200 Subject: [PATCH] Further performance improvements --- database.sql | 1 + update.php | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) 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; -- 2.39.5