The CURRENT ACCELERATOR special register specifies a preferred target accelerator or accelerators to which Db2 sends dynamic SQL queries.
The CURRENT ACCELERATOR special register applies only to dynamic SQL queries. For static SQL queries, you can use the ACCELERATOR bind option to specify a particular accelerator.
If you have multiple accelerators on which the same set of Db2 tables are accelerated, by default the workload balancing algorithm (WLB) distributes the queries based on the queue length on each accelerator. When the CURRENT ACCELERATOR special register names a particular eligible accelerator server, Db2 considers sending eligible SQL to that server before it sends it to other accelerator servers. If the accelerator server that is named by the CURRENT ACCELERATOR isn't available, Db2 considers other available accelerator servers.
FL 509 For executing DML statements on an accelerator-only table that is defined in multiple accelerators, the CURRENT ACCELERATOR special register must specify one of the accelerators in which the table is defined.
- To direct queries to different accelerators based on the priorities of the workload. You can direct higher priority queries to the fastest, highest capacity accelerator, and you can direct lower priority queries to a slower accelerator.
- To avoid increased elapsed times that can occur when queries are sent to a remote accelerator. The WLB algorithm doesn't address the latency that occurs when a query is sent to a remote accelerator. If your environment includes both locally deployed accelerators and remote accelerators (for example, for disaster recovery), you can send higher priority queries to a local accelerator.
The data type is VARCHAR(8).
- If specified for the bind of a package, the ACCELERATOR bind option. This bind option does not have a default value.
- Otherwise, the default setting of CURRENT ACCELERATOR is blank (no preferred accelerator).
SET CURRENT ACCELERATOR = ACCEL1;