Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding new indexes for htpdatasample #1689

Merged
merged 2 commits into from
Oct 15, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@
@Schema(name = "BioSampleGenomicInformation", description = "POJO that represents the BioSampleGenomicInformation")
@AGRCurationSchemaVersion(min = "2.7.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { AuditedObject.class })
@Indexed
@Table(indexes = {
@Index(name = "biosamplegenomicinfo_bioSampleAllele", columnList = "bioSampleAllele_id"),
oblodgett marked this conversation as resolved.
Show resolved Hide resolved
@Index(name = "biosamplegenomicinfo_bioSampleAgm", columnList = "bioSampleAgm_id"),
@Index(name = "biosamplegenomicinfo_bioSampleAgmType", columnList = "bioSampleAgmType_id")
})
public class BioSampleGenomicInformation extends AuditedObject {

@IndexedEmbedded(includePaths = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,18 @@
@Schema(name = "HTPExpressionDatasetSampleAnnotation", description = "POJO that represents the HighThroughputExpressionDatasetSampleAnnotation")
@AGRCurationSchemaVersion(min = "2.7.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { AuditedObject.class })
@Table(indexes = {
@Index(name = "htpdatasetsampleannotation_htpExpressionSample_index", columnList = "htpExpressionSample_id"),
@Index(name = "htpdatasetsampleannotation_dataprovider_index", columnList = "dataprovider_id"),
@Index(name = "htpdatasetsampleannotation_createdby_index", columnList = "createdby_id"),
@Index(name = "htpdatasetsampleannotation_updatedby_index", columnList = "updatedby_id")
@Index(name = "htpdatasample_htpExpressionSample_index", columnList = "htpExpressionSample_id"),
@Index(name = "htpdatasample_htpExpressionSampleType_index", columnList = "htpExpressionSampleType_id"),
@Index(name = "htpdatasample_expressionAssayUsed_index", columnList = "expressionAssayUsed_id"),
@Index(name = "htpdatasample_htpExpressionSampleAge_index", columnList = "htpExpressionSampleAge_id"),
@Index(name = "htpdatasample_genomicInformation_index", columnList = "genomicInformation_id"),
@Index(name = "htpdatasample_microarraySampleDetails_index", columnList = "microarraySampleDetails_id"),
@Index(name = "htpdatasample_geneticSex_index", columnList = "geneticSex_id"),
@Index(name = "htpdatasample_sequencingFormat_index", columnList = "sequencingFormat_id"),
@Index(name = "htpdatasample_taxon_index", columnList = "taxon_id"),
@Index(name = "htpdatasample_dataprovider_index", columnList = "dataprovider_id"),
@Index(name = "htpdatasample_createdby_index", columnList = "createdby_id"),
@Index(name = "htpdatasample_updatedby_index", columnList = "updatedby_id")
})
public class HTPExpressionDatasetSampleAnnotation extends AuditedObject {

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
--Renaming existing indexes
ALTER INDEX htpdatasetsampleannotation_createdby_index RENAME TO htpdatasample_createdby_index;
ALTER INDEX htpdatasetsampleannotation_updatedby_index RENAME TO htpdatasample_updatedby_index;
ALTER INDEX htpdatasetsampleannotation_dataprovider_index RENAME TO htpdatasample_dataprovider_index;
ALTER INDEX htpdatasetsampleannotation_htpexpressionsample_index RENAME TO htpdatasample_htpexpressionsample_index;

--Creating new indexes
CREATE INDEX htpdatasample_htpExpressionSampleType_index ON htpexpressiondatasetsampleannotation USING btree (htpExpressionSampleType_id);
CREATE INDEX htpdatasample_expressionAssayUsed_index ON htpexpressiondatasetsampleannotation USING btree (expressionAssayUsed_id);
CREATE INDEX htpdatasample_htpExpressionSampleAge_index ON htpexpressiondatasetsampleannotation USING btree (htpExpressionSampleAge_id);
CREATE INDEX htpdatasample_genomicInformation_index ON htpexpressiondatasetsampleannotation USING btree (genomicInformation_id);
CREATE INDEX htpdatasample_microarraySampleDetails_index ON htpexpressiondatasetsampleannotation USING btree (microarraySampleDetails_id);
CREATE INDEX htpdatasample_geneticSex_index ON htpexpressiondatasetsampleannotation USING btree (geneticSex_id);
CREATE INDEX htpdatasample_sequencingFormat_index ON htpexpressiondatasetsampleannotation USING btree (sequencingFormat_id);
CREATE INDEX htpdatasample_taxon_index ON htpexpressiondatasetsampleannotation USING btree (taxon_id);

CREATE INDEX biosamplegenomicinfo_bioSampleAllele ON biosamplegenomicinformation USING btree (bioSampleAllele_id);
CREATE INDEX biosamplegenomicinfo_bioSampleAgm ON biosamplegenomicinformation USING btree (bioSampleAgm_id);
CREATE INDEX biosamplegenomicinfo_bioSampleAgmType ON biosamplegenomicinformation USING btree (bioSampleAgmType_id);

--Adding 3 new htp category tags
INSERT INTO vocabularyterm (id, name, vocabulary_id) SELECT nextval('vocabularyterm_seq'), 'bulk RNA-seq', id FROM vocabulary WHERE vocabularylabel = 'data_set_category_tags';
INSERT INTO vocabularyterm (id, name, vocabulary_id) SELECT nextval('vocabularyterm_seq'), 'single cell RNA-seq', id FROM vocabulary WHERE vocabularylabel = 'data_set_category_tags';
INSERT INTO vocabularyterm (id, name, vocabulary_id) SELECT nextval('vocabularyterm_seq'), 'spatial RNA-seq', id FROM vocabulary WHERE vocabularylabel = 'data_set_category_tags';
Loading