Overview
This view displays overall information about SQL workareas on all OBServer nodes, such as the maximum available memory, current memory usage, and currently held memory. It helps you understand the workarea usage, including memory utilization, under the current tenant.
Columns
Field |
Type |
Nullable |
Description |
|---|---|---|---|
| MAX_WORKAREA_SIZE | bigint(20) | NO | Maximum workarea memory, which is determined by the parameter and specifies how much memory can be used. Unit: bytes. |
| WORKAREA_HOLD_SIZE | bigint(20) | NO | The current memory size held by the workarea, in bytes.
NoteThe specific usage amount cannot be obtained from the memory management module, so only the hold value can be retrieved. |
| MAX_AUTO_WORKAREA_SIZE | bigint(20) | NO | When set to auto, it indicates the estimated maximum available memory size, in bytes. You can simply consider that the maximum available memory will be calculated using the formula: max_work_area_size - hold + total_mem_used Calculated based on the current workspace conditions, indicating the maximum memory size that can be automatically managed. |
| MEM_TARGET | bigint(20) | NO | The target size of memory available for the current work area, in bytes. The difference between this value and max_auto_work_area is that this value is a certain percentage of max_auto_work_area. |
| TOTAL_MEM_USED | bigint(20) | NO | The current automatic memory usage, in bytes. This value is reported by the SQL automatic memory management module and does not represent the actual memory usage. |
| GLOBAL_MEM_BOUND | bigint(20) | NO | The maximum size of available memory in auto mode, in bytes. |
| DRIFT_SIZE | bigint(20) | NO | The change in memory required for the current demand, in bytes. It is primarily used to track fluctuations. When the fluctuation reaches a certain range, it automatically triggers a recalculation of the global bound size. |
| WORKAREA_COUNT | bigint(20) | NO | Number of Registered Operator Profiles |
| MANUAL_CALC_COUNT | bigint(20) | NO | Number of Times Calculating Global Bound Size Without Scheduled Trigger |
| TENANT_ID | bigint(20) | NO | Tenant ID |
| SVR_IP | varchar(46) | NO | Server IP Address |
| SVR_PORT | bigint(20) | NO | Server Port Number |
Sample query
In the sys tenant, query the SQL workarea information of all tenants on all OBServer nodes.
obclient [oceanbase]> SELECT * FROM oceanbase.GV$OB_SQL_WORKAREA_MEMORY_INFO;
The query result is as follows:
+-------------------+--------------------+------------------------+------------+----------------+------------------+------------+----------------+-------------------+-----------+----------------+----------+
| MAX_WORKAREA_SIZE | WORKAREA_HOLD_SIZE | MAX_AUTO_WORKAREA_SIZE | MEM_TARGET | TOTAL_MEM_USED | GLOBAL_MEM_BOUND | DRIFT_SIZE | WORKAREA_COUNT | MANUAL_CALC_COUNT | TENANT_ID | SVR_IP | SVR_PORT |
+-------------------+--------------------+------------------------+------------+----------------+------------------+------------+----------------+-------------------+-----------+----------------+----------+
| 53687091 | 0 | 53687091 | 53687091 | 0 | 6710886 | -8000000 | 0 | 289359 | 1001 | 11.xxx.xxx.xxx | 28825 |
| 214748364 | 0 | 214748364 | 214748364 | 0 | 26843545 | 0 | 0 | 1144 | 1002 | 11.xxx.xxx.xxx | 28825 |
| 53687091 | 0 | 53687091 | 53687091 | 0 | 6710886 | -8000000 | 0 | 289572 | 1003 | 11.xxx.xxx.xxx | 28825 |
| 214748364 | 0 | 214748364 | 214748364 | 0 | 26843545 | 0 | 0 | 870 | 1004 | 11.xxx.xxx.xxx | 28825 |
| 53687091 | 0 | 53687091 | 53687091 | 0 | 6710886 | -8000000 | 0 | 280662 | 1005 | 11.xxx.xxx.xxx | 28825 |
| 214748364 | 0 | 214748364 | 214748364 | 0 | 26843545 | 2417152 | 0 | 316 | 1006 | 11.xxx.xxx.xxx | 28825 |
+-------------------+--------------------+------------------------+------------+----------------+------------------+------------+----------------+-------------------+-----------+----------------+----------+
6 rows in set