From 50aa509b3b66d97bd11c7bfd2c9939905a7e438f Mon Sep 17 00:00:00 2001 From: Adam Rauch Date: Thu, 30 Apr 2026 16:38:41 -0700 Subject: [PATCH 1/3] Drop redundant indices --- OConnor/module.properties | 2 +- .../schemas/dbscripts/postgresql/oconnor-26.001-26.002.sql | 7 +++++++ .../dbscripts/postgresql/genotyping-26.000-26.001.sql | 7 +++++++ genotyping/src/org/labkey/genotyping/GenotypingModule.java | 2 +- 4 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 OConnor/resources/schemas/dbscripts/postgresql/oconnor-26.001-26.002.sql create mode 100644 genotyping/resources/schemas/dbscripts/postgresql/genotyping-26.000-26.001.sql diff --git a/OConnor/module.properties b/OConnor/module.properties index 4197cc65..76c8ffa2 100644 --- a/OConnor/module.properties +++ b/OConnor/module.properties @@ -1,4 +1,4 @@ Name: OConnor -SchemaVersion: 26.001 +SchemaVersion: 26.002 RequiredServerVersion: 16.30 ManageVersion: true diff --git a/OConnor/resources/schemas/dbscripts/postgresql/oconnor-26.001-26.002.sql b/OConnor/resources/schemas/dbscripts/postgresql/oconnor-26.001-26.002.sql new file mode 100644 index 00000000..a7436b23 --- /dev/null +++ b/OConnor/resources/schemas/dbscripts/postgresql/oconnor-26.001-26.002.sql @@ -0,0 +1,7 @@ +-- Dropping key [key] because it overlaps with inventorytemp_pkey [key] +DROP INDEX oconnor.key; +-- Dropping experiment_db_experiment_number_key [experiment_number] because it overlaps with pk_experiment_db [experiment_number] +DROP INDEX oconnor.experiment_db_experiment_number_key; +-- Converting experiment_db_experiment_number_created_createdby_description_t [experiment_number, created, createdby, description, type, parents, workbook, container, modifiedby, modified, comments] from unique to non-unique index because pk_experiment_db [experiment_number] overlaps it with a smaller column set +DROP INDEX oconnor.experiment_db_experiment_number_created_createdby_description_t; +CREATE INDEX experiment_db_experiment_number_created_createdby_description_t ON oconnor.experiment_db(experiment_number, created, createdby, description, type, parents, workbook, container, modifiedby, modified, comments); diff --git a/genotyping/resources/schemas/dbscripts/postgresql/genotyping-26.000-26.001.sql b/genotyping/resources/schemas/dbscripts/postgresql/genotyping-26.000-26.001.sql new file mode 100644 index 00000000..d7ab45bf --- /dev/null +++ b/genotyping/resources/schemas/dbscripts/postgresql/genotyping-26.000-26.001.sql @@ -0,0 +1,7 @@ +-- Dropping idx_animalanalysis_animal [AnimalId] because it overlaps with uq_animalanalysis [AnimalId, RunId] +DROP INDEX genotyping.idx_animalanalysis_animal; +-- Dropping idx_animal_container [Container] because it overlaps with uq_animal_labanimalid [Container, LabAnimalId] +DROP INDEX genotyping.idx_animal_container; +-- Converting unique_runs [RowId, Container, MetaDataId] from unique to non-unique index because pk_runs [RowId] overlaps it with a smaller column set +ALTER TABLE genotyping.Runs DROP CONSTRAINT unique_runs; +CREATE INDEX index_runs ON genotyping.Runs(RowId, Container, MetaDataId); diff --git a/genotyping/src/org/labkey/genotyping/GenotypingModule.java b/genotyping/src/org/labkey/genotyping/GenotypingModule.java index b33d48d0..e77f68b3 100644 --- a/genotyping/src/org/labkey/genotyping/GenotypingModule.java +++ b/genotyping/src/org/labkey/genotyping/GenotypingModule.java @@ -51,7 +51,7 @@ public String getName() @Override public @Nullable Double getSchemaVersion() { - return 26.000; + return 26.001; } @Override From 9d42268cc3d0aaf6882f585afb73c790264671a6 Mon Sep 17 00:00:00 2001 From: Adam Rauch Date: Fri, 1 May 2026 08:28:45 -0700 Subject: [PATCH 2/3] Don't recreate 11-column index --- .../schemas/dbscripts/postgresql/oconnor-26.001-26.002.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/OConnor/resources/schemas/dbscripts/postgresql/oconnor-26.001-26.002.sql b/OConnor/resources/schemas/dbscripts/postgresql/oconnor-26.001-26.002.sql index a7436b23..c6c16e5a 100644 --- a/OConnor/resources/schemas/dbscripts/postgresql/oconnor-26.001-26.002.sql +++ b/OConnor/resources/schemas/dbscripts/postgresql/oconnor-26.001-26.002.sql @@ -2,6 +2,6 @@ DROP INDEX oconnor.key; -- Dropping experiment_db_experiment_number_key [experiment_number] because it overlaps with pk_experiment_db [experiment_number] DROP INDEX oconnor.experiment_db_experiment_number_key; --- Converting experiment_db_experiment_number_created_createdby_description_t [experiment_number, created, createdby, description, type, parents, workbook, container, modifiedby, modified, comments] from unique to non-unique index because pk_experiment_db [experiment_number] overlaps it with a smaller column set +-- Dropping unique index because pk_experiment_db [experiment_number] overlaps it with a smaller column set. Not bothering +-- to convert this unique index to a non-unique index because it has 11 columns, which is an absurd. DROP INDEX oconnor.experiment_db_experiment_number_created_createdby_description_t; -CREATE INDEX experiment_db_experiment_number_created_createdby_description_t ON oconnor.experiment_db(experiment_number, created, createdby, description, type, parents, workbook, container, modifiedby, modified, comments); From c22db367ccfbafd28d20dfbf059e5c7dba5c18f7 Mon Sep 17 00:00:00 2001 From: Adam Rauch Date: Fri, 1 May 2026 09:07:10 -0700 Subject: [PATCH 3/3] Comment --- .../schemas/dbscripts/postgresql/oconnor-26.001-26.002.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OConnor/resources/schemas/dbscripts/postgresql/oconnor-26.001-26.002.sql b/OConnor/resources/schemas/dbscripts/postgresql/oconnor-26.001-26.002.sql index c6c16e5a..78918a2f 100644 --- a/OConnor/resources/schemas/dbscripts/postgresql/oconnor-26.001-26.002.sql +++ b/OConnor/resources/schemas/dbscripts/postgresql/oconnor-26.001-26.002.sql @@ -3,5 +3,5 @@ DROP INDEX oconnor.key; -- Dropping experiment_db_experiment_number_key [experiment_number] because it overlaps with pk_experiment_db [experiment_number] DROP INDEX oconnor.experiment_db_experiment_number_key; -- Dropping unique index because pk_experiment_db [experiment_number] overlaps it with a smaller column set. Not bothering --- to convert this unique index to a non-unique index because it has 11 columns, which is an absurd. +-- to convert this unique index to a non-unique index because it has 11 columns, which is absurd. DROP INDEX oconnor.experiment_db_experiment_number_created_createdby_description_t;