Re: [sqlite] What is the most efficient way to gettheclosebynumbers?

2010-08-22 Thread Peng Yu
On Sat, Aug 21, 2010 at 4:25 PM, ve3meo wrote: > "Simon Slavin" ... >> >>> Here's how I have interpreted Simon's suggested chunky query: >>> >>> select * from A as A1, A as A2 where A1.name=A2.name and >>> A1.position != A2.position and >>> A2.chunk between A1.chunk - 1 and A1.chunk + 1 and >>> A2

Re: [sqlite] What is the most efficient way to gettheclosebynumbers?

2010-08-22 Thread Peng Yu
On Sat, Aug 21, 2010 at 7:53 AM, ve3meo 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.po

Re: [sqlite] What is the most efficient way to gettheclosebynumbers?

2010-08-21 Thread ve3meo
"Simon Slavin" ... > >> Here's how I have interpreted Simon's suggested chunky query: >> >> select * from A as A1, A as A2 where A1.name=A2.name and >> A1.position != A2.position and >> A2.chunk between A1.chunk - 1 and A1.chunk + 1 and >> A2.position between A1.position - 10 and A1.position + 10 ;

Re: [sqlite] What is the most efficient way to gettheclosebynumbers?

2010-08-21 Thread ve3meo
"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 op