Filter stat for ReferenceSearchParam and UriSearchParam table#5531
Open
apurvabhaleMS wants to merge 5 commits into
Open
Filter stat for ReferenceSearchParam and UriSearchParam table#5531apurvabhaleMS wants to merge 5 commits into
apurvabhaleMS wants to merge 5 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5531 +/- ##
=======================================
Coverage ? 77.69%
=======================================
Files ? 985
Lines ? 36192
Branches ? 5498
=======================================
Hits ? 28120
Misses ? 6717
Partials ? 1355 🚀 New features to boost your workflow:
|
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds filtered-statistics support for additional SQL search parameter tables (ReferenceSearchParam and UriSearchParam) and verifies the behavior with new unit/integration tests.
Changes:
- Extend
GetKeyColumnsto includedbo.ReferenceSearchParamanddbo.UriSearchParamkey columns. - Add unit tests covering
GetKeyColumnsacross single/two-column tables and unknown/null tables. - Add integration tests asserting filtered stats are created (and skipped for
:missing/ NotExists expressions).
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| test/Microsoft.Health.Fhir.Shared.Tests.Integration/Persistence/SqlServerCreateStatsTests.cs | Adds integration coverage for stats creation for Reference/Uri params and for NotExists behavior. |
| src/Microsoft.Health.Fhir.SqlServer/Features/Search/SqlServerSearchService.cs | Expands key-column mapping for filtered stats to Reference/Uri tables and shares it with the stats pipeline. |
| src/Microsoft.Health.Fhir.SqlServer.UnitTests/Features/Search/SqlServerSearchServiceTests.cs | Adds unit tests validating the expanded GetKeyColumns behavior. |
Contributor
|
I think stats on ref search param should be ST_ReferenceResourceId_WHERE_ResourceTypeId_40_SearchParamId_1219_ReferenceResourceTypeId_XXX |
…i-table # Conflicts: # src/Microsoft.Health.Fhir.SqlServer.UnitTests/Features/Search/SqlServerSearchServiceTests.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
This PR extends the SQL Server filtered statistics mechanism to cover
ReferenceSearchParamandUriSearchParamtables, which were previously missing. When FHIR searches hit these tables, the query optimizer now has per-resource-type statistics for better plan selection.dbo.ReferenceSearchParam
ReferenceResourceIdReferenceResourceTypeIddbo.UriSearchParam
UriScreenshots
Related issues
Addresses AB189018.
Testing
Describe how this change was tested.
FHIR Team Checklist
Semver Change (docs)
Patch|Skip|Feature|Breaking (reason)