CURRENT QUERY ACCELERATION special register
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.Restriction: If the query contains a passthrough-only expression, Db2 returns an error and does not accelerate the query, even if a matching user-defined function exists. For more information about passthrough-only expressions, see Accelerating queries with passthrough-only expressions.
- ELIGIBLE
- Specifies 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.
- ALL
- Specifies 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.
The initial value of CURRENT QUERY ACCELERATION is determined by one of the following settings:
- 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.
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.
The precedence order (lowest to highest) for setting the value of the special register is as follows:
- The QUERY_ACCELERATION subsystem parameter
- The QUERYACCELERATION bind option, if specified
- An explicit SET CURRENT QUERY ACCELERATION statement
SET CURRENT QUERY ACCELERATION NONE;