[Exploring] De-duplicate Search Parame#5557
Open
mikaelweave wants to merge 1 commit intomainfrom
Open
Conversation
…licate SQL CTEs Exact duplicate query parameter tuples (same name and value) produced repeated identical AND predicates in SearchOptionsFactory. Each one was then turned into its own SQL Server CTE, causing long-running queries with chains of identical TokenSearchParam CTEs. Traced via Kusto to trace 245ef4e9db69c79786556e0504351e37 on pod hb3xt9mi7kd1w995ks9mp2yhj, a batch subrequest with Resource-tag repeated 13 times, resulting in 11 identical CTEs for SearchParamId 1218. Fix: apply Distinct() on the Parameters collection before parsing expressions. Preserves repeated same-name/different-value semantics (e.g. _tag=a&_tag=b) while collapsing exact duplicates. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
12f5427 to
176364e
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5557 +/- ##
==========================================
- Coverage 77.63% 77.37% -0.27%
==========================================
Files 985 985
Lines 36189 36189
Branches 5498 5498
==========================================
- Hits 28097 28000 -97
- Misses 6738 6837 +99
+ Partials 1354 1352 -2 🚀 New features to boost your workflow:
|
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
Deduplicate when the exact same search param is passed in
Related issues
Addresses [issue #].
Testing
Describe how this change was tested.
FHIR Team Checklist
Semver Change (docs)
Patch|Skip|Feature|Breaking (reason)