Note
This view is available starting with V1.4.
Purpose
This view displays session-level wait events for all tenants on the current node.
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 wait event timeouts. |
| TIME_WAITED | double | NO | The total wait time of the wait event, in hundredths of a second. |
| AVERAGE_WAIT | double | NO | The average wait time of the wait event, in hundredths of a second. |
| MAX_WAIT | double | NO | The maximum wait time of the wait event, in hundredths of a second. |
| TIME_WAITED_MICRO | bigint(20) | NO | The total wait time of the wait event, 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 wait event type. |
| WAIT_CLASS# | bigint(20) | NO | The index of the wait event type. |
| WAIT_CLASS | varchar(64) | NO | The name of the wait event type. |
Sample query
In the sys tenant, query all sql-related session-level wait events for all tenants on the current node and display the first 10 records.
obclient [oceanbase]> SELECT * FROM oceanbase.V$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 |
+--------+----------------+----------+----------------------+----------------------------+-------------+----------------+-------------+-----------------------+----------+-------------------+------+----------+---------------+-------------+------------+
| 1 | 11.xxx.xxx.xxx | 28825 | 3221677058 | mysql response wait client | 42 | 0 | 11.5376 | 0.27470476190476195 | 7.7163 | 115376 | NULL | 13001 | 106 | 6 | IDLE |
| 1 | 11.xxx.xxx.xxx | 28825 | 3221677058 | exec inner sql wait | 9 | 0 | 2.8834 | 0.32037777777777776 | 2.5938 | 28834 | NULL | 30000 | 100 | 0 | OTHER |
| 1 | 11.xxx.xxx.xxx | 28825 | -9223372036854775680 | exec inner sql wait | 1596 | 0 | 4.9112 | 0.0030771929824561406 | 0.241 | 49112 | NULL | 30000 | 100 | 0 | OTHER |
| 1 | 11.xxx.xxx.xxx | 28825 | -9223372036854775552 | exec inner sql wait | 67839 | 0 | 273.4512 | 0.004030884889223013 | 0.2568 | 2734512 | NULL | 30000 | 100 | 0 | OTHER |
| 1004 | 11.xxx.xxx.xxx | 28825 | -9223372036854723584 | exec inner sql wait | 1083 | 0 | 17.4081 | 0.016073961218836565 | 0.8666 | 174081 | NULL | 30000 | 100 | 0 | OTHER |
| 1006 | 11.xxx.xxx.xxx | 28825 | -9223372036850300480 | exec inner sql wait | 2175 | 0 | 9.8084 | 0.004509609195402299 | 0.3586 | 98084 | NULL | 30000 | 100 | 0 | OTHER |
| 1006 | 11.xxx.xxx.xxx | 28825 | -9223372036850300416 | exec inner sql wait | 195873 | 0 | 1097.3318 | 0.005602261669551189 | 0.2956 | 10973318 | NULL | 30000 | 100 | 0 | OTHER |
| 1 | 11.xxx.xxx.xxx | 28825 | -9223372036854775679 | exec inner sql wait | 1074 | 0 | 14.9904 | 0.013957541899441341 | 9.846 | 149904 | NULL | 30000 | 100 | 0 | OTHER |
| 1 | 11.xxx.xxx.xxx | 28825 | -9223372036854775551 | exec inner sql wait | 67839 | 0 | 291.4151 | 0.004295686846799039 | 0.2507 | 2914151 | NULL | 30000 | 100 | 0 | OTHER |
| 1 | 11.xxx.xxx.xxx | 28825 | -9223372036854775423 | exec inner sql wait | 13570 | 0 | 80.662 | 0.005944141488577745 | 0.3477 | 806620 | NULL | 30000 | 100 | 0 | OTHER |
+--------+----------------+----------+----------------------+----------------------------+-------------+----------------+-------------+-----------------------+----------+-------------------+------+----------+---------------+-------------+------------+
10 rows in set
References
Query the current or previous wait events of all sessions:
- For more information about wait events, see Common wait events.