Note
This variable is avaiable starting with V4.2.0.
Description
optimizer_dynamic_sampling specifies the level of dynamic sampling.
Privilege requirements
Query variables
Global level
systenant and all user tenants can execute theSHOW VARIABLESstatement or query theSYS.TENANT_VIRTUAL_GLOBAL_VARIABLEview (Oracle mode) orinformation_schema.GLOBAL_VARIABLESview (MySQL mode) to obtain the value of a global system variable.Session level
systenant and all user tenants can execute theSHOW VARIABLESstatement or query theSYS.TENANT_VIRTUAL_SESSION_VARIABLEview (Oracle mode) orinformation_schema.SESSION_VARIABLESview (MySQL mode) to obtain the value of a session system variable.
Modify variables
Global level
systenant 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
systenant and all user tenants can directly modify the value of a session system variable.
Attributes
| Attribute | Description |
|---|---|
| Type | Int |
| Default value | 1 |
| Value range | [0, 1] |
| Scope |
|
| Modifiable | Yes. You can execute the SET statement to modify the value. |
Examples
Set the level of dynamic sampling to 1.
Global level
obclient> SET GLOBAL optimizer_dynamic_sampling=1;Session level
obclient> SET optimizer_dynamic_sampling=1;