mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-11-25 05:41:18 +00:00
be1389420b
* SQL format checking, 1. * SQL format checking, 2. * SQL format checking, 3. * SQL format checking, 4. * SQL format checking, 5. * Running pg_format * Getting rid of comment. * Upping pg_format version. * Using git ls-files for sql format check. * Fixing sql lints. * Addressing PR comments.
25 lines
783 B
SQL
25 lines
783 B
SQL
-- Go through all the tables joins, optimize every view, CTE, etc.
|
|
CREATE INDEX idx_post_creator ON post (creator_id);
|
|
|
|
CREATE INDEX idx_post_community ON post (community_id);
|
|
|
|
CREATE INDEX idx_post_like_post ON post_like (post_id);
|
|
|
|
CREATE INDEX idx_post_like_user ON post_like (user_id);
|
|
|
|
CREATE INDEX idx_comment_creator ON comment (creator_id);
|
|
|
|
CREATE INDEX idx_comment_parent ON comment (parent_id);
|
|
|
|
CREATE INDEX idx_comment_post ON comment (post_id);
|
|
|
|
CREATE INDEX idx_comment_like_comment ON comment_like (comment_id);
|
|
|
|
CREATE INDEX idx_comment_like_user ON comment_like (user_id);
|
|
|
|
CREATE INDEX idx_comment_like_post ON comment_like (post_id);
|
|
|
|
CREATE INDEX idx_community_creator ON community (creator_id);
|
|
|
|
CREATE INDEX idx_community_category ON community (category_id);
|
|
|