CURRENT DEGREE special register

CURRENT DEGREE specifies the degree of parallelism for the execution of queries that are dynamically prepared by the application process.

The data type of the register is CHAR(3) and the only valid values are 1 (padded on the right with two blanks) and ANY.

1

When a query is dynamically prepared, the execution of that query will not use most forms of parallelism.

Start of changeSetting the CURRENT DEGREE value to '1' does not disable DPSI parallelism. For information about how to disable DPSI parallelism, see MAX DEGREE FOR DPSI field (PARAMDEG_DPSI subsystem parameter).End of change

ANY
If the value of CURRENT DEGREE is 'ANY' when a query is dynamically prepared, the execution of that query can involve parallelism.

The initial value of CURRENT DEGREE is determined by the value of the CDSSRSDEF subsystem parameter. The default for the initial value of that field is 1 unless your installation has changed it to be ANY by modifying the value in that field. For more information, see CURRENT DEGREE field (CDSSRDEF subsystem parameter).

The initial value of CURRENT DEGREE in a user-defined function or stored procedure is inherited according to the rules in Table 1.

You can change the value of the register by issuing SET CURRENT DEGREE statements.

CURRENT DEGREE is a register at the database server. Its value applies to queries that are dynamically prepared at that server and to queries that are dynamically prepared at another Db2 subsystem as a result of the use of a Db2 private connection between that server and that Db2 subsystem.

Example

The following statement inhibits the use parallelism for dynamics SQL statements:

   SET CURRENT DEGREE = '1';