Skip to content

Conversation

@jestradaMS
Copy link
Contributor

@jestradaMS jestradaMS commented Oct 17, 2025

Description

This pull request introduces a new SQL schema version (V98) for the FHIR SQL Server implementation, primarily to add an index that improves search parameter performance. The main changes include updating schema version constants, adding the new index, and adjusting configuration and project files to support the new version.

Schema version updates:

  • Added V98 to the SchemaVersion enum in SchemaVersion.cs, and updated SchemaVersionConstants.Max to reference V98. [1] [2]
  • Defined SearchParameterLastUpdatedIndex constant for V98 in SchemaVersionConstants.cs.
  • Updated the project file (Microsoft.Health.Fhir.SqlServer.csproj) to set LatestSchemaVersion to 98.

Database performance improvement:

  • Added a nonclustered index IX_SearchParam_LastUpdated on the LastUpdated column in the SearchParam table, both in the main table definition and as a migration script. [1] [2]

Configuration tuning:

  • Reduced SearchParameterCacheRefreshIntervalSeconds from 60 to 20 in appsettings.json to allow for more frequent cache refreshes.

Related issues

Addresses AB#174673.

Testing

Describe how this change was tested.

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 CY25Q3/2Wk08 milestone Oct 17, 2025
@jestradaMS jestradaMS requested a review from a team as a code owner October 17, 2025 17:23
@github-actions github-actions bot added the SQL Scripts If SQL scripts are added to the PR label Oct 17, 2025
@jestradaMS jestradaMS added the Azure Healthcare APIs Label denotes that the issue or PR is relevant to the FHIR service in the Azure Healthcare APIs label Oct 17, 2025
@jestradaMS jestradaMS changed the title Add Index to SearchParam Last Updated and set background sync to 20 seconds Index LastUpdated in SearchParam and set BG sync to 20 seconds Oct 17, 2025
@SergeyGaluzo
Copy link
Contributor

  1. Index name IX_SearchParam_LastIUpdated contains table name, which is redundant for indexes. Please change to IX_LastIUpdated
  2. Compression for this small table is not required. Please remove from newly added index.

@jestradaMS jestradaMS enabled auto-merge (squash) October 20, 2025 13:54
@jestradaMS jestradaMS merged commit aa52541 into main Oct 23, 2025
55 checks passed
@jestradaMS jestradaMS deleted the users/jestrada/searchparambackgroundserviceupdates branch October 23, 2025 21:54
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 SQL Scripts If SQL scripts are added to the PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants