]> Untitled Git - lemmy.git/blob - migrations/2023-04-23-164732_add_person_details_indexes/up.sql
Speedup CI (#3852)
[lemmy.git] / migrations / 2023-04-23-164732_add_person_details_indexes / up.sql
1 -- Add a few indexes to speed up person details queries
2 CREATE INDEX idx_person_lower_name ON person (lower(name));
3
4 CREATE INDEX idx_community_lower_name ON community (lower(name));
5
6 CREATE INDEX idx_community_moderator_published ON community_moderator (published);
7
8 CREATE INDEX idx_community_moderator_community ON community_moderator (community_id);
9
10 CREATE INDEX idx_community_moderator_person ON community_moderator (person_id);
11
12 CREATE INDEX idx_comment_saved_comment ON comment_saved (comment_id);
13
14 CREATE INDEX idx_comment_saved_person ON comment_saved (person_id);
15
16 CREATE INDEX idx_community_block_community ON community_block (community_id);
17
18 CREATE INDEX idx_community_block_person ON community_block (person_id);
19
20 CREATE INDEX idx_community_follower_community ON community_follower (community_id);
21
22 CREATE INDEX idx_community_follower_person ON community_follower (person_id);
23
24 CREATE INDEX idx_person_block_person ON person_block (person_id);
25
26 CREATE INDEX idx_person_block_target ON person_block (target_id);
27
28 CREATE INDEX idx_post_language ON post (language_id);
29
30 CREATE INDEX idx_comment_language ON comment (language_id);
31
32 CREATE INDEX idx_person_aggregates_person ON person_aggregates (person_id);
33
34 CREATE INDEX idx_person_post_aggregates_post ON person_post_aggregates (post_id);
35
36 CREATE INDEX idx_person_post_aggregates_person ON person_post_aggregates (person_id);
37
38 CREATE INDEX idx_comment_reply_comment ON comment_reply (comment_id);
39
40 CREATE INDEX idx_comment_reply_recipient ON comment_reply (recipient_id);
41
42 CREATE INDEX idx_comment_reply_published ON comment_reply (published DESC);
43