Note
This variable is available starting with V4.3.5 BP1.
Description
ENABLE_OPTIMIZER_ROWGOAL specifies whether to consider the row goal (such as the LIMIT operator) when the optimizer estimates the cardinality.
Privilege requirements
Global level
The
systenant 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 view the value of a global system variable.Session level
The
systenant 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 view the value of a session system variable.
Modify variables
Global level
The
systenant can directly modify the value of a global system variable.A MySQL user tenant must have the
SUPERorALTER SYSTEMprivilege to modify the value of a global system variable.An Oracle user tenant must have the
ALTER SYSTEMprivilege to modify the value of a global system variable.
Session level
The
systenant and all user tenants can directly modify the value of a session system variable.
Attributes
| Attribute | Description |
|---|---|
| Type | Enum |
| Default value | AUTO |
| Value range |
|
| Scope |
|
| Modifiable | Yes. You can execute the SET statement to modify the value. |
Examples
Execute the following command to enable the row goal for cardinality estimation.
Global level
obclient> SET GLOBAL enable_optimizer_rowgoal=ON;Session level
obclient> SET enable_optimizer_rowgoal=ON;