Skip to content

Add CosmosDB query optimization documentation#1

Draft
drdr-kr with Copilot wants to merge 2 commits into
mainfrom
copilot/improve-cosmosdb-query-efficiency
Draft

Add CosmosDB query optimization documentation#1
drdr-kr with Copilot wants to merge 2 commits into
mainfrom
copilot/improve-cosmosdb-query-efficiency

Conversation

Copilot AI commented Mar 14, 2026

Copy link
Copy Markdown

Description

Adds documentation explaining CosmosDB indexing internals and query optimization strategies for identifier-based lookups.

New documentation (docs/CosmosDbQueryOptimization.md):

  • How FHIR resources are stored and indexed in CosmosDB (document structure, field abbreviations, partition keys)
  • How identifiers (e.g., NHS numbers) are stored as token search values
  • Optimized query patterns for identifier lookups across related resources
  • Configuration options for reducing RU consumption (UseQueryStatistics, MaxQueryConcurrency, DefaultConsistencyLevel)
  • Best practices for batching queries with _include/_revinclude
  • Monitoring and troubleshooting guidance

Example optimized query pattern:

GET /Patient?identifier=https://fhir.nhs.uk/Id/nhs-number|1234567890
    &_revinclude=Appointment:patient
    &_revinclude=DocumentReference:patient

Related issues

User question about CosmosDB indexing and RU optimization for identifier-based lookups.

Testing

Documentation-only change. Verified Markdown renders correctly.

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)

Skip


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: drdr-kr <157009894+drdr-kr@users.noreply.github.com>
Copilot AI changed the title [WIP] Investigate indexing and query optimization for FHIR server Add CosmosDB query optimization documentation Mar 14, 2026
Copilot AI requested a review from drdr-kr March 14, 2026 08:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants