Note
This variable is available starting with V4.6.0.
Description
ap_query_route_policy specifies the adaptive selection strategy for AP queries.
Privilege requirements
Query variables
Global level
The
systenant and all user tenants can execute theSHOW VARIABLESstatement or query theSYS.TENANT_VIRTUAL_GLOBAL_VARIABLEview (Oracle mode) or theinformation_schema.GLOBAL_VARIABLESview (MySQL mode) to view the values of global system variables.Session level
The
systenant and all user tenants can execute theSHOW VARIABLESstatement or query theSYS.TENANT_VIRTUAL_SESSION_VARIABLEview (Oracle mode) or theinformation_schema.SESSION_VARIABLESview (MySQL mode) to view the values of session system variables.
Modify variables
Global level
The
systenant can directly modify the values of global system variables.MySQL user tenants must have the
SUPERorALTER SYSTEMprivilege to modify the values of global system variables.Oracle user tenants must have the
ALTER SYSTEMprivilege to modify the values of global system variables.
Session level
The
systenant and all user tenants can directly modify the values of session system variables for their own tenants.
Attributes
| Attribute | Description |
|---|---|
| Parameter type | Enum |
| Default value | AUTO |
| Value range |
|
| Scope |
|
| Modifiable | Yes. You can execute the SET statement to modify the value. |
Usage
The ap_query_route_policy variable is the switch for the adaptive selection of columnar replicas. If the cluster has no columnar replicas, the value of the ap_query_route_policy variable does not take effect.
You can also use the opt_param hint to control the adaptive selection of columnar replicas at the query level.
Examples
Set the value of the ap_query_route_policy variable to AUTO.
Session level
obclient> SET ap_query_route_policy = 'AUTO';Global level
obclient> SET GLOBAL ap_query_route_policy = 'AUTO';
