-
Notifications
You must be signed in to change notification settings - Fork 293
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
Improve search speed #2553
Improve search speed #2553
Conversation
great pr thanks @MJ1998! one thing i want to clarify, do you know if this column in the string index table (and similarly in other index tables) https://github.com/google/android-fhir/blob/5efb955619cc1f0ca54e0ce4bee9b7c69360d67b/engine/src/main/java/com/google/android/fhir/db/impl/entities/StringIndexEntity.kt#L49C26-L50C34 can be removed? |
Sorry for commenting late here, based on the solution I see that we are going with the assumption that |
In our query we already use a uuid to join the two tables so the resource type join is superfluous. The uuid is not the resource logical id. It's an id we create for each resource. |
Oh I see. I had a look at the |
IMPORTANT: All PRs must be linked to an issue (except for extremely trivial and straightforward changes).
Fixes #2547
As commented in the above issue, this change reduces time from ~25 seconds to few milliseconds (7k patients).
Description
Remove extra JOIN clause (
a.resourceType = b.resourceType
). This clause is not needed as we already filter the resourceType in WHERE clause.Sample DSL search:-
Query before this change:-
Query after this change:-
Notice that
a.resourceType = b.resourceType
clause is not present afterON
.Alternative(s) considered
None
Type
Choose one: (Bug fix | Feature | Documentation | Testing | Code health | Builds | Releases | Other)
Screenshots (if applicable)
Checklist
./gradlew spotlessApply
and./gradlew spotlessCheck
to check my code follows the style guide of this project../gradlew check
and./gradlew connectedCheck
to test my changes locally.