Oracle Parallel Distribution and 12c Adaptive Plans
Oracle Parallel Distribution and 12c Adaptive Plans
Tips&techniques
Tips&techniques 13
13
When one table is not so big, then we can avoid a whole
set of parallel processes. We can broadcast the small table
(DEPT) to the 4 parallel processes doing the join. In that case,
the same set of processes is able to read EMP and do the
join.
Here is the execution plan:
EXPLAINED SQL STATEMENT:
-----------------------select /*+ leading(EMP DEPT) use_hash(DEPT) swap_join_inputs(DEPT) pq_distribute(DEPT NONE BROADCAST) */ * from
DEPT join EMP using(deptno)
--------------------------------------------------------------------------------------------------------------| Id | Operation
| Name
| Starts |
TQ |
IN-OUT | PQ Distrib | A-Rows | Buffers | OMem |
--------------------------------------------------------------------------------------------------------------|
0 | SELECT STATEMENT
|
|
1 |
|
|
|
14 |
10 |
|
|
1 | PX COORDINATOR
|
|
1 |
|
|
|
14 |
10 |
|
|
2 | PX SEND QC (RANDOM)
| :TQ10001 |
0 | Q1,01 | P->S | QC (RAND) |
0 |
0 |
|
|* 3 |
HASH JOIN
|
|
4 | Q1,01 | PCWP |
|
14 |
15 |
1321K|
|
4 |
BUFFER SORT
|
|
4 | Q1,01 | PCWC |
|
16 |
0 | 2048 |
|
5 |
PX RECEIVE
|
|
4 | Q1,01 | PCWP |
|
16 |
0 |
|
|
6 |
PX SEND BROADCAST | :TQ10000 |
0 |
| S->P | BROADCAST |
0 |
0 |
|
|
7 |
TABLE ACCESS FULL | DEPT
|
1 |
|
|
|
4 |
7 |
|
|
8 |
PX BLOCK ITERATOR
|
|
4 | Q1,01 | PCWC |
|
14 |
15 |
|
|* 9 |
TABLE ACCESS FULL
| EMP
|
5 | Q1,01 | PCWP |
|
14 |
15 |
|
------------------------------------------------------------------------------------------------------------------
14
Tips&techniques
Tips&techniques 15
15
The distribution is HYBRID HASH and there is a STATISTICS COLLECTOR before sending to parallel server consu
mers. Oracle will count the rows coming from DEPT and will
choose to BROADCAST or HASH depending on the number
of rows.
It is easy to check what has been chosen here, knowing
that the DOP was 4. I have 4 rows coming from DEPT
(A-rows on DEPT TABLE ACCESS FULL) and 16 were received by the consumer (A-Rows on PX RECEIVE): this is
broadcast (4x4=16).
Conclusion
Contact
dbi services
Franck Pachot
E-Mail:
[email protected]