Skip to content

Drop redundant unique index on snprc_ehr.labwork_services.ServiceId - #976

Merged
labkey-bpatel merged 1 commit into
release26.3-SNAPSHOTfrom
26.3_fb_remove_dup_idx
Aug 7, 2026
Merged

Drop redundant unique index on snprc_ehr.labwork_services.ServiceId#976
labkey-bpatel merged 1 commit into
release26.3-SNAPSHOTfrom
26.3_fb_remove_dup_idx

Conversation

@labkey-bpatel

Copy link
Copy Markdown
Contributor

Rationale

snprc_ehr.labwork_services declares PRIMARY KEY (ServiceId) and then creates idx_labwork_services_serviceid, a UNIQUE index on that same column. The primary key's B-tree already enforces the identical uniqueness guarantee and serves the same queries, so the second index costs write throughput and storage while buying nothing. ToolsController$TestCase.testOverlappingIndices fails on PostgreSQL because of it.

The index dates to 2017, when the table's primary key was changed to ServiceId. It only became visible to this test after PostgreSQL support was added to the SNPRC modules, since the test is gated on isPostgreSQL().

Related Pull Requests

Changes

  • Drop redundant unique index on snprc_ehr.labwork_services.ServiceId
  • Bump snprc_ehr schema version 26.001 -> 26.002

@labkey-bpatel
labkey-bpatel merged commit 653e460 into release26.3-SNAPSHOT Aug 7, 2026
7 of 9 checks passed
@labkey-bpatel
labkey-bpatel deleted the 26.3_fb_remove_dup_idx branch August 7, 2026 17:27
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