Skip to content

UpdateResourceSearchParams stored procedure to handle incremental udpates #4989

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

jestradaMS
Copy link

@jestradaMS jestradaMS commented May 14, 2025

Updates to UpdateResourceSearchParams stored procedure to handle incremental updates of searchparms #135374

Description

Overview
This PR updates the SQL schema version from 89 to 90 in the Microsoft FHIR Server and enhances the UpdateResourceSearchParams stored procedure with index hints to improve query performance during FHIR resource updates and only delete and insert what's changed.

Changes in Microsoft.Health.Fhir.SqlServer.csproj
Updated the LatestSchemaVersion property from 89 to 90
Updated schema version references to ensure proper migration script generation
SQL Performance Improvements
The main focus of this PR is the optimization of the UpdateResourceSearchParams stored procedure by adding index hints to DELETE statements and only removing / adding changes.

Testing

Verified the SQL migration scripts build successfully
Tested query performance with and without index hints to validate improvements
Confirmed compatibility with existing functionality
The changes maintain backward compatibility while delivering measurable query performance improvements for resource updates.

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.
  • Tag the PR with Schema Version backward compatible or Schema Version backward incompatible or Schema Version unchanged if this adds or updates Sql script which is/is not backward compatible with the code.
  • When changing or adding behavior, if your code modifies the system design or changes design assumptions, please create and include an ADR.
  • CI is green before merge Build Status
  • Review squash-merge requirements

Semver Change (docs)

Patch|Skip|Feature|Breaking (reason)

@jestradaMS jestradaMS added this to the CY25Q2/2Wk03 milestone May 14, 2025
@jestradaMS jestradaMS requested a review from a team as a code owner May 14, 2025 14:40
@jestradaMS jestradaMS added Enhancement-Optimization Optimization on existing functionality. Azure Healthcare APIs Label denotes that the issue or PR is relevant to the FHIR service in the Azure Healthcare APIs Schema Version backward compatible labels May 14, 2025
@jestradaMS
Copy link
Author

jestradaMS commented May 14, 2025

@microsoft-github-policy-service agree company="Microsoft"

@jestradaMS jestradaMS enabled auto-merge (squash) May 14, 2025 22:08
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 Enhancement-Optimization Optimization on existing functionality. Schema Version backward compatible
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants