Of course SQLite wasn't changed much in this part since November 2008
but the citation you gave is either wrong or the key words in it are
"something like" in phrase "SQlite does something like this". Because
SQLite is smart enough to choose smaller table as an outer one and
bigger table as an inner one. Although it can choose other way round
if you have index on Id in smaller table and don't have index on Id in
bigger table. And in this case there's no performance hit in such
decision, only benefit.

Pavel

On Fri, Oct 30, 2009 at 12:07 PM, Kristoffer Danielsson
<kristoffer.daniels...@live.se> wrote:
>
> Quote from: http://sqlite.phxsoftware.com/forums/p/1495/6629.aspx
>
>
>
> SQLite uses only nested loops to implement joins. Given a query like the 
> following:
>
> SELECT ...
> FROM OuterTable O INNER JOIN InnerTable I ON O.Id = I.Id
>
>
>
> SQlite does something like this:
>
>
>
> for each row in OuterTable
>  Seek all rows in InnerTable where InnerTable.Id = OuterTable.Id
> end for each
>
>
>
> I assume SQLite has not improved on JOIN precedence since then, which means 
> that if OuterTable is HUGE, there will be an huge performance hit!
>
>
>
> "Some database engines like SQL Server decide which table is the outer table 
> and which table is the inner table"
>
>
> How do I simulate that behavior in SQLite? A misformed SQL statement from the 
> user results in unacceptable lockups...
>
> _________________________________________________________________
> Nya Windows 7 - Hitta en dator som passar dig! Mer information.
> http://windows.microsoft.com/shop
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to