On 19 Aug 2007 at 12:35, Dirk Bartley wrote:

> There is one alternative index to the above.  The index of the two
> colums (FilenameId, JobId) is really only needed for the condition of
> FilenameId = (SELECT FilenameId FROM Filename WHERE name='').  A
> subquery can't be used when creating an index, but running one command
> and then substituting does work.  To create a partial index in postgres:
> CREATE INDEX file_filenameid_jobid2 ON File (JobId) WHERE FilenameId=5;
> This could not be done until after a record exists in the filename table
> that fits the condition.

The usefulness of that index can be determined by the queries that 
use it.  I would expect that two indexes, one of filenameid and 
another on jobid would work just as well.  But that too must be 
tested.  On PostgreSQL, the "explain analyse" output will show what 
is best.

I can help with the query tuning on PostgreSQL.

> I'm looking for a little feedback.  If there are options that anyone has
> about the queries and indexes, I sure would like to know about them.
> Should indexes for bat be in the install script for the databases??  Is
> advising about possible indexes to increase performance in the help file
> something I should do.

Yes, indexes for bat should be included.

-- 
Dan Langille - http://www.langille.org/
Available for hire: http://www.freebsddiary.org/dan_langille.php



-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
Bacula-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bacula-devel

Reply via email to