Skip to content
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

Add a MongoDB index on case reference UUID fields #701

Merged
merged 4 commits into from
Jul 31, 2020
Merged

Add a MongoDB index on case reference UUID fields #701

merged 4 commits into from
Jul 31, 2020

Conversation

axmb
Copy link
Contributor

@axmb axmb commented Jul 31, 2020

Primarily to optimize the existing batchUpsert API, but functions for any query based on the aforementioned fields.

Trialing this on a batch upload of 10k cases, each with a unique {sourceId,sourceEntryId}, it was about a 3X speedup (14s) as compared to running without the index (42s). Batch upserts without that UUID combo aren't impacted (since they don't query/filter on it, of course); but for reference, inserting 10k cases without the case reference UUID fields actually took slightly longer (16s) as compared to the indexed UUID-full batch upsert.

@axmb axmb requested a review from khmoran July 31, 2020 17:09
@axmb axmb self-assigned this Jul 31, 2020
Copy link
Contributor

@khmoran khmoran left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

very nice!

@axmb axmb merged commit 71f888c into main Jul 31, 2020
@axmb axmb deleted the caseref-index branch July 31, 2020 17:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants