From: Eric Bollengier Date: Tue, 29 Sep 2009 12:44:17 +0000 (+0200) Subject: Remove the inx4 index for SQLite2/3 (FilenameId, PathId) on X-Git-Tag: Release-7.0.0~2616^2~5 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=e71db11c224311ad2ee46cb4a60a9b0603cb8fcf;p=bacula%2Fbacula Remove the inx4 index for SQLite2/3 (FilenameId, PathId) on File table. Replace it by an index over (JobId, PathId, FilenameId). It is useless for common usage, and causes performance issues. This index fragments over the time and the update cost grows very quickly. (This index is not present on Mysql schema) --- diff --git a/bacula/src/cats/make_sqlite3_tables.in b/bacula/src/cats/make_sqlite3_tables.in index 99b5dfd9e6..78b97c7fef 100644 --- a/bacula/src/cats/make_sqlite3_tables.in +++ b/bacula/src/cats/make_sqlite3_tables.in @@ -40,14 +40,13 @@ CREATE TABLE File ( ); CREATE INDEX inx3 ON File (JobId); -CREATE INDEX inx4 ON File (FilenameId, PathId); +CREATE INDEX file_jpf_idx ON File (JobId, PathId, FilenameId); -- -- Possibly add one or more of the following indexes -- if your Verifies are too slow. -- -- CREATE INDEX inx4 ON File (PathId); -- CREATE INDEX inx5 ON File (FileNameId); --- CREATE INDEX inx9 ON File (JobId, PathId, FilenameId); CREATE TABLE Job ( JobId INTEGER, diff --git a/bacula/src/cats/make_sqlite_tables.in b/bacula/src/cats/make_sqlite_tables.in index 9bd0a481e8..e8693f0715 100644 --- a/bacula/src/cats/make_sqlite_tables.in +++ b/bacula/src/cats/make_sqlite_tables.in @@ -38,14 +38,13 @@ CREATE TABLE File ( ); CREATE INDEX inx3 ON File (JobId); -CREATE INDEX inx4 ON File (FilenameId, PathId); +CREATE INDEX file_jpf_idx ON File (JobId, PathId, FilenameId); -- -- Possibly add one or more of the following indexes -- if your Verifies are too slow. -- -- CREATE INDEX inx4 ON File (PathId); -- CREATE INDEX inx5 ON File (FileNameId); --- CREATE INDEX inx9 ON File (JobId, PathId, FilenameId); CREATE TABLE Job ( JobId INTEGER,