[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn commit: r999837 - /subversion/trunk/subversion/libsvn_wc/wc-queries.sql

From: Philip Martin <philip.martin_at_wandisco.com>
Date: Wed, 22 Sep 2010 22:50:38 +0100

Greg Stein <gstein_at_gmail.com> writes:

> On Wed, Sep 22, 2010 at 05:39, <philip_at_apache.org> wrote:
>>...
>> +++ subversion/trunk/subversion/libsvn_wc/wc-queries.sql Wed Sep 22 09:39:45 2010
>> @@ -215,7 +215,7 @@ update nodes set properties = ?3
>>  where wc_id = ?1 and local_relpath = ?2
>>   and op_depth in
>>    (select op_depth from nodes
>> -    where wc_id = ?1 and local_relpath = ?2
>> +    where wc_id = ?1 and local_relpath = ?2 and op_depth > 0
>>     order by op_depth desc
>>     limit 1);
>
> Wouldn't it be better to do:
>
> where wc_id = ?1 and local_relpath = ?2
> and op_depth = (select max(op_depth) from nodes
> where wc_id=?1 and local_relpath=?2 and op_depth > 0);
>
> It seems that eliminating the "order by" and "limit", in favor of
> max() will tell sqlite what we're really searching for: the maximal
> value.

That does look better, I'll try it tomorrow.

> Also note that the above query uses "op_depth in (...)"

That's probably a mistake.

-- 
Philip
Received on 2010-09-22 23:51:23 CEST

This is an archived mail posted to the Subversion Dev mailing list.