]> Untitled Git - lemmy.git/blob - migrations/2023-07-04-153335_add_optimized_indexes/down.sql
Adding a person.admin index, and featured_local/community indexes. (#3479)
[lemmy.git] / migrations / 2023-07-04-153335_add_optimized_indexes / down.sql
1 -- Drop the new indexes
2 drop index idx_person_admin;
3
4 drop index idx_post_aggregates_featured_local_score;
5 drop index idx_post_aggregates_featured_local_newest_comment_time;
6 drop index idx_post_aggregates_featured_local_newest_comment_time_necro;
7 drop index idx_post_aggregates_featured_local_hot;
8 drop index idx_post_aggregates_featured_local_active;
9 drop index idx_post_aggregates_featured_local_published;
10 drop index idx_post_aggregates_published;
11
12 drop index idx_post_aggregates_featured_community_score;
13 drop index idx_post_aggregates_featured_community_newest_comment_time;
14 drop index idx_post_aggregates_featured_community_newest_comment_time_necro;
15 drop index idx_post_aggregates_featured_community_hot;
16 drop index idx_post_aggregates_featured_community_active;
17 drop index idx_post_aggregates_featured_community_published;
18
19 -- Create single column indexes again
20 create index idx_post_aggregates_score on post_aggregates (score desc);
21 create index idx_post_aggregates_published on post_aggregates (published desc);
22 create index idx_post_aggregates_newest_comment_time on post_aggregates (newest_comment_time desc);
23 create index idx_post_aggregates_newest_comment_time_necro on post_aggregates (newest_comment_time_necro desc);
24 create index idx_post_aggregates_featured_community on post_aggregates (featured_community desc);
25 create index idx_post_aggregates_featured_local on post_aggregates (featured_local desc);
26 create index idx_post_aggregates_hot on post_aggregates (hot_rank desc);
27 create index idx_post_aggregates_active on post_aggregates (hot_rank_active desc);