Note
This view was introduced in OceanBase Database V1.4.
Purpose
The V$SQL_PLAN_MONITOR view displays statistics at the operation level for slow queries on the current OBServer node in the tenant. Each operation has one row of statistics.
Columns
| Column | Type | Nullable? | Description |
|---|---|---|---|
| CON_ID | NUMBER | NO | The tenant ID. |
| REQUEST_ID | NUMBER(38) | NO | The ID of the request. |
| KEY | NUMBER | NO | The foreign key for joining with the related virtual table in SQL_MONITOR. |
| STATUS | VARCHAR2(19) | NO | The execution status of the operator: |
| SVR_IP | VARCHAR2(46) | NO | The IP address of the server where the operator resides. |
| SVR_PORT | NUMBER(38) | NO | The port number of the server where the operator resides. |
| TRACE_ID | VARCHAR2(64) | NO | The trace ID of the operator. |
| FIRST_REFRESH_TIME | TIMESTAMP(6) | NO | The start time of the operator's monitoring. |
| LAST_REFRESH_TIME | TIMESTAMP(6) | NO | The end time of the operator's monitoring. |
| FIRST_CHANGE_TIME | TIMESTAMP(6) | NO | The time when the operator outputs the first row of data. |
| LAST_CHANGE_TIME | TIMESTAMP(6) | NO | The time when the operator outputs the last row of data. |
| REFRESH_COUNT | NUMBER | NO | The number of times the statistics are refreshed. |
| SID | NUMBER | NO | The ID of the session. |
| PROCESS_NAME | VARCHAR2(10) | NO | The ID of the execution thread. |
| SQL_ID | VARCHAR2(13) | NO | The ID of the SQL statement. |
| SQL_EXEC_START | TIMESTAMP(6) | NO | The start time of the execution of the SQL statement. |
| SQL_EXEC_ID | NUMBER | NO | The execution ID of the SQL statement. |
| SQL_PLAN_HASH_VALUE | NUMBER | NO | The hash value of the SQL plan. |
| SQL_CHILD_ADDRESS | RAW(8) | NO | The address of the child operator. The default value is NULL. |
| PLAN_PARENT_ID | NUMBER | NO | The ID of the parent operator. |
| PLAN_LINE_ID | NUMBER | NO | The line number of the operator in the plan. The default value is NULL. |
| PLAN_OPERATION | VARCHAR2(30) | NO | The name of the operator. |
| PLAN_OPTIONS | VARCHAR2(30) | NO | The options of the operator. The default value is NULL. |
| PLAN_OBJECT_OWNER | VARCHAR2(128) | NO | The owner of the object. The default value is NULL. |
| PLAN_OBJECT_NAME | VARCHAR2(128) | NO | The name of the object. The default value is NULL. |
| PLAN_OBJECT_TYPE | VARCHAR2(80) | NO | The type of the object. The default value is NULL. |
| PLAN_DEPTH | NUMBER | NO | The depth of the operator in the plan tree. |
| PLAN_POSITION | NUMBER | NO | The position of the operator among its parent operator's children. |
| PLAN_COST | NUMBER | NO | The cost of the operator calculated by the optimizer. |
| PLAN_CARDINALITY | NUMBER | NO | The number of rows of data output by the operator calculated by the optimizer. |
| PLAN_BYTES | NUMBER | NO | The number of bytes of data output by the operator estimated by the optimizer. |
| PLAN_TIME | NUMBER | NO | The execution time of the operator calculated by the optimizer. |
| PLAN_PARTITION_START | VARCHAR2(256) | NO | The start partition of the operator. The default value is NULL. |
| PLAN_PARTITION_STOP | VARCHAR2(256) | NO | The end partition of the operator. The default value is NULL. |
| PLAN_CPU_COST | NUMBER | NO | The CPU cost of the operator estimated by the optimizer. |
| PLAN_IO_COST | NUMBER | NO | The I/O cost of the operator estimated by the optimizer. |
| PLAN_TEMP_SPACE | NUMBER | NO | The space occupied by the operator. |
| STARTS | NUMBER | NO | The number of times the operator is rescanned. |
| OUTPUT_ROWS | NUMBER | NO | The total number of rows of data output by the operator (the sum of the number of rows of data output by all execution instances of the operator). |
| IO_INTERCONNECT_BYTES | NUMBER | NO | The number of bytes of data exchanged between the operator and the storage layer. |
| PHYSICAL_READ_REQUESTS | NUMBER | NO | The number of I/O read requests issued by the operator. |
| PHYSICAL_READ_BYTES | NUMBER | NO | The number of bytes of data read by the operator. |
| PHYSICAL_WRITE_REQUESTS | NUMBER | NO | The number of I/O write requests issued by the operator. |
| PHYSICAL_WRITE_BYTES | NUMBER | NO | The number of bytes of data written by the operator. |
| WORKAREA_MEM | NUMBER | NO | The memory occupied by the operator in the work area. |
| WORKAREA_MAX_MEM | NUMBER | NO | The maximum memory available to the operator in the work area. |
| WORKAREA_TEMPSEG | NUMBER | NO | The space occupied by the operator on the disk dump. |
| WORKAREA_MAX_TEMPSEG | NUMBER | NO | The maximum space available to the operator on the disk dump. |
| OTHERSTAT_GROUP_ID | NUMBER | NO | The ID of the group to which the operator belongs. The default value is NULL. |
| OTHERSTAT_1_ID | NUMBER | NO | The ID of the field. |
| OTHERSTAT_1_TYPE | NUMBER | NO | Reserved. |
| OTHERSTAT_1_VALUE | NUMBER | NO | For a TABLE SCAN operator, the number of bytes read from the storage layer IO_READ_BYTES.
Note
|
| OTHERSTAT_2_ID | NUMBER | NO | The ID of the field. |
| OTHERSTAT_2_TYPE | NUMBER | NO | Reserved. |
| OTHERSTAT_2_VALUE | NUMBER | NO | For a TABLE SCAN operator, the number of bytes read from the SSStore SSSTORE_READ_BYTES.
Note
|
| OTHERSTAT_3_ID | NUMBER | NO | The ID of the field. |
| OTHERSTAT_3_TYPE | NUMBER | NO | Reserved. |
| OTHERSTAT_3_VALUE | NUMBER | NO | For a TABLE SCAN operator, the number of rows read from the SSStore SSSTORE_READ_ROW_COUNT, which supports real-time statistics.
Note
|
| OTHERSTAT_4_ID | NUMBER | NO | The ID of the field. |
| OTHERSTAT_4_TYPE | NUMBER | NO | Reserved. |
| OTHERSTAT_4_VALUE | NUMBER | NO | For a TABLE SCAN operator, the number of rows read from the MEMStore MEMSTORE_READ_ROW_COUNT, which supports real-time statistics. |
| OTHERSTAT_5_ID | NUMBER | NO | Reserved. |
| OTHERSTAT_5_TYPE | NUMBER | NO | Reserved. |
| OTHERSTAT_5_VALUE | NUMBER | NO | Reserved. |
| OTHERSTAT_6_ID | NUMBER | NO | Reserved. |
| OTHERSTAT_6_TYPE | NUMBER | NO | Reserved. |
| OTHERSTAT_6_VALUE | NUMBER | NO | Reserved. |
| OTHERSTAT_7_ID | NUMBER | NO | Reserved. |
| OTHERSTAT_7_TYPE | NUMBER | NO | Reserved. |
| OTHERSTAT_7_VALUE | NUMBER | NO | Reserved. |
| OTHERSTAT_8_ID | NUMBER | NO | Reserved. |
| OTHERSTAT_8_TYPE | NUMBER | NO | Reserved. |
| OTHERSTAT_8_VALUE | NUMBER | NO | Reserved. |
| OTHERSTAT_9_ID | NUMBER | NO | Reserved. |
| OTHERSTAT_9_TYPE | NUMBER | NO | Reserved. |
| OTHERSTAT_9_VALUE | NUMBER | NO | Reserved. |
| OTHERSTAT_10_ID | NUMBER | NO | Reserved. |
| OTHERSTAT_10_TYPE | NUMBER | NO | Reserved. |
| OTHERSTAT_10_VALUE | NUMBER | NO | Reserved. |
| OTHER_XML | VARCHAR2(1) | NO | Other structured data that cannot be written to reserved fields but is required for external use. The external tool is responsible for parsing this data. |
| PLAN_OPERATION_INACTIVE | NUMBER | NO | The default value is NULL. |
| OUTPUT_BATCHES | NUMBER(38) | NO | The number of times the operator calls the get_next_batch interface in vectorized mode. |
| SKIPPED_ROWS_COUNT | NUMBER(38) | NO | The total number of rows that are not processed by the operator in vectorized mode (the total number of filtered rows). |
| DB_TIME | NUMBER(38) | NO | The actual CPU time consumed by the operator. |
| USER_IO_WAIT_TIME | NUMBER(38) | NO | The total time of all user_io events. |
| OTHER_WAIT_TIME | NULL | NO | The waiting time of other events. |
The value of the OTHERSTAT_X_ID field can be queried from the V$SQL_MONITOR_STATNAME view.
Sample query
Query the statistics of slow queries at the operation level on the current OBServer node in the tenant.
obclient [SYS]> SELECT * FROM SYS.V$SQL_PLAN_MONITOR WHERE ROWNUM =1\G
The query result is as follows:
*************************** 1. row ***************************
CON_ID: 1004
REQUEST_ID: 0
KEY: NULL
STATUS: NULL
SVR_IP: xx.xx.xx.xx
SVR_PORT: 2882
TRACE_ID: YB42AC1E87C6-000XXXXXXXXXX-0-0
FIRST_REFRESH_TIME: 23-OCT-24 03.38.34.767694 PM
LAST_REFRESH_TIME: 23-OCT-24 03.38.34.777200 PM
FIRST_CHANGE_TIME: NULL
LAST_CHANGE_TIME: 23-OCT-24 03.38.34.777200 PM
REFRESH_COUNT: NULL
SID: NULL
PROCESS_NAME: 10352
SQL_ID: NULL
SQL_EXEC_START: NULL
SQL_EXEC_ID: NULL
SQL_PLAN_HASH_VALUE: NULL
SQL_CHILD_ADDRESS: NULL
PLAN_PARENT_ID: NULL
PLAN_LINE_ID: 8
PLAN_OPERATION: PHY_BLOCK_SAMPLE_SCAN
PLAN_OPTIONS: NULL
PLAN_OBJECT_OWNER: NULL
PLAN_OBJECT_NAME: NULL
PLAN_OBJECT_TYPE: NULL
PLAN_DEPTH: 8
PLAN_POSITION: NULL
PLAN_COST: NULL
PLAN_CARDINALITY: NULL
PLAN_BYTES: NULL
PLAN_TIME: NULL
PLAN_PARTITION_START: NULL
PLAN_PARTITION_STOP: NULL
PLAN_CPU_COST: NULL
PLAN_IO_COST: NULL
PLAN_TEMP_SPACE: NULL
STARTS: 1
OUTPUT_ROWS: 0
IO_INTERCONNECT_BYTES: NULL
PHYSICAL_READ_REQUESTS: NULL
PHYSICAL_READ_BYTES: NULL
PHYSICAL_WRITE_REQUESTS: NULL
PHYSICAL_WRITE_BYTES: NULL
WORKAREA_MEM: NULL
WORKAREA_MAX_MEM: 0
WORKAREA_TEMPSEG: NULL
WORKAREA_MAX_TEMPSEG: 0
OTHERSTAT_GROUP_ID: NULL
OTHERSTAT_1_ID: 36
OTHERSTAT_1_TYPE: NULL
OTHERSTAT_1_VALUE: 0
OTHERSTAT_2_ID: 37
OTHERSTAT_2_TYPE: NULL
OTHERSTAT_2_VALUE: 0
OTHERSTAT_3_ID: 38
OTHERSTAT_3_TYPE: NULL
OTHERSTAT_3_VALUE: 0
OTHERSTAT_4_ID: 39
OTHERSTAT_4_TYPE: NULL
OTHERSTAT_4_VALUE: 0
OTHERSTAT_5_ID: 0
OTHERSTAT_5_TYPE: NULL
OTHERSTAT_5_VALUE: 0
OTHERSTAT_6_ID: 0
OTHERSTAT_6_TYPE: NULL
OTHERSTAT_6_VALUE: 0
OTHERSTAT_7_ID: 0
OTHERSTAT_7_TYPE: NULL
OTHERSTAT_7_VALUE: 0
OTHERSTAT_8_ID: 0
OTHERSTAT_8_TYPE: NULL
OTHERSTAT_8_VALUE: 0
OTHERSTAT_9_ID: 0
OTHERSTAT_9_TYPE: NULL
OTHERSTAT_9_VALUE: 0
OTHERSTAT_10_ID: 0
OTHERSTAT_10_TYPE: NULL
OTHERSTAT_10_VALUE: 0
OTHER_XML: NULL
PLAN_OPERATION_INACTIVE: NULL
OUTPUT_BATCHES: 1
SKIPPED_ROWS_COUNT: 0
DB_TIME: 5889
USER_IO_WAIT_TIME: 0
OTHER_WAIT_TIME: NULL
1 row in set (0.025 sec)