Dave Blake wrote:
>> It chooses a _correct_ plan.
>
> Really? With query 1) to select a song it first scans the song_artist table
> that could contain many thousands of records. That does not seem right.

The result is correct.  This would not necessarily be the case if it
executed an outer join as if it were an inner join.

A left join forces SQLite to scan the outer table first.  This is
necessary for the join to work correctly.

>> Your queries are quite different.
>
> They produce the same result sets, but yes one uses a view and the other
> the constitent tables.

No, the difference is that the view uses an inner join, while your
second query use only outer joins.


Regards,
Clemens

Reply via email to