From: Eric Bollengier Date: Tue, 29 Sep 2009 14:06:56 +0000 (+0200) Subject: Add index modification in update_sqlite/sqlite3/postgresql scripts X-Git-Tag: Release-5.0.0~299^2~2 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=4b67d0451c995d42fae0cf805e55cdba666df7d0;p=bacula%2Fbacula Add index modification in update_sqlite/sqlite3/postgresql scripts --- diff --git a/bacula/src/cats/update_postgresql_tables.in b/bacula/src/cats/update_postgresql_tables.in index 87381c29f2..756c4412d6 100644 --- a/bacula/src/cats/update_postgresql_tables.in +++ b/bacula/src/cats/update_postgresql_tables.in @@ -29,6 +29,13 @@ CREATE INDEX jobhisto_idx ON JobHisto ( starttime ); UPDATE Version SET VersionId=11; COMMIT; +BEGIN; +-- Replace the broken file_fp_idx by a better one +DROP INDEX file_fp_idx; +CREATE INDEX file_jpfid_idx on file (jobid, pathid, filenameid); +ANALYSE; +COMMIT; + -- If you have already this table, you can remove it with: -- DROP TABLE JobHistory; diff --git a/bacula/src/cats/update_sqlite3_tables.in b/bacula/src/cats/update_sqlite3_tables.in index 54a407d26f..f07f7ba0cb 100644 --- a/bacula/src/cats/update_sqlite3_tables.in +++ b/bacula/src/cats/update_sqlite3_tables.in @@ -224,4 +224,9 @@ CREATE TABLE JobHisto ( ); CREATE INDEX inx61 ON JobHisto (StartTime); +-- Replace the index on (FilenameId, PathId) by (JobId, PathId, FilenameId); +DROP INDEX IF EXISTS inx4; +CREATE INDEX IF NOT EXISTS file_jpf_idx ON File (JobId, PathId, FilenameId); + + END-OF-DATA diff --git a/bacula/src/cats/update_sqlite_tables.in b/bacula/src/cats/update_sqlite_tables.in index 10a88753a4..e9fb72a214 100644 --- a/bacula/src/cats/update_sqlite_tables.in +++ b/bacula/src/cats/update_sqlite_tables.in @@ -224,4 +224,8 @@ CREATE TABLE JobHisto ( ); CREATE INDEX inx61 ON JobHisto (StartTime); +-- Replace the index on (FilenameId, PathId) by (JobId, PathId, FilenameId); +DROP INDEX inx4; +CREATE INDEX file_jpf_idx ON File (JobId, PathId, FilenameId); + END-OF-DATA