| 1 |
select connection_id() into @conid; |
| 2 |
|
| 3 |
select thread_id from performance_schema.threads |
| 4 |
where PROCESSLIST_ID = @conid |
| 5 |
into @tid; |
| 6 |
|
| 7 |
select thread_os_id from performance_schema.threads |
| 8 |
where PROCESSLIST_ID = @conid |
| 9 |
into @osid; |
| 10 |
|
| 11 |
explain select THREAD_ID, NAME from performance_schema.threads |
| 12 |
where thread_id = 1; |
| 13 |
id select_type table partitions type possible_keys key key_len ref rows filtered Extra |
| 14 |
1 SIMPLE threads NULL const PRIMARY PRIMARY 8 const 1 100.00 NULL |
| 15 |
Warnings: |
| 16 |
Note 1003 /* select#1 */ select '1' AS `THREAD_ID`,'thread/sql/main' AS `NAME` from `performance_schema`.`threads` where true |
| 17 |
|
| 18 |
explain select * from performance_schema.threads |
| 19 |
where thread_id > 1; |
| 20 |
id select_type table partitions type possible_keys key key_len ref rows filtered Extra |
| 21 |
1 SIMPLE threads NULL ALL PRIMARY NULL NULL NULL 256 33.33 Using where |
| 22 |
Warnings: |
| 23 |
Note 1003 /* select#1 */ select `performance_schema`.`threads`.`THREAD_ID` AS `THREAD_ID`,`performance_schema`.`threads`.`NAME` AS `NAME`,`performance_schema`.`threads`.`TYPE` AS `TYPE`,`performance_schema`.`threads`.`PROCESSLIST_ID` AS `PROCESSLIST_ID`,`performance_schema`.`threads`.`PROCESSLIST_USER` AS `PROCESSLIST_USER`,`performance_schema`.`threads`.`PROCESSLIST_HOST` AS `PROCESSLIST_HOST`,`performance_schema`.`threads`.`PROCESSLIST_DB` AS `PROCESSLIST_DB`,`performance_schema`.`threads`.`PROCESSLIST_COMMAND` AS `PROCESSLIST_COMMAND`,`performance_schema`.`threads`.`PROCESSLIST_TIME` AS `PROCESSLIST_TIME`,`performance_schema`.`threads`.`PROCESSLIST_STATE` AS `PROCESSLIST_STATE`,`performance_schema`.`threads`.`PROCESSLIST_INFO` AS `PROCESSLIST_INFO`,`performance_schema`.`threads`.`PARENT_THREAD_ID` AS `PARENT_THREAD_ID`,`performance_schema`.`threads`.`ROLE` AS `ROLE`,`performance_schema`.`threads`.`INSTRUMENTED` AS `INSTRUMENTED`,`performance_schema`.`threads`.`HISTORY` AS `HISTORY`,`performance_schema`.`threads`.`CONNECTION_TYPE` AS `CONNECTION_TYPE`,`performance_schema`.`threads`.`THREAD_OS_ID` AS `THREAD_OS_ID`,`performance_schema`.`threads`.`RESOURCE_GROUP` AS `RESOURCE_GROUP`,`performance_schema`.`threads`.`EXECUTION_ENGINE` AS `EXECUTION_ENGINE`,`performance_schema`.`threads`.`CONTROLLED_MEMORY` AS `CONTROLLED_MEMORY`,`performance_schema`.`threads`.`MAX_CONTROLLED_MEMORY` AS `MAX_CONTROLLED_MEMORY`,`performance_schema`.`threads`.`TOTAL_MEMORY` AS `TOTAL_MEMORY`,`performance_schema`.`threads`.`MAX_TOTAL_MEMORY` AS `MAX_TOTAL_MEMORY`,`performance_schema`.`threads`.`TELEMETRY_ACTIVE` AS `TELEMETRY_ACTIVE` from `performance_schema`.`threads` where (`performance_schema`.`threads`.`THREAD_ID` > 1) |
| 24 |
|
| 25 |
explain select * from performance_schema.threads |
| 26 |
where thread_id < 1; |
| 27 |
id select_type table partitions type possible_keys key key_len ref rows filtered Extra |
| 28 |
1 SIMPLE threads NULL ALL PRIMARY NULL NULL NULL 256 33.33 Using where |
| 29 |
Warnings: |
| 30 |
Note 1003 /* select#1 */ select `performance_schema`.`threads`.`THREAD_ID` AS `THREAD_ID`,`performance_schema`.`threads`.`NAME` AS `NAME`,`performance_schema`.`threads`.`TYPE` AS `TYPE`,`performance_schema`.`threads`.`PROCESSLIST_ID` AS `PROCESSLIST_ID`,`performance_schema`.`threads`.`PROCESSLIST_USER` AS `PROCESSLIST_USER`,`performance_schema`.`threads`.`PROCESSLIST_HOST` AS `PROCESSLIST_HOST`,`performance_schema`.`threads`.`PROCESSLIST_DB` AS `PROCESSLIST_DB`,`performance_schema`.`threads`.`PROCESSLIST_COMMAND` AS `PROCESSLIST_COMMAND`,`performance_schema`.`threads`.`PROCESSLIST_TIME` AS `PROCESSLIST_TIME`,`performance_schema`.`threads`.`PROCESSLIST_STATE` AS `PROCESSLIST_STATE`,`performance_schema`.`threads`.`PROCESSLIST_INFO` AS `PROCESSLIST_INFO`,`performance_schema`.`threads`.`PARENT_THREAD_ID` AS `PARENT_THREAD_ID`,`performance_schema`.`threads`.`ROLE` AS `ROLE`,`performance_schema`.`threads`.`INSTRUMENTED` AS `INSTRUMENTED`,`performance_schema`.`threads`.`HISTORY` AS `HISTORY`,`performance_schema`.`threads`.`CONNECTION_TYPE` AS `CONNECTION_TYPE`,`performance_schema`.`threads`.`THREAD_OS_ID` AS `THREAD_OS_ID`,`performance_schema`.`threads`.`RESOURCE_GROUP` AS `RESOURCE_GROUP`,`performance_schema`.`threads`.`EXECUTION_ENGINE` AS `EXECUTION_ENGINE`,`performance_schema`.`threads`.`CONTROLLED_MEMORY` AS `CONTROLLED_MEMORY`,`performance_schema`.`threads`.`MAX_CONTROLLED_MEMORY` AS `MAX_CONTROLLED_MEMORY`,`performance_schema`.`threads`.`TOTAL_MEMORY` AS `TOTAL_MEMORY`,`performance_schema`.`threads`.`MAX_TOTAL_MEMORY` AS `MAX_TOTAL_MEMORY`,`performance_schema`.`threads`.`TELEMETRY_ACTIVE` AS `TELEMETRY_ACTIVE` from `performance_schema`.`threads` where (`performance_schema`.`threads`.`THREAD_ID` < 1) |
| 31 |
|
| 32 |
select processlist_id = @conid, name, processlist_info |
| 33 |
from performance_schema.threads |
| 34 |
where thread_id = @tid; |
| 35 |
processlist_id = @conid name processlist_info |
| 36 |
1 thread/sql/one_connection <info> |
| 37 |
|
| 38 |
explain select THREAD_ID, NAME from performance_schema.threads |
| 39 |
where processlist_id = @conid; |
| 40 |
id select_type table partitions type possible_keys key key_len ref rows filtered Extra |
| 41 |
1 SIMPLE threads NULL ref PROCESSLIST_ID PROCESSLIST_ID 9 const 10 100.00 NULL |
| 42 |
|
| 43 |
explain select * from performance_schema.threads |
| 44 |
where processlist_id > 99999; |
| 45 |
id select_type table partitions type possible_keys key key_len ref rows filtered Extra |
| 46 |
1 SIMPLE threads NULL ALL PROCESSLIST_ID NULL NULL NULL 256 33.33 Using where |
| 47 |
Warnings: |
| 48 |
Note 1003 /* select#1 */ select `performance_schema`.`threads`.`THREAD_ID` AS `THREAD_ID`,`performance_schema`.`threads`.`NAME` AS `NAME`,`performance_schema`.`threads`.`TYPE` AS `TYPE`,`performance_schema`.`threads`.`PROCESSLIST_ID` AS `PROCESSLIST_ID`,`performance_schema`.`threads`.`PROCESSLIST_USER` AS `PROCESSLIST_USER`,`performance_schema`.`threads`.`PROCESSLIST_HOST` AS `PROCESSLIST_HOST`,`performance_schema`.`threads`.`PROCESSLIST_DB` AS `PROCESSLIST_DB`,`performance_schema`.`threads`.`PROCESSLIST_COMMAND` AS `PROCESSLIST_COMMAND`,`performance_schema`.`threads`.`PROCESSLIST_TIME` AS `PROCESSLIST_TIME`,`performance_schema`.`threads`.`PROCESSLIST_STATE` AS `PROCESSLIST_STATE`,`performance_schema`.`threads`.`PROCESSLIST_INFO` AS `PROCESSLIST_INFO`,`performance_schema`.`threads`.`PARENT_THREAD_ID` AS `PARENT_THREAD_ID`,`performance_schema`.`threads`.`ROLE` AS `ROLE`,`performance_schema`.`threads`.`INSTRUMENTED` AS `INSTRUMENTED`,`performance_schema`.`threads`.`HISTORY` AS `HISTORY`,`performance_schema`.`threads`.`CONNECTION_TYPE` AS `CONNECTION_TYPE`,`performance_schema`.`threads`.`THREAD_OS_ID` AS `THREAD_OS_ID`,`performance_schema`.`threads`.`RESOURCE_GROUP` AS `RESOURCE_GROUP`,`performance_schema`.`threads`.`EXECUTION_ENGINE` AS `EXECUTION_ENGINE`,`performance_schema`.`threads`.`CONTROLLED_MEMORY` AS `CONTROLLED_MEMORY`,`performance_schema`.`threads`.`MAX_CONTROLLED_MEMORY` AS `MAX_CONTROLLED_MEMORY`,`performance_schema`.`threads`.`TOTAL_MEMORY` AS `TOTAL_MEMORY`,`performance_schema`.`threads`.`MAX_TOTAL_MEMORY` AS `MAX_TOTAL_MEMORY`,`performance_schema`.`threads`.`TELEMETRY_ACTIVE` AS `TELEMETRY_ACTIVE` from `performance_schema`.`threads` where (`performance_schema`.`threads`.`PROCESSLIST_ID` > 99999) |
| 49 |
|
| 50 |
explain select * from performance_schema.threads |
| 51 |
where processlist_id < 99999; |
| 52 |
id select_type table partitions type possible_keys key key_len ref rows filtered Extra |
| 53 |
1 SIMPLE threads NULL ALL PROCESSLIST_ID NULL NULL NULL 256 33.33 Using where |
| 54 |
Warnings: |
| 55 |
Note 1003 /* select#1 */ select `performance_schema`.`threads`.`THREAD_ID` AS `THREAD_ID`,`performance_schema`.`threads`.`NAME` AS `NAME`,`performance_schema`.`threads`.`TYPE` AS `TYPE`,`performance_schema`.`threads`.`PROCESSLIST_ID` AS `PROCESSLIST_ID`,`performance_schema`.`threads`.`PROCESSLIST_USER` AS `PROCESSLIST_USER`,`performance_schema`.`threads`.`PROCESSLIST_HOST` AS `PROCESSLIST_HOST`,`performance_schema`.`threads`.`PROCESSLIST_DB` AS `PROCESSLIST_DB`,`performance_schema`.`threads`.`PROCESSLIST_COMMAND` AS `PROCESSLIST_COMMAND`,`performance_schema`.`threads`.`PROCESSLIST_TIME` AS `PROCESSLIST_TIME`,`performance_schema`.`threads`.`PROCESSLIST_STATE` AS `PROCESSLIST_STATE`,`performance_schema`.`threads`.`PROCESSLIST_INFO` AS `PROCESSLIST_INFO`,`performance_schema`.`threads`.`PARENT_THREAD_ID` AS `PARENT_THREAD_ID`,`performance_schema`.`threads`.`ROLE` AS `ROLE`,`performance_schema`.`threads`.`INSTRUMENTED` AS `INSTRUMENTED`,`performance_schema`.`threads`.`HISTORY` AS `HISTORY`,`performance_schema`.`threads`.`CONNECTION_TYPE` AS `CONNECTION_TYPE`,`performance_schema`.`threads`.`THREAD_OS_ID` AS `THREAD_OS_ID`,`performance_schema`.`threads`.`RESOURCE_GROUP` AS `RESOURCE_GROUP`,`performance_schema`.`threads`.`EXECUTION_ENGINE` AS `EXECUTION_ENGINE`,`performance_schema`.`threads`.`CONTROLLED_MEMORY` AS `CONTROLLED_MEMORY`,`performance_schema`.`threads`.`MAX_CONTROLLED_MEMORY` AS `MAX_CONTROLLED_MEMORY`,`performance_schema`.`threads`.`TOTAL_MEMORY` AS `TOTAL_MEMORY`,`performance_schema`.`threads`.`MAX_TOTAL_MEMORY` AS `MAX_TOTAL_MEMORY`,`performance_schema`.`threads`.`TELEMETRY_ACTIVE` AS `TELEMETRY_ACTIVE` from `performance_schema`.`threads` where (`performance_schema`.`threads`.`PROCESSLIST_ID` < 99999) |
| 56 |
|
| 57 |
select thread_id = @tid, name, processlist_info |
| 58 |
from performance_schema.threads |
| 59 |
where processlist_id = @conid; |
| 60 |
thread_id = @tid name processlist_info |
| 61 |
1 thread/sql/one_connection <info> |
| 62 |
|
| 63 |
explain select THREAD_ID, NAME from performance_schema.threads |
| 64 |
where thread_os_id = @osid; |
| 65 |
id select_type table partitions type possible_keys key key_len ref rows filtered Extra |
| 66 |
1 SIMPLE threads NULL ref THREAD_OS_ID THREAD_OS_ID 9 const 10 100.00 NULL |
| 67 |
|
| 68 |
explain select * from performance_schema.threads |
| 69 |
where thread_os_id > 99999; |
| 70 |
id select_type table partitions type possible_keys key key_len ref rows filtered Extra |
| 71 |
1 SIMPLE threads NULL ALL THREAD_OS_ID NULL NULL NULL 256 33.33 Using where |
| 72 |
Warnings: |
| 73 |
Note 1003 /* select#1 */ select `performance_schema`.`threads`.`THREAD_ID` AS `THREAD_ID`,`performance_schema`.`threads`.`NAME` AS `NAME`,`performance_schema`.`threads`.`TYPE` AS `TYPE`,`performance_schema`.`threads`.`PROCESSLIST_ID` AS `PROCESSLIST_ID`,`performance_schema`.`threads`.`PROCESSLIST_USER` AS `PROCESSLIST_USER`,`performance_schema`.`threads`.`PROCESSLIST_HOST` AS `PROCESSLIST_HOST`,`performance_schema`.`threads`.`PROCESSLIST_DB` AS `PROCESSLIST_DB`,`performance_schema`.`threads`.`PROCESSLIST_COMMAND` AS `PROCESSLIST_COMMAND`,`performance_schema`.`threads`.`PROCESSLIST_TIME` AS `PROCESSLIST_TIME`,`performance_schema`.`threads`.`PROCESSLIST_STATE` AS `PROCESSLIST_STATE`,`performance_schema`.`threads`.`PROCESSLIST_INFO` AS `PROCESSLIST_INFO`,`performance_schema`.`threads`.`PARENT_THREAD_ID` AS `PARENT_THREAD_ID`,`performance_schema`.`threads`.`ROLE` AS `ROLE`,`performance_schema`.`threads`.`INSTRUMENTED` AS `INSTRUMENTED`,`performance_schema`.`threads`.`HISTORY` AS `HISTORY`,`performance_schema`.`threads`.`CONNECTION_TYPE` AS `CONNECTION_TYPE`,`performance_schema`.`threads`.`THREAD_OS_ID` AS `THREAD_OS_ID`,`performance_schema`.`threads`.`RESOURCE_GROUP` AS `RESOURCE_GROUP`,`performance_schema`.`threads`.`EXECUTION_ENGINE` AS `EXECUTION_ENGINE`,`performance_schema`.`threads`.`CONTROLLED_MEMORY` AS `CONTROLLED_MEMORY`,`performance_schema`.`threads`.`MAX_CONTROLLED_MEMORY` AS `MAX_CONTROLLED_MEMORY`,`performance_schema`.`threads`.`TOTAL_MEMORY` AS `TOTAL_MEMORY`,`performance_schema`.`threads`.`MAX_TOTAL_MEMORY` AS `MAX_TOTAL_MEMORY`,`performance_schema`.`threads`.`TELEMETRY_ACTIVE` AS `TELEMETRY_ACTIVE` from `performance_schema`.`threads` where (`performance_schema`.`threads`.`THREAD_OS_ID` > 99999) |
| 74 |
|
| 75 |
explain select * from performance_schema.threads |
| 76 |
where thread_os_id < 99999; |
| 77 |
id select_type table partitions type possible_keys key key_len ref rows filtered Extra |
| 78 |
1 SIMPLE threads NULL ALL THREAD_OS_ID NULL NULL NULL 256 33.33 Using where |
| 79 |
Warnings: |
| 80 |
Note 1003 /* select#1 */ select `performance_schema`.`threads`.`THREAD_ID` AS `THREAD_ID`,`performance_schema`.`threads`.`NAME` AS `NAME`,`performance_schema`.`threads`.`TYPE` AS `TYPE`,`performance_schema`.`threads`.`PROCESSLIST_ID` AS `PROCESSLIST_ID`,`performance_schema`.`threads`.`PROCESSLIST_USER` AS `PROCESSLIST_USER`,`performance_schema`.`threads`.`PROCESSLIST_HOST` AS `PROCESSLIST_HOST`,`performance_schema`.`threads`.`PROCESSLIST_DB` AS `PROCESSLIST_DB`,`performance_schema`.`threads`.`PROCESSLIST_COMMAND` AS `PROCESSLIST_COMMAND`,`performance_schema`.`threads`.`PROCESSLIST_TIME` AS `PROCESSLIST_TIME`,`performance_schema`.`threads`.`PROCESSLIST_STATE` AS `PROCESSLIST_STATE`,`performance_schema`.`threads`.`PROCESSLIST_INFO` AS `PROCESSLIST_INFO`,`performance_schema`.`threads`.`PARENT_THREAD_ID` AS `PARENT_THREAD_ID`,`performance_schema`.`threads`.`ROLE` AS `ROLE`,`performance_schema`.`threads`.`INSTRUMENTED` AS `INSTRUMENTED`,`performance_schema`.`threads`.`HISTORY` AS `HISTORY`,`performance_schema`.`threads`.`CONNECTION_TYPE` AS `CONNECTION_TYPE`,`performance_schema`.`threads`.`THREAD_OS_ID` AS `THREAD_OS_ID`,`performance_schema`.`threads`.`RESOURCE_GROUP` AS `RESOURCE_GROUP`,`performance_schema`.`threads`.`EXECUTION_ENGINE` AS `EXECUTION_ENGINE`,`performance_schema`.`threads`.`CONTROLLED_MEMORY` AS `CONTROLLED_MEMORY`,`performance_schema`.`threads`.`MAX_CONTROLLED_MEMORY` AS `MAX_CONTROLLED_MEMORY`,`performance_schema`.`threads`.`TOTAL_MEMORY` AS `TOTAL_MEMORY`,`performance_schema`.`threads`.`MAX_TOTAL_MEMORY` AS `MAX_TOTAL_MEMORY`,`performance_schema`.`threads`.`TELEMETRY_ACTIVE` AS `TELEMETRY_ACTIVE` from `performance_schema`.`threads` where (`performance_schema`.`threads`.`THREAD_OS_ID` < 99999) |
| 81 |
|
| 82 |
select thread_id - @tid, name, processlist_info |
| 83 |
from performance_schema.threads |
| 84 |
where thread_os_id = @osid; |
| 85 |
thread_id - @tid name processlist_info |
| 86 |
0 thread/sql/one_connection <info> |
| 87 |
|
| 88 |
explain select THREAD_ID from performance_schema.threads |
| 89 |
where NAME = "impossible"; |
| 90 |
id select_type table partitions type possible_keys key key_len ref rows filtered Extra |
| 91 |
1 SIMPLE threads NULL ref NAME NAME 514 const 10 100.00 NULL |
| 92 |
Warnings: |
| 93 |
Note 1003 /* select#1 */ select `performance_schema`.`threads`.`THREAD_ID` AS `THREAD_ID` from `performance_schema`.`threads` where (`performance_schema`.`threads`.`NAME` = 'impossible') |
| 94 |
|
| 95 |
explain select THREAD_ID from performance_schema.threads |
| 96 |
where NAME = "thread/sql/main"; |
| 97 |
id select_type table partitions type possible_keys key key_len ref rows filtered Extra |
| 98 |
1 SIMPLE threads NULL ref NAME NAME 514 const 10 100.00 NULL |
| 99 |
Warnings: |
| 100 |
Note 1003 /* select#1 */ select `performance_schema`.`threads`.`THREAD_ID` AS `THREAD_ID` from `performance_schema`.`threads` where (`performance_schema`.`threads`.`NAME` = 'thread/sql/main') |
| 101 |
|
| 102 |
explain select * from performance_schema.threads |
| 103 |
where NAME > "foo"; |
| 104 |
id select_type table partitions type possible_keys key key_len ref rows filtered Extra |
| 105 |
1 SIMPLE threads NULL ALL NAME NULL NULL NULL 256 33.33 Using where |
| 106 |
Warnings: |
| 107 |
Note 1003 /* select#1 */ select `performance_schema`.`threads`.`THREAD_ID` AS `THREAD_ID`,`performance_schema`.`threads`.`NAME` AS `NAME`,`performance_schema`.`threads`.`TYPE` AS `TYPE`,`performance_schema`.`threads`.`PROCESSLIST_ID` AS `PROCESSLIST_ID`,`performance_schema`.`threads`.`PROCESSLIST_USER` AS `PROCESSLIST_USER`,`performance_schema`.`threads`.`PROCESSLIST_HOST` AS `PROCESSLIST_HOST`,`performance_schema`.`threads`.`PROCESSLIST_DB` AS `PROCESSLIST_DB`,`performance_schema`.`threads`.`PROCESSLIST_COMMAND` AS `PROCESSLIST_COMMAND`,`performance_schema`.`threads`.`PROCESSLIST_TIME` AS `PROCESSLIST_TIME`,`performance_schema`.`threads`.`PROCESSLIST_STATE` AS `PROCESSLIST_STATE`,`performance_schema`.`threads`.`PROCESSLIST_INFO` AS `PROCESSLIST_INFO`,`performance_schema`.`threads`.`PARENT_THREAD_ID` AS `PARENT_THREAD_ID`,`performance_schema`.`threads`.`ROLE` AS `ROLE`,`performance_schema`.`threads`.`INSTRUMENTED` AS `INSTRUMENTED`,`performance_schema`.`threads`.`HISTORY` AS `HISTORY`,`performance_schema`.`threads`.`CONNECTION_TYPE` AS `CONNECTION_TYPE`,`performance_schema`.`threads`.`THREAD_OS_ID` AS `THREAD_OS_ID`,`performance_schema`.`threads`.`RESOURCE_GROUP` AS `RESOURCE_GROUP`,`performance_schema`.`threads`.`EXECUTION_ENGINE` AS `EXECUTION_ENGINE`,`performance_schema`.`threads`.`CONTROLLED_MEMORY` AS `CONTROLLED_MEMORY`,`performance_schema`.`threads`.`MAX_CONTROLLED_MEMORY` AS `MAX_CONTROLLED_MEMORY`,`performance_schema`.`threads`.`TOTAL_MEMORY` AS `TOTAL_MEMORY`,`performance_schema`.`threads`.`MAX_TOTAL_MEMORY` AS `MAX_TOTAL_MEMORY`,`performance_schema`.`threads`.`TELEMETRY_ACTIVE` AS `TELEMETRY_ACTIVE` from `performance_schema`.`threads` where (`performance_schema`.`threads`.`NAME` > 'foo') |
| 108 |
|
| 109 |
explain select * from performance_schema.threads |
| 110 |
where NAME < "bar"; |
| 111 |
id select_type table partitions type possible_keys key key_len ref rows filtered Extra |
| 112 |
1 SIMPLE threads NULL ALL NAME NULL NULL NULL 256 33.33 Using where |
| 113 |
Warnings: |
| 114 |
Note 1003 /* select#1 */ select `performance_schema`.`threads`.`THREAD_ID` AS `THREAD_ID`,`performance_schema`.`threads`.`NAME` AS `NAME`,`performance_schema`.`threads`.`TYPE` AS `TYPE`,`performance_schema`.`threads`.`PROCESSLIST_ID` AS `PROCESSLIST_ID`,`performance_schema`.`threads`.`PROCESSLIST_USER` AS `PROCESSLIST_USER`,`performance_schema`.`threads`.`PROCESSLIST_HOST` AS `PROCESSLIST_HOST`,`performance_schema`.`threads`.`PROCESSLIST_DB` AS `PROCESSLIST_DB`,`performance_schema`.`threads`.`PROCESSLIST_COMMAND` AS `PROCESSLIST_COMMAND`,`performance_schema`.`threads`.`PROCESSLIST_TIME` AS `PROCESSLIST_TIME`,`performance_schema`.`threads`.`PROCESSLIST_STATE` AS `PROCESSLIST_STATE`,`performance_schema`.`threads`.`PROCESSLIST_INFO` AS `PROCESSLIST_INFO`,`performance_schema`.`threads`.`PARENT_THREAD_ID` AS `PARENT_THREAD_ID`,`performance_schema`.`threads`.`ROLE` AS `ROLE`,`performance_schema`.`threads`.`INSTRUMENTED` AS `INSTRUMENTED`,`performance_schema`.`threads`.`HISTORY` AS `HISTORY`,`performance_schema`.`threads`.`CONNECTION_TYPE` AS `CONNECTION_TYPE`,`performance_schema`.`threads`.`THREAD_OS_ID` AS `THREAD_OS_ID`,`performance_schema`.`threads`.`RESOURCE_GROUP` AS `RESOURCE_GROUP`,`performance_schema`.`threads`.`EXECUTION_ENGINE` AS `EXECUTION_ENGINE`,`performance_schema`.`threads`.`CONTROLLED_MEMORY` AS `CONTROLLED_MEMORY`,`performance_schema`.`threads`.`MAX_CONTROLLED_MEMORY` AS `MAX_CONTROLLED_MEMORY`,`performance_schema`.`threads`.`TOTAL_MEMORY` AS `TOTAL_MEMORY`,`performance_schema`.`threads`.`MAX_TOTAL_MEMORY` AS `MAX_TOTAL_MEMORY`,`performance_schema`.`threads`.`TELEMETRY_ACTIVE` AS `TELEMETRY_ACTIVE` from `performance_schema`.`threads` where (`performance_schema`.`threads`.`NAME` < 'bar') |
| 115 |
|
| 116 |
explain select * from performance_schema.threads |
| 117 |
where NAME like "thread/sql/%"; |
| 118 |
id select_type table partitions type possible_keys key key_len ref rows filtered Extra |
| 119 |
1 SIMPLE threads NULL ALL NAME NULL NULL NULL 256 11.11 Using where |
| 120 |
Warnings: |
| 121 |
Note 1003 /* select#1 */ select `performance_schema`.`threads`.`THREAD_ID` AS `THREAD_ID`,`performance_schema`.`threads`.`NAME` AS `NAME`,`performance_schema`.`threads`.`TYPE` AS `TYPE`,`performance_schema`.`threads`.`PROCESSLIST_ID` AS `PROCESSLIST_ID`,`performance_schema`.`threads`.`PROCESSLIST_USER` AS `PROCESSLIST_USER`,`performance_schema`.`threads`.`PROCESSLIST_HOST` AS `PROCESSLIST_HOST`,`performance_schema`.`threads`.`PROCESSLIST_DB` AS `PROCESSLIST_DB`,`performance_schema`.`threads`.`PROCESSLIST_COMMAND` AS `PROCESSLIST_COMMAND`,`performance_schema`.`threads`.`PROCESSLIST_TIME` AS `PROCESSLIST_TIME`,`performance_schema`.`threads`.`PROCESSLIST_STATE` AS `PROCESSLIST_STATE`,`performance_schema`.`threads`.`PROCESSLIST_INFO` AS `PROCESSLIST_INFO`,`performance_schema`.`threads`.`PARENT_THREAD_ID` AS `PARENT_THREAD_ID`,`performance_schema`.`threads`.`ROLE` AS `ROLE`,`performance_schema`.`threads`.`INSTRUMENTED` AS `INSTRUMENTED`,`performance_schema`.`threads`.`HISTORY` AS `HISTORY`,`performance_schema`.`threads`.`CONNECTION_TYPE` AS `CONNECTION_TYPE`,`performance_schema`.`threads`.`THREAD_OS_ID` AS `THREAD_OS_ID`,`performance_schema`.`threads`.`RESOURCE_GROUP` AS `RESOURCE_GROUP`,`performance_schema`.`threads`.`EXECUTION_ENGINE` AS `EXECUTION_ENGINE`,`performance_schema`.`threads`.`CONTROLLED_MEMORY` AS `CONTROLLED_MEMORY`,`performance_schema`.`threads`.`MAX_CONTROLLED_MEMORY` AS `MAX_CONTROLLED_MEMORY`,`performance_schema`.`threads`.`TOTAL_MEMORY` AS `TOTAL_MEMORY`,`performance_schema`.`threads`.`MAX_TOTAL_MEMORY` AS `MAX_TOTAL_MEMORY`,`performance_schema`.`threads`.`TELEMETRY_ACTIVE` AS `TELEMETRY_ACTIVE` from `performance_schema`.`threads` where (`performance_schema`.`threads`.`NAME` like 'thread/sql/%') |
| 122 |
|
| 123 |
select thread_id, name, processlist_state, processlist_info |
| 124 |
from performance_schema.threads |
| 125 |
where NAME = "thread/sql/main" order by thread_id; |
| 126 |
thread_id name processlist_state processlist_info |
| 127 |
<thread_id> thread/sql/main <state> <info> |
| 128 |
|
| 129 |
explain select THREAD_ID from performance_schema.threads |
| 130 |
where PROCESSLIST_USER = "impossible"; |
| 131 |
id select_type table partitions type possible_keys key key_len ref rows filtered Extra |
| 132 |
1 SIMPLE threads NULL ref PROCESSLIST_ACCOUNT PROCESSLIST_ACCOUNT 131 const 10 100.00 NULL |
| 133 |
Warnings: |
| 134 |
Note 1003 /* select#1 */ select `performance_schema`.`threads`.`THREAD_ID` AS `THREAD_ID` from `performance_schema`.`threads` where (`performance_schema`.`threads`.`PROCESSLIST_USER` = 'impossible') |
| 135 |
|
| 136 |
explain select THREAD_ID from performance_schema.threads |
| 137 |
where PROCESSLIST_USER = "root"; |
| 138 |
id select_type table partitions type possible_keys key key_len ref rows filtered Extra |
| 139 |
1 SIMPLE threads NULL ref PROCESSLIST_ACCOUNT PROCESSLIST_ACCOUNT 131 const 10 100.00 NULL |
| 140 |
Warnings: |
| 141 |
Note 1003 /* select#1 */ select `performance_schema`.`threads`.`THREAD_ID` AS `THREAD_ID` from `performance_schema`.`threads` where (`performance_schema`.`threads`.`PROCESSLIST_USER` = 'root') |
| 142 |
|
| 143 |
explain select * from performance_schema.threads |
| 144 |
where PROCESSLIST_USER > "foo"; |
| 145 |
id select_type table partitions type possible_keys key key_len ref rows filtered Extra |
| 146 |
1 SIMPLE threads NULL ALL PROCESSLIST_ACCOUNT NULL NULL NULL 256 33.33 Using where |
| 147 |
Warnings: |
| 148 |
Note 1003 /* select#1 */ select `performance_schema`.`threads`.`THREAD_ID` AS `THREAD_ID`,`performance_schema`.`threads`.`NAME` AS `NAME`,`performance_schema`.`threads`.`TYPE` AS `TYPE`,`performance_schema`.`threads`.`PROCESSLIST_ID` AS `PROCESSLIST_ID`,`performance_schema`.`threads`.`PROCESSLIST_USER` AS `PROCESSLIST_USER`,`performance_schema`.`threads`.`PROCESSLIST_HOST` AS `PROCESSLIST_HOST`,`performance_schema`.`threads`.`PROCESSLIST_DB` AS `PROCESSLIST_DB`,`performance_schema`.`threads`.`PROCESSLIST_COMMAND` AS `PROCESSLIST_COMMAND`,`performance_schema`.`threads`.`PROCESSLIST_TIME` AS `PROCESSLIST_TIME`,`performance_schema`.`threads`.`PROCESSLIST_STATE` AS `PROCESSLIST_STATE`,`performance_schema`.`threads`.`PROCESSLIST_INFO` AS `PROCESSLIST_INFO`,`performance_schema`.`threads`.`PARENT_THREAD_ID` AS `PARENT_THREAD_ID`,`performance_schema`.`threads`.`ROLE` AS `ROLE`,`performance_schema`.`threads`.`INSTRUMENTED` AS `INSTRUMENTED`,`performance_schema`.`threads`.`HISTORY` AS `HISTORY`,`performance_schema`.`threads`.`CONNECTION_TYPE` AS `CONNECTION_TYPE`,`performance_schema`.`threads`.`THREAD_OS_ID` AS `THREAD_OS_ID`,`performance_schema`.`threads`.`RESOURCE_GROUP` AS `RESOURCE_GROUP`,`performance_schema`.`threads`.`EXECUTION_ENGINE` AS `EXECUTION_ENGINE`,`performance_schema`.`threads`.`CONTROLLED_MEMORY` AS `CONTROLLED_MEMORY`,`performance_schema`.`threads`.`MAX_CONTROLLED_MEMORY` AS `MAX_CONTROLLED_MEMORY`,`performance_schema`.`threads`.`TOTAL_MEMORY` AS `TOTAL_MEMORY`,`performance_schema`.`threads`.`MAX_TOTAL_MEMORY` AS `MAX_TOTAL_MEMORY`,`performance_schema`.`threads`.`TELEMETRY_ACTIVE` AS `TELEMETRY_ACTIVE` from `performance_schema`.`threads` where (`performance_schema`.`threads`.`PROCESSLIST_USER` > 'foo') |
| 149 |
|
| 150 |
explain select * from performance_schema.threads |
| 151 |
where PROCESSLIST_USER < "bar"; |
| 152 |
id select_type table partitions type possible_keys key key_len ref rows filtered Extra |
| 153 |
1 SIMPLE threads NULL ALL PROCESSLIST_ACCOUNT NULL NULL NULL 256 33.33 Using where |
| 154 |
Warnings: |
| 155 |
Note 1003 /* select#1 */ select `performance_schema`.`threads`.`THREAD_ID` AS `THREAD_ID`,`performance_schema`.`threads`.`NAME` AS `NAME`,`performance_schema`.`threads`.`TYPE` AS `TYPE`,`performance_schema`.`threads`.`PROCESSLIST_ID` AS `PROCESSLIST_ID`,`performance_schema`.`threads`.`PROCESSLIST_USER` AS `PROCESSLIST_USER`,`performance_schema`.`threads`.`PROCESSLIST_HOST` AS `PROCESSLIST_HOST`,`performance_schema`.`threads`.`PROCESSLIST_DB` AS `PROCESSLIST_DB`,`performance_schema`.`threads`.`PROCESSLIST_COMMAND` AS `PROCESSLIST_COMMAND`,`performance_schema`.`threads`.`PROCESSLIST_TIME` AS `PROCESSLIST_TIME`,`performance_schema`.`threads`.`PROCESSLIST_STATE` AS `PROCESSLIST_STATE`,`performance_schema`.`threads`.`PROCESSLIST_INFO` AS `PROCESSLIST_INFO`,`performance_schema`.`threads`.`PARENT_THREAD_ID` AS `PARENT_THREAD_ID`,`performance_schema`.`threads`.`ROLE` AS `ROLE`,`performance_schema`.`threads`.`INSTRUMENTED` AS `INSTRUMENTED`,`performance_schema`.`threads`.`HISTORY` AS `HISTORY`,`performance_schema`.`threads`.`CONNECTION_TYPE` AS `CONNECTION_TYPE`,`performance_schema`.`threads`.`THREAD_OS_ID` AS `THREAD_OS_ID`,`performance_schema`.`threads`.`RESOURCE_GROUP` AS `RESOURCE_GROUP`,`performance_schema`.`threads`.`EXECUTION_ENGINE` AS `EXECUTION_ENGINE`,`performance_schema`.`threads`.`CONTROLLED_MEMORY` AS `CONTROLLED_MEMORY`,`performance_schema`.`threads`.`MAX_CONTROLLED_MEMORY` AS `MAX_CONTROLLED_MEMORY`,`performance_schema`.`threads`.`TOTAL_MEMORY` AS `TOTAL_MEMORY`,`performance_schema`.`threads`.`MAX_TOTAL_MEMORY` AS `MAX_TOTAL_MEMORY`,`performance_schema`.`threads`.`TELEMETRY_ACTIVE` AS `TELEMETRY_ACTIVE` from `performance_schema`.`threads` where (`performance_schema`.`threads`.`PROCESSLIST_USER` < 'bar') |
| 156 |
|
| 157 |
explain select * from performance_schema.threads |
| 158 |
where PROCESSLIST_USER like "ro%"; |
| 159 |
id select_type table partitions type possible_keys key key_len ref rows filtered Extra |
| 160 |
1 SIMPLE threads NULL ALL PROCESSLIST_ACCOUNT NULL NULL NULL 256 11.11 Using where |
| 161 |
Warnings: |
| 162 |
Note 1003 /* select#1 */ select `performance_schema`.`threads`.`THREAD_ID` AS `THREAD_ID`,`performance_schema`.`threads`.`NAME` AS `NAME`,`performance_schema`.`threads`.`TYPE` AS `TYPE`,`performance_schema`.`threads`.`PROCESSLIST_ID` AS `PROCESSLIST_ID`,`performance_schema`.`threads`.`PROCESSLIST_USER` AS `PROCESSLIST_USER`,`performance_schema`.`threads`.`PROCESSLIST_HOST` AS `PROCESSLIST_HOST`,`performance_schema`.`threads`.`PROCESSLIST_DB` AS `PROCESSLIST_DB`,`performance_schema`.`threads`.`PROCESSLIST_COMMAND` AS `PROCESSLIST_COMMAND`,`performance_schema`.`threads`.`PROCESSLIST_TIME` AS `PROCESSLIST_TIME`,`performance_schema`.`threads`.`PROCESSLIST_STATE` AS `PROCESSLIST_STATE`,`performance_schema`.`threads`.`PROCESSLIST_INFO` AS `PROCESSLIST_INFO`,`performance_schema`.`threads`.`PARENT_THREAD_ID` AS `PARENT_THREAD_ID`,`performance_schema`.`threads`.`ROLE` AS `ROLE`,`performance_schema`.`threads`.`INSTRUMENTED` AS `INSTRUMENTED`,`performance_schema`.`threads`.`HISTORY` AS `HISTORY`,`performance_schema`.`threads`.`CONNECTION_TYPE` AS `CONNECTION_TYPE`,`performance_schema`.`threads`.`THREAD_OS_ID` AS `THREAD_OS_ID`,`performance_schema`.`threads`.`RESOURCE_GROUP` AS `RESOURCE_GROUP`,`performance_schema`.`threads`.`EXECUTION_ENGINE` AS `EXECUTION_ENGINE`,`performance_schema`.`threads`.`CONTROLLED_MEMORY` AS `CONTROLLED_MEMORY`,`performance_schema`.`threads`.`MAX_CONTROLLED_MEMORY` AS `MAX_CONTROLLED_MEMORY`,`performance_schema`.`threads`.`TOTAL_MEMORY` AS `TOTAL_MEMORY`,`performance_schema`.`threads`.`MAX_TOTAL_MEMORY` AS `MAX_TOTAL_MEMORY`,`performance_schema`.`threads`.`TELEMETRY_ACTIVE` AS `TELEMETRY_ACTIVE` from `performance_schema`.`threads` where (`performance_schema`.`threads`.`PROCESSLIST_USER` like 'ro%') |
| 163 |
|
| 164 |
select thread_id, thread_id = @tid, name, processlist_state, processlist_info |
| 165 |
from performance_schema.threads |
| 166 |
where PROCESSLIST_USER = "root" order by thread_id; |
| 167 |
thread_id thread_id = @tid name processlist_state processlist_info |
| 168 |
<thread_id> 1 thread/sql/one_connection <state> <info> |
| 169 |
|
| 170 |
explain select THREAD_ID from performance_schema.threads |
| 171 |
where PROCESSLIST_USER = "impossible" and PROCESSLIST_HOST = "impossible"; |
| 172 |
id select_type table partitions type possible_keys key key_len ref rows filtered Extra |
| 173 |
1 SIMPLE threads NULL ref PROCESSLIST_ACCOUNT,PROCESSLIST_HOST PROCESSLIST_ACCOUNT 389 const,const 10 100.00 NULL |
| 174 |
Warnings: |
| 175 |
Note 1003 /* select#1 */ select `performance_schema`.`threads`.`THREAD_ID` AS `THREAD_ID` from `performance_schema`.`threads` where ((`performance_schema`.`threads`.`PROCESSLIST_HOST` = 'impossible') and (`performance_schema`.`threads`.`PROCESSLIST_USER` = 'impossible')) |
| 176 |
|
| 177 |
explain select THREAD_ID from performance_schema.threads |
| 178 |
where PROCESSLIST_USER = "root" and PROCESSLIST_HOST = "localhost"; |
| 179 |
id select_type table partitions type possible_keys key key_len ref rows filtered Extra |
| 180 |
1 SIMPLE threads NULL ref PROCESSLIST_ACCOUNT,PROCESSLIST_HOST PROCESSLIST_ACCOUNT 389 const,const 10 100.00 NULL |
| 181 |
Warnings: |
| 182 |
Note 1003 /* select#1 */ select `performance_schema`.`threads`.`THREAD_ID` AS `THREAD_ID` from `performance_schema`.`threads` where ((`performance_schema`.`threads`.`PROCESSLIST_HOST` = 'localhost') and (`performance_schema`.`threads`.`PROCESSLIST_USER` = 'root')) |
| 183 |
|
| 184 |
explain select * from performance_schema.threads |
| 185 |
where PROCESSLIST_USER = "foo" and PROCESSLIST_HOST < "foo"; |
| 186 |
id select_type table partitions type possible_keys key key_len ref rows filtered Extra |
| 187 |
1 SIMPLE threads NULL ref PROCESSLIST_ACCOUNT,PROCESSLIST_HOST PROCESSLIST_ACCOUNT 131 const 10 33.33 Using where |
| 188 |
Warnings: |
| 189 |
Note 1003 /* select#1 */ select `performance_schema`.`threads`.`THREAD_ID` AS `THREAD_ID`,`performance_schema`.`threads`.`NAME` AS `NAME`,`performance_schema`.`threads`.`TYPE` AS `TYPE`,`performance_schema`.`threads`.`PROCESSLIST_ID` AS `PROCESSLIST_ID`,`performance_schema`.`threads`.`PROCESSLIST_USER` AS `PROCESSLIST_USER`,`performance_schema`.`threads`.`PROCESSLIST_HOST` AS `PROCESSLIST_HOST`,`performance_schema`.`threads`.`PROCESSLIST_DB` AS `PROCESSLIST_DB`,`performance_schema`.`threads`.`PROCESSLIST_COMMAND` AS `PROCESSLIST_COMMAND`,`performance_schema`.`threads`.`PROCESSLIST_TIME` AS `PROCESSLIST_TIME`,`performance_schema`.`threads`.`PROCESSLIST_STATE` AS `PROCESSLIST_STATE`,`performance_schema`.`threads`.`PROCESSLIST_INFO` AS `PROCESSLIST_INFO`,`performance_schema`.`threads`.`PARENT_THREAD_ID` AS `PARENT_THREAD_ID`,`performance_schema`.`threads`.`ROLE` AS `ROLE`,`performance_schema`.`threads`.`INSTRUMENTED` AS `INSTRUMENTED`,`performance_schema`.`threads`.`HISTORY` AS `HISTORY`,`performance_schema`.`threads`.`CONNECTION_TYPE` AS `CONNECTION_TYPE`,`performance_schema`.`threads`.`THREAD_OS_ID` AS `THREAD_OS_ID`,`performance_schema`.`threads`.`RESOURCE_GROUP` AS `RESOURCE_GROUP`,`performance_schema`.`threads`.`EXECUTION_ENGINE` AS `EXECUTION_ENGINE`,`performance_schema`.`threads`.`CONTROLLED_MEMORY` AS `CONTROLLED_MEMORY`,`performance_schema`.`threads`.`MAX_CONTROLLED_MEMORY` AS `MAX_CONTROLLED_MEMORY`,`performance_schema`.`threads`.`TOTAL_MEMORY` AS `TOTAL_MEMORY`,`performance_schema`.`threads`.`MAX_TOTAL_MEMORY` AS `MAX_TOTAL_MEMORY`,`performance_schema`.`threads`.`TELEMETRY_ACTIVE` AS `TELEMETRY_ACTIVE` from `performance_schema`.`threads` where ((`performance_schema`.`threads`.`PROCESSLIST_USER` = 'foo') and (`performance_schema`.`threads`.`PROCESSLIST_HOST` < 'foo')) |
| 190 |
|
| 191 |
explain select * from performance_schema.threads |
| 192 |
where PROCESSLIST_USER = "foo" and PROCESSLIST_HOST > "bar"; |
| 193 |
id select_type table partitions type possible_keys key key_len ref rows filtered Extra |
| 194 |
1 SIMPLE threads NULL ref PROCESSLIST_ACCOUNT,PROCESSLIST_HOST PROCESSLIST_ACCOUNT 131 const 10 33.33 Using where |
| 195 |
Warnings: |
| 196 |
Note 1003 /* select#1 */ select `performance_schema`.`threads`.`THREAD_ID` AS `THREAD_ID`,`performance_schema`.`threads`.`NAME` AS `NAME`,`performance_schema`.`threads`.`TYPE` AS `TYPE`,`performance_schema`.`threads`.`PROCESSLIST_ID` AS `PROCESSLIST_ID`,`performance_schema`.`threads`.`PROCESSLIST_USER` AS `PROCESSLIST_USER`,`performance_schema`.`threads`.`PROCESSLIST_HOST` AS `PROCESSLIST_HOST`,`performance_schema`.`threads`.`PROCESSLIST_DB` AS `PROCESSLIST_DB`,`performance_schema`.`threads`.`PROCESSLIST_COMMAND` AS `PROCESSLIST_COMMAND`,`performance_schema`.`threads`.`PROCESSLIST_TIME` AS `PROCESSLIST_TIME`,`performance_schema`.`threads`.`PROCESSLIST_STATE` AS `PROCESSLIST_STATE`,`performance_schema`.`threads`.`PROCESSLIST_INFO` AS `PROCESSLIST_INFO`,`performance_schema`.`threads`.`PARENT_THREAD_ID` AS `PARENT_THREAD_ID`,`performance_schema`.`threads`.`ROLE` AS `ROLE`,`performance_schema`.`threads`.`INSTRUMENTED` AS `INSTRUMENTED`,`performance_schema`.`threads`.`HISTORY` AS `HISTORY`,`performance_schema`.`threads`.`CONNECTION_TYPE` AS `CONNECTION_TYPE`,`performance_schema`.`threads`.`THREAD_OS_ID` AS `THREAD_OS_ID`,`performance_schema`.`threads`.`RESOURCE_GROUP` AS `RESOURCE_GROUP`,`performance_schema`.`threads`.`EXECUTION_ENGINE` AS `EXECUTION_ENGINE`,`performance_schema`.`threads`.`CONTROLLED_MEMORY` AS `CONTROLLED_MEMORY`,`performance_schema`.`threads`.`MAX_CONTROLLED_MEMORY` AS `MAX_CONTROLLED_MEMORY`,`performance_schema`.`threads`.`TOTAL_MEMORY` AS `TOTAL_MEMORY`,`performance_schema`.`threads`.`MAX_TOTAL_MEMORY` AS `MAX_TOTAL_MEMORY`,`performance_schema`.`threads`.`TELEMETRY_ACTIVE` AS `TELEMETRY_ACTIVE` from `performance_schema`.`threads` where ((`performance_schema`.`threads`.`PROCESSLIST_USER` = 'foo') and (`performance_schema`.`threads`.`PROCESSLIST_HOST` > 'bar')) |
| 197 |
|
| 198 |
explain select * from performance_schema.threads |
| 199 |
where PROCESSLIST_USER = "foo" and PROCESSLIST_HOST like "bar%"; |
| 200 |
id select_type table partitions type possible_keys key key_len ref rows filtered Extra |
| 201 |
1 SIMPLE threads NULL ref PROCESSLIST_ACCOUNT,PROCESSLIST_HOST PROCESSLIST_ACCOUNT 131 const 10 11.11 Using where |
| 202 |
Warnings: |
| 203 |
Note 1003 /* select#1 */ select `performance_schema`.`threads`.`THREAD_ID` AS `THREAD_ID`,`performance_schema`.`threads`.`NAME` AS `NAME`,`performance_schema`.`threads`.`TYPE` AS `TYPE`,`performance_schema`.`threads`.`PROCESSLIST_ID` AS `PROCESSLIST_ID`,`performance_schema`.`threads`.`PROCESSLIST_USER` AS `PROCESSLIST_USER`,`performance_schema`.`threads`.`PROCESSLIST_HOST` AS `PROCESSLIST_HOST`,`performance_schema`.`threads`.`PROCESSLIST_DB` AS `PROCESSLIST_DB`,`performance_schema`.`threads`.`PROCESSLIST_COMMAND` AS `PROCESSLIST_COMMAND`,`performance_schema`.`threads`.`PROCESSLIST_TIME` AS `PROCESSLIST_TIME`,`performance_schema`.`threads`.`PROCESSLIST_STATE` AS `PROCESSLIST_STATE`,`performance_schema`.`threads`.`PROCESSLIST_INFO` AS `PROCESSLIST_INFO`,`performance_schema`.`threads`.`PARENT_THREAD_ID` AS `PARENT_THREAD_ID`,`performance_schema`.`threads`.`ROLE` AS `ROLE`,`performance_schema`.`threads`.`INSTRUMENTED` AS `INSTRUMENTED`,`performance_schema`.`threads`.`HISTORY` AS `HISTORY`,`performance_schema`.`threads`.`CONNECTION_TYPE` AS `CONNECTION_TYPE`,`performance_schema`.`threads`.`THREAD_OS_ID` AS `THREAD_OS_ID`,`performance_schema`.`threads`.`RESOURCE_GROUP` AS `RESOURCE_GROUP`,`performance_schema`.`threads`.`EXECUTION_ENGINE` AS `EXECUTION_ENGINE`,`performance_schema`.`threads`.`CONTROLLED_MEMORY` AS `CONTROLLED_MEMORY`,`performance_schema`.`threads`.`MAX_CONTROLLED_MEMORY` AS `MAX_CONTROLLED_MEMORY`,`performance_schema`.`threads`.`TOTAL_MEMORY` AS `TOTAL_MEMORY`,`performance_schema`.`threads`.`MAX_TOTAL_MEMORY` AS `MAX_TOTAL_MEMORY`,`performance_schema`.`threads`.`TELEMETRY_ACTIVE` AS `TELEMETRY_ACTIVE` from `performance_schema`.`threads` where ((`performance_schema`.`threads`.`PROCESSLIST_USER` = 'foo') and (`performance_schema`.`threads`.`PROCESSLIST_HOST` like 'bar%')) |
| 204 |
|
| 205 |
select thread_id, thread_id = @tid, name, processlist_state, processlist_info |
| 206 |
from performance_schema.threads |
| 207 |
where PROCESSLIST_USER = "root" and PROCESSLIST_HOST = "localhost" order by thread_id; |
| 208 |
thread_id thread_id = @tid name processlist_state processlist_info |
| 209 |
<thread_id> 1 thread/sql/one_connection <state> <info> |
| 210 |
|
| 211 |
explain select THREAD_ID from performance_schema.threads |
| 212 |
where PROCESSLIST_HOST = "impossible"; |
| 213 |
id select_type table partitions type possible_keys key key_len ref rows filtered Extra |
| 214 |
1 SIMPLE threads NULL ref PROCESSLIST_HOST PROCESSLIST_HOST 258 const 10 100.00 NULL |
| 215 |
Warnings: |
| 216 |
Note 1003 /* select#1 */ select `performance_schema`.`threads`.`THREAD_ID` AS `THREAD_ID` from `performance_schema`.`threads` where (`performance_schema`.`threads`.`PROCESSLIST_HOST` = 'impossible') |
| 217 |
|
| 218 |
explain select THREAD_ID from performance_schema.threads |
| 219 |
where PROCESSLIST_HOST = "localhost"; |
| 220 |
id select_type table partitions type possible_keys key key_len ref rows filtered Extra |
| 221 |
1 SIMPLE threads NULL ref PROCESSLIST_HOST PROCESSLIST_HOST 258 const 10 100.00 NULL |
| 222 |
Warnings: |
| 223 |
Note 1003 /* select#1 */ select `performance_schema`.`threads`.`THREAD_ID` AS `THREAD_ID` from `performance_schema`.`threads` where (`performance_schema`.`threads`.`PROCESSLIST_HOST` = 'localhost') |
| 224 |
|
| 225 |
explain select * from performance_schema.threads |
| 226 |
where PROCESSLIST_HOST > "foo"; |
| 227 |
id select_type table partitions type possible_keys key key_len ref rows filtered Extra |
| 228 |
1 SIMPLE threads NULL ALL PROCESSLIST_HOST NULL NULL NULL 256 33.33 Using where |
| 229 |
Warnings: |
| 230 |
Note 1003 /* select#1 */ select `performance_schema`.`threads`.`THREAD_ID` AS `THREAD_ID`,`performance_schema`.`threads`.`NAME` AS `NAME`,`performance_schema`.`threads`.`TYPE` AS `TYPE`,`performance_schema`.`threads`.`PROCESSLIST_ID` AS `PROCESSLIST_ID`,`performance_schema`.`threads`.`PROCESSLIST_USER` AS `PROCESSLIST_USER`,`performance_schema`.`threads`.`PROCESSLIST_HOST` AS `PROCESSLIST_HOST`,`performance_schema`.`threads`.`PROCESSLIST_DB` AS `PROCESSLIST_DB`,`performance_schema`.`threads`.`PROCESSLIST_COMMAND` AS `PROCESSLIST_COMMAND`,`performance_schema`.`threads`.`PROCESSLIST_TIME` AS `PROCESSLIST_TIME`,`performance_schema`.`threads`.`PROCESSLIST_STATE` AS `PROCESSLIST_STATE`,`performance_schema`.`threads`.`PROCESSLIST_INFO` AS `PROCESSLIST_INFO`,`performance_schema`.`threads`.`PARENT_THREAD_ID` AS `PARENT_THREAD_ID`,`performance_schema`.`threads`.`ROLE` AS `ROLE`,`performance_schema`.`threads`.`INSTRUMENTED` AS `INSTRUMENTED`,`performance_schema`.`threads`.`HISTORY` AS `HISTORY`,`performance_schema`.`threads`.`CONNECTION_TYPE` AS `CONNECTION_TYPE`,`performance_schema`.`threads`.`THREAD_OS_ID` AS `THREAD_OS_ID`,`performance_schema`.`threads`.`RESOURCE_GROUP` AS `RESOURCE_GROUP`,`performance_schema`.`threads`.`EXECUTION_ENGINE` AS `EXECUTION_ENGINE`,`performance_schema`.`threads`.`CONTROLLED_MEMORY` AS `CONTROLLED_MEMORY`,`performance_schema`.`threads`.`MAX_CONTROLLED_MEMORY` AS `MAX_CONTROLLED_MEMORY`,`performance_schema`.`threads`.`TOTAL_MEMORY` AS `TOTAL_MEMORY`,`performance_schema`.`threads`.`MAX_TOTAL_MEMORY` AS `MAX_TOTAL_MEMORY`,`performance_schema`.`threads`.`TELEMETRY_ACTIVE` AS `TELEMETRY_ACTIVE` from `performance_schema`.`threads` where (`performance_schema`.`threads`.`PROCESSLIST_HOST` > 'foo') |
| 231 |
|
| 232 |
explain select * from performance_schema.threads |
| 233 |
where PROCESSLIST_HOST < "bar"; |
| 234 |
id select_type table partitions type possible_keys key key_len ref rows filtered Extra |
| 235 |
1 SIMPLE threads NULL ALL PROCESSLIST_HOST NULL NULL NULL 256 33.33 Using where |
| 236 |
Warnings: |
| 237 |
Note 1003 /* select#1 */ select `performance_schema`.`threads`.`THREAD_ID` AS `THREAD_ID`,`performance_schema`.`threads`.`NAME` AS `NAME`,`performance_schema`.`threads`.`TYPE` AS `TYPE`,`performance_schema`.`threads`.`PROCESSLIST_ID` AS `PROCESSLIST_ID`,`performance_schema`.`threads`.`PROCESSLIST_USER` AS `PROCESSLIST_USER`,`performance_schema`.`threads`.`PROCESSLIST_HOST` AS `PROCESSLIST_HOST`,`performance_schema`.`threads`.`PROCESSLIST_DB` AS `PROCESSLIST_DB`,`performance_schema`.`threads`.`PROCESSLIST_COMMAND` AS `PROCESSLIST_COMMAND`,`performance_schema`.`threads`.`PROCESSLIST_TIME` AS `PROCESSLIST_TIME`,`performance_schema`.`threads`.`PROCESSLIST_STATE` AS `PROCESSLIST_STATE`,`performance_schema`.`threads`.`PROCESSLIST_INFO` AS `PROCESSLIST_INFO`,`performance_schema`.`threads`.`PARENT_THREAD_ID` AS `PARENT_THREAD_ID`,`performance_schema`.`threads`.`ROLE` AS `ROLE`,`performance_schema`.`threads`.`INSTRUMENTED` AS `INSTRUMENTED`,`performance_schema`.`threads`.`HISTORY` AS `HISTORY`,`performance_schema`.`threads`.`CONNECTION_TYPE` AS `CONNECTION_TYPE`,`performance_schema`.`threads`.`THREAD_OS_ID` AS `THREAD_OS_ID`,`performance_schema`.`threads`.`RESOURCE_GROUP` AS `RESOURCE_GROUP`,`performance_schema`.`threads`.`EXECUTION_ENGINE` AS `EXECUTION_ENGINE`,`performance_schema`.`threads`.`CONTROLLED_MEMORY` AS `CONTROLLED_MEMORY`,`performance_schema`.`threads`.`MAX_CONTROLLED_MEMORY` AS `MAX_CONTROLLED_MEMORY`,`performance_schema`.`threads`.`TOTAL_MEMORY` AS `TOTAL_MEMORY`,`performance_schema`.`threads`.`MAX_TOTAL_MEMORY` AS `MAX_TOTAL_MEMORY`,`performance_schema`.`threads`.`TELEMETRY_ACTIVE` AS `TELEMETRY_ACTIVE` from `performance_schema`.`threads` where (`performance_schema`.`threads`.`PROCESSLIST_HOST` < 'bar') |
| 238 |
|
| 239 |
explain select * from performance_schema.threads |
| 240 |
where PROCESSLIST_HOST like "local%"; |
| 241 |
id select_type table partitions type possible_keys key key_len ref rows filtered Extra |
| 242 |
1 SIMPLE threads NULL ALL PROCESSLIST_HOST NULL NULL NULL 256 11.11 Using where |
| 243 |
Warnings: |
| 244 |
Note 1003 /* select#1 */ select `performance_schema`.`threads`.`THREAD_ID` AS `THREAD_ID`,`performance_schema`.`threads`.`NAME` AS `NAME`,`performance_schema`.`threads`.`TYPE` AS `TYPE`,`performance_schema`.`threads`.`PROCESSLIST_ID` AS `PROCESSLIST_ID`,`performance_schema`.`threads`.`PROCESSLIST_USER` AS `PROCESSLIST_USER`,`performance_schema`.`threads`.`PROCESSLIST_HOST` AS `PROCESSLIST_HOST`,`performance_schema`.`threads`.`PROCESSLIST_DB` AS `PROCESSLIST_DB`,`performance_schema`.`threads`.`PROCESSLIST_COMMAND` AS `PROCESSLIST_COMMAND`,`performance_schema`.`threads`.`PROCESSLIST_TIME` AS `PROCESSLIST_TIME`,`performance_schema`.`threads`.`PROCESSLIST_STATE` AS `PROCESSLIST_STATE`,`performance_schema`.`threads`.`PROCESSLIST_INFO` AS `PROCESSLIST_INFO`,`performance_schema`.`threads`.`PARENT_THREAD_ID` AS `PARENT_THREAD_ID`,`performance_schema`.`threads`.`ROLE` AS `ROLE`,`performance_schema`.`threads`.`INSTRUMENTED` AS `INSTRUMENTED`,`performance_schema`.`threads`.`HISTORY` AS `HISTORY`,`performance_schema`.`threads`.`CONNECTION_TYPE` AS `CONNECTION_TYPE`,`performance_schema`.`threads`.`THREAD_OS_ID` AS `THREAD_OS_ID`,`performance_schema`.`threads`.`RESOURCE_GROUP` AS `RESOURCE_GROUP`,`performance_schema`.`threads`.`EXECUTION_ENGINE` AS `EXECUTION_ENGINE`,`performance_schema`.`threads`.`CONTROLLED_MEMORY` AS `CONTROLLED_MEMORY`,`performance_schema`.`threads`.`MAX_CONTROLLED_MEMORY` AS `MAX_CONTROLLED_MEMORY`,`performance_schema`.`threads`.`TOTAL_MEMORY` AS `TOTAL_MEMORY`,`performance_schema`.`threads`.`MAX_TOTAL_MEMORY` AS `MAX_TOTAL_MEMORY`,`performance_schema`.`threads`.`TELEMETRY_ACTIVE` AS `TELEMETRY_ACTIVE` from `performance_schema`.`threads` where (`performance_schema`.`threads`.`PROCESSLIST_HOST` like 'local%') |
| 245 |
|
| 246 |
select thread_id, thread_id = @tid, name, processlist_state, processlist_info |
| 247 |
from performance_schema.threads |
| 248 |
where PROCESSLIST_HOST = "localhost" order by (thread_id = @tid), thread_id; |
| 249 |
thread_id thread_id = @tid name processlist_state processlist_info |
| 250 |
<thread_id> 0 thread/sql/event_scheduler <state> <info> |
| 251 |
<thread_id> 1 thread/sql/one_connection <state> <info> |