Overview
ap_query_cost_threshold specifies the cost threshold for adaptive selection of columnar storage replicas.
Privilege requirements
Query variables
Global level
Both the
systenant and all user tenants can use theSHOW VARIABLESstatement and theinformation_schema.GLOBAL_VARIABLESview to view the values of global system variables.Session level
Both the
systenant and all user tenants can use theSHOW VARIABLESstatement and theinformation_schema.SESSION_VARIABLESview to view the values of session system variables.
Modify variables
Global effective
The
systenant can directly modify the values of global system variables.The user tenant must have the
SUPERorALTER SYSTEMprivilege to modify the value of a global system variable.
Session Validity Period
The
systenant and all user tenants can directly modify the values of session system variables for their own tenants.
Attributes
Attribute |
Description |
|---|---|
| Parameter type | Uint |
| Default Value | 200000 |
| Value range | [0, 18446744073709551615] |
| Effective Scope |
|
| Modifiable | Yes, you can use theSETStatement modification. |
Usage instructions
A parallel SELECT plan will select a columnstore replica to execute based on the rules. When the cost of a rowstore replica SELECT plan with a single degree of parallelism exceeds the variable ap_query_cost_threshold, the logic for selecting a columnstore replica to generate the plan is triggered.
Configuration example
Set the value of ap_query_cost_threshold to 100000.
Session expiration
obclient> SET ap_query_cost_threshold = 100000;Effective globally
obclient> SET GLOBAL ap_query_cost_threshold = 100000;