Skip to content

Commit 6579ad1

Browse files
committed
Drop redundant indices on PostgreSQL
1 parent 0b726b1 commit 6579ad1

6 files changed

Lines changed: 19 additions & 0 deletions

File tree

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
-- This index overlaps with uq_platesetedge_fromplate_toplate
2+
DROP INDEX assay.ix_platesetedge_fromplatesetid;
3+
-- This index overlaps with uq_wellgroup_plateid_typename_name
4+
DROP INDEX assay.ix_wellgroup_plateid;
5+
-- This index overlaps with uq_well_plateid_row_col
6+
DROP INDEX assay.ix_well_plateid;
7+
-- This index overlaps with uq_plate_container_name_template
8+
DROP INDEX assay.ix_plate_container;
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
-- This index overlaps with uq_documents_parent_documentname
2+
DROP INDEX core.ix_documents_parent;
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
-- This index overlaps with pk_relatedissues
2+
DROP INDEX issues.ix_relatedissues_issueid;
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
-- This index overlaps with uq_exceptionstacktrace_container_hash
2+
DROP INDEX mothership.ix_exceptionstacktrace_container;

study/resources/schemas/dbscripts/postgresql/study-0.000-24.000.sql

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -841,6 +841,9 @@ CREATE TABLE study.VisitTagMap
841841
CONSTRAINT VisitTagMap_Container_VisitTag_Key UNIQUE (Container, VisitTag, VisitId, CohortId)
842842
);
843843

844+
-- This is NOT redundant with the VisitTagMap_Container_VisitTag_Key constraint above since the above allows multiple
845+
-- rows with the same Container, VisitTag, and VisitId as long as they all have a null CohortId. PostgreSQL 15 added
846+
-- a NULLS NOT DISTINCT option; once we require PostgreSQL 15, we could switch to using that option and remove the below.
844847
CREATE UNIQUE INDEX VisitTagMap_container_tag_visit_idx ON study.VisitTagMap (Container, VisitTag, VisitId) WHERE CohortId IS NULL;
845848

846849
CREATE TABLE study.DoseAndRoute
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
-- This index overlaps with ix_participant_currentcohort
2+
DROP INDEX study.ix_participant_cohortid;

0 commit comments

Comments
 (0)