SQLite Forum

CROSS JOIN sometimes re-orders tables when lhs is a CTE
Login
That is, more specifically, in the expression:

A, B LEFT JOIN C JOIN D CROSS JOIN E

Only tables D and E are affected by the ordering constraint implied by the usage of the word CROSS.  Re-ordering of all the tables is permitted so long as E is an inner table with respect to D.

You are (apparently) interpreting the phrase **prevents the query optimizer from reordering the tables in the join** as meaning tables A, B, C, D, and E.  However, this is not the case.  The tables being cross joined and to which the ordering restriction applies are D and E only.

You will also note that except for the specific case of a LEFT JOIN (where the ON clause specifies the conditions for the descent into the table on the RHS of the LEFT JOIN) an ON clause is merely syntactic sugar for a WHERE clause.