Note
This view was introduced in OceanBase Database V1.4.
Purpose
The V$SQL_PLAN_MONITOR view displays statistics at the operation level of slow queries on the current OBServer node in the tenant. Each operation has one statistic.
Columns
| Column | Type | Nullable? | Description |
|---|---|---|---|
| CON_ID | bigint(20) | NO | Tenant ID. |
| REQUEST_ID | bigint(20) | NO | ID number of the request. |
| KEY | bigint(0) unsigned | NO | Foreign key for joining with the related virtual table in the SQL_MONITOR view. |
| STATUS | varchar(19) | NO | Status of the operator: |
| SVR_IP | varchar(46) | NO | IP address of the server where the operator resides. |
| SVR_PORT | bigint(20) | NO | Port number of the server where the operator resides. |
| TRACE_ID | varchar(64) | NO | Trace ID of the operator. |
| DB_TIME | bigint(20) | NO | CPU time consumed by the operator. |
| USER_IO_WAIT_TIME | bigint(20) | NO | Total time of user_io events. |
| OTHER_WAIT_TIME | bigint(0) unsigned | NO | Waiting time of other events. |
| FIRST_REFRESH_TIME | timestamp(6) | NO | Start time of monitoring for the operator. |
| LAST_REFRESH_TIME | timestamp(6) | NO | End time of monitoring for the operator. |
| FIRST_CHANGE_TIME | timestamp(6) | NO | Time when the operator outputs the first row of data. |
| LAST_CHANGE_TIME | timestamp(6) | NO | Time when the operator outputs the last row of data. |
| REFRESH_COUNT | bigint(0) unsigned | NO | Number of times the statistics are refreshed. |
| SID | bigint(0) unsigned | NO | ID of the session. |
| PROCESS_NAME | bigint(20) | NO | ID of the execution thread. |
| SQL_ID | varchar(32) | NO | ID of the SQL statement. |
| SQL_EXEC_START | bigint(0) unsigned | NO | Start time of the execution of the SQL statement. |
| SQL_EXEC_ID | bigint(0) unsigned | NO | ID of the execution of the SQL statement. |
| SQL_PLAN_HASH_VALUE | bigint(0) unsigned | NO | Hash value of the SQL plan. |
| SQL_CHILD_ADDRESS | varbinary(8) | NO | Default value: NULL. |
| PLAN_PARENT_ID | bigint(0) unsigned | NO | ID of the parent operator. |
| PLAN_LINE_ID | bigint(20) | NO | Default value: NULL. |
| PLAN_OPERATION | varchar(128) | NO | Name of the operator. |
| PLAN_OPTIONS | varchar(30) unsigned | NO | Default value: NULL. |
| PLAN_OBJECT_OWNER | varchar(128) | NO | Default value: NULL. |
| PLAN_OBJECT_NAME | varchar(128) | NO | Default value: NULL. |
| PLAN_OBJECT_TYPE | varchar(80) | NO | Default value: NULL. |
| PLAN_DEPTH | bigint(20) | NO | Depth of the operator in the plan tree. |
| PLAN_POSITION | bigint(0) unsigned | NO | Sequence number of the operator as a child of its parent operator. |
| PLAN_COST | bigint(0) unsigned | NO | Cost of the operator calculated by the optimizer. |
| PLAN_CARDINALITY | bigint(0) unsigned | NO | Number of rows output by the operator calculated by the optimizer. |
| PLAN_BYTES | bigint(0) unsigned | NO | Estimated number of bytes output by the operator calculated by the optimizer. |
| PLAN_TIME | bigint(0) unsigned | NO | Estimated execution time of the operator calculated by the optimizer. |
| PLAN_PARTITION_START | bigint(0) unsigned | NO | Default value: NULL. |
| PLAN_PARTITION_STOP | bigint(0) unsigned | NO | Default value: NULL. |
| PLAN_CPU_COST | bigint(0) unsigned | NO | Estimated CPU cost of the operator calculated by the optimizer. |
| PLAN_IO_COST | bigint(0) unsigned | NO | Estimated IO cost of the operator calculated by the optimizer. |
| PLAN_TEMP_SPACE | bigint(0) unsigned | NO | Estimated space occupied by the operator calculated by the optimizer. |
| STARTS | bigint(20) | NO | Number of times the operator is rescanned. |
| OUTPUT_ROWS | bigint(20) | NO | Total number of rows output by the operator (the cumulative value of the number of rows output by all instances of the operator). |
| IO_INTERCONNECT_BYTES | bigint(0) unsigned | NO | Number of bytes of data exchanged between the operator and the storage layer. |
| PHYSICAL_READ_REQUESTS | bigint(0) unsigned | NO | Number of I/O read requests issued by the operator. |
| PHYSICAL_READ_BYTES | bigint(0) unsigned | NO | Number of bytes of data in I/O read requests issued by the operator. |
| PHYSICAL_WRITE_REQUESTS | bigint(0) unsigned | NO | Number of I/O write requests issued by the operator. |
| PHYSICAL_WRITE_BYTES | bigint(0) unsigned | NO | Number of bytes of data in I/O write requests issued by the operator. |
| WORKAREA_MEM | bigint(20) unsigned | NO | Memory occupied by the operator in the work area. |
| WORKAREA_MAX_MEM | bigint(20) unsigned | NO | Maximum memory that the operator can occupy in the work area. |
| WORKAREA_TEMPSEG | bigint(20) unsigned | NO | Disk space occupied by the operator for dumping data. |
| WORKAREA_MAX_TEMPSEG | bigint(20) unsigned | NO | Maximum disk space that the operator can occupy for dumping data. |
| OTHERSTAT_GROUP_ID | bigint(0) unsigned | NO | Default value: NULL. |
| OTHERSTAT_1_ID | bigint(20) | NO | ID of the field. |
| OTHERSTAT_1_TYPE | bigint(0) unsigned | NO | Reserved. |
| OTHERSTAT_1_VALUE | bigint(20) | NO | For a TABLE SCAN operator, the number of bytes read from the storage layer IO_READ_BYTES.
Note
|
| OTHERSTAT_2_ID | bigint(20) | NO | ID of the field. |
| OTHERSTAT_2_TYPE | bigint(0) unsigned | NO | Reserved. |
| OTHERSTAT_2_VALUE | bigint(20) | NO | For a TABLE SCAN operator, the number of bytes read from the SSStore SSSTORE_READ_BYTES.
Note
|
| OTHERSTAT_3_ID | bigint(20) | NO | ID of the field. |
| OTHERSTAT_3_TYPE | bigint(0) unsigned | NO | Reserved. |
| OTHERSTAT_3_VALUE | bigint(20) | 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 | bigint(20) | NO | ID of the field. |
| OTHERSTAT_4_TYPE | bigint(0) unsigned | NO | Reserved. |
| OTHERSTAT_4_VALUE | bigint(20) | 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 | bigint(20) | NO | Reserved. |
| OTHERSTAT_5_TYPE | bigint(0) unsigned | NO | Reserved. |
| OTHERSTAT_5_VALUE | bigint(20) | NO | Reserved. |
| OTHERSTAT_6_ID | bigint(20) | NO | Reserved. |
| OTHERSTAT_6_TYPE | bigint(0) unsigned | NO | Reserved. |
| OTHERSTAT_6_VALUE | bigint(20) | NO | Reserved. |
| OTHERSTAT_7_ID | bigint(20) | NO | Reserved. |
| OTHERSTAT_7_TYPE | bigint(0) unsigned | NO | Reserved. |
| OTHERSTAT_7_VALUE | bigint(20) | NO | Reserved. |
| OTHERSTAT_8_ID | bigint(20) | NO | Reserved. |
| OTHERSTAT_8_TYPE | bigint(0) unsigned | NO | Reserved. |
| OTHERSTAT_8_VALUE | bigint(20) | NO | Reserved. |
| OTHERSTAT_9_ID | bigint(20) | NO | Reserved. |
| OTHERSTAT_9_TYPE | bigint(0) unsigned | NO | Reserved. |
| OTHERSTAT_9_VALUE | bigint(20) | NO | Reserved. |
| OTHERSTAT_10_ID | bigint(20) | NO | Reserved. |
| OTHERSTAT_10_TYPE | bigint(0) unsigned | NO | Reserved. |
| OTHERSTAT_10_VALUE | bigint(20) | NO | Reserved. |
| OTHER_XML | varchar(255) | NO | Structured data that cannot be written to reserved fields but needs to be provided to external tools. External tools are responsible for parsing this field. |
| PLAN_OPERATION_INACTIVE | bigint(0) unsigned | NO | Default value: NULL. |
| OUTPUT_BATCHES | bigint(20) | NO | Number of times the operator calls the get_next_batch interface in vectorized mode. |
| SKIPPED_ROWS_COUNT | bigint(20) | NO | Total number of rows that are not calculated by the operator in vectorized mode (the total number of filtered rows). |
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 current tenant.
obclient [oceanbase]> SELECT * FROM oceanbase.V$SQL_PLAN_MONITOR limit 1\G
The query result is as follows:
*************************** 1. row ***************************
CON_ID: 1
REQUEST_ID: 0
KEY: NULL
STATUS: NULL
SVR_IP: xx.xx.xx.xx
SVR_PORT: 2882
TRACE_ID: YB42AC1E87C6-000XXXXXXXXX-0-0
DB_TIME: 5538
USER_IO_WAIT_TIME: 0
OTHER_WAIT_TIME: NULL
FIRST_REFRESH_TIME: 2024-10-23 15:28:58.252685
LAST_REFRESH_TIME: 2024-10-23 15:28:58.263195
FIRST_CHANGE_TIME: NULL
LAST_CHANGE_TIME: 2024-10-23 15:28:58.262182
REFRESH_COUNT: NULL
SID: NULL
PROCESS_NAME: 10272
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
1 row in set (0.018 sec)