10.07.2015 Views

Expert Oracle Exadata - Parent Directory

Expert Oracle Exadata - Parent Directory

Expert Oracle Exadata - Parent Directory

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

CHAPTER 13 MIGRATING TO EXADATAimmediately loads the rows to the inserted table, without passing them to QC at all. All the SELECT andLOAD work is done within the same slave, there’s no interprocess communication needed. How do weknow that? It is because the IN-OUT column says PCWP (Parallel operation, Combined With <strong>Parent</strong>) forboth operations, and the TQ value for both of the operations is the same (Q1,00). This indicates thatparallel execution slaves do perform all these steps, under the same Table Queue node, without passingthe data around between slave sets.The proper execution plan when reading data from a database link looks like this:SQL> INSERT /*+ APPEND PARALLEL(16) */ INTO tmp2> SELECT /*+ PARALLEL(16) */ * FROM dba_source@srcdb-----------------------------------------------------------------------------------| Id | Operation | Name | Rows | TQ/Ins |IN-OUT| PQ Distrib |-----------------------------------------------------------------------------------| 0 | INSERT STATEMENT | | 211K| | | || 1 | PX COORDINATOR | | | | | || 2 | PX SEND QC (RANDOM) | :TQ10001 | 211K| Q1,01 | P->S | QC (RAND) || 3 | LOAD AS SELECT | TMP | | Q1,01 | PCWP | || 4 | PX RECEIVE | | 211K| Q1,01 | PCWP | || 5 | PX SEND ROUND-ROBIN| :TQ10000 | 211K| | S->P | RND-ROBIN || 6 | REMOTE | DBA_SOURCE | 211K| SRCDB | R->S | |-----------------------------------------------------------------------------------Remote SQL Information (identified by operation id):----------------------------------------------------6 - SELECT /*+ OPAQUE_TRANSFORM SHARED (16) SHARED (16) */"OWNER","NAME","TYPE","LINE","TEXT"FROM "DBA_SOURCE" "DBA_SOURCE" (accessing 'SRCDB' )Note-----Degree of Parallelism is 16 because of hintIn this example, because we enabled parallel DML at the session level, the data loading is done inparallel; the LOAD AS SELECT is a parallel operation (the IN-OUT column shows PCWP) executed within PXslaves and not the QC.Note that DBMS_XPLAN shows the SQL statement for sending to the remote server over the databaselink (in the Remote SQL Information section above). Instead of sending PARALLEL hints to the remoteserver, an undocumented SHARED hint is sent, which is an alias of the PARALLEL hint.This was the easier issue to fix. If your data volumes are really big, then there is another problem tosolve with database links, and it’s explained below.Issue 2—Achieving Fully Parallel Network Data TransferAnother issue with database links and parallel execution is that even if you manage to run parallelexecution on both ends of the link, it is the query coordinators that actually open the database link anddo the network transfer. The PX slaves don’t somehow magically open their own database linkconnections to the other database, all traffic flows through the single query coordinator of a query. Soyou can run your CTAS/IAS statement with hundreds of PX slaves—but you’ll still have only a singledatabase link connection doing network transfer. While you can optimize the network throughput by438

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!