Ensure Unique Query Parameters#5557
Open
mikaelweave wants to merge 2 commits into
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.39% -0.25%
==========================================
Files 985 993 +8
Lines 36189 36418 +229
Branches 5498 5518 +20
==========================================
+ Hits 28097 28187 +90
- Misses 6738 6869 +131
- Partials 1354 1362 +8 🚀 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 query parameters when the exact key and value are passed in. Why?
Example
GET /Patient?_tag=system%7Ccode&_tag=system%7Ccode&_total=accuratein main generatesRelated issues
AB#191513
Testing
FHIR Team Checklist
Semver Change (docs)
Patch|Skip|Feature|Breaking (reason)