fix: Remove unnecessary calls to the DB during DataValueSet import [D… #15688
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
…HIS2-16159]
Summary
During a
DataValueSet
import, calls are made to the DB to getOrganisationUnit
s when theAttributeOptionCombo
has links toOrganisationUnit
s. When there are large amounts ofOrganisationUnit
s this can lead to the import taking a long time.v38 did not experience these issues.
Cause
During a large refactor PR the implementation that was working well was changed.
In v38 code we check
OrganisationUnit
s that are already in-memory (ImportContext
).Post v38 we check
OrganisationUnit
s using a service call which in turn calls the DB.Fix
Revert back to original implementation, checking the
OrganisationUnit
s in memory.Needs backporting to:
Testing
The data below is based on following the steps provided in the Jira issue.
Running locally on a Mac.