Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Question about the order of evaluation of the WHERE clause and ON clause when Oracle FROM syntax is

dariyooshOct 3 2014 — edited Oct 4 2014

Hi,

Oracle version: 11.1.0.7.0 - 64bit

I was reading the online documentation about joins. The page is avialable here: Joins

My question is about the order of evaluation of conditions in join ON clause and those conditions that

are not join conditions and are put in the WHERE clause.

Consider the following pseudocode

SELECT

     t1.col1,

     t2.col1

FROM

     table1 t1 LEFT OUTER JOIN table2 t2

ON

     (condition_expression1)

WHERE

     (condition_expression2)

Is it correct to say that if there is no column of the join condition (condition_expression1) in condition_expression2, then condition_expression2 is run before condition_expression1? In other words, does oracle always try to filter based on the WHERE clause individually each table as much as possible before joining them based on the condition(s) specified in ON clause?

Thanks in advance,

This post has been answered by Frank Kulash on Oct 3 2014
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 1 2014
Added on Oct 3 2014
2 comments
1,574 views