Re: [sqlite] Performance problem for a simple select with range

2007-10-31 Thread Dani Va
Igor Tandetnik wrote: > > Try searching for a value that doesn't fall into any block - you'll > likely find that the query takes a noticeable time to produce zero > records. Pick a large value that's greater than all startIpNum's. > Yes, you are right. That's why I'm going with the original

RE: [sqlite] Performance problem for a simple select with range

2007-10-31 Thread Doug
that first matching row. > -Original Message- > From: Dani Va [mailto:[EMAIL PROTECTED] > Sent: Wednesday, October 31, 2007 8:30 AM > To: sqlite-users@sqlite.org > Subject: Re: [sqlite] Performance problem for a simple select with range > > > First, thanks, your sugg

Re: [sqlite] Performance problem for a simple select with range

2007-10-31 Thread Dani Va
First, thanks, your suggestion worked. To my surprise, it was enough to add "limit 1" to the original query. So: select * from blocks,locations where locations.locid = blocks.locid AND ? >= blocks.startIpNum AND ? <= blocks.endIpNum limit 1 takes about 1.398-005 seconds and select * from

Re: [sqlite] Performance problem for a simple select with range

2007-10-29 Thread drh
"Dani Valevski" <[EMAIL PROTECTED]> wrote: > I think I have a performance problem for a simple select with range. > > My Tables: > CREATE TABLE locations(locidINTEGER PRIMARY KEY, ...); > > CREATE TABLE blocks( > startIpNum INTEGER, > endIpNum INTEGER, >

Re: [sqlite] Performance problem for a simple select with range

2007-10-29 Thread Kees Nuyt
[Default] On Mon, 29 Oct 2007 15:25:18 +0200, "Dani Valevski" <[EMAIL PROTECTED]> wrote: >I think I have a performance problem for a simple select with range. > >My Tables: >CREATE TABLE locations( >locidINTEGER PRIMARY KEY, >country TEXT, >