Disabling query parallelism

You can prevent DB2® from using parallel processing.

Procedure

To disable parallel operations, do any of the following actions:

  • For static SQL, rebind the package and specify the DEGREE(1) bind option.
  • Begin general-use programming interface information.
    For dynamic SQL, issue the following SQL statement:
    SET CURRENT DEGREE = '1';

    The default value for CURRENT DEGREE is 1 unless your installation has changed the default for the CURRENT DEGREE special register.

    End general-use programming interface information.

  • Set the parallel sequential threshold (VPPSEQT) to 0.
  • Insert rows in a resource limit table (DSNRLSTxx) to restrict the parallelism mode:
    1. Specify the RLFFUNC value for each type of parallelism that you want to disable:
      Query I/O parallelism
      Insert a row that contains the RLFFUNC='3' value. Start of changeQuery I/O parallelism is deprecated and is likely to be removed in a future release.End of change
      CP parallelism
      Insert a row that contains the RLFFUNC='4' value.
      Sysplex query parallelism
      Insert a row that contains the RLFFUNC='5' value. Start of changeSysplex query parallelism is deprecated and is likely to be removed in a future release.End of change
      To disable all query parallelism for a dynamic query, you must insert a separate row for each possible mode of parallelism.
    2. Qualify the rows according to the following rules: Qualifying by plan or by package are not separate functions for parallelism, as they are for predictive and reactive governing:
      • When the row specifies a plan name, DB2 finds the row only for queries that are executed from the plan.
      • When the row specifies a package name, DB2 finds the row only for queries that are executed from the package.

      The values of the RLFCOLLN, RLFPKG, and RLFPLAN columns can be blank for rows that are qualified by authorization ID only.

    If parallelism is disabled for a query, the query runs sequentially. If no entry can be found in your resource limit table that applies to parallelism, or if your resource limit table cannot be read, the resource limit facility does not disable query parallelism.

Results

Example

If the following resource limit table is active, it causes the following effects:
  • Disables I/O parallelism for all dynamic queries in the IOHOG package.
  • Disables CP parallelism and Sysplex query parallelism for all dynamic queries in the CPUHOG package.
Table 1. Example RLST to govern query parallelism
RLFFUNC AUTHID LUNAME RLFCOLLN RLFPKG
3 (blank) PUBLIC blank IOHOG
4 (blank) PUBLIC blank CPUHOG
5 (blank) PUBLIC blank CPUHOG

What to do next

Begin program-specific programming interface information.
To determine whether parallelism has been disabled by a value in your resource limit specification table (DSNRLSTxx), look for a non-zero value in field QXRLFDPA in IFCID 0002 or 0003. The QW0022RP field in IFCID 0022 indicates whether this particular statement was disabled.
End program-specific programming interface information.