July 2010
M T W T F S S
« Apr    
 1234
567891011
12131415161718
19202122232425
262728293031  

How to have multiple DFO trees

DFO means "Data Flow Operator". Actually, “queries” don’t run in parallel, it’s "data flow operations" (DFOs) that run in parallel, and a single query can be made up of several data flow operations. DFO tree is composite with DFOs, usually one query have one DFO tree. such as

select /*+ parallel(t1 4) parallel(t2 4) */ [...]

Monitor parallel execution

After the parallel execution, this is the best chance to query the execution information. For Example, to analyze the execution of following parallel SQL statement.

select /*+ ordered use_hash(p c) parallel(p 4) parallel(c 4) pq_distribute(c hash, hash)*/
c.unit_price
from products p, costs c
where c.prod_id = p.prod_id;

After execution,

hlr@ORCL> select * from v$pq_sesstat;

STATISTIC [...]

Parallel Query Distribution Combinations and Hints

The PQ_DISTRIBUTE hint instructs the optimizer how to distribute rows of joined tables among producer and consumer query servers. Such distribution can improve the performance of parallel join operations.
 
tablespec is the name or alias of a table to be used as the inner table of a join. [...]

Parallel Partitioning Execution Plan

Two execution plans.
Disable optimizer_dynamic_sampling firstly.

alter session set optimizer_dynamic_sampling = 0;

Then, create two simple tables;

CREATE TABLE t1 ( c1 NUMBER, c2 NUMBER );
CREATE TABLE t2 ( c1 NUMBER, c2 NUMBER );

hr@ORCL> SELECT /*+ parallel(t1,2) */ t1.c2,t2.c2 FROM t1,t2 WHERE t1.c1 = t2.c1;

Execution Plan
———————————————————-
Plan hash value: 869483324

——————————————————————————————————————
| Id | Operation [...]