Note
This variable is available starting with V4.2.0.
Description
optimizer_dynamic_sampling specifies the sampling level for dynamic sampling.
Privilege requirements
Query variables
Global level
systenants and all user tenants can execute theSHOW VARIABLESstatement or query theSYS.TENANT_VIRTUAL_GLOBAL_VARIABLEview (Oracle-compatible mode) or theinformation_schema.GLOBAL_VARIABLESview (MySQL-compatible mode) to obtain the values of global system variables.Session level
systenants and all user tenants can execute theSHOW VARIABLESstatement or query theSYS.TENANT_VIRTUAL_SESSION_VARIABLEview (Oracle-compatible mode) or theinformation_schema.SESSION_VARIABLESview (MySQL-compatible mode) to obtain the values of session system variables.
Modify variables
Global level
systenants can modify global system variables.MySQL user tenants must have the
SUPERorALTER SYSTEMprivilege to modify global system variables.Oracle user tenants must have the
ALTER SYSTEMprivilege to modify global system variables.
Session level
systenants and all user tenants can modify session system variables.
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 sampling level for dynamic sampling to 1.
Global level
obclient> SET GLOBAL optimizer_dynamic_sampling=1;Session level
obclient> SET optimizer_dynamic_sampling=1;