70
71
select * from t1 where (a1, a2) in (select b1, min(b2) from t2 where b1 > '0' group by b1);
71
72
id select_type table type possible_keys key key_len ref rows filtered Extra
72
1 PRIMARY t1 ALL NULL NULL NULL NULL # 100.00 Using where
73
2 SUBQUERY t2 ALL NULL NULL NULL NULL # 100.00 Using where; Using temporary; Using filesort
75
Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from `test`.`t1` where <in_optimizer>((`test`.`t1`.`a1`,`test`.`t1`.`a2`),(`test`.`t1`.`a1`,`test`.`t1`.`a2`) in ( <materialize> (select `test`.`t2`.`b1` AS `b1`,min(`test`.`t2`.`b2`) AS `min(b2)` from `test`.`t2` where (`test`.`t2`.`b1` > '0') group by `test`.`t2`.`b1` ), <primary_index_lookup>(`test`.`t1`.`a1` in <temporary table> on distinct_key)))
73
1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00 Using where
74
2 SUBQUERY t2 ALL NULL NULL NULL NULL 5 100.00 Using where; Using temporary; Using filesort
76
Note 1003 select "test"."t1"."a1" AS "a1","test"."t1"."a2" AS "a2" from "test"."t1" where <in_optimizer>(("test"."t1"."a1","test"."t1"."a2"),("test"."t1"."a1","test"."t1"."a2") in ( <materialize> (select "test"."t2"."b1" AS "b1",min("test"."t2"."b2") AS "min(b2)" from "test"."t2" where ("test"."t2"."b1" > '0') group by "test"."t2"."b1" ), <primary_index_lookup>("test"."t1"."a1" in <temporary table> on distinct_key)))
76
77
select * from t1 where (a1, a2) in (select b1, min(b2) from t2 where b1 > '0' group by b1);
81
select * from t1i where a1 in (select b1 from t2i where b1 > '0');
82
id select_type table type possible_keys key key_len ref rows filtered Extra
83
1 PRIMARY t1i index NULL it1i3 70 NULL # 100.00 Using where; Using index
84
2 SUBQUERY t2i index it2i1,it2i3 it2i1 35 NULL # 40.00 Using where; Using index
86
Note 1003 select `test`.`t1i`.`a1` AS `a1`,`test`.`t1i`.`a2` AS `a2` from `test`.`t1i` where <in_optimizer>(`test`.`t1i`.`a1`,`test`.`t1i`.`a1` in ( <materialize> (select `test`.`t2i`.`b1` AS `b1` from `test`.`t2i` where (`test`.`t2i`.`b1` > '0') ), <primary_index_lookup>(`test`.`t1i`.`a1` in <temporary table> on distinct_key)))
87
select * from t1i where a1 in (select b1 from t2i where b1 > '0');
92
select * from t1i where a1 in (select b1 from t2i where b1 > '0' group by b1);
93
id select_type table type possible_keys key key_len ref rows filtered Extra
94
1 PRIMARY t1i index NULL it1i3 70 NULL # 100.00 Using where; Using index
95
2 SUBQUERY t2i range it2i1,it2i3 it2i1 35 NULL # 100.00 Using where; Using index for group-by
97
Note 1003 select `test`.`t1i`.`a1` AS `a1`,`test`.`t1i`.`a2` AS `a2` from `test`.`t1i` where <in_optimizer>(`test`.`t1i`.`a1`,`test`.`t1i`.`a1` in ( <materialize> (select `test`.`t2i`.`b1` AS `b1` from `test`.`t2i` where (`test`.`t2i`.`b1` > '0') group by `test`.`t2i`.`b1` ), <primary_index_lookup>(`test`.`t1i`.`a1` in <temporary table> on distinct_key)))
98
select * from t1i where a1 in (select b1 from t2i where b1 > '0' group by b1);
103
select * from t1i where (a1, a2) in (select b1, b2 from t2i where b1 > '0');
104
id select_type table type possible_keys key key_len ref rows filtered Extra
105
1 PRIMARY t1i index NULL it1i3 70 NULL # 100.00 Using where; Using index
106
2 SUBQUERY t2i index it2i1,it2i3 it2i3 70 NULL # 40.00 Using where; Using index
108
Note 1003 select `test`.`t1i`.`a1` AS `a1`,`test`.`t1i`.`a2` AS `a2` from `test`.`t1i` where <in_optimizer>((`test`.`t1i`.`a1`,`test`.`t1i`.`a2`),(`test`.`t1i`.`a1`,`test`.`t1i`.`a2`) in ( <materialize> (select `test`.`t2i`.`b1` AS `b1`,`test`.`t2i`.`b2` AS `b2` from `test`.`t2i` where (`test`.`t2i`.`b1` > '0') ), <primary_index_lookup>(`test`.`t1i`.`a1` in <temporary table> on distinct_key)))
109
select * from t1i where (a1, a2) in (select b1, b2 from t2i where b1 > '0');
114
select * from t1i where (a1, a2) in (select b1, b2 from t2i where b1 > '0' group by b1, b2);
115
id select_type table type possible_keys key key_len ref rows filtered Extra
116
1 PRIMARY t1i index NULL it1i3 70 NULL # 100.00 Using where; Using index
117
2 SUBQUERY t2i range it2i1,it2i3 it2i3 70 NULL # 100.00 Using where; Using index for group-by
119
Note 1003 select `test`.`t1i`.`a1` AS `a1`,`test`.`t1i`.`a2` AS `a2` from `test`.`t1i` where <in_optimizer>((`test`.`t1i`.`a1`,`test`.`t1i`.`a2`),(`test`.`t1i`.`a1`,`test`.`t1i`.`a2`) in ( <materialize> (select `test`.`t2i`.`b1` AS `b1`,`test`.`t2i`.`b2` AS `b2` from `test`.`t2i` where (`test`.`t2i`.`b1` > '0') group by `test`.`t2i`.`b1`,`test`.`t2i`.`b2` ), <primary_index_lookup>(`test`.`t1i`.`a1` in <temporary table> on distinct_key)))
120
select * from t1i where (a1, a2) in (select b1, b2 from t2i where b1 > '0' group by b1, b2);
125
select * from t1i where (a1, a2) in (select b1, min(b2) from t2i where b1 > '0' group by b1);
126
id select_type table type possible_keys key key_len ref rows filtered Extra
127
1 PRIMARY t1i index NULL it1i3 70 NULL # 100.00 Using where; Using index
128
2 SUBQUERY t2i range it2i1,it2i3 it2i3 70 NULL # 100.00 Using where; Using index for group-by
130
Note 1003 select `test`.`t1i`.`a1` AS `a1`,`test`.`t1i`.`a2` AS `a2` from `test`.`t1i` where <in_optimizer>((`test`.`t1i`.`a1`,`test`.`t1i`.`a2`),(`test`.`t1i`.`a1`,`test`.`t1i`.`a2`) in ( <materialize> (select `test`.`t2i`.`b1` AS `b1`,min(`test`.`t2i`.`b2`) AS `min(b2)` from `test`.`t2i` where (`test`.`t2i`.`b1` > '0') group by `test`.`t2i`.`b1` ), <primary_index_lookup>(`test`.`t1i`.`a1` in <temporary table> on distinct_key)))
131
select * from t1i where (a1, a2) in (select b1, min(b2) from t2i where b1 > '0' group by b1);
136
select * from t1 where (a1, a2) in (select b1, b2 from t2 order by b1, b2);
137
id select_type table type possible_keys key key_len ref rows filtered Extra
138
1 PRIMARY t1 ALL NULL NULL NULL NULL # 100.00 Using where
139
2 SUBQUERY t2 ALL NULL NULL NULL NULL # 100.00
141
Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from `test`.`t1` where <in_optimizer>((`test`.`t1`.`a1`,`test`.`t1`.`a2`),(`test`.`t1`.`a1`,`test`.`t1`.`a2`) in ( <materialize> (select `test`.`t2`.`b1` AS `b1`,`test`.`t2`.`b2` AS `b2` from `test`.`t2` order by `test`.`t2`.`b1`,`test`.`t2`.`b2` ), <primary_index_lookup>(`test`.`t1`.`a1` in <temporary table> on distinct_key)))
142
select * from t1 where (a1, a2) in (select b1, b2 from t2 order by b1, b2);
147
select * from t1i where (a1, a2) in (select b1, b2 from t2i order by b1, b2);
148
id select_type table type possible_keys key key_len ref rows filtered Extra
149
1 PRIMARY t1i index NULL it1i3 70 NULL # 100.00 Using where; Using index
150
2 SUBQUERY t2i index NULL it2i3 70 NULL # 100.00 Using index
152
Note 1003 select `test`.`t1i`.`a1` AS `a1`,`test`.`t1i`.`a2` AS `a2` from `test`.`t1i` where <in_optimizer>((`test`.`t1i`.`a1`,`test`.`t1i`.`a2`),(`test`.`t1i`.`a1`,`test`.`t1i`.`a2`) in ( <materialize> (select `test`.`t2i`.`b1` AS `b1`,`test`.`t2i`.`b2` AS `b2` from `test`.`t2i` order by `test`.`t2i`.`b1`,`test`.`t2i`.`b2` ), <primary_index_lookup>(`test`.`t1i`.`a1` in <temporary table> on distinct_key)))
153
select * from t1i where (a1, a2) in (select b1, b2 from t2i order by b1, b2);
159
where (a1, a2) in (select b1, b2 from t2 where b1 > '0') and
160
(a1, a2) in (select c1, c2 from t3
161
where (c1, c2) in (select b1, b2 from t2i where b2 > '0'));
162
id select_type table type possible_keys key key_len ref rows filtered Extra
163
1 PRIMARY t1 ALL NULL NULL NULL NULL # 100.00 Using where
164
3 SUBQUERY t3 ALL NULL NULL NULL NULL # 100.00 Using where
165
4 SUBQUERY t2i index it2i2 it2i3 70 NULL # 40.00 Using where; Using index
166
2 SUBQUERY t2 ALL NULL NULL NULL NULL # 100.00 Using where
168
Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from `test`.`t1` where (<in_optimizer>((`test`.`t1`.`a1`,`test`.`t1`.`a2`),(`test`.`t1`.`a1`,`test`.`t1`.`a2`) in ( <materialize> (select `test`.`t2`.`b1` AS `b1`,`test`.`t2`.`b2` AS `b2` from `test`.`t2` where (`test`.`t2`.`b1` > '0') ), <primary_index_lookup>(`test`.`t1`.`a1` in <temporary table> on distinct_key))) and <in_optimizer>((`test`.`t1`.`a1`,`test`.`t1`.`a2`),(`test`.`t1`.`a1`,`test`.`t1`.`a2`) in ( <materialize> (select `test`.`t3`.`c1` AS `c1`,`test`.`t3`.`c2` AS `c2` from `test`.`t3` where <in_optimizer>((`test`.`t3`.`c1`,`test`.`t3`.`c2`),(`test`.`t3`.`c1`,`test`.`t3`.`c2`) in ( <materialize> (select `test`.`t2i`.`b1` AS `b1`,`test`.`t2i`.`b2` AS `b2` from `test`.`t2i` where (`test`.`t2i`.`b2` > '0') ), <primary_index_lookup>(`test`.`t3`.`c1` in <temporary table> on distinct_key))) ), <primary_index_lookup>(`test`.`t1`.`a1` in <temporary table> on distinct_key))))
170
where (a1, a2) in (select b1, b2 from t2 where b1 > '0') and
171
(a1, a2) in (select c1, c2 from t3
172
where (c1, c2) in (select b1, b2 from t2i where b2 > '0'));
178
where (a1, a2) in (select b1, b2 from t2i where b1 > '0') and
179
(a1, a2) in (select c1, c2 from t3i
180
where (c1, c2) in (select b1, b2 from t2i where b2 > '0'));
181
id select_type table type possible_keys key key_len ref rows filtered Extra
182
1 PRIMARY t1i index NULL it1i3 70 NULL # 100.00 Using where; Using index
183
3 SUBQUERY t3i index NULL it3i3 70 NULL # 100.00 Using where; Using index
184
4 SUBQUERY t2i index it2i2 it2i3 70 NULL # 40.00 Using where; Using index
185
2 SUBQUERY t2i index it2i1,it2i3 it2i3 70 NULL # 40.00 Using where; Using index
187
Note 1003 select `test`.`t1i`.`a1` AS `a1`,`test`.`t1i`.`a2` AS `a2` from `test`.`t1i` where (<in_optimizer>((`test`.`t1i`.`a1`,`test`.`t1i`.`a2`),(`test`.`t1i`.`a1`,`test`.`t1i`.`a2`) in ( <materialize> (select `test`.`t2i`.`b1` AS `b1`,`test`.`t2i`.`b2` AS `b2` from `test`.`t2i` where (`test`.`t2i`.`b1` > '0') ), <primary_index_lookup>(`test`.`t1i`.`a1` in <temporary table> on distinct_key))) and <in_optimizer>((`test`.`t1i`.`a1`,`test`.`t1i`.`a2`),(`test`.`t1i`.`a1`,`test`.`t1i`.`a2`) in ( <materialize> (select `test`.`t3i`.`c1` AS `c1`,`test`.`t3i`.`c2` AS `c2` from `test`.`t3i` where <in_optimizer>((`test`.`t3i`.`c1`,`test`.`t3i`.`c2`),(`test`.`t3i`.`c1`,`test`.`t3i`.`c2`) in ( <materialize> (select `test`.`t2i`.`b1` AS `b1`,`test`.`t2i`.`b2` AS `b2` from `test`.`t2i` where (`test`.`t2i`.`b2` > '0') ), <primary_index_lookup>(`test`.`t3i`.`c1` in <temporary table> on distinct_key))) ), <primary_index_lookup>(`test`.`t1i`.`a1` in <temporary table> on distinct_key))))
189
where (a1, a2) in (select b1, b2 from t2i where b1 > '0') and
190
(a1, a2) in (select c1, c2 from t3i
191
where (c1, c2) in (select b1, b2 from t2i where b2 > '0'));
197
where (a1, a2) in (select b1, b2 from t2
198
where b2 in (select c2 from t3 where c2 LIKE '%02') or
199
b2 in (select c2 from t3 where c2 LIKE '%03')) and
200
(a1, a2) in (select c1, c2 from t3
201
where (c1, c2) in (select b1, b2 from t2i where b2 > '0'));
202
id select_type table type possible_keys key key_len ref rows filtered Extra
203
1 PRIMARY t1 ALL NULL NULL NULL NULL # 100.00 Using where
204
5 SUBQUERY t3 ALL NULL NULL NULL NULL # 100.00 Using where
205
6 SUBQUERY t2i index it2i2 it2i3 70 NULL # 40.00 Using where; Using index
206
2 SUBQUERY t2 ALL NULL NULL NULL NULL # 100.00 Using where
207
4 SUBQUERY t3 ALL NULL NULL NULL NULL # 100.00 Using where
208
3 SUBQUERY t3 ALL NULL NULL NULL NULL # 100.00 Using where
210
Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from `test`.`t1` where (<in_optimizer>((`test`.`t1`.`a1`,`test`.`t1`.`a2`),(`test`.`t1`.`a1`,`test`.`t1`.`a2`) in ( <materialize> (select `test`.`t2`.`b1` AS `b1`,`test`.`t2`.`b2` AS `b2` from `test`.`t2` where (<in_optimizer>(`test`.`t2`.`b2`,`test`.`t2`.`b2` in ( <materialize> (select `test`.`t3`.`c2` AS `c2` from `test`.`t3` where (`test`.`t3`.`c2` like '%02') ), <primary_index_lookup>(`test`.`t2`.`b2` in <temporary table> on distinct_key))) or <in_optimizer>(`test`.`t2`.`b2`,`test`.`t2`.`b2` in ( <materialize> (select `test`.`t3`.`c2` AS `c2` from `test`.`t3` where (`test`.`t3`.`c2` like '%03') ), <primary_index_lookup>(`test`.`t2`.`b2` in <temporary table> on distinct_key)))) ), <primary_index_lookup>(`test`.`t1`.`a1` in <temporary table> on distinct_key))) and <in_optimizer>((`test`.`t1`.`a1`,`test`.`t1`.`a2`),(`test`.`t1`.`a1`,`test`.`t1`.`a2`) in ( <materialize> (select `test`.`t3`.`c1` AS `c1`,`test`.`t3`.`c2` AS `c2` from `test`.`t3` where <in_optimizer>((`test`.`t3`.`c1`,`test`.`t3`.`c2`),(`test`.`t3`.`c1`,`test`.`t3`.`c2`) in ( <materialize> (select `test`.`t2i`.`b1` AS `b1`,`test`.`t2i`.`b2` AS `b2` from `test`.`t2i` where (`test`.`t2i`.`b2` > '0') ), <primary_index_lookup>(`test`.`t3`.`c1` in <temporary table> on distinct_key))) ), <primary_index_lookup>(`test`.`t1`.`a1` in <temporary table> on distinct_key))))
212
where (a1, a2) in (select b1, b2 from t2
213
where b2 in (select c2 from t3 where c2 LIKE '%02') or
214
b2 in (select c2 from t3 where c2 LIKE '%03')) and
215
(a1, a2) in (select c1, c2 from t3
216
where (c1, c2) in (select b1, b2 from t2i where b2 > '0'));
221
where (a1, a2) in (select b1, b2 from t2
82
select * from t1i where a1 in (select b1 from t2i where b1 > '0');
83
id select_type table type possible_keys key key_len ref rows filtered Extra
84
1 PRIMARY t1i index NULL it1i3 18 NULL 3 100.00 Using where; Using index
85
2 SUBQUERY t2i index it2i1,it2i3 it2i1 9 NULL 5 100.00 Using where; Using index
87
Note 1003 select "test"."t1i"."a1" AS "a1","test"."t1i"."a2" AS "a2" from "test"."t1i" where <in_optimizer>("test"."t1i"."a1","test"."t1i"."a1" in ( <materialize> (select "test"."t2i"."b1" AS "b1" from "test"."t2i" where ("test"."t2i"."b1" > '0') ), <primary_index_lookup>("test"."t1i"."a1" in <temporary table> on distinct_key)))
88
select * from t1i where a1 in (select b1 from t2i where b1 > '0');
93
select * from t1i where a1 in (select b1 from t2i where b1 > '0' group by b1);
94
id select_type table type possible_keys key key_len ref rows filtered Extra
95
1 PRIMARY t1i index NULL it1i3 18 NULL 3 100.00 Using where; Using index
96
2 SUBQUERY t2i range it2i1,it2i3 it2i1 9 NULL 3 100.00 Using where; Using index for group-by
98
Note 1003 select "test"."t1i"."a1" AS "a1","test"."t1i"."a2" AS "a2" from "test"."t1i" where <in_optimizer>("test"."t1i"."a1","test"."t1i"."a1" in ( <materialize> (select "test"."t2i"."b1" AS "b1" from "test"."t2i" where ("test"."t2i"."b1" > '0') group by "test"."t2i"."b1" ), <primary_index_lookup>("test"."t1i"."a1" in <temporary table> on distinct_key)))
99
select * from t1i where a1 in (select b1 from t2i where b1 > '0' group by b1);
104
select * from t1i where (a1, a2) in (select b1, b2 from t2i where b1 > '0');
105
id select_type table type possible_keys key key_len ref rows filtered Extra
106
1 PRIMARY t1i index NULL it1i3 18 NULL 3 100.00 Using where; Using index
107
2 SUBQUERY t2i index it2i1,it2i3 it2i3 18 NULL 5 100.00 Using where; Using index
109
Note 1003 select "test"."t1i"."a1" AS "a1","test"."t1i"."a2" AS "a2" from "test"."t1i" where <in_optimizer>(("test"."t1i"."a1","test"."t1i"."a2"),("test"."t1i"."a1","test"."t1i"."a2") in ( <materialize> (select "test"."t2i"."b1" AS "b1","test"."t2i"."b2" AS "b2" from "test"."t2i" where ("test"."t2i"."b1" > '0') ), <primary_index_lookup>("test"."t1i"."a1" in <temporary table> on distinct_key)))
110
select * from t1i where (a1, a2) in (select b1, b2 from t2i where b1 > '0');
115
select * from t1i where (a1, a2) in (select b1, b2 from t2i where b1 > '0' group by b1, b2);
116
id select_type table type possible_keys key key_len ref rows filtered Extra
117
1 PRIMARY t1i index NULL it1i3 18 NULL 3 100.00 Using where; Using index
118
2 SUBQUERY t2i range it2i1,it2i3 it2i3 18 NULL 3 100.00 Using where; Using index for group-by
120
Note 1003 select "test"."t1i"."a1" AS "a1","test"."t1i"."a2" AS "a2" from "test"."t1i" where <in_optimizer>(("test"."t1i"."a1","test"."t1i"."a2"),("test"."t1i"."a1","test"."t1i"."a2") in ( <materialize> (select "test"."t2i"."b1" AS "b1","test"."t2i"."b2" AS "b2" from "test"."t2i" where ("test"."t2i"."b1" > '0') group by "test"."t2i"."b1","test"."t2i"."b2" ), <primary_index_lookup>("test"."t1i"."a1" in <temporary table> on distinct_key)))
121
select * from t1i where (a1, a2) in (select b1, b2 from t2i where b1 > '0' group by b1, b2);
126
select * from t1i where (a1, a2) in (select b1, min(b2) from t2i where b1 > '0' group by b1);
127
id select_type table type possible_keys key key_len ref rows filtered Extra
128
1 PRIMARY t1i index NULL it1i3 18 NULL 3 100.00 Using where; Using index
129
2 SUBQUERY t2i range it2i1,it2i3 it2i3 18 NULL 3 100.00 Using where; Using index for group-by
131
Note 1003 select "test"."t1i"."a1" AS "a1","test"."t1i"."a2" AS "a2" from "test"."t1i" where <in_optimizer>(("test"."t1i"."a1","test"."t1i"."a2"),("test"."t1i"."a1","test"."t1i"."a2") in ( <materialize> (select "test"."t2i"."b1" AS "b1",min("test"."t2i"."b2") AS "min(b2)" from "test"."t2i" where ("test"."t2i"."b1" > '0') group by "test"."t2i"."b1" ), <primary_index_lookup>("test"."t1i"."a1" in <temporary table> on distinct_key)))
132
select * from t1i where (a1, a2) in (select b1, min(b2) from t2i where b1 > '0' group by b1);
137
select * from t1 where (a1, a2) in (select b1, b2 from t2 order by b1, b2);
138
id select_type table type possible_keys key key_len ref rows filtered Extra
139
1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00 Using where
140
2 SUBQUERY t2 ALL NULL NULL NULL NULL 5 100.00
142
Note 1003 select "test"."t1"."a1" AS "a1","test"."t1"."a2" AS "a2" from "test"."t1" where <in_optimizer>(("test"."t1"."a1","test"."t1"."a2"),("test"."t1"."a1","test"."t1"."a2") in ( <materialize> (select "test"."t2"."b1" AS "b1","test"."t2"."b2" AS "b2" from "test"."t2" order by "test"."t2"."b1","test"."t2"."b2" ), <primary_index_lookup>("test"."t1"."a1" in <temporary table> on distinct_key)))
143
select * from t1 where (a1, a2) in (select b1, b2 from t2 order by b1, b2);
148
select * from t1i where (a1, a2) in (select b1, b2 from t2i order by b1, b2);
149
id select_type table type possible_keys key key_len ref rows filtered Extra
150
1 PRIMARY t1i index NULL it1i3 18 NULL 3 100.00 Using where; Using index
151
2 SUBQUERY t2i index NULL it2i3 18 NULL 5 100.00 Using index
153
Note 1003 select "test"."t1i"."a1" AS "a1","test"."t1i"."a2" AS "a2" from "test"."t1i" where <in_optimizer>(("test"."t1i"."a1","test"."t1i"."a2"),("test"."t1i"."a1","test"."t1i"."a2") in ( <materialize> (select "test"."t2i"."b1" AS "b1","test"."t2i"."b2" AS "b2" from "test"."t2i" order by "test"."t2i"."b1","test"."t2i"."b2" ), <primary_index_lookup>("test"."t1i"."a1" in <temporary table> on distinct_key)))
154
select * from t1i where (a1, a2) in (select b1, b2 from t2i order by b1, b2);
160
where (a1, a2) in (select b1, b2 from t2 where b1 > '0') and
161
(a1, a2) in (select c1, c2 from t3
162
where (c1, c2) in (select b1, b2 from t2i where b2 > '0'));
163
id select_type table type possible_keys key key_len ref rows filtered Extra
164
1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00 Using where
165
3 SUBQUERY t3 ALL NULL NULL NULL NULL 4 100.00 Using where
166
4 SUBQUERY t2i index it2i2 it2i3 18 NULL 5 100.00 Using where; Using index
167
2 SUBQUERY t2 ALL NULL NULL NULL NULL 5 100.00 Using where
169
Note 1003 select "test"."t1"."a1" AS "a1","test"."t1"."a2" AS "a2" from "test"."t1" where (<in_optimizer>(("test"."t1"."a1","test"."t1"."a2"),("test"."t1"."a1","test"."t1"."a2") in ( <materialize> (select "test"."t2"."b1" AS "b1","test"."t2"."b2" AS "b2" from "test"."t2" where ("test"."t2"."b1" > '0') ), <primary_index_lookup>("test"."t1"."a1" in <temporary table> on distinct_key))) and <in_optimizer>(("test"."t1"."a1","test"."t1"."a2"),("test"."t1"."a1","test"."t1"."a2") in ( <materialize> (select "test"."t3"."c1" AS "c1","test"."t3"."c2" AS "c2" from "test"."t3" where <in_optimizer>(("test"."t3"."c1","test"."t3"."c2"),("test"."t3"."c1","test"."t3"."c2") in ( <materialize> (select "test"."t2i"."b1" AS "b1","test"."t2i"."b2" AS "b2" from "test"."t2i" where ("test"."t2i"."b2" > '0') ), <primary_index_lookup>("test"."t3"."c1" in <temporary table> on distinct_key))) ), <primary_index_lookup>("test"."t1"."a1" in <temporary table> on distinct_key))))
171
where (a1, a2) in (select b1, b2 from t2 where b1 > '0') and
172
(a1, a2) in (select c1, c2 from t3
173
where (c1, c2) in (select b1, b2 from t2i where b2 > '0'));
179
where (a1, a2) in (select b1, b2 from t2i where b1 > '0') and
180
(a1, a2) in (select c1, c2 from t3i
181
where (c1, c2) in (select b1, b2 from t2i where b2 > '0'));
182
id select_type table type possible_keys key key_len ref rows filtered Extra
183
1 PRIMARY t1i index NULL it1i3 18 NULL 3 100.00 Using where; Using index
184
3 SUBQUERY t3i index NULL it3i3 18 NULL 4 100.00 Using where; Using index
185
4 SUBQUERY t2i index it2i2 it2i3 18 NULL 5 100.00 Using where; Using index
186
2 SUBQUERY t2i index it2i1,it2i3 it2i3 18 NULL 5 100.00 Using where; Using index
188
Note 1003 select "test"."t1i"."a1" AS "a1","test"."t1i"."a2" AS "a2" from "test"."t1i" where (<in_optimizer>(("test"."t1i"."a1","test"."t1i"."a2"),("test"."t1i"."a1","test"."t1i"."a2") in ( <materialize> (select "test"."t2i"."b1" AS "b1","test"."t2i"."b2" AS "b2" from "test"."t2i" where ("test"."t2i"."b1" > '0') ), <primary_index_lookup>("test"."t1i"."a1" in <temporary table> on distinct_key))) and <in_optimizer>(("test"."t1i"."a1","test"."t1i"."a2"),("test"."t1i"."a1","test"."t1i"."a2") in ( <materialize> (select "test"."t3i"."c1" AS "c1","test"."t3i"."c2" AS "c2" from "test"."t3i" where <in_optimizer>(("test"."t3i"."c1","test"."t3i"."c2"),("test"."t3i"."c1","test"."t3i"."c2") in ( <materialize> (select "test"."t2i"."b1" AS "b1","test"."t2i"."b2" AS "b2" from "test"."t2i" where ("test"."t2i"."b2" > '0') ), <primary_index_lookup>("test"."t3i"."c1" in <temporary table> on distinct_key))) ), <primary_index_lookup>("test"."t1i"."a1" in <temporary table> on distinct_key))))
190
where (a1, a2) in (select b1, b2 from t2i where b1 > '0') and
191
(a1, a2) in (select c1, c2 from t3i
192
where (c1, c2) in (select b1, b2 from t2i where b2 > '0'));
198
where (a1, a2) in (select b1, b2 from t2
199
where b2 in (select c2 from t3 where c2 LIKE '%02') or
200
b2 in (select c2 from t3 where c2 LIKE '%03')) and
201
(a1, a2) in (select c1, c2 from t3
202
where (c1, c2) in (select b1, b2 from t2i where b2 > '0'));
203
id select_type table type possible_keys key key_len ref rows filtered Extra
204
1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00 Using where
205
5 SUBQUERY t3 ALL NULL NULL NULL NULL 4 100.00 Using where
206
6 SUBQUERY t2i index it2i2 it2i3 18 NULL 5 100.00 Using where; Using index
207
2 SUBQUERY t2 ALL NULL NULL NULL NULL 5 100.00 Using where
208
4 SUBQUERY t3 ALL NULL NULL NULL NULL 4 100.00 Using where
209
3 SUBQUERY t3 ALL NULL NULL NULL NULL 4 100.00 Using where
211
Note 1003 select "test"."t1"."a1" AS "a1","test"."t1"."a2" AS "a2" from "test"."t1" where (<in_optimizer>(("test"."t1"."a1","test"."t1"."a2"),("test"."t1"."a1","test"."t1"."a2") in ( <materialize> (select "test"."t2"."b1" AS "b1","test"."t2"."b2" AS "b2" from "test"."t2" where (<in_optimizer>("test"."t2"."b2","test"."t2"."b2" in ( <materialize> (select "test"."t3"."c2" AS "c2" from "test"."t3" where ("test"."t3"."c2" like '%02') ), <primary_index_lookup>("test"."t2"."b2" in <temporary table> on distinct_key))) or <in_optimizer>("test"."t2"."b2","test"."t2"."b2" in ( <materialize> (select "test"."t3"."c2" AS "c2" from "test"."t3" where ("test"."t3"."c2" like '%03') ), <primary_index_lookup>("test"."t2"."b2" in <temporary table> on distinct_key)))) ), <primary_index_lookup>("test"."t1"."a1" in <temporary table> on distinct_key))) and <in_optimizer>(("test"."t1"."a1","test"."t1"."a2"),("test"."t1"."a1","test"."t1"."a2") in ( <materialize> (select "test"."t3"."c1" AS "c1","test"."t3"."c2" AS "c2" from "test"."t3" where <in_optimizer>(("test"."t3"."c1","test"."t3"."c2"),("test"."t3"."c1","test"."t3"."c2") in ( <materialize> (select "test"."t2i"."b1" AS "b1","test"."t2i"."b2" AS "b2" from "test"."t2i" where ("test"."t2i"."b2" > '0') ), <primary_index_lookup>("test"."t3"."c1" in <temporary table> on distinct_key))) ), <primary_index_lookup>("test"."t1"."a1" in <temporary table> on distinct_key))))
213
where (a1, a2) in (select b1, b2 from t2
214
where b2 in (select c2 from t3 where c2 LIKE '%02') or
215
b2 in (select c2 from t3 where c2 LIKE '%03')) and
216
(a1, a2) in (select c1, c2 from t3
217
where (c1, c2) in (select b1, b2 from t2i where b2 > '0'));
222
where (a1, a2) in (select b1, b2 from t2
222
223
where b2 in (select c2 from t3 t3a where c1 = a1) or
223
224
b2 in (select c2 from t3 t3b where c2 LIKE '%03')) and
224
225
(a1, a2) in (select c1, c2 from t3 t3c
225
226
where (c1, c2) in (select b1, b2 from t2i where b2 > '0'));
226
227
id select_type table type possible_keys key key_len ref rows filtered Extra
227
1 PRIMARY t1 ALL NULL NULL NULL NULL # 100.00 Using where
228
5 SUBQUERY t3c ALL NULL NULL NULL NULL # 100.00 Using where
229
6 SUBQUERY t2i index it2i2 it2i3 70 NULL # 40.00 Using where; Using index
230
2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL # 100.00 Using where
231
4 SUBQUERY t3b ALL NULL NULL NULL NULL # 100.00 Using where
232
3 DEPENDENT SUBQUERY t3a ALL NULL NULL NULL NULL # 100.00 Using where
228
1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00 Using where
229
5 SUBQUERY t3c ALL NULL NULL NULL NULL 4 100.00 Using where
230
6 SUBQUERY t2i index it2i2 it2i3 18 NULL 5 100.00 Using where; Using index
231
2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 5 100.00 Using where
232
4 SUBQUERY t3b ALL NULL NULL NULL NULL 4 100.00 Using where
233
3 DEPENDENT SUBQUERY t3a ALL NULL NULL NULL NULL 4 100.00 Using where
234
235
Note 1276 Field or reference 'test.t1.a1' of SELECT #3 was resolved in SELECT #1
235
Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from `test`.`t1` where (<in_optimizer>((`test`.`t1`.`a1`,`test`.`t1`.`a2`),<exists>(select `test`.`t2`.`b1` AS `b1`,`test`.`t2`.`b2` AS `b2` from `test`.`t2` where ((<in_optimizer>(`test`.`t2`.`b2`,<exists>(select 1 AS `Not_used` from `test`.`t3` `t3a` where ((`test`.`t3a`.`c1` = `test`.`t1`.`a1`) and (<cache>(`test`.`t2`.`b2`) = `test`.`t3a`.`c2`)))) or <in_optimizer>(`test`.`t2`.`b2`,`test`.`t2`.`b2` in ( <materialize> (select `test`.`t3b`.`c2` AS `c2` from `test`.`t3` `t3b` where (`test`.`t3b`.`c2` like '%03') ), <primary_index_lookup>(`test`.`t2`.`b2` in <temporary table> on distinct_key)))) and (<cache>(`test`.`t1`.`a1`) = `test`.`t2`.`b1`) and (<cache>(`test`.`t1`.`a2`) = `test`.`t2`.`b2`)))) and <in_optimizer>((`test`.`t1`.`a1`,`test`.`t1`.`a2`),(`test`.`t1`.`a1`,`test`.`t1`.`a2`) in ( <materialize> (select `test`.`t3c`.`c1` AS `c1`,`test`.`t3c`.`c2` AS `c2` from `test`.`t3` `t3c` where <in_optimizer>((`test`.`t3c`.`c1`,`test`.`t3c`.`c2`),(`test`.`t3c`.`c1`,`test`.`t3c`.`c2`) in ( <materialize> (select `test`.`t2i`.`b1` AS `b1`,`test`.`t2i`.`b2` AS `b2` from `test`.`t2i` where (`test`.`t2i`.`b2` > '0') ), <primary_index_lookup>(`test`.`t3c`.`c1` in <temporary table> on distinct_key))) ), <primary_index_lookup>(`test`.`t1`.`a1` in <temporary table> on distinct_key))))
236
Note 1003 select "test"."t1"."a1" AS "a1","test"."t1"."a2" AS "a2" from "test"."t1" where (<in_optimizer>(("test"."t1"."a1","test"."t1"."a2"),<exists>(select "test"."t2"."b1" AS "b1","test"."t2"."b2" AS "b2" from "test"."t2" where ((<in_optimizer>("test"."t2"."b2",<exists>(select 1 AS "Not_used" from "test"."t3" "t3a" where (("test"."t3a"."c1" = "test"."t1"."a1") and (<cache>("test"."t2"."b2") = "test"."t3a"."c2")))) or <in_optimizer>("test"."t2"."b2","test"."t2"."b2" in ( <materialize> (select "test"."t3b"."c2" AS "c2" from "test"."t3" "t3b" where ("test"."t3b"."c2" like '%03') ), <primary_index_lookup>("test"."t2"."b2" in <temporary table> on distinct_key)))) and (<cache>("test"."t1"."a1") = "test"."t2"."b1") and (<cache>("test"."t1"."a2") = "test"."t2"."b2")))) and <in_optimizer>(("test"."t1"."a1","test"."t1"."a2"),("test"."t1"."a1","test"."t1"."a2") in ( <materialize> (select "test"."t3c"."c1" AS "c1","test"."t3c"."c2" AS "c2" from "test"."t3" "t3c" where <in_optimizer>(("test"."t3c"."c1","test"."t3c"."c2"),("test"."t3c"."c1","test"."t3c"."c2") in ( <materialize> (select "test"."t2i"."b1" AS "b1","test"."t2i"."b2" AS "b2" from "test"."t2i" where ("test"."t2i"."b2" > '0') ), <primary_index_lookup>("test"."t3c"."c1" in <temporary table> on distinct_key))) ), <primary_index_lookup>("test"."t1"."a1" in <temporary table> on distinct_key))))
237
238
where (a1, a2) in (select b1, b2 from t2
238
239
where b2 in (select c2 from t3 t3a where c1 = a1) or