| 1 |
create user foo@localhost; |
| 2 |
grant ALL on *.* to foo@localhost; |
| 3 |
truncate table performance_schema.events_transactions_current; |
| 4 |
# Connection 1 |
| 5 |
select connection_id() into @conid; |
| 6 |
start transaction; |
| 7 |
# Default connection |
| 8 |
|
| 9 |
==================================================================== |
| 10 |
Testing index for columns THREAD_ID, EVENT_ID |
| 11 |
==================================================================== |
| 12 |
############ Explain for Query #################################### |
| 13 |
explain select END_EVENT_ID |
| 14 |
from performance_schema.events_transactions_current |
| 15 |
where THREAD_ID = "impossible"; |
| 16 |
id select_type table partitions type possible_keys key key_len ref rows filtered Extra |
| 17 |
1 SIMPLE events_transactions_current NULL ref PRIMARY PRIMARY 8 const # 100.00 Using where |
| 18 |
############ Explain for Query #################################### |
| 19 |
explain select END_EVENT_ID |
| 20 |
from performance_schema.events_transactions_current |
| 21 |
where THREAD_ID > "impossible"; |
| 22 |
id select_type table partitions type possible_keys key key_len ref rows filtered Extra |
| 23 |
1 SIMPLE events_transactions_current NULL ALL PRIMARY NULL NULL NULL # 33.33 Using where |
| 24 |
############ Explain for Query #################################### |
| 25 |
explain select END_EVENT_ID |
| 26 |
from performance_schema.events_transactions_current |
| 27 |
where THREAD_ID < "2"; |
| 28 |
id select_type table partitions type possible_keys key key_len ref rows filtered Extra |
| 29 |
1 SIMPLE events_transactions_current NULL ALL PRIMARY NULL NULL NULL # 33.33 Using where |
| 30 |
############ Explain for Query #################################### |
| 31 |
explain select END_EVENT_ID |
| 32 |
from performance_schema.events_transactions_current |
| 33 |
where THREAD_ID = @tid; |
| 34 |
id select_type table partitions type possible_keys key key_len ref rows filtered Extra |
| 35 |
1 SIMPLE events_transactions_current NULL ref PRIMARY PRIMARY 8 const # 100.00 NULL |
| 36 |
############ Explain for Query #################################### |
| 37 |
explain select END_EVENT_ID |
| 38 |
from performance_schema.events_transactions_current |
| 39 |
where THREAD_ID = "impossible" |
| 40 |
and EVENT_ID = "impossible"; |
| 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 |
############ Explain for Query #################################### |
| 44 |
explain select END_EVENT_ID |
| 45 |
from performance_schema.events_transactions_current |
| 46 |
where THREAD_ID = @tid |
| 47 |
and EVENT_ID = "impossible"; |
| 48 |
id select_type table partitions type possible_keys key key_len ref rows filtered Extra |
| 49 |
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL # NULL no matching row in const table |
| 50 |
############ Explain for Query #################################### |
| 51 |
explain select END_EVENT_ID |
| 52 |
from performance_schema.events_transactions_current |
| 53 |
where THREAD_ID = @tid |
| 54 |
and EVENT_ID > "impossible"; |
| 55 |
id select_type table partitions type possible_keys key key_len ref rows filtered Extra |
| 56 |
1 SIMPLE events_transactions_current NULL ref PRIMARY PRIMARY 8 const # 33.33 Using where |
| 57 |
############ Explain for Query #################################### |
| 58 |
explain select END_EVENT_ID |
| 59 |
from performance_schema.events_transactions_current |
| 60 |
where THREAD_ID = @tid |
| 61 |
and EVENT_ID < "2"; |
| 62 |
id select_type table partitions type possible_keys key key_len ref rows filtered Extra |
| 63 |
1 SIMPLE events_transactions_current NULL ref PRIMARY PRIMARY 8 const # 33.33 Using where |
| 64 |
############ Explain for Query #################################### |
| 65 |
explain select END_EVENT_ID |
| 66 |
from performance_schema.events_transactions_current |
| 67 |
where THREAD_ID = @tid |
| 68 |
and EVENT_ID = @eid; |
| 69 |
id select_type table partitions type possible_keys key key_len ref rows filtered Extra |
| 70 |
1 SIMPLE events_transactions_current NULL const PRIMARY PRIMARY 16 const,const # 100.00 NULL |
| 71 |
############# Explain End ######################################### |
| 72 |
flush status; |
| 73 |
select END_EVENT_ID |
| 74 |
from performance_schema.events_transactions_current |
| 75 |
where THREAD_ID = @tid |
| 76 |
and EVENT_ID = @eid; |
| 77 |
END_EVENT_ID |
| 78 |
# |
| 79 |
OK: handler_read_key incremented |
| 80 |
commit; |
| 81 |
drop user foo@localhost; |