FHIR Chat · Unexpected performance of Location search parameters · hapi

Stream: hapi

Topic: Unexpected performance of Location search parameters


view this post on Zulip 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

Slow
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-postalcode=06040

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-postalcode:contains=06040

view this post on Zulip 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.

view this post on Zulip Saul Kravitz (Oct 29 2020 at 01:17):

Hi @Keith Boone -- dumb question, are those HAPI configuration options?

view this post on Zulip 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.

view this post on Zulip 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.

view this post on Zulip 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