Note
- For OceanBase Database V4.3.x, this view is introduced in V4.3.5.
- For OceanBase Database V4.2.x, this view is introduced in V4.2.2.
Purpose
The V$OB_SYS_TIME_MODEL view displays the time model statistics for tenants on the current node.
Columns
| Column | Type | Nullable? | Description |
|---|---|---|---|
| TENANT_ID | bigint(20) | NO | Tenant ID |
| SVR_IP | varchar(46) | NO | IP address of the node |
| SVR_PORT | bigint(20) | NO | Port number of the node |
| STAT_ID | bigint(20) | NO | Statistics ID |
| STAT_NAME | varchar(64) | NO | Statistics name |
| VALUE | bigint(20) | NO | Statistics value |
The following table describes the statistics event names and IDs in the STAT_NAME column of the view.
| Statistics event name | Description | Statistics event ID | Statistics event type |
|---|---|---|---|
| DB time | Total time of database activities, including the sum of CPU usage and non-idle wait time | 200001 | 3072 |
| DB CPU | CPU usage of database activities | 200002 | 3072 |
| background elapsed time | Total time of background process execution | 200005 | 3072 |
| background cpu time | CPU usage of background processes | 200006 | 3072 |
| non idle wait time | Total time of non-idle waits, which is the total time that a session is in a wait state but not in an idle wait state | 200010 | 3072 |
| idle wait time | Total time of idle waits, which is the total time that a session is in an idle wait state | 200011 | 3072 |
| background database time | Total time of database operations executed by background processes | 200012 | 3072 |
| background database non-idle wait time | Total time of database operations executed by background processes in a non-idle wait state | 200013 | 3072 |
| background database idle wait time | Total time of database operations executed by background processes in an idle wait state | 200014 | 3072 |
| concurrency wait total time | Total wait time due to concurrency issues, such as wait time caused by resource locking | 220001 | 3072 |
| user io wait total time | Total wait time of user processes waiting for I/O operations (such as data read or write to disk) to complete | 220002 | 3072 |
| application wait total time | Total wait time caused by user application code (such as lock waits caused by row-level locking or explicit locking commands) | 2200013 | 3072 |
Sample query
obclient [oceanbase]> SELECT * FROM oceanbase.V$OB_SYS_TIME_MODEL LIMIT 10;
The query result is as follows:
+-----------+----------------+----------+---------+-------------------------+------------+
| TENANT_ID | SVR_IP | SVR_PORT | STAT_ID | STAT_NAME | VALUE |
+-----------+----------------+----------+---------+-------------------------+------------+
| 1 | 172.xx.xxx.xxx | 2882 | 200001 | DB time | 2912951619 |
| 1 | 172.xx.xxx.xxx | 2882 | 200002 | DB CPU | 2019929545 |
| 1 | 172.xx.xxx.xxx | 2882 | 200005 | background elapsed time | 3117600573 |
| 1 | 172.xx.xxx.xxx | 2882 | 200006 | background cpu time | 2872316120 |
| 1 | 172.xx.xxx.xxx | 2882 | 200010 | non idle wait time | 893022074 |
| 1 | 172.xx.xxx.xxx | 2882 | 200011 | idle wait time | 6902209 |
| 1001 | 172.xx.xxx.xxx | 2882 | 200001 | DB time | 0 |
| 1001 | 172.xx.xxx.xxx | 2882 | 200002 | DB CPU | 0 |
| 1001 | 172.xx.xxx.xxx | 2882 | 200005 | background elapsed time | 2821229725 |
| 1001 | 172.xx.xxx.xxx | 2882 | 200006 | background cpu time | 2619812567 |
+-----------+----------------+----------+---------+-------------------------+------------+
10 rows in set