Changeset View
Changeset View
Standalone View
Standalone View
swh/storage/sql/60-indexes.sql
Show First 20 Lines • Show All 258 Lines • ▼ Show 20 Lines | |||||
\if :dbflavor_does_deduplication | \if :dbflavor_does_deduplication | ||||
create unique index concurrently metadata_authority_type_url on metadata_authority(type, url); | create unique index concurrently metadata_authority_type_url on metadata_authority(type, url); | ||||
\else | \else | ||||
create index concurrently metadata_authority_type_url on metadata_authority(type, url); | create index concurrently metadata_authority_type_url on metadata_authority(type, url); | ||||
\endif | \endif | ||||
-- raw_extrinsic_metadata | -- raw_extrinsic_metadata | ||||
create unique index concurrently raw_extrinsic_metadata_pkey on raw_extrinsic_metadata(id); | |||||
alter table raw_extrinsic_metadata add primary key using index raw_extrinsic_metadata_pkey; | |||||
create unique index concurrently raw_extrinsic_metadata_content_authority_date_fetcher on raw_extrinsic_metadata(target, authority_id, discovery_date, fetcher_id); | create unique index concurrently raw_extrinsic_metadata_content_authority_date_fetcher on raw_extrinsic_metadata(target, authority_id, discovery_date, fetcher_id); | ||||
olasd: this should probably be deuniqueified | |||||
Done Inline Actionsvlorentz: D5030 | |||||
\if :dbflavor_default | \if :dbflavor_default | ||||
alter table raw_extrinsic_metadata add constraint raw_extrinsic_metadata_authority_fkey foreign key (authority_id) references metadata_authority(id) not valid; | alter table raw_extrinsic_metadata add constraint raw_extrinsic_metadata_authority_fkey foreign key (authority_id) references metadata_authority(id) not valid; | ||||
alter table raw_extrinsic_metadata validate constraint raw_extrinsic_metadata_authority_fkey; | alter table raw_extrinsic_metadata validate constraint raw_extrinsic_metadata_authority_fkey; | ||||
alter table raw_extrinsic_metadata add constraint raw_extrinsic_metadata_fetcher_fkey foreign key (fetcher_id) references metadata_fetcher(id) not valid; | alter table raw_extrinsic_metadata add constraint raw_extrinsic_metadata_fetcher_fkey foreign key (fetcher_id) references metadata_fetcher(id) not valid; | ||||
alter table raw_extrinsic_metadata validate constraint raw_extrinsic_metadata_fetcher_fkey; | alter table raw_extrinsic_metadata validate constraint raw_extrinsic_metadata_fetcher_fkey; | ||||
\endif | \endif | ||||
-- object_counts | -- object_counts | ||||
create unique index concurrently object_counts_pkey on object_counts(object_type); | create unique index concurrently object_counts_pkey on object_counts(object_type); | ||||
alter table object_counts add primary key using index object_counts_pkey; | alter table object_counts add primary key using index object_counts_pkey; | ||||
-- object_counts_bucketed | -- object_counts_bucketed | ||||
create unique index concurrently object_counts_bucketed_pkey on object_counts_bucketed(line); | create unique index concurrently object_counts_bucketed_pkey on object_counts_bucketed(line); | ||||
alter table object_counts_bucketed add primary key using index object_counts_bucketed_pkey; | alter table object_counts_bucketed add primary key using index object_counts_bucketed_pkey; |
this should probably be deuniqueified