CURRENT QUERY ACCELERATION

The CURRENT QUERY ACCELERATION special register specifies a value that identifies when DB2® sends dynamic SQL queries to an accelerator server and what DB2 does if the accelerator server fails. The special register does not apply to static SQL queries.

The data type is VARCHAR(255).

Valid values are:

NONE
Specifies that no queries are sent to an accelerator server.
ENABLE
Specifies that queries are accelerated only if DB2 determines that it is advantageous to do so. If an accelerator failure occurs while a query is running or if the accelerator returns an error, DB2 returns a negative SQLCODE to the application.
ENABLE WITH FAILBACK
Specifies that queries are accelerated only if DB2 determines that it is advantageous to do so. If the accelerator returns an error during the PREPARE or first OPEN for the query, DB2 executes the query without the accelerator. If the accelerator returns an error during a FETCH or a subsequent OPEN, DB2 returns the error to the user and does not execute the query.
Start of changeELIGIBLEEnd of change
Start of changeSpecifies that queries are accelerated if they are eligible for acceleration. DB2 does not use cost information to determine whether to accelerate the queries. Queries that are not eligible for acceleration are executed by DB2. If an accelerator failure occurs while a query is running or if the accelerator returns an error, DB2 returns a negative SQLCODE to the application.End of change
Start of changeALLEnd of change
Start of changeSpecifies that queries are accelerated if they are eligible for acceleration. DB2 does not use cost information to determine whether to accelerate the queries. Queries that are not eligible for acceleration are not executed by DB2, and an SQL error is returned. If an accelerator failure occurs while a query is running or if the accelerator returns an error, DB2 returns a negative SQLCODE to the application.End of change

Start of changeThe initial value of CURRENT QUERY ACCELERATION is determined by one of the following settings:End of change

Start of change
  • The value of DB2 subsystem parameter QUERY_ACCELERATION. The default for the initial value of this subsystem parameter is NONE unless your installation has changed the value.
  • If specified for the bind of a package, the QUERYACCELERATION bind option. This behavior enables the QUERYACCELERATION bind option to be used to specify the acceleration behavior for dynamic SQL queries and not only static SQL queries. This bind option does not have a default value.
End of change

The initial value of CURRENT QUERY ACCELERATION in a user-defined function or stored procedure is inherited according to the rules in Special registers in a user-defined function or a stored procedure.

You can change the value of the register by executing the SET CURRENT QUERY ACCELERATION statement.

Start of changeThe precedence order (lowest to highest) for setting the value of the special register is as follows:End of change

Start of change
  • The QUERY_ACCELERATION subsystem parameter
  • The QUERYACCELERATION bind option, if specified
  • An explicit SET CURRENT QUERY ACCELERATION statement
End of change
Example: The following statement sets the CURRENT QUERY ACCELERATION special register so that no query acceleration occurs.
  SET CURRENT QUERY ACCELERATION NONE;