I' learned that when we use join
(left join or right join, not inner join) statement in mysql, mysql will generate a Cartesian Product as temporary table.
But somebody told me that if the columns which used in on
statement have index,
Cartesian Product won't be generated.
I'm not sure if he is right, because I can't find article or manual talks about it. It's he right?
By the way, somebody told me not to use join
statement in production environment because it may have potential problem. But I think using join
is quite no harm. And if we optimize the sql carefully, we will have no worry about performance problems. Should we forbid to use join
in production environment? Thank you.