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