Mark Brand wrote:
> Shouldn't we expect subquery flattening to happen in V2 below?
>
> -- no flattening
> CREATE VIEW V2 AS
>     SELECT * FROM X
>     LEFT JOIN (
>         SELECT * FROM X
>         LEFT JOIN Y ON Y.a = X.a
>     ) Z
>     ON Z.a = X.a;
>
> -- manually flattened version of V2
> CREATE VIEW V2_FLATTENED AS
>     SELECT *
>     FROM X
>     LEFT JOIN X X2
>        ON X2.a = X.a
>     LEFT JOIN Y
>        ON Y.a = X2.a;

In the general case, left outer joins are not associative.  Apparently,
SQLite does not try to prove the opposite for special cases.


Regards,
Clemens
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to