SQL Execution Question

From: Anthony Ballo <anthony.ballo_at_onecall.com>
Date: Wed, 5 Oct 2011 08:20:17 -0700
Message-ID: <CAB1C0BB.F101%anthony.ballo_at_onecall.com>



I am on 10.2.0.4 - and had a question about the execution of a SQL statement. I have a modular query and was wondering if you have:
SELECT A.col1,
       B.col2,
       C.col3
       D.col4

FROM
(SELECT .... FROM .... WHERE ....) A,
(SELECT .... FROM ....) B,
(SELECT .... FROM ....) C,
(SELECT .... FROM ....) D

WHERE
      A.col1 = B.col1
      A.col1 = C.col1
      A.col1 = D.col1


Say A returns only 10 records - when B (C and D also) is executed, will it only be executed for the joined rows (10) or the full rowset returned by the SELECT statement? I'm not a pro at interpreting a Explain Plan but I suspect it is returning all rows. Whats the best way to work with this while keeping the modular approach?

Thanks in advance,

Anthony

--
http://www.freelists.org/webpage/oracle-l
Received on Wed Oct 05 2011 - 10:20:17 CDT

Original text of this message