-
-
Notifications
You must be signed in to change notification settings - Fork 7.1k
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 of account timelines #17709
Conversation
9a750f4
to
79f7354
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.
The refactor is welcome, but I think I found a bug (inline comment).
Otherwise I'm on the fence about not listing DMs (or private messages, if you don't follow the person) that mention you, as there are little other places where you can check them (especially with Mastodon's DM conversation view not handling broken or forking threads very well). On the other hand, the speedup you're claiming is more than tempting.
I wonder if there's a way to improve the existing query, but I'm not sure we can efficiently handle the case where someone who often gets mentioned looks at the profile of someone they don't follow (or who sends a lot of DMs).
e0606c8
to
fa9a38f
Compare
No more behaviour change regarding mentions, join is faster than subquery. Fixed typo. |
Co-authored-by: Claire <[email protected]>
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.
The queries look good, they returned the same results than the old permitted_for
in the few real-world data tests I tried, and they seem to please the query planner! Thanks!
When
exclude_reblogs
,tagged
oronly_media
filters are requested, there is no way that a reblog would turn up in the results; nevertheless, previously a join was performed even on those queries to filter out potential reblogs from excluded accounts. This made those queries unnecessarily slower.Comparison for a "Posts" tab query as a logged-in follower (same profile):
Comparison for the "Media" tab (same profile):