MySQL Forums
Forum List  »  Newbie

Re: Cross join result sequence
Posted by: Phillip Ward
Date: July 09, 2015 06:31AM

First question - why would you want to do a Cartesian (Cross) Product join in the first place?
OK, as an academic exercise with five rows in each table, it might have some merit. Put a million rows in both tables and you can probably go to lunch (and dinner, and breakfast, for a week!) before you get anything back.

As for the order? It will be whatever you put in the "Order By" clause. :-)
If you don't include one, then it will be in whatever order MySql feels like handing you. That might vary with different versions of MySql, on the execution plans generated for the two tables for any given execution (yes, repeated executions against a table taking updates might just get you different[ly ordered] results!) and many other factors.

Regards, Phill W.

Options: ReplyQuote


Subject
Written By
Posted
Re: Cross join result sequence
July 09, 2015 06:31AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.