-
-
Notifications
You must be signed in to change notification settings - Fork 7k
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
Fix performance on instances list in admin UI #15282
Conversation
5afdcc4
to
61af347
Compare
10506ae
to
c75d957
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I appreciate the performance improvements here, but:
- so far, instances are sorted by number of known accounts, which won't be the case anymore. Not sure how helpful that was, so it might be fine to drop this, but i'm not sure.
- do we have to use SQL views here? I'm not fundamentally against that, but I'm unsure about adding another dependency for migrations
lib/mastodon/domains_cli.rb
needs to be updated becauseAccount#domains
got removed
Personally, I have never browsed the unfiltered list of instances since adding it. Certainly it did not matter to me how many accounts were at the top, it was just frustrating how slow the page loads.
The refactor hinges on SQL views simplifying all queries, allowing preloads etc. I think we might want to make more use of that part of PostgreSQL in the future. |
c75d957
to
efedec5
Compare
fee93ef
to
9d14291
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not actually tested yet, but apart from the remaining inlined comments it looks good to me now.
9d14291
to
7feb95d
Compare
- Reduce duplicate queries - Remove n+1 queries - Add accounts count to detailed view - Add separate action log entry for updating existing domain blocks
7feb95d
to
ff7c86c
Compare
Here is a report from the user seeing https://discourse.joinmastodon.org/t/api-errors-after-upgrade-to-v3-3-0/3209/6?u=saper |
This PR also adds a materialized view in PostgreSQL which simplifies queries and logic around getting a list of domains from the database by treating them as a read-only model.