Note
This view is available starting with V2.2.77.
Purpose
This view displays the workarea statistics of all operators that are managed by SQL automatic memory management.
Columns
| Column | Type | Nullable | Description |
|---|---|---|---|
| ADDRESS | varbinary(8) | NO | The handle address corresponding to the SQL statement. This column is not specified. |
| HASH_VALUE | bigint(0) | NO | The hash value of the statement. |
| DB_ID | bigint(20) | NO | The ID of the database to which the connection of the SQL statement belongs.
NoteThis column is available starting with V4.2.3. |
| SQL_ID | varchar(32) | NO | The unique identifier of the SQL statement. |
| CHILD_NUMBER | bigint(0) | NO | The number of cursors. |
| WORKAREA_ADDRESS | varbinary(8) | NO | The address of the workarea. |
| OPERATION_TYPE | varchar(40) | NO | The type of the workarea operator, such as Sort, Hash Join, and Group by. |
| OPERATION_ID | bigint(20) | NO | The unique identifier of the operator in the plan tree. |
| POLICY | varchar(10) | NO | The workarea strategy: |
| ESTIMATED_OPTIMAL_SIZE | bigint(20) | NO | The estimated memory size required to optimally execute the operator. The unit is bytes. |
| ESTIMATED_ONEPASS_SIZE | bigint(20) | NO | The estimated memory size required to execute the operator in the one-pass scenario. The unit is bytes. |
| LAST_MEMORY_USED | bigint(20) | NO | The memory size used by the cursor in the last execution. The unit is bytes. |
| LAST_EXECUTION | varchar(10) | NO | The workarea selection mode in the last execution: optimal, one pass, or multi passes. |
| LAST_DEGREE | bigint(20) | NO | The parallelism degree in the last execution. |
| TOTAL_EXECUTIONS | bigint(20) | NO | The total number of times the workarea has been used. |
| OPTIMAL_EXECUTIONS | bigint(20) | NO | The number of times the workarea has been used in the optimal scenario. |
| ONEPASS_EXECUTIONS | bigint(20) | NO | The number of times the workarea has been used in the one-pass scenario. |
| MULTIPASSES_EXECUTIONS | bigint(20) | NO | The number of times the workarea has been used in the multi-pass scenario. |
| ACTIVE_TIME | bigint(20) | NO | The average active time of the workarea. The unit is seconds. |
| MAX_TEMPSEG_SIZE | bigint(20) | NO | The maximum temporary disk space used by the workarea. The unit is bytes. If this column is NULL, no temporary space has been used. |
| LAST_TEMPSEG_SIZE | bigint(20) | NO | The temporary disk space used by the workarea in the last execution. If this column is NULL, no temporary space has been used. |
| CON_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 workarea statistics of all operators managed by SQL automatic memory management on all OBServier nodes.
obclient [oceanbase]> SELECT * FROM oceanbase.GV$SQL_WORKAREA LIMIT 1\G
The query result is as follows:
*************************** 1. row ***************************
ADDRESS: NULL
HASH_VALUE: NULL
DB_ID: 201001
SQL_ID: DC0ECB93D5AA3E26623B4E6CF05B6E74
CHILD_NUMBER: 337
WORKAREA_ADDRESS: NULL
OPERATION_TYPE: PHY_HASH_JOIN
OPERATION_ID: 1
POLICY: AUTO
ESTIMATED_OPTIMAL_SIZE: 2604288
ESTIMATED_ONEPASS_SIZE: 412725
LAST_MEMORY_USED: 109388
LAST_EXECUTION: OPTIMAL
LAST_DEGREE: 1
TOTAL_EXECUTIONS: 17
OPTIMAL_EXECUTIONS: 17
ONEPASS_EXECUTIONS: 0
MULTIPASSES_EXECUTIONS: 0
ACTIVE_TIME: 460
MAX_TEMPSEG_SIZE: 0
LAST_TEMPSEG_SIZE: 0
CON_ID: 1002
SVR_IP: 172.xx.xx.xx
SVR_PORT: 2882
1 row in set