Update sorting for tag-filtered public timeline: needs notice_tag_tag_created_notice_id_idx index added to notice_tag

This commit is contained in:
Brion Vibber
2010-12-17 14:37:46 -08:00
parent 33daace6cb
commit 00a5a5342a
3 changed files with 11 additions and 9 deletions

View File

@@ -1,3 +1,7 @@
-- Add indexes for sorting changes in 0.9.7
-- Allows sorting public timeline by timestamp efficiently
alter table notice add index notice_created_id_is_local_idx (created,id,is_local);
-- Allows sorting tag-filtered public timeline by timestamp efficiently
alter table notice_tag add index notice_tag_tag_created_notice_id_idx (tag, created, notice_id);

View File

@@ -307,7 +307,10 @@ create table notice_tag (
constraint primary key (tag, notice_id),
index notice_tag_created_idx (created),
index notice_tag_notice_id_idx (notice_id)
index notice_tag_notice_id_idx (notice_id),
-- For sorting tag-filtered public timeline
index notice_tag_tag_created_notice_id_idx (tag, created, notice_id)
) ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_bin;
/* Synching with foreign services */