-
-
Notifications
You must be signed in to change notification settings - Fork 0
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
Review indices on mongodb #438
Comments
I would like to understand the rationale behind the recent index changes. Did we do any profiling to verify that these changes have a positive or negative impact? |
Yes, this is all the result of looking at the query profiler and index usage in Atlas. We were running into issues with queries on pretranslations examining way too many documents (because they weren't covered by existing indexes). Peeking now, I see that the same kind of query pre-update took almost 2 seconds and now it's taking around 200 ms. I removed redundant indexes, and I also removed indexes that were completely unused. (There was also a separate change regarding a bug in using a change stream that was causing a performance hit). |
That sounds good. We probably want to re-add the index on the |
Do we have an issue to fix the bug in using change streams? |
OK. That makes sense. I did wonder about that - I figured the lack of use might be more to do with the kinds of requests we're getting more than simply unneeded indexes. I can put in a PR to re-add those quickly.
I fixed the particular misuse in a recent PR and left a comment about ways in which we might improve the implementation of change stream use in general by using resume tokens (if we intend to keep the timeout functionality). |
I think we want to keep the timeout functionality. We should probably create a separate issue to track fixing the change streams. |
At some point, we should carefully comb through exiting indices specified in mongodb and see which are being used as well as give more thought to compound indices. We should also remove unused indices (both from the code and make sure to delete from Atlas).
The text was updated successfully, but these errors were encountered: