On Mon, Jan 23, 2012 at 1:09 PM, Ryan Johnson
<ryan.john...@cs.utoronto.ca>wrote:

> On 23/01/2012 12:48 PM, Simon Slavin wrote:On 21/01/2012 12:49 PM, Ryan
> Johnson wrote:
>
>> consider the following query:
>>
>> select count(*) from orders O, Customer C where C.custkey=O.custkey and
>> C.name like '%115';
>>
>> .stats/explain reports 149999 fullscan steps for the query plan:
>>
>>> 0|0|TABLE orders AS O
>>> 1|1|TABLE Customer AS C USING PRIMARY KEY
>>>
>>
>> Putting Customer first in the FROM clause makes the query markedly faster
>> and executes only 14999 fullscan steps. The query plan confirms the change:
>>
>>> 0|0|TABLE Customer AS C
>>> 1|1|TABLE orders AS O WITH INDEX OrderCustomers
>>>
>>
> In what way does the above query from the OP not sufficient to demonstrate
> the problem?
>


I don't have your database file.  I cannot run the scenario myself to see
what is going on.

-- 
D. Richard Hipp
d...@sqlite.org
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to