2023-07-20 10:44:23 -04:00
|
|
|
-- Drop the new indexes
|
2023-08-02 12:44:51 -04:00
|
|
|
DROP INDEX idx_post_aggregates_featured_local_most_comments;
|
|
|
|
|
|
|
|
DROP INDEX idx_post_aggregates_featured_local_hot;
|
|
|
|
|
|
|
|
DROP INDEX idx_post_aggregates_featured_local_active;
|
|
|
|
|
|
|
|
DROP INDEX idx_post_aggregates_featured_local_score;
|
|
|
|
|
|
|
|
DROP INDEX idx_post_aggregates_featured_community_hot;
|
|
|
|
|
|
|
|
DROP INDEX idx_post_aggregates_featured_community_active;
|
|
|
|
|
|
|
|
DROP INDEX idx_post_aggregates_featured_community_score;
|
|
|
|
|
|
|
|
DROP INDEX idx_post_aggregates_featured_community_most_comments;
|
|
|
|
|
|
|
|
DROP INDEX idx_comment_aggregates_hot;
|
|
|
|
|
|
|
|
DROP INDEX idx_comment_aggregates_score;
|
2023-07-20 10:44:23 -04:00
|
|
|
|
|
|
|
-- Add the old ones back in
|
|
|
|
-- featured_local
|
2023-08-02 12:44:51 -04:00
|
|
|
CREATE INDEX idx_post_aggregates_featured_local_hot ON post_aggregates (featured_local DESC, hot_rank DESC);
|
|
|
|
|
|
|
|
CREATE INDEX idx_post_aggregates_featured_local_active ON post_aggregates (featured_local DESC, hot_rank_active DESC);
|
|
|
|
|
|
|
|
CREATE INDEX idx_post_aggregates_featured_local_score ON post_aggregates (featured_local DESC, score DESC);
|
2023-07-20 10:44:23 -04:00
|
|
|
|
|
|
|
-- featured_community
|
2023-08-02 12:44:51 -04:00
|
|
|
CREATE INDEX idx_post_aggregates_featured_community_hot ON post_aggregates (featured_community DESC, hot_rank DESC);
|
|
|
|
|
|
|
|
CREATE INDEX idx_post_aggregates_featured_community_active ON post_aggregates (featured_community DESC, hot_rank_active DESC);
|
|
|
|
|
|
|
|
CREATE INDEX idx_post_aggregates_featured_community_score ON post_aggregates (featured_community DESC, score DESC);
|
|
|
|
|
|
|
|
CREATE INDEX idx_comment_aggregates_hot ON comment_aggregates (hot_rank DESC);
|
2023-07-20 10:44:23 -04:00
|
|
|
|
2023-08-02 12:44:51 -04:00
|
|
|
CREATE INDEX idx_comment_aggregates_score ON comment_aggregates (score DESC);
|
2023-07-20 10:44:23 -04:00
|
|
|
|