Note
This view is available starting with V2.2.77.
Purpose
This view displays some overall information about the SQL Workarea on all OBServer nodes, such as the maximum available memory, current used memory, and current held memory. You can use this view to obtain information about the usage of the Workarea in the current tenant, including the memory utilization.
Columns
| Column | Type | Nullable | Description |
|---|---|---|---|
| MAX_WORKAREA_SIZE | bigint(20) | NO | The maximum Workarea memory, determined by the parameter. Unit: bytes. |
| WORKAREA_HOLD_SIZE | bigint(20) | NO | The size of the held memory in the Workarea. Unit: bytes.
Note>The actual usage cannot be obtained from the memory management module, so only the held value can be obtained. |
| MAX_AUTO_WORKAREA_SIZE | bigint(20) | NO | The estimated maximum available memory size in auto mode. Unit: bytes. It can be simply considered that the maximum available memory is calculated using the formula max_work_area_size - hold + total_mem_used, representing the maximum memory size that can be managed by auto mode in the current Workarea. |
| MEM_TARGET | bigint(20) | NO | The target size of the available memory in the Workarea. Unit: bytes. The difference from max_auto_work_area is that this value is a certain proportion of the max_auto_work_area value. |
| TOTAL_MEM_USED | bigint(20) | NO | The current auto memory usage size. Unit: bytes. This value is statistically obtained by the SQL automatic memory management module and does not represent the actual usage size. |
| GLOBAL_MEM_BOUND | bigint(20) | NO | The maximum available memory size in global mode. Unit: bytes. |
| DRIFT_SIZE | bigint(20) | NO | The change in the current memory demand. Unit: bytes. It is mainly used to calculate the fluctuation value. When the fluctuation reaches a certain range, it will automatically trigger the recalculation of the global bound size. |
| WORKAREA_COUNT | bigint(20) | NO | The number of registered operator profiles. |
| MANUAL_CALC_COUNT | bigint(20) | NO | The number of times the global bound size is calculated non-periodically. |
| TENANT_ID | bigint(20) | NO | The tenant ID. |
| SVR_IP | varchar(46) | NO | The IP address of the server. |
| SVR_PORT | bigint(20) | NO | The port number of the server. |
Sample query
Query the SQL Workarea information of the current tenant 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 |
+-------------------+--------------------+------------------------+------------+----------------+------------------+------------+----------------+-------------------+-----------+----------------+----------+
| 214748364 | 0 | 214748364 | 214748364 | 0 | 26843545 | 0 | 0 | 1166 | 1002 | 11.xxx.xxx.xxx | 28825 |
+-------------------+--------------------+------------------------+------------+----------------+------------------+------------+----------------+-------------------+-----------+----------------+----------+
1 row in set
