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

Re: SQLite and SELECT WHERE local_relpath LIKE

From: Philip Martin <philip.martin_at_wandisco.com>
Date: Fri, 29 Oct 2010 10:20:27 +0100

Philip Martin <philip.martin_at_wandisco.com> writes:

> I need something like
>
> local_relpath = 'zig1/zag27
> OR (local_relpath > 'zig1/zag27/' AND local_relpath < 'zig1/zag270')
>
> and that is as slow as LIKE. Adding that "local_relpath =" is the
> problem, without it I get the children in 0.006s. With it I get the
> path and the children but it takes 0.35s.

SQL is tricky: I can run a query using either

      local_relpath = 'zig1/zag27

or using

     local_relpath > 'zig1/zag27/' AND local_relpath < 'zig1/zag270'

and it takes 0.006s, but if I put in both parts in together with OR it
takes 0.35s. That's 2 orders of magnitude! I suppose I will have to
try using EXPLAIN.

-- 
Philip
Received on 2010-10-29 11:21:10 CEST

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

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.