From: Eric Bollengier Date: Wed, 16 Jun 2010 09:35:18 +0000 (+0200) Subject: Improve performance for MySQL with update stats command X-Git-Tag: Release-5.2.1~1294 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=b8dff341d9cc5ce4de3294a14e0f468cb9d3f9f5;p=bacula%2Fbacula Improve performance for MySQL with update stats command --- diff --git a/bacula/src/cats/make_mysql_tables.in b/bacula/src/cats/make_mysql_tables.in index 7fc01b3126..9fcd97ee90 100644 --- a/bacula/src/cats/make_mysql_tables.in +++ b/bacula/src/cats/make_mysql_tables.in @@ -181,6 +181,7 @@ CREATE TABLE JobHisto ( HasCache TINYINT DEFAULT 0, Reviewed TINYINT DEFAULT 0, Comment BLOB, + INDEX (JobId), INDEX (StartTime) ); diff --git a/bacula/src/cats/update_mysql_tables.in b/bacula/src/cats/update_mysql_tables.in index 22db77c3f4..f1b5e16463 100644 --- a/bacula/src/cats/update_mysql_tables.in +++ b/bacula/src/cats/update_mysql_tables.in @@ -42,6 +42,8 @@ CREATE TABLE RestoreObject ( INDEX (JobId) ); +CREATE INDEX jobhisto_jobid_idx ON JobHisto (JobId); + DELETE FROM Version; INSERT INTO Version (VersionId) VALUES (13);