Overview
This view displays general information about the SQL workarea 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. The amount of memory available is determined by the parameter, in 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; therefore, 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 is calculated using the formula: max_work_area_size - hold + total_mem_used Calculated based on the current workspace conditions, indicating the maximum memory size managed by auto mode. |
| 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
Query the SQL workspace information of the current tenant on all OBServer nodes in the user tenant.
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 |
+-------------------+--------------------+------------------------+------------+----------------+------------------+------------+----------------+-------------------+-----------+----------------+----------+
| 214748364 | 0 | 214748364 | 214748364 | 0 | 26843545 | 0 | 0 | 1166 | 1002 | 11.xxx.xxx.xxx | 28825 |
+-------------------+--------------------+------------------------+------------+----------------+------------------+------------+----------------+-------------------+-----------+----------------+----------+
1 row in set