Re: [sqlite] Re: [inbox] Re: [sqlite] Optimizing a query

2004-01-14 Thread Michael Hunley
At 11:12 AM 1/14/2004 -0500, D. Richard Hipp wrote: SELECT count(*) FROM table WHERE col1>'abc' AND col1<'xyz'; In the original query, the result was indeed a count(*) so no access to the data we required there. But access to the data was required in order to evaluate the WHERE clause. So it

Re: [sqlite] Re: [inbox] Re: [sqlite] Optimizing a query

2004-01-14 Thread D. Richard Hipp
Michael Hunley wrote: At 10:37 AM 1/14/2004 -0500, D. Richard Hipp wrote: In some cases you can avoid the O(logN) lookup of the main table entry and just use the index. For example: SELECT count(*) FROM table WHERE col1>'abc' AND col1<'xyz'; Wasn't that the original question, Ken? Except

[sqlite] Re: [inbox] Re: [sqlite] Optimizing a query

2004-01-14 Thread Michael Hunley
At 10:37 AM 1/14/2004 -0500, D. Richard Hipp wrote: In some cases you can avoid the O(logN) lookup of the main table entry and just use the index. For example: SELECT count(*) FROM table WHERE col1>'abc' AND col1<'xyz'; Wasn't that the original question, Ken? Except it was a count(*) on a

[sqlite] Re: [inbox] Re: [sqlite] Optimizing a query

2004-01-13 Thread Michael Hunley
At 07:17 PM 1/13/2004 -0500, D. Richard Hipp wrote: Actually, SQLite implements JOIN USING by translating the USING clausing into some extra WHERE clause terms. It does the same with NATURAL JOIN and JOIN ON. So while those constructs might be helpful to the human reader, they don't really make