Note
This view is introduced since OceanBase Database V4.2.2.
Purpose
The GV$OB_SESS_TIME_MODEL view displays the session-level time model statistical items of the cluster.
Columns
| Column | Type | Nullable? | Description |
|---|---|---|---|
| SID | bigint(20) | NO | The ID of the session. |
| TENANT_ID | bigint(20) | NO | The ID of the tenant. |
| SVR_IP | varchar(46) | NO | The IP address of the OBServer node. |
| SVR_PORT | bigint(20) | NO | The port number of the OBServer node. |
| STAT_ID | bigint(20) | NO | The ID of the statistical item. |
| STAT_NAME | varchar(64) | NO | The name of the statistical item. |
| VALUE | bigint(20) | NO | The value of the statistical item. |
The following table lists the names and IDs of statistical events in the STAT_NAME column.
| Event name | Description | Event ID | Event class |
|---|---|---|---|
| DB time | The total amount of active time of the database, which is an accumulative value of the CPU time and non-idle wait time. | 200001 | 3072 |
| DB CPU | The CPU time consumed by the database in the active state. | 200002 | 3072 |
| background elapsed time | The total amount of time spent on background process execution. | 200005 | 3072 |
| background cpu time | The CPU time consumed by background processes. | 200006 | 3072 |
| non idle wait time | The amount of non-idle wait time, namely, the total amount of time elapsed when the session is in the wait but not idle state. | 200010 | 3072 |
| idle wait time | The amount of idle wait time, namely, the total amount of time elapsed when the session is in the idle wait state. | 200011 | 3072 |
| background database time | The total amount of time spent by background processes in executing database operations. | 200012 | 3072 |
| background database non-idle wait time | The amount of time spent by background processes in executing database operations in the non-idle wait state. | 200013 | 3072 |
| background database idle wait time | The amount of time spent by background processes in executing database operations in the idle wait state. | 200014 | 3072 |
| concurrency wait total time | The total amount of wait time caused by concurrency issues, such as the wait time caused by resource locking. | 220001 | 3072 |
| user io wait total time | The total amount of time spent by user processes in waiting for the I/O operations, such as data reads from or data writes to the disk, to complete. | 220002 | 3072 |
| application wait total time | The total amount of wait time caused by the application code, such as lock waits caused by row-level locking or explicit lock commands. | 2200013 | 3072 |
Sample query
obclient [oceanbase]> SELECT * FROM oceanbase.GV$OB_SESS_TIME_MODEL LIMIT 10;
The query result is as follows:
+---------------+-----------+----------------+----------+---------+--------------------+-------+
| SID | TENANT_ID | SVR_IP | SVR_PORT | STAT_ID | STAT_NAME | VALUE |
+---------------+-----------+----------------+----------+---------+--------------------+-------+
| 3221659547 | 1 | 172.xx.xxx.xxx | 2882 | 200010 | non idle wait time | 0 |
| 3221659547 | 1 | 172.xx.xxx.xxx | 2882 | 200011 | idle wait time | 0 |
| 3221667739 | 1 | 172.xx.xxx.xxx | 2882 | 200010 | non idle wait time | 0 |
| 3221667739 | 1 | 172.xx.xxx.xxx | 2882 | 200011 | idle wait time | 0 |
| 549755813888 | 500 | 172.xx.xxx.xxx | 2882 | 200010 | non idle wait time | 0 |
| 549755813888 | 500 | 172.xx.xxx.xxx | 2882 | 200011 | idle wait time | 0 |
| 3221667740 | 1 | 172.xx.xxx.xxx | 2882 | 200010 | non idle wait time | 287 |
| 3221667740 | 1 | 172.xx.xxx.xxx | 2882 | 200011 | idle wait time | 0 |
| 1099511627776 | 0 | 172.xx.xxx.xxx | 2882 | 200010 | non idle wait time | 0 |
| 1099511627776 | 0 | 172.xx.xxx.xxx | 2882 | 200011 | idle wait time | 0 |
+---------------+-----------+----------------+----------+---------+--------------------+-------+
10 rows in set