Note
- This view is available starting with V4.3.5 for V4.3.x.
- This view is available starting with V4.2.2 for V4.2.x.
Purpose
The GV$OB_SESS_TIME_MODEL view displays the Time Model statistics at the session level in the cluster.
Columns
| Column | Type | Nullable? | Description |
|---|---|---|---|
| SID | bigint(20) | NO | The session ID. |
| TENANT_ID | bigint(20) | NO | The tenant ID. |
| SVR_IP | varchar(46) | NO | The IP address of the node. |
| SVR_PORT | bigint(20) | NO | The port number of the node. |
| STAT_ID | bigint(20) | NO | The ID of the statistic. |
| STAT_NAME | varchar(64) | NO | The name of the statistic. |
| VALUE | bigint(20) | NO | The value of the statistic. |
The values of the STAT_NAME column in this view are the names of the statistics and their corresponding IDs, as shown in the following table.
| Statistic Name | Description | Statistic ID | Statistic Type |
|---|---|---|---|
| DB time | The total time of database activities, including the sum of CPU time and non-idle wait time. | 200001 | 3072 |
| DB CPU | The CPU time consumed in database activities. | 200002 | 3072 |
| background elapsed time | The total time of background processes. | 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 time when the session is in a waiting state but not in an idle wait state. | 200010 | 3072 |
| idle wait time | The total time of idle waits, that is, the time when the session is in an idle wait state. | 200011 | 3072 |
| background database time | The total time of database operations executed by background processes. | 200012 | 3072 |
| background database non-idle wait time | The time when background processes execute database operations in a non-idle wait state. | 200013 | 3072 |
| background database idle wait time | The time when background processes execute database operations in an idle wait state. | 200014 | 3072 |
| concurrency wait total time | The total time of waits caused by concurrency issues, such as the time spent waiting for resource locks. | 220001 | 3072 |
| user io wait total time | The total time that user processes spend waiting for I/O operations (such as reading data from or writing data to a disk) to complete. | 220002 | 3072 |
| application wait total time | The total time of waits caused by user application code, such as lock waits caused by row-level locks or explicit lock commands. | 2200013 | 3072 |
Sample query
Query the Time Model statistics at the session level on all nodes and display the first 10 records.
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 |
+---------------+-----------+----------------+----------+---------+--------------------+-------+
| 3298534883328 | 1002 | 172.xx.xxx.xxx | 2882 | 200010 | non idle wait time | 0 |
| 3298534883328 | 1002 | 172.xx.xxx.xxx | 2882 | 200011 | idle wait time | 0 |
| 3848290697216 | 1001 | 172.xx.xxx.xxx | 2882 | 200010 | non idle wait time | 0 |
| 3848290697216 | 1001 | 172.xx.xxx.xxx | 2882 | 200011 | idle wait time | 0 |
| 3221659555 | 1 | 172.xx.xxx.xxx | 2882 | 200010 | non idle wait time | 3 |
| 3221659555 | 1 | 172.xx.xxx.xxx | 2882 | 200011 | idle wait time | 0 |
| 4398046511104 | 1001 | 172.xx.xxx.xxx | 2882 | 200010 | non idle wait time | 0 |
| 4398046511104 | 1001 | 172.xx.xxx.xxx | 2882 | 200011 | idle wait time | 0 |
| 4947802324992 | 1004 | 172.xx.xxx.xxx | 2882 | 200010 | non idle wait time | 0 |
| 4947802324992 | 1004 | 172.xx.xxx.xxx | 2882 | 200011 | idle wait time | 0 |
+---------------+-----------+----------------+----------+---------+--------------------+-------+
10 rows in set