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 put

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 example

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 looks

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 seq

RE: [sqlite] Possible enhancement to SQL logic

2005-07-11 Thread Steve O'Hara
July 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 inde

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 A

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 ind

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