RE: [sqlite] Possible enhancement to SQL logic

2005-07-11 Thread D. Richard Hipp
On Mon, 2005-07-11 at 14:20 +0100, Steve O'Hara wrote: > Is that statement correct Richard? > I assumed that something clever was going on with OR's such that under the > bonnet they got translated into UNION statements or similar. > SQLite does not currently optimizer ORs in any way. If you

Re: [sqlite] Possible enhancement to SQL logic

2005-07-11 Thread Ben Clewett
[EMAIL PROTECTED] wrote: Ben Clewett <[EMAIL PROTECTED]> writes: D. Richard Hipp wrote: MySQL and PostgreSQL will use the indexes here, and therefore return the result considerably faster. Really? I would be very interested to know what query plan MySQL and PostgreSQL use in this

Re: [sqlite] Possible enhancement to SQL logic

2005-07-11 Thread Derrell . Lipman
Ben Clewett <[EMAIL PROTECTED]> writes: > D. Richard Hipp wrote: >>> MySQL and PostgreSQL will use the indexes here, and therefore return the >>> result considerably faster. >>> >> Really? I would be very interested to know what >> query plan MySQL and PostgreSQL use in this example. > > It

Re: [sqlite] Possible enhancement to SQL logic

2005-07-11 Thread Ben Clewett
D. Richard Hipp wrote: MySQL and PostgreSQL will use the indexes here, and therefore return the result considerably faster. Really? I would be very interested to know what query plan MySQL and PostgreSQL use in this example. It looks like I didn't look before leaping. MySQL does do a

RE: [sqlite] Possible enhancement to SQL logic

2005-07-11 Thread Steve O'Hara
2005 11:49 To: sqlite-users@sqlite.org Subject: Re: [sqlite] Possible enhancement to SQL logic Won't work unfortunately. Currently indices are never used if the WHERE clause has an OR expression in it. --- Aaron Burghardt <[EMAIL PROTECTED]> wrote: > Try adding another index: > &g

Re: [sqlite] Possible enhancement to SQL logic

2005-07-11 Thread Dan Kennedy
Won't work unfortunately. Currently indices are never used if the WHERE clause has an OR expression in it. --- Aaron Burghardt <[EMAIL PROTECTED]> wrote: > Try adding another index: > > CREATE INDEX a_f1_f2 ON a (f1, f2); > > Does that help? > > Aaron Burghardt > > On Jul 11, 2005, at 6:07

Re: [sqlite] Possible enhancement to SQL logic

2005-07-11 Thread D. Richard Hipp
On Mon, 2005-07-11 at 11:07 +0100, Ben Clewett wrote: > If you create a table with two indexes: > > CREATE TABLE a ( > f0 INTEGER PRIMARY KEY, > f1 INTEGER, > f2 INTEGER > ); > CREATE INDEX a_f1 ON a (f1); > CREATE INDEX a_f2 ON a (f2); > > Now execute a query using both the

Re: [sqlite] Possible enhancement to SQL logic

2005-07-11 Thread Aaron Burghardt
Try adding another index: CREATE INDEX a_f1_f2 ON a (f1, f2); Does that help? Aaron Burghardt On Jul 11, 2005, at 6:07 AM, Ben Clewett wrote: Dear SQLite, I have found a possible area where the SQL logic of SQLite is not as good as other DBMS. Like MySQL or PostgreSQL. It's a simple

[sqlite] Possible enhancement to SQL logic

2005-07-11 Thread Ben Clewett
Dear SQLite, I have found a possible area where the SQL logic of SQLite is not as good as other DBMS. Like MySQL or PostgreSQL. It's a simple thing, so I am showing it as a candidate for work. (If I could submit a patch I would :) If you create a table with two indexes: CREATE TABLE a (