Note
This variable is available starting with V4.6.0.
Description
ap_query_cost_threshold specifies the cost threshold for adaptive selection of columnar replicas.
Privilege requirements
Query variables
Global level
The
systenant and all user tenants can query the value of Global system variables by using theSHOW VARIABLESstatement or theSYS.TENANT_VIRTUAL_GLOBAL_VARIABLEview (Oracle mode) and theinformation_schema.GLOBAL_VARIABLESview (MySQL mode).Session level
The
systenant and all user tenants can query the value of Session system variables by using theSHOW VARIABLESstatement or theSYS.TENANT_VIRTUAL_SESSION_VARIABLEview (Oracle mode) and theinformation_schema.SESSION_VARIABLESview (MySQL mode).
Modify variables
Global level
The
systenant can directly modify the value of Global system variables.MySQL user tenants must have the
SUPERorALTER SYSTEMprivilege to modify the value of Global system variables.Oracle user tenants must have the
ALTER SYSTEMprivilege to modify the value of Global system variables.
Session level
The
systenant and all user tenants can directly modify the value of Session system variables.
Attributes
| Attribute | Description |
|---|---|
| Type | Uint |
| Default value | 200000 |
| Value range | [0, 18446744073709551615] |
| Scope |
|
| Modifiable | Yes. You can execute the SET statement to modify the value. |
Usage
A parallel SELECT plan is generated based on the rules. When the cost of a rowstore replica SELECT plan with a single parallelism level exceeds the value of the ap_query_cost_threshold variable, the system generates a plan for a columnar replica.
Examples
Set the value of ap_query_cost_threshold to 100000.
Session level
obclient> SET ap_query_cost_threshold = 100000;Global level
obclient> SET GLOBAL ap_query_cost_threshold = 100000;
