Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> How do I force two inline views to execute separately?

How do I force two inline views to execute separately?

From: TomGreene <c014572_at_yahoo.com>
Date: 24 Nov 2003 07:41:38 -0800
Message-ID: <7237e353.0311240741.10f5d7a8@posting.google.com>


I'm in an Oracle 8i environment and am at the mercy of a third-party software tool that is generating SQL. The tool uses a view against itself to get both detail and rolled up amounts. I can execute either portion IV_1 or IV_2 separately in about 30 seconds. Combine them
(like here) and the time goes to 45 minutes. Since IV_1 returns about
50 rows and IV_2 returns about 500 rows I'd like each view to fire separately and then have the result sets joined. Is there a way to do this?

SELECT *
FROM
(select x1, x2, x3, sum(x4) x4 from BIG_VIEW
  group by x1,x2,x3
  where x5=1 and x6=2) IV_1
,(select y1, y2, y3, y4, y5, y6 from BIG_VIEW   where x5=1 and x6=2) IV_2
WHERE IV_1.x1 = IV_2.y1
  AND IV_1.x2 = IV_2.y2;

Thanks,
Tom Received on Mon Nov 24 2003 - 09:41:38 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US