| 1 |
select connection_id() into @conid; |
| 2 |
select thread_id from performance_schema.threads |
| 3 |
where PROCESSLIST_ID = @conid |
| 4 |
into @tid; |
| 5 |
############ Explain for Query #################################### |
| 6 |
explain select THREAD_ID, EVENT_NAME |
| 7 |
from performance_schema.events_waits_summary_by_thread_by_event_name |
| 8 |
where THREAD_ID = 1; |
| 9 |
id select_type table partitions type possible_keys key key_len ref rows filtered Extra |
| 10 |
1 SIMPLE events_waits_summary_by_thread_by_event_name NULL ref PRIMARY PRIMARY 8 const # 100.00 NULL |
| 11 |
Warnings: |
| 12 |
Note 1003 /* select#1 */ select `performance_schema`.`events_waits_summary_by_thread_by_event_name`.`THREAD_ID` AS `THREAD_ID`,`performance_schema`.`events_waits_summary_by_thread_by_event_name`.`EVENT_NAME` AS `EVENT_NAME` from `performance_schema`.`events_waits_summary_by_thread_by_event_name` where (`performance_schema`.`events_waits_summary_by_thread_by_event_name`.`THREAD_ID` = 1) |
| 13 |
############ Explain for Query #################################### |
| 14 |
explain select * |
| 15 |
from performance_schema.events_waits_summary_by_thread_by_event_name |
| 16 |
where THREAD_ID > 1; |
| 17 |
id select_type table partitions type possible_keys key key_len ref rows filtered Extra |
| 18 |
1 SIMPLE events_waits_summary_by_thread_by_event_name NULL ALL PRIMARY NULL NULL NULL # 33.33 Using where |
| 19 |
Warnings: |
| 20 |
Note 1003 /* select#1 */ select `performance_schema`.`events_waits_summary_by_thread_by_event_name`.`THREAD_ID` AS `THREAD_ID`,`performance_schema`.`events_waits_summary_by_thread_by_event_name`.`EVENT_NAME` AS `EVENT_NAME`,`performance_schema`.`events_waits_summary_by_thread_by_event_name`.`COUNT_STAR` AS `COUNT_STAR`,`performance_schema`.`events_waits_summary_by_thread_by_event_name`.`SUM_TIMER_WAIT` AS `SUM_TIMER_WAIT`,`performance_schema`.`events_waits_summary_by_thread_by_event_name`.`MIN_TIMER_WAIT` AS `MIN_TIMER_WAIT`,`performance_schema`.`events_waits_summary_by_thread_by_event_name`.`AVG_TIMER_WAIT` AS `AVG_TIMER_WAIT`,`performance_schema`.`events_waits_summary_by_thread_by_event_name`.`MAX_TIMER_WAIT` AS `MAX_TIMER_WAIT` from `performance_schema`.`events_waits_summary_by_thread_by_event_name` where (`performance_schema`.`events_waits_summary_by_thread_by_event_name`.`THREAD_ID` > 1) |
| 21 |
############ Explain for Query #################################### |
| 22 |
explain select * |
| 23 |
from performance_schema.events_waits_summary_by_thread_by_event_name |
| 24 |
where THREAD_ID < 1; |
| 25 |
id select_type table partitions type possible_keys key key_len ref rows filtered Extra |
| 26 |
1 SIMPLE events_waits_summary_by_thread_by_event_name NULL ALL PRIMARY NULL NULL NULL # 33.33 Using where |
| 27 |
Warnings: |
| 28 |
Note 1003 /* select#1 */ select `performance_schema`.`events_waits_summary_by_thread_by_event_name`.`THREAD_ID` AS `THREAD_ID`,`performance_schema`.`events_waits_summary_by_thread_by_event_name`.`EVENT_NAME` AS `EVENT_NAME`,`performance_schema`.`events_waits_summary_by_thread_by_event_name`.`COUNT_STAR` AS `COUNT_STAR`,`performance_schema`.`events_waits_summary_by_thread_by_event_name`.`SUM_TIMER_WAIT` AS `SUM_TIMER_WAIT`,`performance_schema`.`events_waits_summary_by_thread_by_event_name`.`MIN_TIMER_WAIT` AS `MIN_TIMER_WAIT`,`performance_schema`.`events_waits_summary_by_thread_by_event_name`.`AVG_TIMER_WAIT` AS `AVG_TIMER_WAIT`,`performance_schema`.`events_waits_summary_by_thread_by_event_name`.`MAX_TIMER_WAIT` AS `MAX_TIMER_WAIT` from `performance_schema`.`events_waits_summary_by_thread_by_event_name` where (`performance_schema`.`events_waits_summary_by_thread_by_event_name`.`THREAD_ID` < 1) |
| 29 |
############ Explain for Query #################################### |
| 30 |
explain select THREAD_ID, EVENT_NAME |
| 31 |
from performance_schema.events_waits_summary_by_thread_by_event_name |
| 32 |
where THREAD_ID = 1 and EVENT_NAME = "impossible"; |
| 33 |
id select_type table partitions type possible_keys key key_len ref rows filtered Extra |
| 34 |
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL # NULL no matching row in const table |
| 35 |
Warnings: |
| 36 |
Note 1003 /* select#1 */ select NULL AS `THREAD_ID`,NULL AS `EVENT_NAME` from `performance_schema`.`events_waits_summary_by_thread_by_event_name` where (multiple equal(1, NULL) and multiple equal('impossible', NULL)) |
| 37 |
############ Explain for Query #################################### |
| 38 |
explain select THREAD_ID, EVENT_NAME |
| 39 |
from performance_schema.events_waits_summary_by_thread_by_event_name |
| 40 |
where THREAD_ID = 99999 and EVENT_NAME = "wait/lock/table/sql/handler"; |
| 41 |
id select_type table partitions type possible_keys key key_len ref rows filtered Extra |
| 42 |
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL # NULL no matching row in const table |
| 43 |
Warnings: |
| 44 |
Note 1003 /* select#1 */ select NULL AS `THREAD_ID`,NULL AS `EVENT_NAME` from `performance_schema`.`events_waits_summary_by_thread_by_event_name` where (multiple equal(99999, NULL) and multiple equal('wait/lock/table/sql/handler', NULL)) |
| 45 |
############ Explain for Query #################################### |
| 46 |
explain select THREAD_ID, EVENT_NAME |
| 47 |
from performance_schema.events_waits_summary_by_thread_by_event_name |
| 48 |
where THREAD_ID = 1 and EVENT_NAME = "wait/lock/table/sql/handler"; |
| 49 |
id select_type table partitions type possible_keys key key_len ref rows filtered Extra |
| 50 |
1 SIMPLE events_waits_summary_by_thread_by_event_name NULL const PRIMARY PRIMARY 522 const,const # 100.00 NULL |
| 51 |
Warnings: |
| 52 |
Note 1003 /* select#1 */ select '1' AS `THREAD_ID`,'wait/lock/table/sql/handler' AS `EVENT_NAME` from `performance_schema`.`events_waits_summary_by_thread_by_event_name` where true |
| 53 |
############# Explain End ######################################### |
| 54 |
flush status; |
| 55 |
select EVENT_NAME, COUNT_STAR |
| 56 |
from performance_schema.events_waits_summary_by_thread_by_event_name |
| 57 |
where thread_id = @tid and EVENT_NAME = "wait/lock/table/sql/handler"; |
| 58 |
EVENT_NAME COUNT_STAR |
| 59 |
wait/lock/table/sql/handler 0 |
| 60 |
select EVENT_NAME, COUNT_STAR |
| 61 |
from performance_schema.events_waits_summary_by_thread_by_event_name |
| 62 |
where thread_id = @tid and EVENT_NAME = "wait/lock/table/sql/handler"; |
| 63 |
EVENT_NAME COUNT_STAR |
| 64 |
wait/lock/table/sql/handler 0 |
| 65 |
OK: handler_read_key incremented |