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