Note
This view is available starting with V1.4.
Purpose
This view displays session-level wait events for the current tenant on all OBServer nodes.
Columns
| Column | Type | Nullable | Description |
|---|---|---|---|
| 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. |
| SID | bigint(20) | NO | For V4.2.x:
|
| EVENT | varchar(64) | NO | The description of the wait event. |
| TOTAL_WAITS | bigint(20) | NO | The total number of wait events. |
| TOTAL_TIMEOUTS | bigint(20) | NO | The total number of timeouts for wait events. |
| TIME_WAITED | double | NO | The total wait time, in hundredths of a second. |
| AVERAGE_WAIT | double | NO | The average wait time, in hundredths of a second. |
| MAX_WAIT | double | NO | The maximum wait time, in hundredths of a second. |
| TIME_WAITED_MICRO | bigint(20) | NO | The total wait time, in microseconds. |
| CPU | null | NO | An invalid column. |
| EVENT_ID | bigint(20) | NO | The ID of the wait event. |
| WAIT_CLASS_ID | bigint(20) | NO | The ID of the type to which the wait event belongs. |
| WAIT_CLASS# | bigint(20) | NO | The index of the type to which the wait event belongs. |
| WAIT_CLASS | varchar(64) | NO | The name of the type to which the wait event belongs. |
Sample query
Query the sql-related session-level wait events for the current tenant on all nodes, and display the first 10 records.
obclient [oceanbase]> SELECT * FROM oceanbase.GV$SESSION_EVENT WHERE EVENT LIKE '%sql%' LIMIT 10;
The query result is as follows:
+--------+----------------+----------+----------------------+---------------------+-------------+----------------+-------------+-----------------------+----------+-------------------+------+----------+---------------+-------------+------------+
| CON_ID | SVR_IP | SVR_PORT | SID | EVENT | TOTAL_WAITS | TOTAL_TIMEOUTS | TIME_WAITED | AVERAGE_WAIT | MAX_WAIT | TIME_WAITED_MICRO | CPU | EVENT_ID | WAIT_CLASS_ID | WAIT_CLASS# | WAIT_CLASS |
+--------+----------------+----------+----------------------+---------------------+-------------+----------------+-------------+-----------------------+----------+-------------------+------+----------+---------------+-------------+------------+
| 1002 | 11.xxx.xxx.xxx | 28825 | 3221716963 | exec inner sql wait | 4 | 0 | 0.082 | 0.0205 | 0.0702 | 820 | NULL | 30000 | 100 | 0 | OTHER |
| 1002 | 11.xxx.xxx.xxx | 28825 | -9223372036854727934 | exec inner sql wait | 1826940 | 0 | 7474.8778 | 0.004091474158976212 | 0.9016 | 74748778 | NULL | 30000 | 100 | 0 | OTHER |
| 1002 | 11.xxx.xxx.xxx | 28825 | -9223372036854727870 | exec inner sql wait | 6305515 | 0 | 22349.8128 | 0.003544486501102606 | 4.1072 | 223498128 | NULL | 30000 | 100 | 0 | OTHER |
| 1002 | 11.xxx.xxx.xxx | 28825 | -9223372036854727869 | exec inner sql wait | 203661 | 0 | 1131.0565 | 0.005553623423237635 | 0.335 | 11310565 | NULL | 30000 | 100 | 0 | OTHER |
| 1002 | 11.xxx.xxx.xxx | 28825 | -9223372036854727868 | exec inner sql wait | 203661 | 0 | 1096.0671 | 0.005381821261802702 | 0.4135 | 10960671 | NULL | 30000 | 100 | 0 | OTHER |
| 1002 | 11.xxx.xxx.xxx | 28825 | -9223372036854727867 | exec inner sql wait | 203661 | 0 | 1125.6153 | 0.0055269064769396204 | 0.3247 | 11256153 | NULL | 30000 | 100 | 0 | OTHER |
| 1002 | 11.xxx.xxx.xxx | 28825 | -9223372036854727866 | exec inner sql wait | 203661 | 0 | 1112.3133 | 0.005461592057389485 | 0.4123 | 11123133 | NULL | 30000 | 100 | 0 | OTHER |
| 1002 | 11.xxx.xxx.xxx | 28825 | -9223372036854727929 | exec inner sql wait | 2262 | 0 | 10.3428 | 0.004572413793103448 | 0.3312 | 103428 | NULL | 30000 | 100 | 0 | OTHER |
| 1002 | 11.xxx.xxx.xxx | 28825 | -9223372036854727865 | exec inner sql wait | 542950 | 0 | 10729.4608 | 0.01976141596832121 | 17.0666 | 107294608 | NULL | 30000 | 100 | 0 | OTHER |
| 1002 | 11.xxx.xxx.xxx | 28825 | -9223372036854727928 | exec inner sql wait | 18 | 0 | 0.5979 | 0.033216666666666665 | 0.3193 | 5979 | NULL | 30000 | 100 | 0 | OTHER |
+--------+----------------+----------+----------------------+---------------------+-------------+----------------+-------------+-----------------------+----------+-------------------+------+----------+---------------+-------------+------------+
10 rows in set
References
Query the current or previous wait events for all sessions:
- For more information about wait events, see Common wait events.