From: Eric Bollengier Date: Wed, 7 Nov 2012 15:03:46 +0000 (+0100) Subject: Fix missing index on Media table X-Git-Tag: Release-7.0.0~83 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=13751c48595fd738d33b3a56844f2119edbbf183;p=bacula%2Fbacula Fix missing index on Media table --- diff --git a/bacula/src/cats/make_postgresql_tables.in b/bacula/src/cats/make_postgresql_tables.in index cb8d58dd6d..9e570880b1 100644 --- a/bacula/src/cats/make_postgresql_tables.in +++ b/bacula/src/cats/make_postgresql_tables.in @@ -219,7 +219,8 @@ CREATE TABLE media primary key (mediaid) ); -create unique index media_volumename_id on media (volumename); +CREATE UNIQUE INDEX media_volumename_id ON Media (VolumeName); +CREATE INDEX media_poolid_idx ON Media (PoolId); CREATE TABLE MediaType ( diff --git a/bacula/src/cats/update_postgresql_tables.in b/bacula/src/cats/update_postgresql_tables.in index d737bcf35a..f97cb60007 100644 --- a/bacula/src/cats/update_postgresql_tables.in +++ b/bacula/src/cats/update_postgresql_tables.in @@ -45,6 +45,9 @@ ALTER TABLE File ADD COLUMN DeltaSeq smallint default 0; UPDATE Version SET VersionId=14; COMMIT; +set client_min_messages = fatal; +CREATE INDEX media_poolid_idx on Media (PoolId); + ANALYSE; END-OF-DATA