Note
This variable is available starting with V2.1.
Description
The optimizer_use_sql_plan_baselines variable controls whether the optimizer uses a plan baseline.
Required privileges
Query variables
Global level
systenants and user tenants can execute theSHOW VARIABLESstatement or viewSYS.TENANT_VIRTUAL_GLOBAL_VARIABLE(Oracle mode) orinformation_schema.GLOBAL_VARIABLES(MySQL mode) to query the value of a global system variable.Session level
systenants and user tenants can execute theSHOW VARIABLESstatement or viewSYS.TENANT_VIRTUAL_SESSION_VARIABLE(Oracle mode) orinformation_schema.SESSION_VARIABLES(MySQL mode) to query the value of a session system variable.
Modify variables
Set the variable at the 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.
Set the variable at the session level
systenants and user tenants can directly modify the value of a session system variable in their own tenant.
Attributes
| Attribute | Description |
|---|---|
| Type | bool |
| Default value | 0 |
| Value range | |
| Effect scope | |
| Modifiable | Yes. You can modify this variable by using the SET statement. |
Examples
Set the optimizer to not use plans in plan baselines.
Global level
obclient> SET GLOBAL optimizer_use_sql_plan_baselines = 0;Session level
obclient> SET optimizer_use_sql_plan_baselines = 0;