On 19/06/2011 8:03 PM, Simon Slavin wrote:
> On 20 Jun 2011, at 12:58am, Lucas Cotta wrote:
>
>> I understand that for a query with a two tables join, SQLite will do a
>> nested loop join with these two tables.
>> But what about a query joining 5 tables?
>> It would be like this?:
>>
>> for(table1 lines){
>>       for(table2 lines){
>>           for(table3 lines){
>>           ....
> You can use JOIN any number of times in a SELECT query.  SQLite will work out 
> an optimal way to access each table.  You can speed things up a great deal by 
> having useful INDEXes created.
IIRC sqlite does *not* do any join ordering optimizations and simply 
runs them in whatever order the query specifies. This can have 
unfortunate effects on runtime for some queries. Can anyone verify this?

Ryan

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

Reply via email to