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!

How does oracle execute a correlated subquery .... some confusion

760519Mar 18 2010 — edited Mar 18 2010
How does oracle 10g execute a correlated subquery?

I read some articles online & i am a little confused.

example:

select * from emp e
where e.deptno in (select d.deptno from dept d
where e.deptno = d.deptno);

My questions .......

1.In the above example, does oracle read the entire outer table first and then run the inner query using the rows returned by the outer query?

I read in some articles that they execute simultaneously.

How does this work?

2.Should the inner query have lesser amount of rows compared to the outer query for a good performance?

3.Can every correlated subquery be converted to a join and if so which one to use?


Truly appreciate any inputs on how oracle executes it at the backend.

Thanks in advance.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 15 2010
Added on Mar 18 2010
6 comments
13,960 views