Skip to content
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

SQL retry on query plan failure, use INNER JOIN instead of EXISTS #3295

Merged
merged 7 commits into from
May 17, 2023

Conversation

feordin
Copy link
Contributor

@feordin feordin commented May 12, 2023

At times with complex FHIR queries, the resulting SQL query is very complex and SQL server can timeout attempting to generate the query plan. We use an EXISTS clause to link References to the target type, but it reduces the burden on SQL server if we use an INNER JOIN.

This change alters the SQL query generator to use an INNER JOIN for ReferenceSearchParams.

Related issues

Addresses [issue AB#95713].

Testing

Manual testing with include .http file. Also added automated testing via member match.

FHIR Team Checklist

  • Update the title of the PR to be succinct and less than 65 characters
  • Add a milestone to the PR for the sprint that it is merged (i.e. add S47)
  • Tag the PR with the type of update: Bug, Build, Dependencies, Enhancement, New-Feature or Documentation
  • Tag the PR with Open source, Azure API for FHIR (CosmosDB or common code) or Azure Healthcare APIs (SQL or common code) to specify where this change is intended to be released.
  • CI is green before merge Build Status
  • Review squash-merge requirements

Semver Change (docs)

Patch|Skip|Feature|Breaking (reason)

@feordin feordin requested a review from a team as a code owner May 12, 2023 18:19
@feordin feordin added Bug Bug bug bug. Enhancement Enhancement on existing functionality. Azure Healthcare APIs Label denotes that the issue or PR is relevant to the FHIR service in the Azure Healthcare APIs labels May 12, 2023
@feordin feordin added this to the S114 milestone May 12, 2023
@feordin feordin merged commit 8c86f75 into main May 17, 2023
@feordin feordin deleted the personal/jaerwin/sql-query-generation branch May 17, 2023 18:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Azure Healthcare APIs Label denotes that the issue or PR is relevant to the FHIR service in the Azure Healthcare APIs Bug Bug bug bug. Enhancement Enhancement on existing functionality.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants