Monitoring parallel operations
You can monitor the use of parallelism by Db2.
About this task
The number of parallel tasks that Db2 uses to access data is determined at bind time, and is adjusted again when the query is executed.
- Bind time
- At bind time, Db2 collects
partition statistics from the catalog, estimates the processor cycles
for the costs of processing the partitions, and determines the optimal
number of parallel tasks to achieve minimum elapsed time.
When a planned degree exceeds the number of online CPs, the query might not be completely processor-bound. Instead it might be approaching the number of partitions because it is I/O-bound. In general, the more I/O-bound a query is, the closer the degree of parallelism is to the number of partitions.
In general, the more processor-bound a query is, the more degree of parallelism is related to the to the number of online CPs. However, the degree of parallelism can exceed the number of CPs. The default degree of parallelism is twice the number of CPs. A degree of parallelism that is greater than the number of CPs is beneficial in cases where works is distributed unevenly among parallel child tasks.
To help Db2 determine the optimal degree of parallelism, use the RUNSTATS utility to keep your statistics current.
You can find the expected degree of parallelism in the ACCESS_DEGREE and JOIN_DEGREE columns of the PLAN_TABLE.
- Execution time
- For
each parallel group, parallelism can execute at a reduced degree or
degrade to sequential operations for the following reasons:
- Amount of virtual buffer pool space available
- Host variable values
- Availability of the hardware sort assist facility
- Ambiguous cursors
- A change in the number or configuration of online processors
Procedure
To monitor parallel operations, use one of the following approaches: