-
Notifications
You must be signed in to change notification settings - Fork 427
(Fix) Update TopTorrents newest tab #5186
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
base: development
Are you sure you want to change the base?
(Fix) Update TopTorrents newest tab #5186
Conversation
Since this was ordering by torrent_id, if a torrent was uploaded and pending mod queue and other trusted torrents were uploaded after, these would bury the pending mod queue torrent after it gets approved. Ordering by created_at fixes it.
(Fix) Update TopTorrents newest tab
Revert "(Fix) Update TopTorrents newest tab"
Since this was ordering by torrent_id, if a torrent was uploaded and pending mod queue and other trusted torrents were uploaded after, these would bury the pending mod queue torrent after it gets approved. Ordering by created_at fixes it.
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.
Does the created_at index apply to this new query? What are the query times for the previous query and for this new query for a database with a few hundred thousand torrents? Given that this query is loaded on the home page, we try to make it as efficient as possible.
|
From my rough testing and lack of knowledge on how to check it properly, I didn't see any performance hit on a 100k torrent set. If you want to look further into it, I can close this and open an issue instead. |
|
By default, when you have |
|
On my local setup, previously, it took 3.24ms. Now it's takes 394ms. That's a very big performance drop, especially for the frequently loaded home page. Can you try and get it below 10ms? For perspective, the other 50 home page queries finish in 93ms combined. |
Since this was ordered by torrent_id, if a torrent was uploaded and pending moderation and other trusted torrents were uploaded after it, those would bury the pending moderation torrent once it was approved. Ordering by created_at fixes this.