Note
This variable was introduced in V2.1.
Description
The ob_sql_work_area_percentage variable specifies the percentage of memory in the tenant that is allocated for SQL work areas.
Privilege requirements
Query variables
Users in the
systenant and all users in other tenants can execute theSHOW VARIABLESstatement or view theSYS.TENANT_VIRTUAL_GLOBAL_VARIABLEview (Oracle mode) or theinformation_schema.GLOBAL_VARIABLESview (MySQL mode) to query the value of a global system variable.Modify variables
Users in the
systenant can modify the value of a global system variable directly.MySQL users must have the
SUPERorALTER SYSTEMprivilege to modify the value of a global system variable.Oracle users must have the
ALTER SYSTEMprivilege to modify the value of a global system variable.
Attributes
| Attribute | Description |
|---|---|
| Type | String |
| Default value | 5 |
| Value range | [0, 100] |
| Scope | Global |
| Modifiable | Yes. You can modify it by using the SET statement. |
Considerations
The SQL work area is the memory used by blocking operators such as sorting. The value of the ob_sql_work_area_percentage tenant-level variable specifies the percentage of tenant memory allocated for SQL work areas. The default value is 5%, which means that work area memory = tenant memory * ob_sql_work_area_percentage (default 5%).
If the concurrent request volume is high and each request uses a large amount of work area memory, an error indicating insufficient work area memory may occur. Common scenarios where this error occurs are UNION, SORT, and GROUP BY. You can avoid this error by appropriately increasing the value of the system variable. For example:
obclient> SET GLOBAL ob_sql_work_area_percentage = 10;