From 3980a53dce47b0f14bca61082b762323ab2cdf12 Mon Sep 17 00:00:00 2001 From: Eric Bollengier Date: Wed, 16 Jun 2010 14:48:48 +0200 Subject: [PATCH] Improve the "update stats" sql command --- bacula/src/cats/sql_cmds.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bacula/src/cats/sql_cmds.c b/bacula/src/cats/sql_cmds.c index dbcdb6d559..e29a055d8c 100644 --- a/bacula/src/cats/sql_cmds.c +++ b/bacula/src/cats/sql_cmds.c @@ -63,7 +63,9 @@ const char *fill_jobhisto = "PurgedFiles, HasBase, Reviewed, Comment " "FROM Job " "WHERE JobStatus IN ('T','W','f','A','E') " - "AND JobId NOT IN (SELECT JobId FROM JobHisto) " + "AND NOT EXISTS " + "(SELECT JobHisto.JobId " + "FROM JobHisto WHERE JobHisto.Jobid=Job.JobId) " "AND JobTDate < %s "; /* For ua_update.c */ -- 2.39.5