Note
This view is available starting with V1.4.
Purpose
This view displays information about the current or previous wait events of all sessions in the current tenant on all OBServer nodes. The information includes the wait event name, wait time, and so on.
Columns
| Column | Type | Nullable | Description |
|---|---|---|---|
| SID | bigint(20) | NO | For V4.2.x:
|
| CON_ID | bigint(20) | NO | The tenant ID. |
| SVR_IP | varchar(46) | NO | The IP address of the server. |
| SVR_PORT | bigint(20) | NO | The port number of the server. |
| EVENT | varchar(64) | NO | The name of the wait event. |
| P1TEXT | varchar(64) | NO | The description of the first parameter of the wait event. |
| P1 | bigint(20) unsigned | NO | The value of the first parameter of the wait event. |
| P2TEXT | varchar(64) | NO | The description of the second parameter of the wait event. |
| P2 | bigint(20) unsigned | NO | The value of the second parameter of the wait event. |
| P3TEXT | varchar(64) | NO | The description of the third parameter of the wait event. |
| P3 | bigint(20) unsigned | NO | The value of the third parameter of the wait event. |
| WAIT_CLASS_ID | bigint(20) | NO | The ID of the wait event category. |
| WAIT_CLASS# | bigint(20) | NO | The sequence number of the wait event category. |
| WAIT_CLASS | varchar(64) | NO | The name of the wait event category. |
| STATE | varchar(19) | NO | The status of the wait event. Valid values: |
| WAIT_TIME_MICRO | bigint(20) | NO | The wait time in microseconds. If the session is still waiting, this field indicates the duration of the wait so far. If the session is not waiting, this field indicates the total wait time of the last wait. |
| TIME_REMAINING_MICRO | bigint(20) | NO | |
| TIME_SINCE_LAST_WAIT_MICRO | bigint(20) | NO | The time elapsed since the last wait ended, in microseconds. If the session is still waiting, this field is 0. |
Sample query
Query the current or previous wait events of all sessions in the current tenant on all nodes, and display the first two rows of the result.
obclient [oceanbase]> SELECT * FROM oceanbase.GV$SESSION_WAIT LIMIT 2\G
The query result is as follows:
*************************** 1. row ***************************
SID: 3221554030
CON_ID: 1002
SVR_IP: 11.xxx.xxx.xxx
SVR_PORT: 28825
EVENT: exec inner sql wait
P1TEXT: wait inner sql class
P1: 0
P2TEXT: inner session id
P2: 9223372037041564425
P3TEXT:
P3: 0
WAIT_CLASS_ID: 100
WAIT_CLASS#: 0
WAIT_CLASS: OTHER
STATE: WAITED SHORT TIME
WAIT_TIME_MICRO: 10
TIME_REMAINING_MICRO: -1
TIME_SINCE_LAST_WAIT_MICRO: -98899914482593272
*************************** 2. row ***************************
SID: -9223372036854727872
CON_ID: 1002
SVR_IP: 11.xxx.xxx.xxx
SVR_PORT: 28825
EVENT: db file compact write
P1TEXT: schedule_queue_delay
P1: 19
P2TEXT: device_delay
P2: 159
P3TEXT: callback_delay
P3: 0
WAIT_CLASS_ID: 109
WAIT_CLASS#: 9
WAIT_CLASS: SYSTEM_IO
STATE: WAITED SHORT TIME
WAIT_TIME_MICRO: 140
TIME_REMAINING_MICRO: NULL
TIME_SINCE_LAST_WAIT_MICRO: -98893816462565364
2 rows in set
References
Query all wait events at the session level:
- For more information about wait events, see Common wait events.