Forum Indexes
Existing Indexes, Complete Set
Currently there are 24 indexes.
Suggested For Removal:
Other compound indexes take priority over "comment_thread_id_1"
Other compound indexes take priority over "author_id_1"
Other compound indexes take priority over "commentable_id_1"
For Further Review:
I don't believe this query ever runs by itself.
We currently do not support showing the least votes on the browser nor does it make sense to.
I don't know if this query ever runs by itself but it might exist as a catchall in case an index for most upvotes does not exist? The only combinations in the browser are "most voted" * ("all", "unread", "pinned", "flagged"). Would require more digging. Also, votes.point is the sum of votes.up and vote.down, I don't know what the use case would be for just getting only the most upvoted.
When running `db.contents.disctinct("delete_spam")`, there are no entries.
I'm not sure if this ever gets call or not.
No index for this query. It searches by commentable_id but this is not sufficient. Suggested to add a more specific index?
https://openedx.atlassian.net/browse/DEVOPS-3156
endorsed_date
db.contents.ensureIndex({"_type" : -1, "course_id" : 1, "pinned" : -1, "endorsed": -1, "last_activity_at" : -1, "created_at": -1}, {"background":true})endorsed_votes
db.contents.ensureIndex({"_type" : -1, "course_id" : 1, "pinned" : -1, "endorsed": -1, "votes.point" : -1, "created_at": -1}, {"background":true})endorsed_comments
db.contents.ensureIndex({"_type" : -1, "course_id" : 1, "pinned" : -1, "endorsed": -1, "comment_count" : -1, "created_at": -1}, {"background":true})Comments
Christopher Lee (Deactivated) Edward Zarecor (Do Not Use) (Deactivated) has the exercise taken place of removing the indexes proposed for removal in loadtest, and running locust against the service, to see what happens?
Not yet, but when we added an index last time we followed a similar process. Removal of indexes took <1s.
I assume restoring the index took quite a bit longer than that...
Christopher Lee (Deactivated): Does the column ordering really match up? For instance, on the first query, shouldn't endorsed go before pinned?
pinned is almost always used in multiple thread queries, but i don't think endorsed always is.
I believe you are correct. We would be throwing away pinned results if they are not endorsed. Good catch.
edit: Might not matter.
Dave Ormsbee (Deactivated) Jim Abramson (Deactivated) ChristinaR (Deactivated) Nimisha Asthagiri (Deactivated)
All, Christopher Lee (Deactivated) is proposing some changes to indexes for the forums and we wanted some additional review and feedback before proceeding. We are trying to get this moving quickly, so your timely review is appreciated.