Note
- This view was introduced in V4.3.5 for V4.3.x.
- This view was introduced in V4.2.2 for V4.2.x.
Purpose
The GV$OB_SESS_TIME_MODEL view displays time model statistics for sessions in the cluster.
Columns
| Column | Type | Nullable? | Description |
|---|---|---|---|
| SID | bigint(20) | NO | Session ID |
| TENANT_ID | bigint(20) | NO | Tenant ID |
| SVR_IP | varchar(46) | NO | Node IP |
| SVR_PORT | bigint(20) | NO | Node port |
| STAT_ID | bigint(20) | NO | Stat ID |
| STAT_NAME | varchar(64) | NO | Stat name |
| VALUE | bigint(20) | NO | Stat value |
The following table lists the statistics events and their corresponding IDs in the STAT_NAME column of the view.
| Statistics event | Description | Stat ID | Stat type |
|---|---|---|---|
| DB time | The total time of database activities, which is the sum of CPU time and non-idle wait time. | 200001 | 3072 |
| DB CPU | The time consumed by the database for CPU operations. | 200002 | 3072 |
| background elapsed time | The total time of background process execution. | 200005 | 3072 |
| background cpu time | The CPU time consumed by background processes. | 200006 | 3072 |
| non idle wait time | The total time of non-idle waits, that is, the total time when the session is in a wait state but not in an idle wait state. | 200010 | 3072 |
| idle wait time | The total time of idle waits, that is, the total time when the session is in an idle wait state. | 200011 | 3072 |
| background database time | The total time of database operations performed by background processes. | 200012 | 3072 |
| background database non-idle wait time | The total time of database operations performed by background processes in a non-idle wait state. | 200013 | 3072 |
| background database idle wait time | The total time of database operations performed by background processes in an idle wait state. | 200014 | 3072 |
| concurrency wait total time | The total waiting time due to concurrency issues, such as waiting time due to resource locking. | 220001 | 3072 |
| user io wait total time | The total waiting time of user processes for I/O operations (such as reading data or writing data to disk). | 220002 | 3072 |
| application wait total time | The total waiting time generated by user application code (for example, lock waiting 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 sample 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