]> git.sur5r.net Git - bacula/bacula/commitdiff
Remove the inx4 index for SQLite2/3 (FilenameId, PathId) on
authorEric Bollengier <eric@eb.homelinux.org>
Tue, 29 Sep 2009 12:44:17 +0000 (14:44 +0200)
committerEric Bollengier <eric@eb.homelinux.org>
Tue, 29 Sep 2009 13:49:29 +0000 (15:49 +0200)
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)

bacula/src/cats/make_sqlite3_tables.in
bacula/src/cats/make_sqlite_tables.in

index 8f1ce00833da136f50d2711d5c6bef638575f906..98b037d8682b286d422241c8e9026b5356e238f6 100644 (file)
@@ -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,
index 9bd0a481e8327b2f9ccf8cfba5c384fd6ed2235a..e8693f0715b1d118dbb3e19969f8bb52b4ed2893 100644 (file)
@@ -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,