MySQL Forums
Forum List  »  Optimizer & Parser

STRAIGHT_JOIN for OUTER JOINGS
Posted by: Paul Tsui
Date: August 19, 2012 08:28PM

I am running a query like this:

SELECT a.key, a.col_1, b.col_1 FROM (SELECT * FROM table_a ORDER BY a.key LIMIT 100) a JOIN (SELECT * FROM table_b) b ON a.key=b.key;

It turns out that using STRAIGHT_JOIN rather than INNER JOIN is much better in performance. (2x - 3x as fast)

However, what I actually need is LEFT OUTER JOIN rather than INNER JOIN. Using simply LEFT JOIN have more or less the same performance as INNER JOIN. I guess LEFT JOIN is actually using the same algorithm to INNER JOIN rather than STRAIGHT JOIN.

Is there a STRAIGHT_JOIN equivalence for OUTER JOIN?

Thanks!

Options: ReplyQuote


Subject
Views
Written By
Posted
STRAIGHT_JOIN for OUTER JOINGS
3790
August 19, 2012 08:28PM


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.