-
Notifications
You must be signed in to change notification settings - Fork 296
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
Bypass join to TokenIndexEntity
table for SearchParameter _id
#2721
Comments
TokenIndexEntity
table for SearchParameter [_id](https://build.fhir.org/search.html#_id)TokenIndexEntity
table for SearchParameter _id
Thanks for raising this @LZRS. This is a valid request. However the SQL generation logic in engine library is generic to deal with all kinds of keys. Let us evaluate if this is possible. @jingtang10 @aditya-07 |
Yeah, that would work although we have some usecases that would require Search DSL, for example getting Patient's Observations and Conditions using revInclude Example
|
@aditya-07 @dubdabasoduba @google/labs-ai-sdk-contribs we discussed this, the change should happen here:
add a shortcut so that filtering by id goes through a different codepath. |
have you tried not using revinclude and just search observations and conditions with a reference to the known patient? i guess in the applicaiton you want one query to load all the observations and conditions? is that right? |
No, we hadn't tried that. But I believe that would then require multiple queries, although they wouldn't probably be more than 5....yeah, I think we could try that In that case, implementing this would just be okay I think |
Is your feature request related to a problem? Please describe.
Searching for resources given multiple ids with filter
_id
, does a join to theTokenIndexEntity
, that may seem to incur an extra performance costDescribe the solution you'd like
When search is done using filter in the form
the query generated is of the form of
The suggestion we had was if we could bypass joining to the
TokenIndexEntity
table for the_id
, and instead filter directly from theResourceEntity
table.The resulting query would therefore look similar to
Additional context
Link to
RES_ID
constantDescribe alternatives you've considered
Enhancing the
fhirEngine.get
interface to support multipleresourceId
to fetch multiple resources, although this wouldn't work with the rest of the Search DSLWould you like to work on the issue?
Please state if this issue should be assigned to you or who you think could help to solve this issue.
The text was updated successfully, but these errors were encountered: