Was this helpful?
Sample Parallel QEPs
The following example shows a QEP diagram with a 1:n exchange node above a join node. It shows eight threads being created to divide the work of the join.
Two joins each of pairwise compatible partitions of the underlying tables are performed by each thread, all in parallel.
select a.col1, b.col2
   from aprel a, bprel b
   where a.col1 = b.col1
       and b.col2 between 500 and 1500
 
                                    Exchange
                                    Heap
                                    Pages 319 Tups 14012
                                    Reduction 4301
                                    Threads 8
                                    PC Join count 16
                                    D689 C6386
                         /
                        Hash Join(col1)
                        Heap
                        Pages 319 Tups 14012
                        PC Join count 16
                        D689 C6386
              /                     \
            Proj-rest               Proj-rest
            Heap                    Heap
            Pages 73 Tups 10000     Pages 83 Tups 14012
            D384 C100               D305 C140
 /                       /aprel           bprelB-Tree(NU)    B-Tree(col2)
Pages 768 Tups 10000    Pages 12872 Tups 299814
Partitions 128          Partitions 16
PC Join count 16        PC Join count 16
This example shows a union select in which the exchange node generates one thread to process each of the selects.
select a.col1 from arel a
    union all select b.col2 from brel b
 
 
QUERY PLAN 1,3, no timeout, of union subquery
 
            Proj-rest
            Heap
            Pages 25 Tups 8197
            D283 C82
 /
brel
(b)
Heap
Pages 1132 Tups 8197
 
QUERY PLAN 1,2, no timeout, of union subquery
 
            Proj-rest
            Heap
            Pages 16 Tups 5126
            D218 C51
 /
arel
(a)
Heap
Pages 872 Tups 5126
 
QUERY PLAN 1,1, no timeout, of main query
 
                        Exchange
                        Heap
                        Pages 54 Tups 17886
                        Reduction 242
                        Threads 2
                        D501 C266
             /
            Proj-rest
            Heap
            Pages 54 Tups 17886            D501 C266
 /
T3
Heap
Pages 16 Tups 17886
Last modified date: 08/29/2024