On Sat, Aug 21, 2010 at 7:53 AM, ve3meo <holden_fam...@sympatico.ca> wrote: > > "Simon Slavin" ... >> >> By the way, you might find that swapping the last two lines makes it >> faster: >> >> >>> select * from A as A1, A as A2 where A1.name=A2.name and >>> A2.position between A1.position - 10 and A1.position + 10 and >>> A1.position != A2.position ; >> >> But you might not: SQLite's optimizer may already have spotted it. >> > I had opted for the other because it had fewer VM instructions and I thought > the != condition might be a faster process than the 'between' and eliminate > some points from being processed by 'between'. Of course, the result is > highly dependent on the correlation of data - if every point is unique then > the != condition is a wasteful test. > > Thanks for the feedback, Simon & Igor. > > Sorry, Peng, if it seems I highjacked the discussion. Hope it was helpful to > you, too.
This is indeed helpful to me and lead me to read the document deeper. -- Regards, Peng _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users