Bacula-users

Re: [Bacula-users] Bacula 2.2.8, dbcheck never completes

2008-08-18 17:53:38
Subject: Re: [Bacula-users] Bacula 2.2.8, dbcheck never completes
From: "Yuri Timofeev" <tim4dev AT gmail DOT com>
To: bacula-users AT lists.sourceforge DOT net
Date: Tue, 19 Aug 2008 00:52:47 +0300
Hi

Ryan Novosielski wrote:
> The problem is, dbcheck never seems to finish.

I now have researched the same problem.

Only I have more records about the files ;)

select count(FileId)  from File;
+---------------+
| count(FileId) |
+---------------+
|       8258778 |
+---------------+


And I was not able to finish in 3 days:
8) Check for orphaned File records
9) Check for orphaned Path records

Mysql severely slowed when JOIN needs to be done on a large sample, as
well as before it copies all the data into a temporary table.

Unfortunately it is impossible to use indexes, example (Check for
orphaned File records):

EXPLAIN SELECT File.FileId, Job.JobId FROM File LEFT OUTER JOIN Job ON
(File.JobId = Job.JobId)
   -> WHERE Job.JobId IS NULL
   -> LIMIT 300000;
+----+-------------+-------+--------+---------------+---------+---------+-------------------+---------+--------------------------------------+
| id | select_type | table | type   | possible_keys | key     |
key_len | ref               | rows    | Extra
      |
+----+-------------+-------+--------+---------------+---------+---------+-------------------+---------+--------------------------------------+
|  1 | SIMPLE      | File  | ALL    | NULL          | NULL    | NULL
 | NULL              | 8258778 |
|
|  1 | SIMPLE      | Job   | eq_ref | PRIMARY       | PRIMARY | 4
 | bacula.File.JobId |       1 | Using where; Using index; Not exists
|
+----+-------------+-------+--------+---------------+---------+---------+-------------------+---------+--------------------------------------+

So I now try to change the SQL queries, so that became MYSQL use indexes.

The condition "LIMIT 300000" harms here, because first will be built a
HUGE sample, and only then will be chosen from 300 K records.

--
with best regards

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Bacula-users mailing list
Bacula-users AT lists.sourceforge DOT net
https://lists.sourceforge.net/lists/listinfo/bacula-users