Note
This view is available starting with V4.2.2.
Overview
The DBA_WR_SQLSTAT view displays basic performance statistics for SQL statements executed by the current tenant. Each SQL statement is represented as a row (i.e., each unique combination of SQL_ID and Plan_Hash corresponds to one row). A column containing _DELTA indicates that the value represents the increment in statistics from the time the last WR snapshot was collected until the current time.
Columns
Field |
Type |
Nullable |
Description |
|---|---|---|---|
| SNAP_ID | bigint(20) | NO | Snapshot ID |
| SVR_IP | varchar(46) | NO | Node IP |
| SVR_PORT | bigint(20) | NO | Node Port Number |
| SQL_ID | varchar(32) | NO | SQL Statement ID |
| PLAN_HASH | bigint(20) unsigned | NO | Hash value of the execution plan |
| PLAN_ID | bigint(20) | NO | Execution Plan ID |
| PLAN_TYPE | bigint(20) | NO | For SQL plan caching, this field indicates the plan type:
For PL object caching, this field indicates the type of the PL object:
|
| MODULE | varchar(64) | YES | The application module when the statement was first parsed. You can pass in theDBMS_APPLICATION_INFO.SET_MODULEPackage settings |
| ACTION | varchar(64) | YES | The application action when this statement is parsed for the first time. The value of this parameter is specified by theDBMS_APPLICATION_INFO.SET_ACTIONPackage settings |
| PARSING_DB_ID | bigint(20) | NO | Database ID during statement parsing |
| PARSING_DB_NAME | varchar(128) | NO | Database name during statement parsing |
| PARSING_USER_ID | bigint(20) | NO | User ID during statement parsing |
| EXECUTIONS_TOTAL | bigint(20) | NO | Total executions of the plan in the plan cache |
| EXECUTIONS_DELTA | bigint(20) | NO | Increment of Total Executions for the Plan in Plan Cache |
| DISK_READS_TOTAL | bigint(20) | NO | Total Disk Reads |
| DISK_READS_DELTA | bigint(20) | NO | Increment of Disk I/O Operations |
| BUFFER_GETS_TOTAL | bigint(20) | NO | Total Logical Reads from Cache |
| BUFFER_GETS_DELTA | bigint(20) | NO | Increment of Logical Read Operations from Cache |
| ELAPSED_TIME_TOTAL | bigint(20) | NO | The total time consumed by this statement. For parallel execution scenarios, this value is the cumulative value for each execution thread. |
| ELAPSED_TIME_DELTA | bigint(20) | NO | The incremental time consumed by this statement |
| CPU_TIME_TOTAL | bigint(20) | NO | Total CPU Time |
| CPU_TIME_DELTA | bigint(20) | NO | Increment of Total CPU Time |
| CCWAIT_TOTAL | bigint(20) | NO | Total Time Spent on Concurrency-Waiting Events |
| CCWAIT_DELTA | bigint(20) | NO | Increment of Total Time Spent on Concurrency-Waiting Events |
| USERIO_WAIT_TOTAL | bigint(20) | NO | Total I/O Wait Time |
| USERIO_WAIT_DELTA | bigint(20) | NO | Increment of Total I/O Wait Time |
| APWAIT_TOTAL | bigint(20) | NO | Total Time Spent by Application-Waiting Events |
| APWAIT_DELTA | bigint(20) | NO | Increment of Total Waiting Event Time for Application Classes |
| PHYSICAL_READ_REQUESTS_TOTAL | bigint(20) | NO | Total Number of Physical Read Requests |
| PHYSICAL_READ_REQUESTS_DELTA | bigint(20) | NO | Increment of Physical Read Requests |
| PHYSICAL_READ_BYTES_TOTAL | bigint(20) | NO | Total Bytes of Physical Read |
| PHYSICAL_READ_BYTES_DELTA | bigint(20) | NO | Increment of Physical Read Bytes |
| WRITE_THROTTLE_TOTAL | bigint(20) | NO | Total Time Throttled When Writing to MemStore |
| WRITE_THROTTLE_DELTA | bigint(20) | NO | Increment of Total Time Throttled When Writing to MemStore |
| ROWS_PROCESSED_TOTAL | bigint(20) | NO | Total rows processed |
| ROWS_PROCESSED_DELTA | bigint(20) | NO | Increment of Total Rows Processed by Statements |
| MEMSTORE_READ_ROWS_TOTAL | bigint(20) | NO | Total rows read from MemStore |
| MEMSTORE_READ_ROWS_DELTA | bigint(20) | NO | Increment of Total Rows Read from MemStore |
| MINOR_SSSTORE_READ_ROWS_TOTAL | bigint(20) | NO | Total rows read from MINOR SSStore |
| MINOR_SSSTORE_READ_ROWS_DELTA | bigint(20) | NO | Increment of Total Rows Read from MINOR SSStore |
| MAJOR_SSSTORE_READ_ROWS_TOTAL | bigint(20) | NO | Total rows read from MAJOR SSStore |
| MAJOR_SSSTORE_READ_ROWS_DELTA | bigint(20) | NO | Increment of Total Rows Read from MAJOR SSStore |
| RPC_TOTAL | bigint(20) | NO | Total RPC Calls |
| RPC_DELTA | bigint(20) | NO | Increment of RPC Calls |
| FETCHES_TOTAL | bigint(20) | NO | Total Number of Result Sets Retrieved |
| FETCHES_DELTA | bigint(20) | NO | Increment of Result Set Retrieved |
| RETRY_TOTAL | bigint(20) | NO | Total Number of SQL Retry Attempts |
| RETRY_DELTA | bigint(20) | NO | Increment of SQL Retry Attempts |
| PARTITION_TOTAL | bigint(20) | NO | Total Number of Scanned Partitions During SQL Execution |
| PARTITION_DELTA | bigint(20) | NO | Incremental Number of Scanned Partitions During SQL Execution |
| NESTED_SQL_TOTAL | bigint(20) | NO | Total nested SQL executions. The value increases by 1 for each additional executed sub-SQL statement. |
| NESTED_SQL_DELTA | bigint(20) | NO | Increment of Nested SQL Execution |
| SOURCE_IP | varchar(46) | NO | IP Address of Request Origin |
| SOURCE_PORT | bigint(20) | NO | Port number of the request source |
| ROUTE_MISS_TOTAL | bigint(20) | NO | Total Number of Requests That Have Not Been Correctly Hit by the Plan Since Its Generation |
| ROUTE_MISS_DELTA | bigint(20) | NO | Total Number of Requests That Could Not Be Correctly Assigned to a Partition Since the Last WR Snapshot Collection |
| FIRST_LOAD_TIME | timestamp(6) | YES | Execution Plan Generation Time |
| PLAN_CACHE_HIT_TOTAL | bigint(20) | NO | Total Number of Times a Plan Has Hit the Plan Cache Since Its Generation |
| PLAN_CACHE_HIT_DELTA | bigint(20) | NO | Number of Times Hit by Plan Cache Since the Last WR Snapshot Collection |
| MUTI_QUERY_TOTAL | bigint(20) | NO | Number of Times This SQL Statement Has Been Included in a Multi-Query Since the Execution Plan Was Generated
NoteThis field is available starting with V4.2.5 BP7 for version V4.2.5. |
| MUTI_QUERY_DELTA | bigint(20) | NO | Number of Times This SQL Statement Has Been Included in a Multi-Query Since the Last WR Snapshot Collection
NoteThis field is available starting with V4.2.5 BP7 for version V4.2.5. |
| MUTI_QUERY_BATCH_TOTAL | bigint(20) | NO | Number of executions for this SQL batch since the plan was generated
NoteThis field is available starting with V4.2.5 BP7 for version V4.2.5. |
| MUTI_QUERY_BATCH_DELTA | bigint(20) | NO | Number of executions of this SQL batch since the last WR snapshot collection
NoteThis field is available starting with V4.2.5 BP7 for version V4.2.5. |
| FULL_TABLE_SCAN_TOTAL | bigint(20) | NO | Number of Full Table Scans for This SQL Statement Since Plan Generation
NoteThis field is available starting with V4.2.5 BP7. |
| FULL_TABLE_SCAN_DELTA | bigint(20) | NO | Number of Full Table Scans of This SQL Statement Since the Last WR Snapshot Collection
NoteThis field is available starting from V4.2.5 BP7 for version V4.2.5. |
| ERROR_COUNT_TOTAL | bigint(20) | NO | Number of times this SQL statement has returned an error since the plan was generated
NoteThis field is available starting with V4.2.5 BP7 for version V4.2.5. |
| ERROR_COUNT_DELTA | bigint(20) | NO | Number of times this SQL error occurred since the last WR snapshot collection
NoteFor V4.2.5, this field is available starting with V4.2.5 BP7. |
Sample query
Query the basic performance statistics of SQL statements executed in the current tenant and display the first record.
obclient [oceanbase]> SELECT * FROM oceanbase.DBA_WR_SQLSTAT LIMIT 1\G
The query result is as follows:
*************************** 1. row ***************************
SNAP_ID: 1
SVR_IP: xx.xx.xx.xx
SVR_PORT: 2882
SQL_ID: 01058E374A5EF26873BA4D99C4A74582
PLAN_HASH: 5547575357486659143
PLAN_TYPE: 1
MODULE: NULL
ACTION: NULL
PARSING_DB_ID: 201001
PARSING_DB_NAME: oceanbase
PARSING_USER_ID: 200001
EXECUTIONS_TOTAL: 3
EXECUTIONS_DELTA: 3
DISK_READS_TOTAL: 1
DISK_READS_DELTA: 1
BUFFER_GETS_TOTAL: 1
BUFFER_GETS_DELTA: 1
ELAPSED_TIME_TOTAL: 4864
ELAPSED_TIME_DELTA: 4864
CPU_TIME_TOTAL: 0
CPU_TIME_DELTA: 0
CCWAIT_TOTAL: 0
CCWAIT_DELTA: 0
USERIO_WAIT_TOTAL: 0
USERIO_WAIT_DELTA: 0
APWAIT_TOTAL: 0
APWAIT_DELTA: 0
PHYSICAL_READ_REQUESTS_TOTAL: 1
PHYSICAL_READ_REQUESTS_DELTA: 1
PHYSICAL_READ_BYTES_TOTAL: 194
PHYSICAL_READ_BYTES_DELTA: 194
WRITE_THROTTLE_TOTAL: 0
WRITE_THROTTLE_DELTA: 0
ROWS_PROCESSED_TOTAL: 0
ROWS_PROCESSED_DELTA: 0
MEMSTORE_READ_ROWS_TOTAL: 0
MEMSTORE_READ_ROWS_DELTA: 0
MINOR_SSSTORE_READ_ROWS_TOTAL: 0
MINOR_SSSTORE_READ_ROWS_DELTA: 0
MAJOR_SSSTORE_READ_ROWS_TOTAL: 0
MAJOR_SSSTORE_READ_ROWS_DELTA: 0
RPC_TOTAL: 0
RPC_DELTA: 0
FETCHES_TOTAL: 0
FETCHES_DELTA: 0
RETRY_TOTAL: 0
RETRY_DELTA: 0
PARTITION_TOTAL: 1
PARTITION_DELTA: 1
NESTED_SQL_TOTAL: 0
NESTED_SQL_DELTA: 0
SOURCE_IP: xx.xx.xx.xx
SOURCE_PORT: 2882
ROUTE_MISS_TOTAL: 0
ROUTE_MISS_DELTA: 0
FIRST_LOAD_TIME: 2025-10-15 11:11:19.638416
PLAN_CACHE_HIT_TOTAL: 1
PLAN_CACHE_HIT_DELTA: 1
MUTI_QUERY_TOTAL: 0
MUTI_QUERY_DELTA: 0
MUTI_QUERY_BATCH_TOTAL: 0
MUTI_QUERY_BATCH_DELTA: 0
FULL_TABLE_SCAN_TOTAL: 0
FULL_TABLE_SCAN_DELTA: 0
ERROR_COUNT_TOTAL: 0
ERROR_COUNT_DELTA: 0
1 row in set
