Re: Left join vs Inner join
LEFT JOIN says that the stuff on the right is 'optional'. And it cannot be looked at until the stuff on the left is done.
JOIN gives the Optimizer the option to _start_ with the stuff on the right.
When JOINing to a ( SELECT ... ) it is best if the optimizer can _start_ with that.
That should explain the timing difference. (I can't follow the query, so I don't have advice on how to retain LEFT but get better performance.)
Try putting that subquery into a TEMPORARY TABLE, and give it a suitable INDEX (or PRIMARY KEY, if possible). Then use that table in the LEFT JOIN.
Subject
Views
Written By
Posted
2112
May 09, 2016 06:10PM
1120
May 10, 2016 08:04AM
1018
May 10, 2016 10:40AM
Re: Left join vs Inner join
1008
May 10, 2016 07:23PM
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.