-
Notifications
You must be signed in to change notification settings - Fork 156
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
Support _total parameter in search requests #1353
Comments
Added the label to bulkdata, it would cut the queries in nearly a half. For a 12K export that would mean about 24 queries at 100ms each is 2.4 seconds of saved time. In very large environments, this adds up. |
We may want to add support for this |
There is a little bit of validation with paging and the calculation of the next page link that detects if a request would be beyond the last page. If the _total is not "accurate", then if we skip the total page calculation to save on performance, then we would need to ensure that requests beyond the last page behave in a reasonable matter, since we would no longer know which page is the last without having the total.
|
I dug into it a bit more.
|
In FHIRPersistenceJDBCImpl.search(…) the total is used to determine matched vs included, if the _include/_revcinclude parameters are used. So may need to disallow _total in combination with _include/_revinclude. |
I think there would be a way out needing to do the match vs included calculation at all by adding "includeType" to the ResourceDTO since the underlying query does use a SORT_ORDER specifically for that. If it's worth doing, that is. |
Signed-off-by: Troy Biesterfeld <tbieste@us.ibm.com>
I think we would always return a next page blindly.
We could just return the next page, and the next page would be empty.
👍🏻 I like this approach.
Interesting, did not know we did that....
👍🏻
👍🏻 I totally agree on the disallowed combination and we'd just update our conformance.md
|
Since there's an issue for allowing the currently-disallowed combination of _sort + _include/_revinclude, #1915, I think deferring this as well. Then the combination of _total + _include/_revinclude and be considered a future enhancement. I opened issue #2070 to size and prioritize that enhancement. |
Signed-off-by: Troy Biesterfeld <tbieste@us.ibm.com>
Signed-off-by: Troy Biesterfeld <tbieste@us.ibm.com>
Signed-off-by: Troy Biesterfeld <tbieste@us.ibm.com>
Signed-off-by: Troy Biesterfeld <tbieste@us.ibm.com>
Signed-off-by: Troy Biesterfeld <tbieste@us.ibm.com>
Signed-off-by: Troy Biesterfeld <tbieste@us.ibm.com>
Signed-off-by: Troy Biesterfeld <tbieste@us.ibm.com>
Signed-off-by: Troy Biesterfeld <tbieste@us.ibm.com>
Signed-off-by: Troy Biesterfeld <tbieste@us.ibm.com>
Signed-off-by: Troy Biesterfeld <tbieste@us.ibm.com>
Issue #1353 - Add support for _total search parameter
Verified:
|
Is your feature request related to a problem? Please describe.
https://www.hl7.org/fhir/search.html#total
The _total parameter is trial-use, but could be useful in cases where the client wants to improve performance by bypassing the resource count calculation (which requires a separate database query).
Per the spec:
Team Discussion:
In our implementation we are only going to support 'estimate' as 'accurate'
Describe the solution you'd like
Implement _total as described in the spec.
Describe alternatives you've considered
Ignore _total and rely on existing count query implementation.
Additional context
N/A
The text was updated successfully, but these errors were encountered: