On Fri, 16 Sep 2005, Daniel Weuthen wrote:

This is surprising because I always understood that a multiple index
(JobId, PathId, FilenameId) was equivalent (actually better) than one only
on JobId.

It should be....

Could you tell me what DB you are using MySQL, ...?

mysql  Ver 12.22 Distrib 4.0.24, for pc-linux-gnu (i386)

as released in debian sarge

and confirm what
indexes you had before and after your change?

previously there was an index called FilenameId which included the columns
FilenameId and PathId only.

I just added the index JobId including only JobId because when bacula is
building the filelist the where statemant looks for matching JobId's most of
the time.

Adding the index here took just under 90 minutes, and brought the select down to 23 seconds from more than an hour (non-optimised database)

After building a new index on all three columns, which took 70 min, the select now takes 1 min 11 (the other 2 indexes were left there, which may be slowing it down)

If simply adding a single index on JobId to the File table makes such an
amazing difference in speed, I definitely want to ensure that 1.38 is
released that way.

AB



-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download it for free - -and be entered to win a 42" plasma tv or your very
own Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users

Reply via email to