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!

short circuit evaluation in sql where clause

547817Nov 27 2011 — edited Nov 27 2011
hey,

i running this example query
select * from t1 where 1=0 and exists (select 1 from t2 where t1.id= t2.id);
i took the execution plan using set autot traceonly and i noticed that he was also checking the exists predicate. checking this predicate is obviously not necessary.

my question is how can i assure that only the necessary conditions will be evaluated in a situation like this (aka short circuit evaluation) ?

thanks, haki.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 25 2011
Added on Nov 27 2011
11 comments
2,379 views