Note
This variable is available starting with V4.6.0.
Description
ap_query_replica_fallback specifies whether to fall back to non-columnar replicas when no columnar replicas are available for an AP query that is automatically routed.
Privilege requirements
Query variables
Global level
systenants 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 value of a global system variable.Session level
systenants 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 value of a session system variable.
Modify variables
Global level
systenants can directly modify the value of a global system variable.MySQL user tenants must have the
SUPERorALTER SYSTEMprivilege to modify the value of a global system variable.Oracle user tenants must have the
ALTER SYSTEMprivilege to modify the value of a global system variable.
Session level
systenants and all user tenants can directly modify the value of a session system variable for their own tenant.
Attributes
| Attribute | Description |
|---|---|
| Type | Bool |
| Default value | ON |
| Value range |
|
| Scope |
|
| Modifiable | Yes. You can execute the SET statement to modify the value. |
Usage
The ap_query_replica_fallback variable specifies whether to fall back to non-columnar replicas when no columnar replicas are available for an AP query that is automatically routed.
- When the value is
ON: If the AP/TP automatic routing feature is enabled, the optimizer checks whether columnar replicas are available before generating a columnar replica plan for an AP query. If any of the tables involved in the query do not have available columnar replicas, the optimizer does not generate a columnar replica plan and instead falls back to non-columnar replicas. - When the value is
OFF: If the AP/TP automatic routing feature is enabled, the optimizer does not check whether columnar replicas are available and directly generates a columnar replica plan for an AP query. If columnar replicas are unavailable, an error is returned during query execution.
This variable works in conjunction with the ap_query_route_policy variable. If the value of ap_query_route_policy is OFF, this variable has no effect.
Examples
Set the value of ap_query_replica_fallback to ON.
Session level
obclient> SET ap_query_replica_fallback = ON;Global level
obclient> SET GLOBAL ap_query_replica_fallback = ON;
