-
Notifications
You must be signed in to change notification settings - Fork 159
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
Suboptimal compartment search execution plan on Postgres #1708
Labels
bug
Something isn't working
cms-interop
This issue is associated with the CMS interoperability rule
performance
performance
Milestone
Comments
kmbarton423
added
the
cms-interop
This issue is associated with the CMS interoperability rule
label
Nov 17, 2020
punktilious
added a commit
that referenced
this issue
Nov 18, 2020
…tment searches Signed-off-by: Robin Arnold <robin.arnold23@ibm.com>
punktilious
added a commit
that referenced
this issue
Nov 19, 2020
Signed-off-by: Robin Arnold <robin.arnold23@ibm.com>
punktilious
added a commit
that referenced
this issue
Nov 20, 2020
…tered out Signed-off-by: Robin Arnold <robin.arnold23@ibm.com>
punktilious
added a commit
that referenced
this issue
Nov 22, 2020
… is required for storing compartment references Signed-off-by: Robin Arnold <robin.arnold23@ibm.com>
punktilious
added a commit
that referenced
this issue
Nov 22, 2020
Signed-off-by: Robin Arnold <robin.arnold23@ibm.com>
punktilious
added a commit
that referenced
this issue
Nov 23, 2020
Signed-off-by: Robin Arnold <robin.arnold23@ibm.com>
punktilious
added a commit
that referenced
this issue
Nov 23, 2020
Signed-off-by: Robin Arnold <robin.arnold23@ibm.com>
punktilious
added a commit
that referenced
this issue
Nov 23, 2020
issue #1708 store compartment search parameters for faster compartment search queries
This was referenced Dec 2, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
bug
Something isn't working
cms-interop
This issue is associated with the CMS interoperability rule
performance
performance
Describe the bug
Example compartment search:
Query (after parameter variable substitution):
According to the execution plan, Postgres decides to perform the access for (param0) token-values = 'active' first before it attempts to find the matching patient (param1). In other words, it is computing "get all active CareTeam values and then find me any which match the given patient" instead of "get all CareTeam resources for the given patient and find which are active". The "OR" appears to confuse the cardinality estimation. If the OR is removed for the participant (2006) reference, the query response in about 260ms (over the internet).
Expected behavior
Database should filter on the most selective predicate first (patient logical-id, in the above example) before considering far less selective predicates such as status.
Implementation Notes
Because compartment is an important concept in many searches, it seems appropriate to extract compartment membership during ingestion and populate specific fields instead of interpreting compartment membership via references in the search query.
The text was updated successfully, but these errors were encountered: