Closed dullbananas closed 1 week ago
I see we have separate indexes for both the content
and published desc
, but we might need to add some combined indexes for several of these, in the same way we do for the post_aggregates
table.
Indexes: "comment_pkey" PRIMARY KEY, btree (id)
"idx_comment_ap_id" UNIQUE CONSTRAINT, btree (ap_id)
"idx_comment_content_trigram" gin (content gin_trgm_ops)
"idx_comment_creator" btree (creator_id)
"idx_comment_language" btree (language_id)
"idx_comment_post" btree (post_id)
"idx_comment_published" btree (published DESC)
"idx_path_gist" gist (path)
Tested this on lemmy.ml and lemmy.ca. In both cases the API call takes around 400ms, which is consistent with other endpoints /api/v3/post/list
. So there seems to be no need for any changes.
Requirements
Summary
Any search query with comments and with New sort is very slow
Steps to Reproduce
Technical Details
🫘
Version
0.19.5
Lemmy Instance URL
https://lemmy.ca