Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Comment search is slow when sorting by published #4851

Open
5 tasks done
dullbananas opened this issue Jun 20, 2024 · 1 comment
Open
5 tasks done

[Bug]: Comment search is slow when sorting by published #4851

dullbananas opened this issue Jun 20, 2024 · 1 comment

Comments

@dullbananas
Copy link
Collaborator

Requirements

  • Is this a bug report? For questions or discussions use https://lemmy.ml/c/lemmy_support
  • Did you check to see if this issue already exists?
  • Is this only a single bug? Do not put multiple bugs in one issue.
  • Do you agree to follow the rules in our Code of Conduct?
  • Is this a backend issue? Use the lemmy-ui repo for UI / frontend issues.

Summary

Any search query with comments and with New sort is very slow

Steps to Reproduce

  1. Do a search for comments or all
  2. Set sort to new

Technical Details

🫘

Version

0.19.5

Lemmy Instance URL

https://lemmy.ca

@dessalines
Copy link
Member

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants