Note
This view is available starting with V2.2.77.
Purpose
This view displays the workarea statistics for all operators 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 database ID of the connection associated with the SQL request.
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 workarea address. |
| 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 for identifying 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 execute the operator optimally, in bytes. |
| ESTIMATED_ONEPASS_SIZE | bigint(20) | NO | The estimated memory size required to execute the operator in one pass mode, in bytes. |
| LAST_MEMORY_USED | bigint(20) | NO | The memory size used by the cursor in the last execution, in bytes. |
| LAST_EXECUTION | varchar(10) | NO | The execution mode of the workarea 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 was used. |
| OPTIMAL_EXECUTIONS | bigint(20) | NO | The number of times the workarea was used in optimal mode. |
| ONEPASS_EXECUTIONS | bigint(20) | NO | The number of times the workarea was used in one pass mode. |
| MULTIPASSES_EXECUTIONS | bigint(20) | NO | The number of times the workarea was used in multi passes mode. |
| ACTIVE_TIME | bigint(20) | NO | The average active time of the workarea, in seconds. |
| MAX_TEMPSEG_SIZE | bigint(20) | NO | The maximum temporary disk space used by the workarea, in bytes. If this column is NULL, no temporary space was 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 was 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 for all operators managed by SQL automatic memory management on the current OBServier node.
obclient [oceanbase]> SELECT * FROM oceanbase.V$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: 18
OPTIMAL_EXECUTIONS: 18
ONEPASS_EXECUTIONS: 0
MULTIPASSES_EXECUTIONS: 0
ACTIVE_TIME: 498
MAX_TEMPSEG_SIZE: 0
LAST_TEMPSEG_SIZE: 0
CON_ID: 1002
SVR_IP: 172.xx.xx.xx
SVR_PORT: 2882
1 row in set