Bacula-users

Re: [Bacula-users] Performance with MySQL queries since 3.0.0 (Dir inserting attributes hang)

2009-06-19 05:21:20
Subject: Re: [Bacula-users] Performance with MySQL queries since 3.0.0 (Dir inserting attributes hang)
From: Martin Simmons <martin AT lispworks DOT com>
To: bacula-users AT lists.sourceforge DOT net
Date: Fri, 19 Jun 2009 10:17:00 +0100
>>>>> On Fri, 19 Jun 2009 03:00:54 +0300, Jari Fredriksson said:
> 
> > 
> > INSERT INTO Filename( Name )
> > SELECT a.Name
> > FROM (
> > 
> > SELECT DISTINCT Name
> > FROM batch
> > ) AS a
> > WHERE NOT
> > EXISTS (
> > 
> > SELECT Name
> > FROM Filename AS f
> > WHERE f.Name = a.Name
> > )
> > 
> 
> That looks silly.
> 
> I would write it shorter as
> 
> INSERT INTO Filename(Name)
> SELECT DISTINCT Name
> FROM batch AS a
> WHERE NOT EXISTS
> (
>     SELECT Name
>     FROM Filename AS f
>     WHERE f.Name = a.Name
> )

Maybe, but perhaps it quicker to remove the duplicates from batch.name before
comparing them to the rows in Filename.name?

__Martin

------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
Bacula-users mailing list
Bacula-users AT lists.sourceforge DOT net
https://lists.sourceforge.net/lists/listinfo/bacula-users

<Prev in Thread] Current Thread [Next in Thread>