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 -> Tuning: PLSQL/INSERT INTO statement

Tuning: PLSQL/INSERT INTO statement

From: Kevin Burton <pdsinc_at_compuserve.com>
Date: Tue, 4 Jan 2000 22:43:49 -0500
Message-ID: <84uejd$ev3$1@ssauraac-i-1.production.compuserve.com>


I have a select query that I execute and it takes several minutes to get the results back. Now I want to put those results into a table so I do: INSERT INTO <TABLE>

       SELECT Query.
Now the process takes hours to complete. The table has no constraints or triggers. I did notice the temp table space keeps getting filled when I run the query with the INSERT INTO clause but not when I run just the SELECT statement. WHY?

The query looke something like this:
SELECT A1,

                  A2,
                  A3,
                  A4,
                  A5,
 FROM ( SELECT A1
                                 A2
                                 A3
                                 sum(A4)
                 FROM ( SELECT A1,
                                                 A2,
                                                 min(A3)
                                 FROM table A, Table B
                                 WHERE A1 = B1 and
                                                 A2 = B2
                                 GROUP BY A1,A2) A , TABLE B
                 WHERE A1 = B1 and
                                 A2 = B2
                  GROUP BY A1,A2,A3) AA
WHERE AA.A1 = VALUE
                AA.A2 = VALUE

Any help would be appreciated. I just don't understand why it would take any more Temp table space do the insert on this query as it would to just execute the SELECT statement alone.

Received on Tue Jan 04 2000 - 21:43:49 CST

Original text of this message

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