From: Eric Bollengier Date: Wed, 7 Nov 2012 15:03:46 +0000 (+0100) Subject: Fix missing index on Media table X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=cde5db89e2cf65145eaed1c8353e91e802875370;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