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 | RAW(8) | NO | The handle address of the SQL statement. This column is not supported and is set to NULL by default. |
| HASH_VALUE | NUMBER | NO | The hash value of the statement. This column is not supported and is set to NULL by default. |
| DB_ID | NUMBER(38) | NO | The database ID of the connection to which the SQL statement belongs.
NoteThis column is available starting with V4.2.3. |
| SQL_ID | VARCHAR2(32) | NO | The unique identifier of the SQL statement. |
| CHILD_NUMBER | NUMBER | NO | The number of cursors. This column is not supported and is set to NULL by default. |
| WORKAREA_ADDRESS | RAW(8) | NO | The address of the workarea. This column is not supported and is set to NULL by default. |
| OPERATION_TYPE | VARCHAR2(160) | NO | The type of the workarea operator, such as Sort, Hash Join, and Group by. |
| OPERATION_ID | NUMBER | NO | The unique identifier of the operator in the plan tree. |
| POLICY | VARCHAR2(40) | NO | The workarea strategy: |
| ESTIMATED_OPTIMAL_SIZE | NUMBER | NO | The estimated memory size required to execute the operator optimally, in bytes. |
| ESTIMATED_ONEPASS_SIZE | NUMBER | NO | The estimated memory size required to execute the operator in one pass, in bytes. |
| LAST_MEMORY_USED | NUMBER | NO | The memory size used by the cursor in the last execution, in bytes. |
| LAST_EXECUTION | VARCHAR2(40) | NO | The execution mode of the workarea in the last execution: optimal, one pass, or multi passes. |
| LAST_DEGREE | NUMBER | NO | The parallelism degree in the last execution. |
| TOTAL_EXECUTIONS | NUMBER | NO | The total number of times the workarea was used. |
| OPTIMAL_EXECUTIONS | NUMBER | NO | The number of times the workarea was used in optimal mode. |
| ONEPASS_EXECUTIONS | NUMBER | NO | The number of times the workarea was used in one pass mode. |
| MULTIPASSES_EXECUTIONS | NUMBER | NO | The number of times the workarea was used in multi passes mode. |
| ACTIVE_TIME | NUMBER | NO | The average active time of the workarea, in seconds. |
| MAX_TEMPSEG_SIZE | NUMBER | NO | The maximum temporary disk space used by the workarea, in bytes. If this column is NULL, the temporary space was not used. |
| LAST_TEMPSEG_SIZE | NUMBER | NO | The temporary disk space used by the workarea in the last execution. If this column is NULL, the temporary space was not used. |
| CON_ID | NUMBER | NO | The tenant ID. |
| SVR_IP | VARCHAR2(46) | NO | The IP address of the server. |
| SVR_PORT | NUMBER(38) | 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 [SYS]> SELECT * FROM SYS.GV$SQL_WORKAREA WHERE ROWNUM <= 1\G
The query result is as follows:
*************************** 1. row ***************************
ADDRESS: NULL
HASH_VALUE: NULL
DB_ID: 201001
SQL_ID: DC0ECB93D5AA3E26623B4E6CF05B6E74
CHILD_NUMBER: 461
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: 394
MAX_TEMPSEG_SIZE: 0
LAST_TEMPSEG_SIZE: 0
CON_ID: 1004
SVR_IP: 172.xx.xx.xx
SVR_PORT: 2882
1 row in set