1 -- Drop the new indexes
2 DROP INDEX idx_post_aggregates_featured_local_most_comments;
4 DROP INDEX idx_post_aggregates_featured_local_hot;
6 DROP INDEX idx_post_aggregates_featured_local_active;
8 DROP INDEX idx_post_aggregates_featured_local_score;
10 DROP INDEX idx_post_aggregates_featured_community_hot;
12 DROP INDEX idx_post_aggregates_featured_community_active;
14 DROP INDEX idx_post_aggregates_featured_community_score;
16 DROP INDEX idx_post_aggregates_featured_community_most_comments;
18 DROP INDEX idx_comment_aggregates_hot;
20 DROP INDEX idx_comment_aggregates_score;
22 -- Add the old ones back in
24 CREATE INDEX idx_post_aggregates_featured_local_hot ON post_aggregates (featured_local DESC, hot_rank DESC);
26 CREATE INDEX idx_post_aggregates_featured_local_active ON post_aggregates (featured_local DESC, hot_rank_active DESC);
28 CREATE INDEX idx_post_aggregates_featured_local_score ON post_aggregates (featured_local DESC, score DESC);
31 CREATE INDEX idx_post_aggregates_featured_community_hot ON post_aggregates (featured_community DESC, hot_rank DESC);
33 CREATE INDEX idx_post_aggregates_featured_community_active ON post_aggregates (featured_community DESC, hot_rank_active DESC);
35 CREATE INDEX idx_post_aggregates_featured_community_score ON post_aggregates (featured_community DESC, score DESC);
37 CREATE INDEX idx_comment_aggregates_hot ON comment_aggregates (hot_rank DESC);
39 CREATE INDEX idx_comment_aggregates_score ON comment_aggregates (score DESC);