fix(postgres): index bare reference ID searches - #1427
Open
Gordex2014 wants to merge 1 commit into
Open
Gordex2014 wants to merge 1 commit into
Gordex2014 wants to merge 1 commit into
Conversation
Gordex2014
marked this pull request as ready for review
September 21, 2026 20:02
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
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.
Closes #1414.
PostgreSQL bare-ID reference searches previously combined an equality with a leading-wildcard suffix match. Accurate totals therefore scanned the full reference-parameter slice and timed out on the Synthea QA corpus.
This change:
Type/id, absolute URL,:Type, modifier, and contained-reference behavior;Validation:
idx_search_reference_target_idwith the target value inIndex Condand no suffix filter;Patient/id.Deployment note: schema v41 uses transactional, non-concurrent
CREATE INDEX. It permits reads but blocks writes tosearch_indexwhile building. Build time and disk use scale with reference rows; the QA corpus produced an approximately 3.3 GB index. Reference writes subsequently maintain one additional btree entry.Visual explanation
See the query-path, migration, and verification summary.
Temporary review evidence expires
2026-09-26T19:59:38.754Z.