Overview
The GV$SESSION_WAIT view displays information about the current or previous wait events for all sessions on all nodes, including the event name and wait time.
Columns
Field |
Type |
Nullable |
Description |
|---|---|---|---|
| SID | bigint(20) | NO |
|
| CON_ID | bigint(20) | NO | Tenant ID |
| SVR_IP | varchar(46) | NO | Server IP |
| SVR_PORT | bigint(20) | NO | Server Port |
| EVENT | varchar(64) | NO | Event Name |
| P1TEXT | varchar(64) | NO | Description of the first parameter for waiting for an event |
| P1 | bigint(20) unsigned | NO | Value of the first parameter for the wait event |
| P2TEXT | varchar(64) | NO | Description of the second parameter for waiting on an event |
| P2 | bigint(20) unsigned | NO | Value of the Second Parameter for Waiting for an Event |
| P3TEXT | varchar(64) | NO | Description of the third parameter for waiting on an event |
| P3 | bigint(20) unsigned | NO | Value of the third parameter for the wait event |
| WAIT_CLASS_ID | bigint(20) | NO | Category ID of the waiting event |
| WAIT_CLASS# | bigint(20) | NO | Category number of the waiting event |
| WAIT_CLASS | varchar(64) | NO | Category name of the event to be waited for |
| STATE | varchar(19) | NO | The current status of the event wait, which includes four states:
|
| WAIT_TIME_MICRO | bigint(20) | NO | Wait time, in microseconds. If currently waiting, indicates the duration already spent waiting; if not currently waiting, indicates the total wait time from the last wait. |
| TIME_REMAINING_MICRO | bigint(20) | NO |
|
| TIME_SINCE_LAST_WAIT_MICRO | bigint(20) | NO | Time elapsed since the last wait ended, in microseconds. If currently waiting, the value is 0. |
Sample query
Query some information about the current or previous wait events for all sessions on all nodes.
obclient [oceanbase]> SELECT * FROM oceanbase.GV$SESSION_WAIT LIMIT 1\G
The query result is as follows:
*************************** 1. row ***************************
SID: 3221608040
CON_ID: 1
SVR_IP: xx.xx.xx.xx
SVR_PORT: 2882
EVENT: wait in request queue
P1TEXT: pcode
P1: 0
P2TEXT: level
P2: 0
P3TEXT: priority
P3: 0
WAIT_CLASS_ID: 102
WAIT_CLASS#: 2
WAIT_CLASS: CONFIGURATION
STATE: WAITED SHORT TIME
WAIT_TIME_MICRO: 12
TIME_REMAINING_MICRO: -1
TIME_SINCE_LAST_WAIT_MICRO: -360944228277398966