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

Home -> Community -> Mailing Lists -> Oracle-L -> direct distributed insert causes massive sorting on target, why?

direct distributed insert causes massive sorting on target, why?

From: Jack Silvey <oracle-l_at_warehousedba.com>
Date: Wed, 25 Dec 2002 20:58:41 -0800
Message-ID: <F001.0052208A.20021225205841@fatcity.com>


All,

In our 8.1.7.4 warehouse, we are attempting to copy records from a partitioned table in one domain to a partitioned table in another domain (via a database link) like so:

alter session enable parallel dml;

insert /*+ append parallel(a,12) */ into tablea a select /*+ full(b) parallel(b,12) */ * from tableb_at_dblnk b;

However, unexpectedly, this causes two sets of parallel processes to be spawned on the target. One of these sets goes to work immediately, building huge sort segments in their temporary tablespace, and the others sit idle. Since we are extracting 250m+ records, we are blowing out temp tablespace. (The sort segments being created are not the same as the temporary segments that are written by CTAS or index creation statements, instead, they are true sort segments.)

I would expect this behavior from a large query that needed to sort
(since these types of queries can spawn two sets of PQ processes - one
for record retrieval, one for sorting) however, this is just an insert of all the records with no criteria in the select statement.

Why would a direct distributed parallel DML insert as select (I guess we could call this a DDPDMLIAS? :>)) cause an initial run of sorting?

My working hypothesis is that Oracle is following its usual rules of distributed transactions and bringing the source resultset to the target for manipulation, building it into temp segments and then using that as a source for inserts, much as it does in a typical distributed query. Perhaps a driving_site hint would help here.

However, that does not explain why I was able to cause it to stop it from doing the massive sorts by serializing the target insert.

Oracle support has been able to provide no technical information on this topic.

Any input appreciated.

Thanks,

Jack Silvey

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: Jack Silvey
  INET: oracle-l_at_warehousedba.com

Fat City Network Services    -- 858-538-5051 http://www.fatcity.com
San Diego, California        -- Mailing list and web hosting services
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L

(or the name of mailing list you want to be removed from). You may
also send the HELP command for other information (like subscribing).
Received on Wed Dec 25 2002 - 22:58:41 CST

Original text of this message

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