From 119fd8ad30755349d4e41249a022855aea562750 Mon Sep 17 00:00:00 2001 From: Eric Bollengier Date: Wed, 16 Jun 2010 11:35:18 +0200 Subject: [PATCH] Improve performance for MySQL with update stats command --- bacula/src/cats/make_mysql_tables.in | 1 + bacula/src/cats/update_mysql_tables.in | 2 ++ 2 files changed, 3 insertions(+) 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); -- 2.39.5