Stream: hapi
Topic: Unexpected performance of Location search parameters
Saul Kravitz (Oct 28 2020 at 20:20):
Three searches, one using Location:address, and two variants on Location:address-postalcode.
The first runs 20x faster than the other. Thoughts?
Fast:
https://davinci-plan-net-ri.logicahealth.org/fhir/Location?_has:OrganizationAffiliation:location:network=Organization/plannet-network-HPID010000&_has:OrganizationAffiliation:location:role=pharmacy&_revinclude=OrganizationAffiliation:location&address:contains=06040
Keith Boone (Oct 28 2020 at 23:04):
Check the indexes that might be used. Different query parameters might result in different optimization decisions being used by the query optimizer. That kind of speed difference is typically a result of indexing choices, and/or query optimization planning choices.
Saul Kravitz (Oct 29 2020 at 01:17):
Hi @Keith Boone -- dumb question, are those HAPI configuration options?
Keith Boone (Nov 04 2020 at 21:16):
Even dumber answer: I don't know, but I suspect that @James Agnew might be able to point you in the right direction.
Keith Boone (Nov 04 2020 at 21:17):
For what it's worth, the HAPI JPA Server does (or can) log the queries it is using if I remember correctly, and that might provide more insight.
Ian Bacher (Nov 05 2020 at 14:35):
I'm noticing that the two "fast" queries are both using :contains
, which makes me think that the difference here is that the :contains
queries are hitting the Lucene index (which is used for full-text search and can be quite a bit faster), but I'm not really familiar enough with the JPA server search internals to be sure about that.
Last updated: Apr 12 2022 at 19:14 UTC