mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
PERF: add indexes to speed up profile pages (#11598)
These 2 indexes optimise performance on profile pages. The summary page displays: 1. A list of "Top Link" - links sorted by number of clicks posted by user 2. A list of "Top Replies" - replies made by a user that go the most hearts These two areas could devolve into full index or table scans, new indexes are there to avoid this cost on large dbs One minor downside is that storage requirements go a tiny bit up to maintain the new indexes
This commit is contained in:
@@ -1174,4 +1174,5 @@ end
|
||||
# index_posts_on_topic_id_and_post_number (topic_id,post_number) UNIQUE
|
||||
# index_posts_on_topic_id_and_sort_order (topic_id,sort_order)
|
||||
# index_posts_on_user_id_and_created_at (user_id,created_at)
|
||||
# index_posts_user_and_likes (user_id,like_count DESC,created_at DESC) WHERE (post_number > 1)
|
||||
#
|
||||
|
||||
Reference in New Issue
Block a user