UpdateResourceSearchParams stored procedure to handle incremental udpates #4989
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Semver Change (docs)
Patch|Skip|Feature|Breaking (reason)