RE: [sqlite] Performance of two queries, why such big difference ?

2006-07-04 Thread Brandon, Nicholas (UK)
>Yes, but it completes the first query in 1ms somehow, so where is the >difference ? >From your original email... >WHERE channel = ? AND time >= ? >ORDER BY time ASC " >WHERE channel IN (-2,?) AND time >= ? >ORDER BY time ASC " .. the WHERE clause is different, that is why you are getting th

Re: [sqlite] Performance of two queries, why such big difference ?

2006-07-04 Thread kamil
- Original Message - From: "Brandon, Nicholas (UK)" <[EMAIL PROTECTED]> To: Sent: Monday, July 03, 2006 1:59 PM Subject: RE: [sqlite] Performance of two queries, why such big difference ? It takes <1ms to return 16 rows using the first query, but over 200ms wh

Re: [sqlite] Performance of two queries, why such big difference ?

2006-07-03 Thread Dan Kennedy
--- kamil <[EMAIL PROTECTED]> wrote: > I have a table with ~1 milion records. > > CREATE TABLE > ( > time INTEGER NOT NULL, > channel INTEGER NOT NULL, > path INTEGER NOT NULL, > file INTEGER NOT NULL, > flags INTEGER NOT NULL, > PRIMARY KEY(channel,time,path,file) > ) > > CREATE INDEX id_chan

RE: [sqlite] Performance of two queries, why such big difference ?

2006-07-03 Thread Brandon, Nicholas (UK)
>It takes <1ms to return 16 rows using the first query, but over 200ms when using the second one. What is wrong ? Is there a way to speed up the second >query ? If you are using a newer version of SQLite, I suggest you run the two queries again prefixing the SQL statement with EXPLAIN QUERY PLAN

[sqlite] Performance of two queries, why such big difference ?

2006-07-03 Thread kamil
I have a table with ~1 milion records. CREATE TABLE ( time INTEGER NOT NULL, channel INTEGER NOT NULL, path INTEGER NOT NULL, file INTEGER NOT NULL, flags INTEGER NOT NULL, PRIMARY KEY(channel,time,path,file) ) CREATE INDEX id_channel_time ON files(channel,time) And I have a two queries: SELEC