Bacula-users

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

2008-08-19 03:51:22
Subject: Re: [Bacula-users] Bacula 2.2.8, dbcheck never completes
From: Technik <technik AT zli DOT ch>
To: Yuri Timofeev <tim4dev AT gmail DOT com>
Date: Tue, 19 Aug 2008 09:51:09 +0200 (CEST)
>>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 |
>+---------------+

Don't worry. Maybe it takes some more time to create new indices ...

>EXPLAIN SELECT File.FileId, Job.JobId FROM File LEFT OUTER JOIN Job ON
>(File.JobId = Job.JobId)
>-> WHERE Job.JobId IS NULL
>-> LIMIT 300000;

My queries for the ninth and tenth option of dbcheck are diffrent.

*** Ninth option (eliminate_orphaned_path_records) ***
SELECT DISTINCT Path.PathId,File.PathId FROM Path LEFT OUTER JOIN File
ON (Path.PathId=File.PathId) WHERE File.PathId IS NULL;

Explained by MySQL the result is:

+----+-------------+-------+-------+---------------+---------+---------+--------------------+-------+--------------------------------------+
| id | select_type | table | type  | possible_keys | key     | key_len |
ref                | rows  | Extra                                |

+----+-------------+-------+-------+---------------+---------+---------+--------------------+-------+--------------------------------------+
|  1 | SIMPLE      | Path  | index | NULL          | PRIMARY | 4       |
NULL               | 32604 | Using index; Using temporary         |
|  1 | SIMPLE      | File  | ref   | PathId        | PathId  | 4       |
bacula.Path.PathId |    17 | Using where; Using index; Not exists |

+----+-------------+-------+-------+---------------+---------+---------+--------------------+-------+--------------------------------------+

*** Tenth option (eliminate_orphaned_filename_records ***
SELECT Filename.FilenameId,File.FilenameId FROM Filename LEFT OUTER JOIN
File ON (Filename.FilenameId=File.FilenameId) WHERE File.FilenameId IS
NULL;

Explained by MySQL the result is:

+----+-------------+----------+-------+---------------+------------+---------+----------------------------+--------+--------------------------------------+
| id | select_type | table    | type  | possible_keys | key        |
key_len | ref                        | rows   |
Extra                                |

+----+-------------+----------+-------+---------------+------------+---------+----------------------------+--------+--------------------------------------+
|  1 | SIMPLE      | Filename | index | NULL          | PRIMARY    |
4       | NULL                       | 145566 | Using
index                          |
|  1 | SIMPLE      | File     | ref   | FilenameId    | FilenameId |
4       | bacula.Filename.FilenameId |     17 | Using where; Using
index; Not exists |

+----+-------------+----------+-------+---------------+------------+---------+----------------------------+--------+--------------------------------------+

And it's obvious that the newly created indices are used. So just create
the mentioned indices on the tables File and Job.

And as an reminder these are the indices you should create:
create index PathId on File (PathId);
create index FilenameId on File (FilenameId);
create index ClientId on Job (ClientId);
create index FileSetId on Job (FileSetId);


Cheers. Primus.


-------------------------------------------------------------------------
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