Note
This variable is available starting with V2.1.
Description
ob_sql_work_area_percentage specifies the percentage of the SQL work area memory in the total memory of the tenant.
Privilege requirements
Query variables
You can execute the
SHOW VARIABLESstatement or query theSYS.TENANT_VIRTUAL_GLOBAL_VARIABLEview (Oracle mode) or theinformation_schema.GLOBAL_VARIABLESview (MySQL mode) to obtain the value of a Global system variable in thesystenant and all user tenants.Modify variables
In the
systenant, you can directly modify the value of a Global system variable.In a MySQL user tenant, you must have the
SUPERorALTER SYSTEMprivilege to modify the value of a Global system variable.In an Oracle user tenant, you must have the
ALTER SYSTEMprivilege to modify the value of a Global system variable.
Attributes
| Attribute | Description |
|---|---|
| Parameter type | String |
| Default value | 5 |
| Value range | [0, 100] |
| Scope | Global |
| Modifiable | Yes. You can execute the SET statement to modify the value. |
Usage notes
The SQL work area memory is the memory used by blocking operators such as sorting. You can use the tenant system variable ob_sql_work_area_percentage to control the SQL work area memory. By default, the value of ob_sql_work_area_percentage is 5%. That is, the SQL work area memory is 5% of the total memory of the tenant.
If the number of concurrent requests is large and each request occupies a large amount of SQL work area memory, an out-of-memory error may occur. This error often occurs in scenarios such as UNION, SORT, and GROUP BY. If this error occurs, you can increase the value of the system variable to avoid the error. For example:
obclient> SET GLOBAL ob_sql_work_area_percentage = 10;
