Further performance improvements

This commit is contained in:
Michael 2012-07-25 22:50:06 +02:00
parent 69b883829a
commit f140a6da89
2 changed files with 8 additions and 1 deletions

View file

@ -571,6 +571,7 @@ CREATE TABLE IF NOT EXISTS `item` (
KEY `author-name` (`author-name`), KEY `author-name` (`author-name`),
KEY `uid_commented` (`uid`, `commented`), KEY `uid_commented` (`uid`, `commented`),
KEY `uid_created` (`uid`, `created`), KEY `uid_created` (`uid`, `created`),
KEY `uid_unseen` (`uid`, `unseen`),
FULLTEXT KEY `title` (`title`), FULLTEXT KEY `title` (`title`),
FULLTEXT KEY `body` (`body`), FULLTEXT KEY `body` (`body`),
FULLTEXT KEY `allow_cid` (`allow_cid`), FULLTEXT KEY `allow_cid` (`allow_cid`),

View file

@ -1338,7 +1338,13 @@ function update_1152() {
} }
function update_1153() { 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) if(! $r)
return UPDATE_FAILED; return UPDATE_FAILED;
return UPDATE_SUCCESS; return UPDATE_SUCCESS;