How does oracle execute a correlated subquery .... some confusion
760519Mar 18 2010 — edited Mar 18 2010How 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.