lemmy/migrations/2023-02-01-012747_fix_active_index/up.sql
Dessalines d0c94a4f49
Fixing GetPosts active sort index. Fixes #2683 (#2684)
* Fixing GetPosts active sort index. Fixes #2683

* Fixing other sort.
2023-02-02 14:09:32 -05:00

7 lines
566 B
SQL

-- This should use the newest_comment_time_necro, not the newest_comment_time for the hot_rank
drop index
idx_post_aggregates_featured_local_active,
idx_post_aggregates_featured_community_active;
create index idx_post_aggregates_featured_local_active on post_aggregates (featured_local desc, hot_rank(score, newest_comment_time_necro) desc, newest_comment_time_necro desc);
create index idx_post_aggregates_featured_community_active on post_aggregates (featured_community desc, hot_rank(score, newest_comment_time_necro) desc, newest_comment_time_necro desc);