[Proposal / Discussion] Adding B-tree indices on fhir_uuid for core clinical tables

Hi everyone,

While reviewing fhir_uuid lookups across FHIR synchronization and HIE workflows, I noticed that the fhir_uuid columns added in liquibase/2.3.x.x/uuid_columns.xml do not yet have indices on the highest-volume clinical tables:

  • clinlims.analysis
  • clinlims.result
  • clinlims.sample
  • clinlims.sample_item
  • clinlims.patient

I’ve opened a GitHub issue to track adding standard B-tree indices via a new Liquibase changeset in 3.6.x.x/:

Summary of Proposed Change

  • Add a Liquibase XML changeset (035-add-fhir-uuid-indexes.xml, registered in 3.6.x.x/base.xml) creating non-unique B-tree indices on fhir_uuid for those five tables.
  • Guard each with <preConditions onFail="MARK_RAN"> (<indexExists>) so existing or upgraded environments don’t fail.
  • Include explicit <rollback> blocks (<dropIndex>) for every index, per Constitution Principle VI.

Questions for Maintainers

  1. Upgrade / Locking Considerations: For large production databases during upgrades, is standard Liquibase <createIndex> (which runs inside the Liquibase transaction) preferred, or would you prefer PostgreSQL CREATE INDEX CONCURRENTLY (runInTransaction="false") to avoid write locks on analysis / result / sample?
  2. Scope & Naming: Are there any other high-volume fhir_uuid tables (e.g., organization, provider already has provider_fhir_uuid_index) you’d like included or excluded from this pass?
  3. Assignment: If this looks good, could I be assigned the issue so I can put up a PR targeting develop?

Thanks!