Debian Codegraph @

mysql-test/suite/ndb_opt/join_pushdown_bka.result

raw
1 set @@global.optimizer_switch='batched_key_access=on';
2 select @@session.optimizer_switch;
3 @@session.optimizer_switch
4 index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on,index_condition_pushdown=on,mrr=on,mrr_cost_based=on,block_nested_loop=on,batched_key_access=on,materialization=on,semijoin=on,loosescan=on,firstmatch=on,duplicateweedout=on,subquery_materialization_cost_based=on,use_index_extensions=on,condition_fanout_filter=on,derived_merge=on,use_invisible_indexes=off,skip_scan=on,hash_join=on,subquery_to_derived=off,prefer_ordering_index=on,hypergraph_optimizer=off,derived_condition_pushdown=on
5 create temporary table server_counts_at_startup
6 select * from performance_schema.global_status
7 where variable_name in
8 ('Ndb_pruned_scan_count',
9 'Ndb_sorted_scan_count',
10 'Ndb_pushed_queries_defined',
11 'Ndb_pushed_queries_dropped');
12 set @save_debug = @@global.debug;
13 set @save_ndb_join_pushdown = @@session.ndb_join_pushdown;
14 set ndb_join_pushdown = true;
15 create table t1 (
16 a int not null,
17 b int not null,
18 c int not null,
19 d int not null,
20 primary key (`a`,`b`)
21 ) engine=ndbcluster
22 partition by key() partitions 8;
23 insert into t1 values
24 (1,1,1,1), (2,2,2,2), (3,3,3,3), (4,4,4,4),
25 (1,2,5,1), (1,3,1,2), (1,4,2,3),
26 (2,1,3,4), (2,3,4,5), (2,4,5,1),
27 (3,1,1,2), (3,2,2,3), (3,4,3,4),
28 (4,1,4,5), (4,2,5,1), (4,3,1,2);
29 explain
30 select *
31 from t1
32 join t1 as t2 on t2.a = t1.b and t2.b = t1.c;
33 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
34 1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 16 100.00 NULL
35 1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.b,test.t1.c 1 100.00 Using join buffer (Batched Key Access)
36 Warnings:
37 Note 1003 Can't push table 't2' as child, access type 'Batched-key' not implemented
38 Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t1`.`d` AS `d`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d` from `test`.`t1` join `test`.`t1` `t2` where ((`test`.`t2`.`b` = `test`.`t1`.`c`) and (`test`.`t2`.`a` = `test`.`t1`.`b`))
39 select *
40 from t1
41 join t1 as t2 on t2.a = t1.b and t2.b = t1.c;
42 a b c d a b c d
43 1 1 1 1 1 1 1 1
44 1 3 1 2 3 1 1 2
45 1 4 2 3 4 2 5 1
46 2 1 3 4 1 3 1 2
47 2 2 2 2 2 2 2 2
48 2 3 4 5 3 4 3 4
49 3 1 1 2 1 1 1 1
50 3 2 2 3 2 2 2 2
51 3 3 3 3 3 3 3 3
52 3 4 3 4 4 3 1 2
53 4 1 4 5 1 4 2 3
54 4 3 1 2 3 1 1 2
55 4 4 4 4 4 4 4 4
56 explain format=JSON
57 select *
58 from t1
59 join t1 as t2 on t2.a = t1.b and t2.b = t1.c;
60 EXPLAIN
61 {
62 "query_block": {
63 "select_id": 1,
64 "cost_info": {
65 "query_cost": "4007.20"
66 },
67 "nested_loop": [
68 {
69 "table": {
70 "table_name": "t1",
71 "partitions": [
72 "p0",
73 "p1",
74 "p2",
75 "p3",
76 "p4",
77 "p5",
78 "p6",
79 "p7"
80 ],
81 "access_type": "ALL",
82 "rows_examined_per_scan": 16,
83 "rows_produced_per_join": 16,
84 "filtered": "100.00",
85 "cost_info": {
86 "read_cost": "4000.00",
87 "eval_cost": "1.60",
88 "prefix_cost": "4001.60",
89 "data_read_per_join": "384"
90 },
91 "used_columns": [
92 "a",
93 "b",
94 "c",
95 "d"
96 ]
97 }
98 },
99 {
100 "table": {
101 "table_name": "t2",
102 "partitions": [
103 "p0",
104 "p1",
105 "p2",
106 "p3",
107 "p4",
108 "p5",
109 "p6",
110 "p7"
111 ],
112 "access_type": "eq_ref",
113 "possible_keys": [
114 "PRIMARY"
115 ],
116 "key": "PRIMARY",
117 "used_key_parts": [
118 "a",
119 "b"
120 ],
121 "key_length": "8",
122 "ref": [
123 "test.t1.b",
124 "test.t1.c"
125 ],
126 "rows_examined_per_scan": 1,
127 "rows_produced_per_join": 16,
128 "filtered": "100.00",
129 "using_join_buffer": "Batched Key Access",
130 "cost_info": {
131 "read_cost": "4.00",
132 "eval_cost": "1.60",
133 "prefix_cost": "4007.20",
134 "data_read_per_join": "384"
135 },
136 "used_columns": [
137 "a",
138 "b",
139 "c",
140 "d"
141 ]
142 }
143 }
144 ]
145 }
146 }
147 Warnings:
148 Note 1003 Can't push table 't2' as child, access type 'Batched-key' not implemented
149 Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t1`.`d` AS `d`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d` from `test`.`t1` join `test`.`t1` `t2` where ((`test`.`t2`.`b` = `test`.`t1`.`c`) and (`test`.`t2`.`a` = `test`.`t1`.`b`))
150 explain
151 select straight_join count(*)
152 from t1 as x1
153 join t1 as x2 on x1.d > x2.a + 1000
154 join t1 as x3 on x1.c=x3.a and x1.d=x3.b;
155 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
156 1 SIMPLE x1 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 16 100.00 NULL
157 1 SIMPLE x2 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 16 100.00 Using where; Using join buffer (hash join)
158 1 SIMPLE x3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.x1.c,test.x1.d 1 100.00 Using join buffer (Batched Key Access)
159 Warnings:
160 Note 1003 Can't push table 'x2' as child, 'type' must be a 'ref' access
161 Note 1003 Can't push table 'x3' as child, access type 'Batched-key' not implemented
162 Note 1003 /* select#1 */ select straight_join count(0) AS `count(*)` from `test`.`t1` `x1` join `test`.`t1` `x2` join `test`.`t1` `x3` where ((`test`.`x3`.`b` = `test`.`x1`.`d`) and (`test`.`x3`.`a` = `test`.`x1`.`c`) and (`test`.`x1`.`d` > (`test`.`x2`.`a` + 1000)))
163 select straight_join count(*)
164 from t1 as x1
165 join t1 as x2 on x1.d > x2.a + 1000
166 join t1 as x3 on x1.c=x3.a and x1.d=x3.b;
167 count(*)
168 0
169 explain select *
170 from t1 as x1
171 join t1 as x2 on x1.a=1 and x1.c=x2.a and x1.d=x2.b
172 join t1 as x3
173 join t1 as x4 where x4.a=x3.c and x4.b=x1.d;
174 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
175 1 SIMPLE x1 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 const 3 100.00 NULL
176 1 SIMPLE x2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.x1.c,test.x1.d 1 100.00 Using join buffer (Batched Key Access)
177 1 SIMPLE x3 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 16 100.00 Using join buffer (hash join)
178 1 SIMPLE x4 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.x3.c,test.x1.d 1 100.00 Using join buffer (Batched Key Access)
179 Warnings:
180 Note 1003 Can't push table 'x2' as child, access type 'Batched-key' not implemented
181 Note 1003 Can't push table 'x3' as child, 'type' must be a 'ref' access
182 Note 1003 Can't push table 'x4' as child, access type 'Batched-key' not implemented
183 Note 1003 /* select#1 */ select `test`.`x1`.`a` AS `a`,`test`.`x1`.`b` AS `b`,`test`.`x1`.`c` AS `c`,`test`.`x1`.`d` AS `d`,`test`.`x2`.`a` AS `a`,`test`.`x2`.`b` AS `b`,`test`.`x2`.`c` AS `c`,`test`.`x2`.`d` AS `d`,`test`.`x3`.`a` AS `a`,`test`.`x3`.`b` AS `b`,`test`.`x3`.`c` AS `c`,`test`.`x3`.`d` AS `d`,`test`.`x4`.`a` AS `a`,`test`.`x4`.`b` AS `b`,`test`.`x4`.`c` AS `c`,`test`.`x4`.`d` AS `d` from `test`.`t1` `x1` join `test`.`t1` `x2` join `test`.`t1` `x3` join `test`.`t1` `x4` where ((`test`.`x2`.`a` = `test`.`x1`.`c`) and (`test`.`x1`.`a` = 1) and (`test`.`x2`.`b` = `test`.`x1`.`d`) and (`test`.`x4`.`b` = `test`.`x1`.`d`) and (`test`.`x4`.`a` = `test`.`x3`.`c`))
184 select *
185 from t1 as x1
186 join t1 as x2 on x1.a=1 and x1.c=x2.a and x1.d=x2.b
187 join t1 as x3
188 join t1 as x4 where x4.a=x3.c and x4.b=x1.d;
189 a b c d a b c d a b c d a b c d
190 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
191 1 1 1 1 1 1 1 1 1 3 1 2 1 1 1 1
192 1 1 1 1 1 1 1 1 1 4 2 3 2 1 3 4
193 1 1 1 1 1 1 1 1 2 1 3 4 3 1 1 2
194 1 1 1 1 1 1 1 1 2 2 2 2 2 1 3 4
195 1 1 1 1 1 1 1 1 2 3 4 5 4 1 4 5
196 1 1 1 1 1 1 1 1 3 1 1 2 1 1 1 1
197 1 1 1 1 1 1 1 1 3 2 2 3 2 1 3 4
198 1 1 1 1 1 1 1 1 3 3 3 3 3 1 1 2
199 1 1 1 1 1 1 1 1 3 4 3 4 3 1 1 2
200 1 1 1 1 1 1 1 1 4 1 4 5 4 1 4 5
201 1 1 1 1 1 1 1 1 4 3 1 2 1 1 1 1
202 1 1 1 1 1 1 1 1 4 4 4 4 4 1 4 5
203 1 3 1 2 1 2 5 1 1 1 1 1 1 2 5 1
204 1 3 1 2 1 2 5 1 1 3 1 2 1 2 5 1
205 1 3 1 2 1 2 5 1 1 4 2 3 2 2 2 2
206 1 3 1 2 1 2 5 1 2 1 3 4 3 2 2 3
207 1 3 1 2 1 2 5 1 2 2 2 2 2 2 2 2
208 1 3 1 2 1 2 5 1 2 3 4 5 4 2 5 1
209 1 3 1 2 1 2 5 1 3 1 1 2 1 2 5 1
210 1 3 1 2 1 2 5 1 3 2 2 3 2 2 2 2
211 1 3 1 2 1 2 5 1 3 3 3 3 3 2 2 3
212 1 3 1 2 1 2 5 1 3 4 3 4 3 2 2 3
213 1 3 1 2 1 2 5 1 4 1 4 5 4 2 5 1
214 1 3 1 2 1 2 5 1 4 3 1 2 1 2 5 1
215 1 3 1 2 1 2 5 1 4 4 4 4 4 2 5 1
216 1 4 2 3 2 3 4 5 1 1 1 1 1 3 1 2
217 1 4 2 3 2 3 4 5 1 3 1 2 1 3 1 2
218 1 4 2 3 2 3 4 5 1 4 2 3 2 3 4 5
219 1 4 2 3 2 3 4 5 2 1 3 4 3 3 3 3
220 1 4 2 3 2 3 4 5 2 2 2 2 2 3 4 5
221 1 4 2 3 2 3 4 5 2 3 4 5 4 3 1 2
222 1 4 2 3 2 3 4 5 3 1 1 2 1 3 1 2
223 1 4 2 3 2 3 4 5 3 2 2 3 2 3 4 5
224 1 4 2 3 2 3 4 5 3 3 3 3 3 3 3 3
225 1 4 2 3 2 3 4 5 3 4 3 4 3 3 3 3
226 1 4 2 3 2 3 4 5 4 1 4 5 4 3 1 2
227 1 4 2 3 2 3 4 5 4 3 1 2 1 3 1 2
228 1 4 2 3 2 3 4 5 4 4 4 4 4 3 1 2
229 explain
230 select *
231 from t1
232 left join t1 as t2 on t2.a = t1.b and t2.b = t1.c;
233 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
234 1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 16 100.00 NULL
235 1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.b,test.t1.c 1 100.00 Using join buffer (Batched Key Access)
236 Warnings:
237 Note 1003 Can't push table 't2' as child, access type 'Batched-key' not implemented
238 Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t1`.`d` AS `d`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d` from `test`.`t1` left join `test`.`t1` `t2` on(((`test`.`t2`.`b` = `test`.`t1`.`c`) and (`test`.`t2`.`a` = `test`.`t1`.`b`))) where true
239 select *
240 from t1
241 left join t1 as t2 on t2.a = t1.b and t2.b = t1.c;
242 a b c d a b c d
243 1 1 1 1 1 1 1 1
244 1 2 5 1 NULL NULL NULL NULL
245 1 3 1 2 3 1 1 2
246 1 4 2 3 4 2 5 1
247 2 1 3 4 1 3 1 2
248 2 2 2 2 2 2 2 2
249 2 3 4 5 3 4 3 4
250 2 4 5 1 NULL NULL NULL NULL
251 3 1 1 2 1 1 1 1
252 3 2 2 3 2 2 2 2
253 3 3 3 3 3 3 3 3
254 3 4 3 4 4 3 1 2
255 4 1 4 5 1 4 2 3
256 4 2 5 1 NULL NULL NULL NULL
257 4 3 1 2 3 1 1 2
258 4 4 4 4 4 4 4 4
259 explain
260 select *
261 from t1
262 join t1 as t2 on t2.a = t1.b and t2.b = t1.c
263 join t1 as t3 on t3.a = t2.a and t3.b = t2.b
264 where t1.a = 1 and t1.b = 1;
265 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
266 1 SIMPLE t1 p7 eq_ref PRIMARY PRIMARY 8 const,const 1 100.00 NULL
267 1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 const,test.t1.c 1 100.00 Using join buffer (Batched Key Access)
268 1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 const,test.t1.c 1 100.00 Using join buffer (Batched Key Access)
269 Warnings:
270 Note 1003 Can't push table 't2' as child, access type 'Batched-key' not implemented
271 Note 1003 Can't push table 't3' as child, access type 'Batched-key' not implemented
272 Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t1`.`d` AS `d`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t3`.`c` AS `c`,`test`.`t3`.`d` AS `d` from `test`.`t1` join `test`.`t1` `t2` join `test`.`t1` `t3` where ((`test`.`t2`.`b` = `test`.`t1`.`c`) and (`test`.`t3`.`b` = `test`.`t1`.`c`) and (`test`.`t1`.`b` = 1) and (`test`.`t2`.`a` = 1) and (`test`.`t3`.`a` = 1) and (`test`.`t1`.`a` = 1))
273 select *
274 from t1
275 join t1 as t2 on t2.a = t1.b and t2.b = t1.c
276 join t1 as t3 on t3.a = t2.a and t3.b = t2.b
277 where t1.a = 1 and t1.b = 1;
278 a b c d a b c d a b c d
279 1 1 1 1 1 1 1 1 1 1 1 1
280 explain
281 select *
282 from t1
283 join t1 as t2 on t2.a = t1.b and t2.b = t1.c
284 join t1 as t3 on t3.a = t2.a and t3.b = t2.b;
285 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
286 1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 16 100.00 NULL
287 1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.b,test.t1.c 1 100.00 Using join buffer (Batched Key Access)
288 1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.b,test.t1.c 1 100.00 Using join buffer (Batched Key Access)
289 Warnings:
290 Note 1003 Can't push table 't2' as child, access type 'Batched-key' not implemented
291 Note 1003 Can't push table 't3' as child, access type 'Batched-key' not implemented
292 Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t1`.`d` AS `d`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t3`.`c` AS `c`,`test`.`t3`.`d` AS `d` from `test`.`t1` join `test`.`t1` `t2` join `test`.`t1` `t3` where ((`test`.`t2`.`b` = `test`.`t1`.`c`) and (`test`.`t3`.`b` = `test`.`t1`.`c`) and (`test`.`t2`.`a` = `test`.`t1`.`b`) and (`test`.`t3`.`a` = `test`.`t1`.`b`))
293 select *
294 from t1
295 join t1 as t2 on t2.a = t1.b and t2.b = t1.c
296 join t1 as t3 on t3.a = t2.a and t3.b = t2.b;
297 a b c d a b c d a b c d
298 1 1 1 1 1 1 1 1 1 1 1 1
299 1 3 1 2 3 1 1 2 3 1 1 2
300 1 4 2 3 4 2 5 1 4 2 5 1
301 2 1 3 4 1 3 1 2 1 3 1 2
302 2 2 2 2 2 2 2 2 2 2 2 2
303 2 3 4 5 3 4 3 4 3 4 3 4
304 3 1 1 2 1 1 1 1 1 1 1 1
305 3 2 2 3 2 2 2 2 2 2 2 2
306 3 3 3 3 3 3 3 3 3 3 3 3
307 3 4 3 4 4 3 1 2 4 3 1 2
308 4 1 4 5 1 4 2 3 1 4 2 3
309 4 3 1 2 3 1 1 2 3 1 1 2
310 4 4 4 4 4 4 4 4 4 4 4 4
311 explain
312 select *
313 from t1
314 join t1 as t2 on t2.a = t1.b and t2.b = t1.c
315 left join t1 as t3 on t3.a = t2.a and t3.b = t2.b;
316 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
317 1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 16 100.00 NULL
318 1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.b,test.t1.c 1 100.00 Using join buffer (Batched Key Access)
319 1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.b,test.t1.c 1 100.00 Using join buffer (Batched Key Access)
320 Warnings:
321 Note 1003 Can't push table 't2' as child, access type 'Batched-key' not implemented
322 Note 1003 Can't push table 't3' as child, access type 'Batched-key' not implemented
323 Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t1`.`d` AS `d`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t3`.`c` AS `c`,`test`.`t3`.`d` AS `d` from `test`.`t1` join `test`.`t1` `t2` left join `test`.`t1` `t3` on(((`test`.`t3`.`b` = `test`.`t1`.`c`) and (`test`.`t3`.`a` = `test`.`t1`.`b`))) where ((`test`.`t2`.`b` = `test`.`t1`.`c`) and (`test`.`t2`.`a` = `test`.`t1`.`b`))
324 select *
325 from t1
326 join t1 as t2 on t2.a = t1.b and t2.b = t1.c
327 left join t1 as t3 on t3.a = t2.a and t3.b = t2.b;
328 a b c d a b c d a b c d
329 1 1 1 1 1 1 1 1 1 1 1 1
330 1 3 1 2 3 1 1 2 3 1 1 2
331 1 4 2 3 4 2 5 1 4 2 5 1
332 2 1 3 4 1 3 1 2 1 3 1 2
333 2 2 2 2 2 2 2 2 2 2 2 2
334 2 3 4 5 3 4 3 4 3 4 3 4
335 3 1 1 2 1 1 1 1 1 1 1 1
336 3 2 2 3 2 2 2 2 2 2 2 2
337 3 3 3 3 3 3 3 3 3 3 3 3
338 3 4 3 4 4 3 1 2 4 3 1 2
339 4 1 4 5 1 4 2 3 1 4 2 3
340 4 3 1 2 3 1 1 2 3 1 1 2
341 4 4 4 4 4 4 4 4 4 4 4 4
342 explain
343 select *
344 from t1
345 left join t1 as t2 on t2.a = t1.b and t2.b = t1.c
346 left join t1 as t3 on t3.a = t2.a and t3.b = t2.b;
347 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
348 1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 16 100.00 NULL
349 1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.b,test.t1.c 1 100.00 Using join buffer (Batched Key Access)
350 1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t2.a,test.t2.b 1 100.00 Using join buffer (Batched Key Access)
351 Warnings:
352 Note 1003 Can't push table 't2' as child, access type 'Batched-key' not implemented
353 Note 1003 Can't push table 't3' as child, access type 'Batched-key' not implemented
354 Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t1`.`d` AS `d`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t3`.`c` AS `c`,`test`.`t3`.`d` AS `d` from `test`.`t1` left join `test`.`t1` `t2` on(((`test`.`t2`.`b` = `test`.`t1`.`c`) and (`test`.`t2`.`a` = `test`.`t1`.`b`))) left join `test`.`t1` `t3` on(((`test`.`t3`.`b` = `test`.`t2`.`b`) and (`test`.`t3`.`a` = `test`.`t2`.`a`))) where true
355 select *
356 from t1
357 left join t1 as t2 on t2.a = t1.b and t2.b = t1.c
358 left join t1 as t3 on t3.a = t2.a and t3.b = t2.b;
359 a b c d a b c d a b c d
360 1 1 1 1 1 1 1 1 1 1 1 1
361 1 2 5 1 NULL NULL NULL NULL NULL NULL NULL NULL
362 1 3 1 2 3 1 1 2 3 1 1 2
363 1 4 2 3 4 2 5 1 4 2 5 1
364 2 1 3 4 1 3 1 2 1 3 1 2
365 2 2 2 2 2 2 2 2 2 2 2 2
366 2 3 4 5 3 4 3 4 3 4 3 4
367 2 4 5 1 NULL NULL NULL NULL NULL NULL NULL NULL
368 3 1 1 2 1 1 1 1 1 1 1 1
369 3 2 2 3 2 2 2 2 2 2 2 2
370 3 3 3 3 3 3 3 3 3 3 3 3
371 3 4 3 4 4 3 1 2 4 3 1 2
372 4 1 4 5 1 4 2 3 1 4 2 3
373 4 2 5 1 NULL NULL NULL NULL NULL NULL NULL NULL
374 4 3 1 2 3 1 1 2 3 1 1 2
375 4 4 4 4 4 4 4 4 4 4 4 4
376 set ndb_join_pushdown=true;
377 explain
378 select *
379 from t1
380 join t1 as t2 on t2.a = t1.c and t2.b = t1.d
381 where t1.a = 2 and t1.b = 3;
382 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
383 1 SIMPLE t1 pX eq_ref PRIMARY PRIMARY 8 const,const 1 100.00 NULL
384 1 SIMPLE t2 pXYZ eq_ref PRIMARY PRIMARY 8 test.t1.c,test.t1.d 1 100.00 Using join buffer (Batched Key Access)
385 Warnings:
386 Note 1003 Can't push table 't2' as child, access type 'Batched-key' not implemented
387 Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t1`.`d` AS `d`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d` from `test`.`t1` join `test`.`t1` `t2` where ((`test`.`t2`.`b` = `test`.`t1`.`d`) and (`test`.`t2`.`a` = `test`.`t1`.`c`) and (`test`.`t1`.`b` = 3) and (`test`.`t1`.`a` = 2))
388 select *
389 from t1
390 join t1 as t2 on t2.a = t1.c and t2.b = t1.d
391 where t1.a = 2 and t1.b = 3;
392 a b c d a b c d
393 LOCK TABLES t1 read, t1 as t2 read;
394 explain
395 select *
396 from t1
397 join t1 as t2 on t2.a = t1.c and t2.b = t1.d
398 where t1.a = 2 and t1.b = 3;
399 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
400 1 SIMPLE t1 pX eq_ref PRIMARY PRIMARY 8 const,const 1 100.00 NULL
401 1 SIMPLE t2 pXYZ eq_ref PRIMARY PRIMARY 8 test.t1.c,test.t1.d 1 100.00 Using join buffer (Batched Key Access)
402 Warnings:
403 Note 1003 Can't push table 't2' as child, access type 'Batched-key' not implemented
404 Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t1`.`d` AS `d`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d` from `test`.`t1` join `test`.`t1` `t2` where ((`test`.`t2`.`b` = `test`.`t1`.`d`) and (`test`.`t2`.`a` = `test`.`t1`.`c`) and (`test`.`t1`.`b` = 3) and (`test`.`t1`.`a` = 2))
405 select *
406 from t1
407 join t1 as t2 on t2.a = t1.c and t2.b = t1.d
408 where t1.a = 2 and t1.b = 3;
409 a b c d a b c d
410 select *
411 from t1
412 join t1 as t2 on t2.a = t1.c and t2.b = t1.d
413 where t1.a = 3 and t1.b = 3;
414 a b c d a b c d
415 3 3 3 3 3 3 3 3
416 UNLOCK TABLES;
417 explain
418 select *
419 from t1
420 left join t1 as t2 on t2.a = t1.c and t2.b = t1.d
421 where t1.a = 2 and t1.b = 3;
422 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
423 1 SIMPLE t1 pX eq_ref PRIMARY PRIMARY 8 const,const 1 100.00 NULL
424 1 SIMPLE t2 pXYZ eq_ref PRIMARY PRIMARY 8 test.t1.c,test.t1.d 1 100.00 Using join buffer (Batched Key Access)
425 Warnings:
426 Note 1003 Can't push table 't2' as child, access type 'Batched-key' not implemented
427 Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t1`.`d` AS `d`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d` from `test`.`t1` left join `test`.`t1` `t2` on(((`test`.`t2`.`b` = `test`.`t1`.`d`) and (`test`.`t2`.`a` = `test`.`t1`.`c`))) where ((`test`.`t1`.`b` = 3) and (`test`.`t1`.`a` = 2))
428 select *
429 from t1
430 left join t1 as t2 on t2.a = t1.c and t2.b = t1.d
431 where t1.a = 2 and t1.b = 3;
432 a b c d a b c d
433 2 3 4 5 NULL NULL NULL NULL
434 explain
435 select *
436 from t1
437 left join t1 as t2 on t2.a = t1.c and t2.b = t1.d
438 where t1.a = 2 and t1.b = 3
439 order by t1.c;
440 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
441 1 SIMPLE t1 pX eq_ref PRIMARY PRIMARY 8 const,const 1 100.00 Using temporary; Using filesort
442 1 SIMPLE t2 pXYZ eq_ref PRIMARY PRIMARY 8 test.t1.c,test.t1.d 1 100.00 Using join buffer (Batched Key Access)
443 Warnings:
444 Note 1003 Can't push table 't2' as child, access type 'Batched-key' not implemented
445 Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t1`.`d` AS `d`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d` from `test`.`t1` left join `test`.`t1` `t2` on(((`test`.`t2`.`b` = `test`.`t1`.`d`) and (`test`.`t2`.`a` = `test`.`t1`.`c`))) where ((`test`.`t1`.`b` = 3) and (`test`.`t1`.`a` = 2)) order by `test`.`t1`.`c`
446 select *
447 from t1
448 left join t1 as t2 on t2.a = t1.c and t2.b = t1.d
449 where t1.a = 2 and t1.b = 3
450 order by t1.c;
451 a b c d a b c d
452 2 3 4 5 NULL NULL NULL NULL
453 set ndb_join_pushdown=false;
454 explain
455 select *
456 from t1
457 join t1 as t2 on t2.a = t1.c and t2.b = t1.d
458 where t1.a = 2 and t1.b = 3;
459 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
460 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table
461 Warnings:
462 Note 1003 /* select#1 */ select '2' AS `a`,'3' AS `b`,'4' AS `c`,'5' AS `d`,NULL AS `a`,NULL AS `b`,NULL AS `c`,NULL AS `d` from `test`.`t1` join `test`.`t1` `t2` where (multiple equal(2) and multiple equal(3) and multiple equal('4', NULL) and multiple equal('5', NULL))
463 select *
464 from t1
465 join t1 as t2 on t2.a = t1.c and t2.b = t1.d
466 where t1.a = 2 and t1.b = 3;
467 a b c d a b c d
468 explain
469 select *
470 from t1
471 left join t1 as t2 on t2.a = t1.c and t2.b = t1.d
472 where t1.a = 2 and t1.b = 3;
473 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
474 1 SIMPLE t1 pX const PRIMARY PRIMARY 8 const,const 1 100.00 NULL
475 1 SIMPLE t2 pXYZ const PRIMARY PRIMARY 8 const,const 0 0.00 unique row not found
476 Warnings:
477 Note 1003 /* select#1 */ select '2' AS `a`,'3' AS `b`,'4' AS `c`,'5' AS `d`,NULL AS `a`,NULL AS `b`,NULL AS `c`,NULL AS `d` from `test`.`t1` left join `test`.`t1` `t2` on((multiple equal('4', NULL) and multiple equal('5', NULL))) where true
478 select *
479 from t1
480 left join t1 as t2 on t2.a = t1.c and t2.b = t1.d
481 where t1.a = 2 and t1.b = 3;
482 a b c d a b c d
483 2 3 4 5 NULL NULL NULL NULL
484 set ndb_join_pushdown=true;
485 explain
486 select *
487 from t1
488 join t1 as t2 on t2.a = t1.c and t2.b = t1.d
489 where t1.a = 1 and t1.b = 1;
490 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
491 1 SIMPLE t1 p7 eq_ref PRIMARY PRIMARY 8 const,const 1 100.00 NULL
492 1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.c,test.t1.d 1 100.00 Using join buffer (Batched Key Access)
493 Warnings:
494 Note 1003 Can't push table 't2' as child, access type 'Batched-key' not implemented
495 Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t1`.`d` AS `d`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d` from `test`.`t1` join `test`.`t1` `t2` where ((`test`.`t2`.`b` = `test`.`t1`.`d`) and (`test`.`t2`.`a` = `test`.`t1`.`c`) and (`test`.`t1`.`b` = 1) and (`test`.`t1`.`a` = 1))
496 select *
497 from t1
498 join t1 as t2 on t2.a = t1.c and t2.b = t1.d
499 where t1.a = 1 and t1.b = 1;
500 a b c d a b c d
501 1 1 1 1 1 1 1 1
502 explain
503 select *
504 from t1
505 left join t1 as t2 on t2.a = t1.c and t2.b = t1.d
506 where t1.a = 1 and t1.b = 1;
507 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
508 1 SIMPLE t1 p7 eq_ref PRIMARY PRIMARY 8 const,const 1 100.00 NULL
509 1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.c,test.t1.d 1 100.00 Using join buffer (Batched Key Access)
510 Warnings:
511 Note 1003 Can't push table 't2' as child, access type 'Batched-key' not implemented
512 Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t1`.`d` AS `d`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d` from `test`.`t1` left join `test`.`t1` `t2` on(((`test`.`t2`.`b` = `test`.`t1`.`d`) and (`test`.`t2`.`a` = `test`.`t1`.`c`))) where ((`test`.`t1`.`b` = 1) and (`test`.`t1`.`a` = 1))
513 select *
514 from t1
515 left join t1 as t2 on t2.a = t1.c and t2.b = t1.d
516 where t1.a = 1 and t1.b = 1;
517 a b c d a b c d
518 1 1 1 1 1 1 1 1
519 set ndb_join_pushdown=false;
520 explain
521 select *
522 from t1
523 join t1 as t2 on t2.a = t1.c and t2.b = t1.d
524 where t1.a = 1 and t1.b = 1;
525 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
526 1 SIMPLE t1 p7 const PRIMARY PRIMARY 8 const,const 1 100.00 NULL
527 1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 const PRIMARY PRIMARY 8 const,const 1 100.00 NULL
528 Warnings:
529 Note 1003 /* select#1 */ select '1' AS `a`,'1' AS `b`,'1' AS `c`,'1' AS `d`,'1' AS `a`,'1' AS `b`,'1' AS `c`,'1' AS `d` from `test`.`t1` join `test`.`t1` `t2` where true
530 select *
531 from t1
532 join t1 as t2 on t2.a = t1.c and t2.b = t1.d
533 where t1.a = 1 and t1.b = 1;
534 a b c d a b c d
535 1 1 1 1 1 1 1 1
536 explain
537 select *
538 from t1
539 left join t1 as t2 on t2.a = t1.c and t2.b = t1.d
540 where t1.a = 1 and t1.b = 1;
541 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
542 1 SIMPLE t1 p7 const PRIMARY PRIMARY 8 const,const 1 100.00 NULL
543 1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 const PRIMARY PRIMARY 8 const,const 1 100.00 NULL
544 Warnings:
545 Note 1003 /* select#1 */ select '1' AS `a`,'1' AS `b`,'1' AS `c`,'1' AS `d`,'1' AS `a`,'1' AS `b`,'1' AS `c`,'1' AS `d` from `test`.`t1` left join `test`.`t1` `t2` on((multiple equal('1', '1') and multiple equal('1', '1'))) where true
546 select *
547 from t1
548 left join t1 as t2 on t2.a = t1.c and t2.b = t1.d
549 where t1.a = 1 and t1.b = 1;
550 a b c d a b c d
551 1 1 1 1 1 1 1 1
552 set ndb_join_pushdown=true;
553 explain
554 select *
555 from t1
556 join t1 as t2 on t2.a = t1.c
557 join t1 as t3 on t3.a = t1.c and t3.b = t2.b;
558 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
559 1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 16 100.00 NULL
560 1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.t1.c 1 100.00 Using join buffer (Batched Key Access)
561 1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.c,test.t2.b 1 100.00 Using join buffer (Batched Key Access)
562 Warnings:
563 Note 1003 Can't push table 't2' as child, access type 'Batched-key' not implemented
564 Note 1003 Can't push table 't3' as child, access type 'Batched-key' not implemented
565 Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t1`.`d` AS `d`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t3`.`c` AS `c`,`test`.`t3`.`d` AS `d` from `test`.`t1` join `test`.`t1` `t2` join `test`.`t1` `t3` where ((`test`.`t3`.`b` = `test`.`t2`.`b`) and (`test`.`t2`.`a` = `test`.`t1`.`c`) and (`test`.`t3`.`a` = `test`.`t1`.`c`))
566 select *
567 from t1
568 join t1 as t2 on t2.a = t1.c
569 join t1 as t3 on t3.a = t1.c and t3.b = t2.b;
570 a b c d a b c d a b c d
571 1 1 1 1 1 1 1 1 1 1 1 1
572 1 1 1 1 1 2 5 1 1 2 5 1
573 1 1 1 1 1 3 1 2 1 3 1 2
574 1 1 1 1 1 4 2 3 1 4 2 3
575 1 3 1 2 1 1 1 1 1 1 1 1
576 1 3 1 2 1 2 5 1 1 2 5 1
577 1 3 1 2 1 3 1 2 1 3 1 2
578 1 3 1 2 1 4 2 3 1 4 2 3
579 1 4 2 3 2 1 3 4 2 1 3 4
580 1 4 2 3 2 2 2 2 2 2 2 2
581 1 4 2 3 2 3 4 5 2 3 4 5
582 1 4 2 3 2 4 5 1 2 4 5 1
583 2 1 3 4 3 1 1 2 3 1 1 2
584 2 1 3 4 3 2 2 3 3 2 2 3
585 2 1 3 4 3 3 3 3 3 3 3 3
586 2 1 3 4 3 4 3 4 3 4 3 4
587 2 2 2 2 2 1 3 4 2 1 3 4
588 2 2 2 2 2 2 2 2 2 2 2 2
589 2 2 2 2 2 3 4 5 2 3 4 5
590 2 2 2 2 2 4 5 1 2 4 5 1
591 2 3 4 5 4 1 4 5 4 1 4 5
592 2 3 4 5 4 2 5 1 4 2 5 1
593 2 3 4 5 4 3 1 2 4 3 1 2
594 2 3 4 5 4 4 4 4 4 4 4 4
595 3 1 1 2 1 1 1 1 1 1 1 1
596 3 1 1 2 1 2 5 1 1 2 5 1
597 3 1 1 2 1 3 1 2 1 3 1 2
598 3 1 1 2 1 4 2 3 1 4 2 3
599 3 2 2 3 2 1 3 4 2 1 3 4
600 3 2 2 3 2 2 2 2 2 2 2 2
601 3 2 2 3 2 3 4 5 2 3 4 5
602 3 2 2 3 2 4 5 1 2 4 5 1
603 3 3 3 3 3 1 1 2 3 1 1 2
604 3 3 3 3 3 2 2 3 3 2 2 3
605 3 3 3 3 3 3 3 3 3 3 3 3
606 3 3 3 3 3 4 3 4 3 4 3 4
607 3 4 3 4 3 1 1 2 3 1 1 2
608 3 4 3 4 3 2 2 3 3 2 2 3
609 3 4 3 4 3 3 3 3 3 3 3 3
610 3 4 3 4 3 4 3 4 3 4 3 4
611 4 1 4 5 4 1 4 5 4 1 4 5
612 4 1 4 5 4 2 5 1 4 2 5 1
613 4 1 4 5 4 3 1 2 4 3 1 2
614 4 1 4 5 4 4 4 4 4 4 4 4
615 4 3 1 2 1 1 1 1 1 1 1 1
616 4 3 1 2 1 2 5 1 1 2 5 1
617 4 3 1 2 1 3 1 2 1 3 1 2
618 4 3 1 2 1 4 2 3 1 4 2 3
619 4 4 4 4 4 1 4 5 4 1 4 5
620 4 4 4 4 4 2 5 1 4 2 5 1
621 4 4 4 4 4 3 1 2 4 3 1 2
622 4 4 4 4 4 4 4 4 4 4 4 4
623 explain
624 select straight_join *
625 from (t1 as x cross join t1 as y)
626 join t1 as z on z.a=x.a and z.b=y.b;
627 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
628 1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 ALL PRIMARY NULL NULL NULL 16 100.00 NULL
629 1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 16 100.00 Using join buffer (hash join)
630 1 SIMPLE z p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.x.a,test.y.b 1 100.00 Using join buffer (Batched Key Access)
631 Warnings:
632 Note 1003 Can't push table 'y' as child, 'type' must be a 'ref' access
633 Note 1003 Can't push table 'z' as child, access type 'Batched-key' not implemented
634 Note 1003 /* select#1 */ select straight_join `test`.`x`.`a` AS `a`,`test`.`x`.`b` AS `b`,`test`.`x`.`c` AS `c`,`test`.`x`.`d` AS `d`,`test`.`y`.`a` AS `a`,`test`.`y`.`b` AS `b`,`test`.`y`.`c` AS `c`,`test`.`y`.`d` AS `d`,`test`.`z`.`a` AS `a`,`test`.`z`.`b` AS `b`,`test`.`z`.`c` AS `c`,`test`.`z`.`d` AS `d` from `test`.`t1` `x` join `test`.`t1` `y` join `test`.`t1` `z` where ((`test`.`z`.`b` = `test`.`y`.`b`) and (`test`.`z`.`a` = `test`.`x`.`a`))
635 select straight_join *
636 from (t1 as x cross join t1 as y)
637 join t1 as z on z.a=x.a and z.b=y.b;
638 a b c d a b c d a b c d
639 1 1 1 1 1 1 1 1 1 1 1 1
640 1 1 1 1 1 2 5 1 1 2 5 1
641 1 1 1 1 1 3 1 2 1 3 1 2
642 1 1 1 1 1 4 2 3 1 4 2 3
643 1 1 1 1 2 1 3 4 1 1 1 1
644 1 1 1 1 2 2 2 2 1 2 5 1
645 1 1 1 1 2 3 4 5 1 3 1 2
646 1 1 1 1 2 4 5 1 1 4 2 3
647 1 1 1 1 3 1 1 2 1 1 1 1
648 1 1 1 1 3 2 2 3 1 2 5 1
649 1 1 1 1 3 3 3 3 1 3 1 2
650 1 1 1 1 3 4 3 4 1 4 2 3
651 1 1 1 1 4 1 4 5 1 1 1 1
652 1 1 1 1 4 2 5 1 1 2 5 1
653 1 1 1 1 4 3 1 2 1 3 1 2
654 1 1 1 1 4 4 4 4 1 4 2 3
655 1 2 5 1 1 1 1 1 1 1 1 1
656 1 2 5 1 1 2 5 1 1 2 5 1
657 1 2 5 1 1 3 1 2 1 3 1 2
658 1 2 5 1 1 4 2 3 1 4 2 3
659 1 2 5 1 2 1 3 4 1 1 1 1
660 1 2 5 1 2 2 2 2 1 2 5 1
661 1 2 5 1 2 3 4 5 1 3 1 2
662 1 2 5 1 2 4 5 1 1 4 2 3
663 1 2 5 1 3 1 1 2 1 1 1 1
664 1 2 5 1 3 2 2 3 1 2 5 1
665 1 2 5 1 3 3 3 3 1 3 1 2
666 1 2 5 1 3 4 3 4 1 4 2 3
667 1 2 5 1 4 1 4 5 1 1 1 1
668 1 2 5 1 4 2 5 1 1 2 5 1
669 1 2 5 1 4 3 1 2 1 3 1 2
670 1 2 5 1 4 4 4 4 1 4 2 3
671 1 3 1 2 1 1 1 1 1 1 1 1
672 1 3 1 2 1 2 5 1 1 2 5 1
673 1 3 1 2 1 3 1 2 1 3 1 2
674 1 3 1 2 1 4 2 3 1 4 2 3
675 1 3 1 2 2 1 3 4 1 1 1 1
676 1 3 1 2 2 2 2 2 1 2 5 1
677 1 3 1 2 2 3 4 5 1 3 1 2
678 1 3 1 2 2 4 5 1 1 4 2 3
679 1 3 1 2 3 1 1 2 1 1 1 1
680 1 3 1 2 3 2 2 3 1 2 5 1
681 1 3 1 2 3 3 3 3 1 3 1 2
682 1 3 1 2 3 4 3 4 1 4 2 3
683 1 3 1 2 4 1 4 5 1 1 1 1
684 1 3 1 2 4 2 5 1 1 2 5 1
685 1 3 1 2 4 3 1 2 1 3 1 2
686 1 3 1 2 4 4 4 4 1 4 2 3
687 1 4 2 3 1 1 1 1 1 1 1 1
688 1 4 2 3 1 2 5 1 1 2 5 1
689 1 4 2 3 1 3 1 2 1 3 1 2
690 1 4 2 3 1 4 2 3 1 4 2 3
691 1 4 2 3 2 1 3 4 1 1 1 1
692 1 4 2 3 2 2 2 2 1 2 5 1
693 1 4 2 3 2 3 4 5 1 3 1 2
694 1 4 2 3 2 4 5 1 1 4 2 3
695 1 4 2 3 3 1 1 2 1 1 1 1
696 1 4 2 3 3 2 2 3 1 2 5 1
697 1 4 2 3 3 3 3 3 1 3 1 2
698 1 4 2 3 3 4 3 4 1 4 2 3
699 1 4 2 3 4 1 4 5 1 1 1 1
700 1 4 2 3 4 2 5 1 1 2 5 1
701 1 4 2 3 4 3 1 2 1 3 1 2
702 1 4 2 3 4 4 4 4 1 4 2 3
703 2 1 3 4 1 1 1 1 2 1 3 4
704 2 1 3 4 1 2 5 1 2 2 2 2
705 2 1 3 4 1 3 1 2 2 3 4 5
706 2 1 3 4 1 4 2 3 2 4 5 1
707 2 1 3 4 2 1 3 4 2 1 3 4
708 2 1 3 4 2 2 2 2 2 2 2 2
709 2 1 3 4 2 3 4 5 2 3 4 5
710 2 1 3 4 2 4 5 1 2 4 5 1
711 2 1 3 4 3 1 1 2 2 1 3 4
712 2 1 3 4 3 2 2 3 2 2 2 2
713 2 1 3 4 3 3 3 3 2 3 4 5
714 2 1 3 4 3 4 3 4 2 4 5 1
715 2 1 3 4 4 1 4 5 2 1 3 4
716 2 1 3 4 4 2 5 1 2 2 2 2
717 2 1 3 4 4 3 1 2 2 3 4 5
718 2 1 3 4 4 4 4 4 2 4 5 1
719 2 2 2 2 1 1 1 1 2 1 3 4
720 2 2 2 2 1 2 5 1 2 2 2 2
721 2 2 2 2 1 3 1 2 2 3 4 5
722 2 2 2 2 1 4 2 3 2 4 5 1
723 2 2 2 2 2 1 3 4 2 1 3 4
724 2 2 2 2 2 2 2 2 2 2 2 2
725 2 2 2 2 2 3 4 5 2 3 4 5
726 2 2 2 2 2 4 5 1 2 4 5 1
727 2 2 2 2 3 1 1 2 2 1 3 4
728 2 2 2 2 3 2 2 3 2 2 2 2
729 2 2 2 2 3 3 3 3 2 3 4 5
730 2 2 2 2 3 4 3 4 2 4 5 1
731 2 2 2 2 4 1 4 5 2 1 3 4
732 2 2 2 2 4 2 5 1 2 2 2 2
733 2 2 2 2 4 3 1 2 2 3 4 5
734 2 2 2 2 4 4 4 4 2 4 5 1
735 2 3 4 5 1 1 1 1 2 1 3 4
736 2 3 4 5 1 2 5 1 2 2 2 2
737 2 3 4 5 1 3 1 2 2 3 4 5
738 2 3 4 5 1 4 2 3 2 4 5 1
739 2 3 4 5 2 1 3 4 2 1 3 4
740 2 3 4 5 2 2 2 2 2 2 2 2
741 2 3 4 5 2 3 4 5 2 3 4 5
742 2 3 4 5 2 4 5 1 2 4 5 1
743 2 3 4 5 3 1 1 2 2 1 3 4
744 2 3 4 5 3 2 2 3 2 2 2 2
745 2 3 4 5 3 3 3 3 2 3 4 5
746 2 3 4 5 3 4 3 4 2 4 5 1
747 2 3 4 5 4 1 4 5 2 1 3 4
748 2 3 4 5 4 2 5 1 2 2 2 2
749 2 3 4 5 4 3 1 2 2 3 4 5
750 2 3 4 5 4 4 4 4 2 4 5 1
751 2 4 5 1 1 1 1 1 2 1 3 4
752 2 4 5 1 1 2 5 1 2 2 2 2
753 2 4 5 1 1 3 1 2 2 3 4 5
754 2 4 5 1 1 4 2 3 2 4 5 1
755 2 4 5 1 2 1 3 4 2 1 3 4
756 2 4 5 1 2 2 2 2 2 2 2 2
757 2 4 5 1 2 3 4 5 2 3 4 5
758 2 4 5 1 2 4 5 1 2 4 5 1
759 2 4 5 1 3 1 1 2 2 1 3 4
760 2 4 5 1 3 2 2 3 2 2 2 2
761 2 4 5 1 3 3 3 3 2 3 4 5
762 2 4 5 1 3 4 3 4 2 4 5 1
763 2 4 5 1 4 1 4 5 2 1 3 4
764 2 4 5 1 4 2 5 1 2 2 2 2
765 2 4 5 1 4 3 1 2 2 3 4 5
766 2 4 5 1 4 4 4 4 2 4 5 1
767 3 1 1 2 1 1 1 1 3 1 1 2
768 3 1 1 2 1 2 5 1 3 2 2 3
769 3 1 1 2 1 3 1 2 3 3 3 3
770 3 1 1 2 1 4 2 3 3 4 3 4
771 3 1 1 2 2 1 3 4 3 1 1 2
772 3 1 1 2 2 2 2 2 3 2 2 3
773 3 1 1 2 2 3 4 5 3 3 3 3
774 3 1 1 2 2 4 5 1 3 4 3 4
775 3 1 1 2 3 1 1 2 3 1 1 2
776 3 1 1 2 3 2 2 3 3 2 2 3
777 3 1 1 2 3 3 3 3 3 3 3 3
778 3 1 1 2 3 4 3 4 3 4 3 4
779 3 1 1 2 4 1 4 5 3 1 1 2
780 3 1 1 2 4 2 5 1 3 2 2 3
781 3 1 1 2 4 3 1 2 3 3 3 3
782 3 1 1 2 4 4 4 4 3 4 3 4
783 3 2 2 3 1 1 1 1 3 1 1 2
784 3 2 2 3 1 2 5 1 3 2 2 3
785 3 2 2 3 1 3 1 2 3 3 3 3
786 3 2 2 3 1 4 2 3 3 4 3 4
787 3 2 2 3 2 1 3 4 3 1 1 2
788 3 2 2 3 2 2 2 2 3 2 2 3
789 3 2 2 3 2 3 4 5 3 3 3 3
790 3 2 2 3 2 4 5 1 3 4 3 4
791 3 2 2 3 3 1 1 2 3 1 1 2
792 3 2 2 3 3 2 2 3 3 2 2 3
793 3 2 2 3 3 3 3 3 3 3 3 3
794 3 2 2 3 3 4 3 4 3 4 3 4
795 3 2 2 3 4 1 4 5 3 1 1 2
796 3 2 2 3 4 2 5 1 3 2 2 3
797 3 2 2 3 4 3 1 2 3 3 3 3
798 3 2 2 3 4 4 4 4 3 4 3 4
799 3 3 3 3 1 1 1 1 3 1 1 2
800 3 3 3 3 1 2 5 1 3 2 2 3
801 3 3 3 3 1 3 1 2 3 3 3 3
802 3 3 3 3 1 4 2 3 3 4 3 4
803 3 3 3 3 2 1 3 4 3 1 1 2
804 3 3 3 3 2 2 2 2 3 2 2 3
805 3 3 3 3 2 3 4 5 3 3 3 3
806 3 3 3 3 2 4 5 1 3 4 3 4
807 3 3 3 3 3 1 1 2 3 1 1 2
808 3 3 3 3 3 2 2 3 3 2 2 3
809 3 3 3 3 3 3 3 3 3 3 3 3
810 3 3 3 3 3 4 3 4 3 4 3 4
811 3 3 3 3 4 1 4 5 3 1 1 2
812 3 3 3 3 4 2 5 1 3 2 2 3
813 3 3 3 3 4 3 1 2 3 3 3 3
814 3 3 3 3 4 4 4 4 3 4 3 4
815 3 4 3 4 1 1 1 1 3 1 1 2
816 3 4 3 4 1 2 5 1 3 2 2 3
817 3 4 3 4 1 3 1 2 3 3 3 3
818 3 4 3 4 1 4 2 3 3 4 3 4
819 3 4 3 4 2 1 3 4 3 1 1 2
820 3 4 3 4 2 2 2 2 3 2 2 3
821 3 4 3 4 2 3 4 5 3 3 3 3
822 3 4 3 4 2 4 5 1 3 4 3 4
823 3 4 3 4 3 1 1 2 3 1 1 2
824 3 4 3 4 3 2 2 3 3 2 2 3
825 3 4 3 4 3 3 3 3 3 3 3 3
826 3 4 3 4 3 4 3 4 3 4 3 4
827 3 4 3 4 4 1 4 5 3 1 1 2
828 3 4 3 4 4 2 5 1 3 2 2 3
829 3 4 3 4 4 3 1 2 3 3 3 3
830 3 4 3 4 4 4 4 4 3 4 3 4
831 4 1 4 5 1 1 1 1 4 1 4 5
832 4 1 4 5 1 2 5 1 4 2 5 1
833 4 1 4 5 1 3 1 2 4 3 1 2
834 4 1 4 5 1 4 2 3 4 4 4 4
835 4 1 4 5 2 1 3 4 4 1 4 5
836 4 1 4 5 2 2 2 2 4 2 5 1
837 4 1 4 5 2 3 4 5 4 3 1 2
838 4 1 4 5 2 4 5 1 4 4 4 4
839 4 1 4 5 3 1 1 2 4 1 4 5
840 4 1 4 5 3 2 2 3 4 2 5 1
841 4 1 4 5 3 3 3 3 4 3 1 2
842 4 1 4 5 3 4 3 4 4 4 4 4
843 4 1 4 5 4 1 4 5 4 1 4 5
844 4 1 4 5 4 2 5 1 4 2 5 1
845 4 1 4 5 4 3 1 2 4 3 1 2
846 4 1 4 5 4 4 4 4 4 4 4 4
847 4 2 5 1 1 1 1 1 4 1 4 5
848 4 2 5 1 1 2 5 1 4 2 5 1
849 4 2 5 1 1 3 1 2 4 3 1 2
850 4 2 5 1 1 4 2 3 4 4 4 4
851 4 2 5 1 2 1 3 4 4 1 4 5
852 4 2 5 1 2 2 2 2 4 2 5 1
853 4 2 5 1 2 3 4 5 4 3 1 2
854 4 2 5 1 2 4 5 1 4 4 4 4
855 4 2 5 1 3 1 1 2 4 1 4 5
856 4 2 5 1 3 2 2 3 4 2 5 1
857 4 2 5 1 3 3 3 3 4 3 1 2
858 4 2 5 1 3 4 3 4 4 4 4 4
859 4 2 5 1 4 1 4 5 4 1 4 5
860 4 2 5 1 4 2 5 1 4 2 5 1
861 4 2 5 1 4 3 1 2 4 3 1 2
862 4 2 5 1 4 4 4 4 4 4 4 4
863 4 3 1 2 1 1 1 1 4 1 4 5
864 4 3 1 2 1 2 5 1 4 2 5 1
865 4 3 1 2 1 3 1 2 4 3 1 2
866 4 3 1 2 1 4 2 3 4 4 4 4
867 4 3 1 2 2 1 3 4 4 1 4 5
868 4 3 1 2 2 2 2 2 4 2 5 1
869 4 3 1 2 2 3 4 5 4 3 1 2
870 4 3 1 2 2 4 5 1 4 4 4 4
871 4 3 1 2 3 1 1 2 4 1 4 5
872 4 3 1 2 3 2 2 3 4 2 5 1
873 4 3 1 2 3 3 3 3 4 3 1 2
874 4 3 1 2 3 4 3 4 4 4 4 4
875 4 3 1 2 4 1 4 5 4 1 4 5
876 4 3 1 2 4 2 5 1 4 2 5 1
877 4 3 1 2 4 3 1 2 4 3 1 2
878 4 3 1 2 4 4 4 4 4 4 4 4
879 4 4 4 4 1 1 1 1 4 1 4 5
880 4 4 4 4 1 2 5 1 4 2 5 1
881 4 4 4 4 1 3 1 2 4 3 1 2
882 4 4 4 4 1 4 2 3 4 4 4 4
883 4 4 4 4 2 1 3 4 4 1 4 5
884 4 4 4 4 2 2 2 2 4 2 5 1
885 4 4 4 4 2 3 4 5 4 3 1 2
886 4 4 4 4 2 4 5 1 4 4 4 4
887 4 4 4 4 3 1 1 2 4 1 4 5
888 4 4 4 4 3 2 2 3 4 2 5 1
889 4 4 4 4 3 3 3 3 4 3 1 2
890 4 4 4 4 3 4 3 4 4 4 4 4
891 4 4 4 4 4 1 4 5 4 1 4 5
892 4 4 4 4 4 2 5 1 4 2 5 1
893 4 4 4 4 4 3 1 2 4 3 1 2
894 4 4 4 4 4 4 4 4 4 4 4 4
895 explain
896 select *
897 from t1
898 straight_join t1 as t2 on t2.a = t1.b+0 and t2.b = t1.c
899 straight_join t1 as t3 on t3.a = t1.b and t3.b = t2.b;
900 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
901 1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 16 100.00 NULL
902 1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 func,test.t1.c 1 100.00 Using where; Using join buffer (Batched Key Access)
903 1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.b,test.t1.c 1 100.00 Using join buffer (Batched Key Access)
904 Warnings:
905 Note 1003 Can't push table 't2' as child, access type 'Batched-key' not implemented
906 Note 1003 Can't push table 't3' as child, access type 'Batched-key' not implemented
907 Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t1`.`d` AS `d`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t3`.`c` AS `c`,`test`.`t3`.`d` AS `d` from `test`.`t1` straight_join `test`.`t1` `t2` straight_join `test`.`t1` `t3` where ((`test`.`t2`.`b` = `test`.`t1`.`c`) and (`test`.`t3`.`b` = `test`.`t1`.`c`) and (`test`.`t3`.`a` = `test`.`t1`.`b`) and (`test`.`t2`.`a` = (`test`.`t1`.`b` + 0)))
908 select *
909 from t1
910 straight_join t1 as t2 on t2.a = t1.b+0 and t2.b = t1.c
911 straight_join t1 as t3 on t3.a = t1.b and t3.b = t2.b;
912 a b c d a b c d a b c d
913 1 1 1 1 1 1 1 1 1 1 1 1
914 1 3 1 2 3 1 1 2 3 1 1 2
915 1 4 2 3 4 2 5 1 4 2 5 1
916 2 1 3 4 1 3 1 2 1 3 1 2
917 2 2 2 2 2 2 2 2 2 2 2 2
918 2 3 4 5 3 4 3 4 3 4 3 4
919 3 1 1 2 1 1 1 1 1 1 1 1
920 3 2 2 3 2 2 2 2 2 2 2 2
921 3 3 3 3 3 3 3 3 3 3 3 3
922 3 4 3 4 4 3 1 2 4 3 1 2
923 4 1 4 5 1 4 2 3 1 4 2 3
924 4 3 1 2 3 1 1 2 3 1 1 2
925 4 4 4 4 4 4 4 4 4 4 4 4
926 explain
927 select *
928 from t1
929 straight_join t1 as t2 on t2.a = t1.b+0 and t2.b = t1.c
930 straight_join t1 as t3 on t3.a = t1.b and t3.b = t2.b
931 where t1.a=1 and t1.d=1;
932 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
933 1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 const # # Using pushed condition (`test`.`t1`.`d` = 1)
934 1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 func,test.t1.c # # Using where; Using join buffer (Batched Key Access)
935 1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.b,test.t1.c # # Using join buffer (Batched Key Access)
936 Warnings:
937 Note 1003 Can't push table 't2' as child, access type 'Batched-key' not implemented
938 Note 1003 Can't push table 't3' as child, access type 'Batched-key' not implemented
939 Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t1`.`d` AS `d`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t3`.`c` AS `c`,`test`.`t3`.`d` AS `d` from `test`.`t1` straight_join `test`.`t1` `t2` straight_join `test`.`t1` `t3` where ((`test`.`t2`.`b` = `test`.`t1`.`c`) and (`test`.`t3`.`b` = `test`.`t1`.`c`) and (`test`.`t3`.`a` = `test`.`t1`.`b`) and (`test`.`t1`.`d` = 1) and (`test`.`t1`.`a` = 1) and (`test`.`t2`.`a` = (`test`.`t1`.`b` + 0)))
940 select *
941 from t1
942 straight_join t1 as t2 on t2.a = t1.b+0 and t2.b = t1.c
943 straight_join t1 as t3 on t3.a = t1.b and t3.b = t2.b
944 where t1.a=1 and t1.d=1;
945 a b c d a b c d a b c d
946 1 1 1 1 1 1 1 1 1 1 1 1
947 explain
948 select *
949 from t1
950 straight_join t1 as t2 on t2.a = t1.b+0
951 straight_join t1 as t3 on t3.a = t1.b and t3.b = t2.b;
952 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
953 1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 16 100.00 NULL
954 1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 func 1 100.00 Using where; Using join buffer (Batched Key Access)
955 1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.b,test.t2.b 1 100.00 Using join buffer (Batched Key Access)
956 Warnings:
957 Note 1003 Can't push table 't2' as child, access type 'Batched-key' not implemented
958 Note 1003 Can't push table 't3' as child, access type 'Batched-key' not implemented
959 Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t1`.`d` AS `d`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t3`.`c` AS `c`,`test`.`t3`.`d` AS `d` from `test`.`t1` straight_join `test`.`t1` `t2` straight_join `test`.`t1` `t3` where ((`test`.`t3`.`b` = `test`.`t2`.`b`) and (`test`.`t3`.`a` = `test`.`t1`.`b`) and (`test`.`t2`.`a` = (`test`.`t1`.`b` + 0)))
960 select *
961 from t1
962 straight_join t1 as t2 on t2.a = t1.b+0
963 straight_join t1 as t3 on t3.a = t1.b and t3.b = t2.b;
964 a b c d a b c d a b c d
965 1 1 1 1 1 1 1 1 1 1 1 1
966 1 1 1 1 1 2 5 1 1 2 5 1
967 1 1 1 1 1 3 1 2 1 3 1 2
968 1 1 1 1 1 4 2 3 1 4 2 3
969 1 2 5 1 2 1 3 4 2 1 3 4
970 1 2 5 1 2 2 2 2 2 2 2 2
971 1 2 5 1 2 3 4 5 2 3 4 5
972 1 2 5 1 2 4 5 1 2 4 5 1
973 1 3 1 2 3 1 1 2 3 1 1 2
974 1 3 1 2 3 2 2 3 3 2 2 3
975 1 3 1 2 3 3 3 3 3 3 3 3
976 1 3 1 2 3 4 3 4 3 4 3 4
977 1 4 2 3 4 1 4 5 4 1 4 5
978 1 4 2 3 4 2 5 1 4 2 5 1
979 1 4 2 3 4 3 1 2 4 3 1 2
980 1 4 2 3 4 4 4 4 4 4 4 4
981 2 1 3 4 1 1 1 1 1 1 1 1
982 2 1 3 4 1 2 5 1 1 2 5 1
983 2 1 3 4 1 3 1 2 1 3 1 2
984 2 1 3 4 1 4 2 3 1 4 2 3
985 2 2 2 2 2 1 3 4 2 1 3 4
986 2 2 2 2 2 2 2 2 2 2 2 2
987 2 2 2 2 2 3 4 5 2 3 4 5
988 2 2 2 2 2 4 5 1 2 4 5 1
989 2 3 4 5 3 1 1 2 3 1 1 2
990 2 3 4 5 3 2 2 3 3 2 2 3
991 2 3 4 5 3 3 3 3 3 3 3 3
992 2 3 4 5 3 4 3 4 3 4 3 4
993 2 4 5 1 4 1 4 5 4 1 4 5
994 2 4 5 1 4 2 5 1 4 2 5 1
995 2 4 5 1 4 3 1 2 4 3 1 2
996 2 4 5 1 4 4 4 4 4 4 4 4
997 3 1 1 2 1 1 1 1 1 1 1 1
998 3 1 1 2 1 2 5 1 1 2 5 1
999 3 1 1 2 1 3 1 2 1 3 1 2
1000 3 1 1 2 1 4 2 3 1 4 2 3
1001 3 2 2 3 2 1 3 4 2 1 3 4
1002 3 2 2 3 2 2 2 2 2 2 2 2
1003 3 2 2 3 2 3 4 5 2 3 4 5
1004 3 2 2 3 2 4 5 1 2 4 5 1
1005 3 3 3 3 3 1 1 2 3 1 1 2
1006 3 3 3 3 3 2 2 3 3 2 2 3
1007 3 3 3 3 3 3 3 3 3 3 3 3
1008 3 3 3 3 3 4 3 4 3 4 3 4
1009 3 4 3 4 4 1 4 5 4 1 4 5
1010 3 4 3 4 4 2 5 1 4 2 5 1
1011 3 4 3 4 4 3 1 2 4 3 1 2
1012 3 4 3 4 4 4 4 4 4 4 4 4
1013 4 1 4 5 1 1 1 1 1 1 1 1
1014 4 1 4 5 1 2 5 1 1 2 5 1
1015 4 1 4 5 1 3 1 2 1 3 1 2
1016 4 1 4 5 1 4 2 3 1 4 2 3
1017 4 2 5 1 2 1 3 4 2 1 3 4
1018 4 2 5 1 2 2 2 2 2 2 2 2
1019 4 2 5 1 2 3 4 5 2 3 4 5
1020 4 2 5 1 2 4 5 1 2 4 5 1
1021 4 3 1 2 3 1 1 2 3 1 1 2
1022 4 3 1 2 3 2 2 3 3 2 2 3
1023 4 3 1 2 3 3 3 3 3 3 3 3
1024 4 3 1 2 3 4 3 4 3 4 3 4
1025 4 4 4 4 4 1 4 5 4 1 4 5
1026 4 4 4 4 4 2 5 1 4 2 5 1
1027 4 4 4 4 4 3 1 2 4 3 1 2
1028 4 4 4 4 4 4 4 4 4 4 4 4
1029 create table t1_myisam (
1030 a int not null,
1031 b int not null,
1032 c int not null,
1033 d int not null,
1034 primary key (`a`,`b`)
1035 ) engine=myisam;
1036 insert into t1_myisam values
1037 (1,1,1,1), (2,2,1,1), (3,3,1,1), (4,4,1,1);
1038 set ndb_join_pushdown=true;
1039 explain
1040 select *
1041 from t1_myisam as t1
1042 join t1 as t2 on t2.a = t1.c and t2.b = t1.d
1043 join t1 as t3 on t3.a = t2.a and t3.b = t2.b
1044 where t1.a=2 and t1.b=2;
1045 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
1046 1 SIMPLE t1 NULL const PRIMARY PRIMARY 8 const,const 1 100.00 NULL
1047 1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 const,const 1 100.00 NULL
1048 1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t2.a,test.t2.b 1 100.00 Using pushed condition ((`test`.`t3`.`b` = '1') and (`test`.`t3`.`a` = '1')); Using join buffer (Batched Key Access)
1049 Warnings:
1050 Note 1003 Can't push table 't3' as child, access type 'Batched-key' not implemented
1051 Note 1003 /* select#1 */ select '2' AS `a`,'2' AS `b`,'1' AS `c`,'1' AS `d`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t3`.`c` AS `c`,`test`.`t3`.`d` AS `d` from `test`.`t1_myisam` `t1` join `test`.`t1` `t2` join `test`.`t1` `t3` where ((`test`.`t2`.`b` = '1') and (`test`.`t3`.`b` = '1') and (`test`.`t2`.`a` = '1') and (`test`.`t3`.`a` = '1'))
1052 select *
1053 from t1_myisam as t1
1054 join t1 as t2 on t2.a = t1.c and t2.b = t1.d
1055 join t1 as t3 on t3.a = t2.a and t3.b = t2.b
1056 where t1.a=2 and t1.b=2;
1057 a b c d a b c d a b c d
1058 2 2 1 1 1 1 1 1 1 1 1 1
1059 explain
1060 select *
1061 from t1_myisam as t1
1062 join t1 as t2 on t2.a = t1.c
1063 join t1 as t3 on t3.a = t2.b and t3.b = t1.b;
1064 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
1065 1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 4 100.00 NULL
1066 1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.t1.c 1 100.00 Using join buffer (Batched Key Access)
1067 1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t2.b,test.t1.b 1 100.00 Using join buffer (Batched Key Access)
1068 Warnings:
1069 Note 1003 Can't push table 't3' as child, access type 'Batched-key' not implemented
1070 Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t1`.`d` AS `d`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t3`.`c` AS `c`,`test`.`t3`.`d` AS `d` from `test`.`t1_myisam` `t1` join `test`.`t1` `t2` join `test`.`t1` `t3` where ((`test`.`t2`.`a` = `test`.`t1`.`c`) and (`test`.`t3`.`b` = `test`.`t1`.`b`) and (`test`.`t3`.`a` = `test`.`t2`.`b`))
1071 select *
1072 from t1_myisam as t1
1073 join t1 as t2 on t2.a = t1.c
1074 join t1 as t3 on t3.a = t2.b and t3.b = t1.b;
1075 a b c d a b c d a b c d
1076 1 1 1 1 1 1 1 1 1 1 1 1
1077 1 1 1 1 1 2 5 1 2 1 3 4
1078 1 1 1 1 1 3 1 2 3 1 1 2
1079 1 1 1 1 1 4 2 3 4 1 4 5
1080 2 2 1 1 1 1 1 1 1 2 5 1
1081 2 2 1 1 1 2 5 1 2 2 2 2
1082 2 2 1 1 1 3 1 2 3 2 2 3
1083 2 2 1 1 1 4 2 3 4 2 5 1
1084 3 3 1 1 1 1 1 1 1 3 1 2
1085 3 3 1 1 1 2 5 1 2 3 4 5
1086 3 3 1 1 1 3 1 2 3 3 3 3
1087 3 3 1 1 1 4 2 3 4 3 1 2
1088 4 4 1 1 1 1 1 1 1 4 2 3
1089 4 4 1 1 1 2 5 1 2 4 5 1
1090 4 4 1 1 1 3 1 2 3 4 3 4
1091 4 4 1 1 1 4 2 3 4 4 4 4
1092 drop table t1_myisam;
1093 set ndb_join_pushdown=true;
1094 explain select *
1095 from t1
1096 join t1 as t2 on t2.a = t1.c and t2.b = t1.d
1097 where t1.d = 3;
1098 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
1099 1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL # # Using pushed condition (`test`.`t1`.`d` = 3)
1100 1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.c,const # # Using join buffer (Batched Key Access)
1101 Warnings:
1102 Note 1003 Can't push table 't2' as child, access type 'Batched-key' not implemented
1103 Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t1`.`d` AS `d`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d` from `test`.`t1` join `test`.`t1` `t2` where ((`test`.`t2`.`a` = `test`.`t1`.`c`) and (`test`.`t1`.`d` = 3) and (`test`.`t2`.`b` = 3))
1104 select *
1105 from t1
1106 join t1 as t2 on t2.a = t1.c and t2.b = t1.d
1107 where t1.d = 3;
1108 a b c d a b c d
1109 1 4 2 3 2 3 4 5
1110 3 2 2 3 2 3 4 5
1111 3 3 3 3 3 3 3 3
1112 explain select *
1113 from t1
1114 join t1 as t2 on t2.a = t1.c and t2.b = t1.d
1115 where t1.a > 2 and t1.d = 3;
1116 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
1117 1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 range PRIMARY PRIMARY 4 NULL # # Using pushed condition ((`test`.`t1`.`d` = 3) and (`test`.`t1`.`a` > 2)); Using MRR
1118 1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.c,const # # Using join buffer (Batched Key Access)
1119 Warnings:
1120 Note 1003 Can't push table 't2' as child, access type 'Batched-key' not implemented
1121 Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t1`.`d` AS `d`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d` from `test`.`t1` join `test`.`t1` `t2` where ((`test`.`t2`.`a` = `test`.`t1`.`c`) and (`test`.`t1`.`d` = 3) and (`test`.`t2`.`b` = 3) and (`test`.`t1`.`a` > 2))
1122 select *
1123 from t1
1124 join t1 as t2 on t2.a = t1.c and t2.b = t1.d
1125 where t1.a > 2 and t1.d = 3;
1126 a b c d a b c d
1127 3 2 2 3 2 3 4 5
1128 3 3 3 3 3 3 3 3
1129 explain select *
1130 from t1 join t1 as t2 on t2.a = t1.c and t2.b = t1.d
1131 where t1.d = 3
1132 order by t1.a;
1133 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
1134 1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL # # Using pushed condition (`test`.`t1`.`d` = 3); Using temporary; Using filesort
1135 1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.c,const # # Using join buffer (Batched Key Access)
1136 Warnings:
1137 Note 1003 Can't push table 't2' as child, access type 'Batched-key' not implemented
1138 Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t1`.`d` AS `d`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d` from `test`.`t1` join `test`.`t1` `t2` where ((`test`.`t2`.`a` = `test`.`t1`.`c`) and (`test`.`t1`.`d` = 3) and (`test`.`t2`.`b` = 3)) order by `test`.`t1`.`a`
1139 select *
1140 from t1 join t1 as t2 on t2.a = t1.c and t2.b = t1.d
1141 where t1.d = 3
1142 order by t1.a;
1143 a b c d a b c d
1144 1 4 2 3 2 3 4 5
1145 3 2 2 3 2 3 4 5
1146 3 3 3 3 3 3 3 3
1147 set ndb_join_pushdown=true;
1148 explain
1149 select *
1150 from t1
1151 join t1 as t2 on t2.a = t1.c
1152 join t1 as t3 on t3.a = t2.c and t3.b = t2.d
1153 where t1.a = 1 and t1.b = 1;
1154 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
1155 1 SIMPLE t1 p7 eq_ref PRIMARY PRIMARY 8 const,const 1 100.00 NULL
1156 1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.t1.c 1 100.00 Using join buffer (Batched Key Access)
1157 1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t2.c,test.t2.d 1 100.00 Using join buffer (Batched Key Access)
1158 Warnings:
1159 Note 1003 Can't push table 't2' as child, access type 'Batched-key' not implemented
1160 Note 1003 Can't push table 't3' as child, access type 'Batched-key' not implemented
1161 Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t1`.`d` AS `d`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t3`.`c` AS `c`,`test`.`t3`.`d` AS `d` from `test`.`t1` join `test`.`t1` `t2` join `test`.`t1` `t3` where ((`test`.`t2`.`a` = `test`.`t1`.`c`) and (`test`.`t3`.`b` = `test`.`t2`.`d`) and (`test`.`t3`.`a` = `test`.`t2`.`c`) and (`test`.`t1`.`b` = 1) and (`test`.`t1`.`a` = 1))
1162 select *
1163 from t1
1164 join t1 as t2 on t2.a = t1.c
1165 join t1 as t3 on t3.a = t2.c and t3.b = t2.d
1166 where t1.a = 1 and t1.b = 1;
1167 a b c d a b c d a b c d
1168 1 1 1 1 1 1 1 1 1 1 1 1
1169 1 1 1 1 1 3 1 2 1 2 5 1
1170 1 1 1 1 1 4 2 3 2 3 4 5
1171 explain
1172 select *
1173 from t1
1174 left join t1 as t2 on t2.a = t1.c
1175 left join t1 as t3 on t3.a = t2.c and t3.b = t2.d
1176 where t1.a = 1 and t1.b = 1;
1177 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
1178 1 SIMPLE t1 p7 eq_ref PRIMARY PRIMARY 8 const,const 1 100.00 NULL
1179 1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.t1.c 1 100.00 Using join buffer (Batched Key Access)
1180 1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t2.c,test.t2.d 1 100.00 Using join buffer (Batched Key Access)
1181 Warnings:
1182 Note 1003 Can't push table 't2' as child, access type 'Batched-key' not implemented
1183 Note 1003 Can't push table 't3' as child, access type 'Batched-key' not implemented
1184 Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t1`.`d` AS `d`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t3`.`c` AS `c`,`test`.`t3`.`d` AS `d` from `test`.`t1` left join `test`.`t1` `t2` on((`test`.`t2`.`a` = `test`.`t1`.`c`)) left join `test`.`t1` `t3` on(((`test`.`t3`.`b` = `test`.`t2`.`d`) and (`test`.`t3`.`a` = `test`.`t2`.`c`))) where ((`test`.`t1`.`b` = 1) and (`test`.`t1`.`a` = 1))
1185 select *
1186 from t1
1187 left join t1 as t2 on t2.a = t1.c
1188 left join t1 as t3 on t3.a = t2.c and t3.b = t2.d
1189 where t1.a = 1 and t1.b = 1;
1190 a b c d a b c d a b c d
1191 1 1 1 1 1 1 1 1 1 1 1 1
1192 1 1 1 1 1 2 5 1 NULL NULL NULL NULL
1193 1 1 1 1 1 3 1 2 1 2 5 1
1194 1 1 1 1 1 4 2 3 2 3 4 5
1195 set ndb_join_pushdown=false;
1196 explain
1197 select *
1198 from t1
1199 join t1 as t2 on t2.a = t1.c
1200 join t1 as t3 on t3.a = t2.c and t3.b = t2.d
1201 where t1.a = 1 and t1.b = 1;
1202 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
1203 1 SIMPLE t1 p7 const PRIMARY PRIMARY 8 const,const 1 100.00 NULL
1204 1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 const 3 100.00 NULL
1205 1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t2.c,test.t2.d 1 100.00 Using join buffer (Batched Key Access)
1206 Warnings:
1207 Note 1003 /* select#1 */ select '1' AS `a`,'1' AS `b`,'1' AS `c`,'1' AS `d`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t3`.`c` AS `c`,`test`.`t3`.`d` AS `d` from `test`.`t1` join `test`.`t1` `t2` join `test`.`t1` `t3` where ((`test`.`t2`.`a` = '1') and (`test`.`t3`.`b` = `test`.`t2`.`d`) and (`test`.`t3`.`a` = `test`.`t2`.`c`))
1208 select *
1209 from t1
1210 join t1 as t2 on t2.a = t1.c
1211 join t1 as t3 on t3.a = t2.c and t3.b = t2.d
1212 where t1.a = 1 and t1.b = 1;
1213 a b c d a b c d a b c d
1214 1 1 1 1 1 1 1 1 1 1 1 1
1215 1 1 1 1 1 3 1 2 1 2 5 1
1216 1 1 1 1 1 4 2 3 2 3 4 5
1217 explain
1218 select *
1219 from t1
1220 left join t1 as t2 on t2.a = t1.c
1221 left join t1 as t3 on t3.a = t2.c and t3.b = t2.d
1222 where t1.a = 1 and t1.b = 1;
1223 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
1224 1 SIMPLE t1 p7 const PRIMARY PRIMARY 8 const,const 1 100.00 NULL
1225 1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 const 3 100.00 NULL
1226 1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t2.c,test.t2.d 1 100.00 Using join buffer (Batched Key Access)
1227 Warnings:
1228 Note 1003 /* select#1 */ select '1' AS `a`,'1' AS `b`,'1' AS `c`,'1' AS `d`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t3`.`c` AS `c`,`test`.`t3`.`d` AS `d` from `test`.`t1` left join `test`.`t1` `t2` on((`test`.`t2`.`a` = '1')) left join `test`.`t1` `t3` on(((`test`.`t3`.`b` = `test`.`t2`.`d`) and (`test`.`t3`.`a` = `test`.`t2`.`c`))) where true
1229 select *
1230 from t1
1231 left join t1 as t2 on t2.a = t1.c
1232 left join t1 as t3 on t3.a = t2.c and t3.b = t2.d
1233 where t1.a = 1 and t1.b = 1;
1234 a b c d a b c d a b c d
1235 1 1 1 1 1 1 1 1 1 1 1 1
1236 1 1 1 1 1 2 5 1 NULL NULL NULL NULL
1237 1 1 1 1 1 3 1 2 1 2 5 1
1238 1 1 1 1 1 4 2 3 2 3 4 5
1239 set ndb_join_pushdown=true;
1240 explain
1241 select *
1242 from t1 as t2
1243 join t1 as t3 on t3.a = t2.c and t3.b = t2.d
1244 where t2.a = 1;
1245 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
1246 1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 const 3 100.00 NULL
1247 1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t2.c,test.t2.d 1 100.00 Using join buffer (Batched Key Access)
1248 Warnings:
1249 Note 1003 Can't push table 't3' as child, access type 'Batched-key' not implemented
1250 Note 1003 /* select#1 */ select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t3`.`c` AS `c`,`test`.`t3`.`d` AS `d` from `test`.`t1` `t2` join `test`.`t1` `t3` where ((`test`.`t3`.`b` = `test`.`t2`.`d`) and (`test`.`t3`.`a` = `test`.`t2`.`c`) and (`test`.`t2`.`a` = 1))
1251 select *
1252 from t1 as t2
1253 join t1 as t3 on t3.a = t2.c and t3.b = t2.d
1254 where t2.a = 1;
1255 a b c d a b c d
1256 1 1 1 1 1 1 1 1
1257 1 3 1 2 1 2 5 1
1258 1 4 2 3 2 3 4 5
1259 set ndb_join_pushdown=true;
1260 explain
1261 select straight_join *
1262 from t1
1263 join t1 as t2 on t2.a = t1.a and t2.b = t1.b
1264 join t1 as t3 on t3.a = t2.c and t3.b = t1.c;
1265 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
1266 1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL PRIMARY NULL NULL NULL 16 100.00 NULL
1267 1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.a,test.t1.b 1 100.00 Using join buffer (Batched Key Access)
1268 1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t2.c,test.t1.c 1 100.00 Using join buffer (Batched Key Access)
1269 Warnings:
1270 Note 1003 Can't push table 't2' as child, access type 'Batched-key' not implemented
1271 Note 1003 Can't push table 't3' as child, access type 'Batched-key' not implemented
1272 Note 1003 /* select#1 */ select straight_join `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t1`.`d` AS `d`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t3`.`c` AS `c`,`test`.`t3`.`d` AS `d` from `test`.`t1` join `test`.`t1` `t2` join `test`.`t1` `t3` where ((`test`.`t2`.`b` = `test`.`t1`.`b`) and (`test`.`t2`.`a` = `test`.`t1`.`a`) and (`test`.`t3`.`b` = `test`.`t1`.`c`) and (`test`.`t3`.`a` = `test`.`t2`.`c`))
1273 select straight_join *
1274 from t1
1275 join t1 as t2 on t2.a = t1.a and t2.b = t1.b
1276 join t1 as t3 on t3.a = t2.c and t3.b = t1.c;
1277 a b c d a b c d a b c d
1278 1 1 1 1 1 1 1 1 1 1 1 1
1279 1 3 1 2 1 3 1 2 1 1 1 1
1280 1 4 2 3 1 4 2 3 2 2 2 2
1281 2 1 3 4 2 1 3 4 3 3 3 3
1282 2 2 2 2 2 2 2 2 2 2 2 2
1283 2 3 4 5 2 3 4 5 4 4 4 4
1284 3 1 1 2 3 1 1 2 1 1 1 1
1285 3 2 2 3 3 2 2 3 2 2 2 2
1286 3 3 3 3 3 3 3 3 3 3 3 3
1287 3 4 3 4 3 4 3 4 3 3 3 3
1288 4 1 4 5 4 1 4 5 4 4 4 4
1289 4 3 1 2 4 3 1 2 1 1 1 1
1290 4 4 4 4 4 4 4 4 4 4 4 4
1291 explain
1292 select straight_join *
1293 from t1
1294 join t1 as t2 on t2.a = t1.a and t2.b = t1.b
1295 join t1 as t3 on t3.a = t1.c and t3.b = t1.d
1296 join t1 as t4 on t4.a = t3.c and t4.b = t2.c;
1297 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
1298 1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL PRIMARY NULL NULL NULL 16 100.00 NULL
1299 1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.a,test.t1.b 1 100.00 Using join buffer (Batched Key Access)
1300 1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.c,test.t1.d 1 100.00 Using join buffer (Batched Key Access)
1301 1 SIMPLE t4 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t3.c,test.t2.c 1 100.00 Using join buffer (Batched Key Access)
1302 Warnings:
1303 Note 1003 Can't push table 't2' as child, access type 'Batched-key' not implemented
1304 Note 1003 Can't push table 't3' as child, access type 'Batched-key' not implemented
1305 Note 1003 Can't push table 't4' as child, access type 'Batched-key' not implemented
1306 Note 1003 /* select#1 */ select straight_join `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t1`.`d` AS `d`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t3`.`c` AS `c`,`test`.`t3`.`d` AS `d`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t4`.`c` AS `c`,`test`.`t4`.`d` AS `d` from `test`.`t1` join `test`.`t1` `t2` join `test`.`t1` `t3` join `test`.`t1` `t4` where ((`test`.`t2`.`b` = `test`.`t1`.`b`) and (`test`.`t2`.`a` = `test`.`t1`.`a`) and (`test`.`t3`.`b` = `test`.`t1`.`d`) and (`test`.`t3`.`a` = `test`.`t1`.`c`) and (`test`.`t4`.`b` = `test`.`t2`.`c`) and (`test`.`t4`.`a` = `test`.`t3`.`c`))
1307 select straight_join *
1308 from t1
1309 join t1 as t2 on t2.a = t1.a and t2.b = t1.b
1310 join t1 as t3 on t3.a = t1.c and t3.b = t1.d
1311 join t1 as t4 on t4.a = t3.c and t4.b = t2.c;
1312 a b c d a b c d a b c d a b c d
1313 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1314 1 4 2 3 1 4 2 3 2 3 4 5 4 2 5 1
1315 2 1 3 4 2 1 3 4 3 4 3 4 3 3 3 3
1316 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
1317 3 2 2 3 3 2 2 3 2 3 4 5 4 2 5 1
1318 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3
1319 3 4 3 4 3 4 3 4 3 4 3 4 3 3 3 3
1320 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
1321 explain
1322 select straight_join *
1323 from t1
1324 join t1 as t2 on t2.a = t1.a and t2.b = t1.b
1325 join t1 as t3 on t3.a = t1.c and t3.b = t2.d
1326 join t1 as t4 on t4.a = t3.c and t4.b = t2.c;
1327 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
1328 1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL PRIMARY NULL NULL NULL 16 100.00 NULL
1329 1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.a,test.t1.b 1 100.00 Using join buffer (Batched Key Access)
1330 1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.c,test.t2.d 1 100.00 Using join buffer (Batched Key Access)
1331 1 SIMPLE t4 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t3.c,test.t2.c 1 100.00 Using join buffer (Batched Key Access)
1332 Warnings:
1333 Note 1003 Can't push table 't2' as child, access type 'Batched-key' not implemented
1334 Note 1003 Can't push table 't3' as child, access type 'Batched-key' not implemented
1335 Note 1003 Can't push table 't4' as child, access type 'Batched-key' not implemented
1336 Note 1003 /* select#1 */ select straight_join `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t1`.`d` AS `d`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t3`.`c` AS `c`,`test`.`t3`.`d` AS `d`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t4`.`c` AS `c`,`test`.`t4`.`d` AS `d` from `test`.`t1` join `test`.`t1` `t2` join `test`.`t1` `t3` join `test`.`t1` `t4` where ((`test`.`t2`.`b` = `test`.`t1`.`b`) and (`test`.`t2`.`a` = `test`.`t1`.`a`) and (`test`.`t3`.`b` = `test`.`t2`.`d`) and (`test`.`t3`.`a` = `test`.`t1`.`c`) and (`test`.`t4`.`b` = `test`.`t2`.`c`) and (`test`.`t4`.`a` = `test`.`t3`.`c`))
1337 select straight_join *
1338 from t1
1339 join t1 as t2 on t2.a = t1.a and t2.b = t1.b
1340 join t1 as t3 on t3.a = t1.c and t3.b = t2.d
1341 join t1 as t4 on t4.a = t3.c and t4.b = t2.c;
1342 a b c d a b c d a b c d a b c d
1343 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1344 1 4 2 3 1 4 2 3 2 3 4 5 4 2 5 1
1345 2 1 3 4 2 1 3 4 3 4 3 4 3 3 3 3
1346 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
1347 3 2 2 3 3 2 2 3 2 3 4 5 4 2 5 1
1348 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3
1349 3 4 3 4 3 4 3 4 3 4 3 4 3 3 3 3
1350 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
1351 explain
1352 select straight_join *
1353 from t1
1354 join t1 as t2 on t2.a = t1.a and t2.b = t1.b
1355 join t1 as t3 on t3.a = t1.c and t3.b = t2.d
1356 join t1 as t4 on t4.a = t3.c and t4.b = t1.d;
1357 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
1358 1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL PRIMARY NULL NULL NULL 16 100.00 NULL
1359 1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.a,test.t1.b 1 100.00 Using join buffer (Batched Key Access)
1360 1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.c,test.t2.d 1 100.00 Using join buffer (Batched Key Access)
1361 1 SIMPLE t4 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t3.c,test.t1.d 1 100.00 Using join buffer (Batched Key Access)
1362 Warnings:
1363 Note 1003 Can't push table 't2' as child, access type 'Batched-key' not implemented
1364 Note 1003 Can't push table 't3' as child, access type 'Batched-key' not implemented
1365 Note 1003 Can't push table 't4' as child, access type 'Batched-key' not implemented
1366 Note 1003 /* select#1 */ select straight_join `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t1`.`d` AS `d`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t3`.`c` AS `c`,`test`.`t3`.`d` AS `d`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t4`.`c` AS `c`,`test`.`t4`.`d` AS `d` from `test`.`t1` join `test`.`t1` `t2` join `test`.`t1` `t3` join `test`.`t1` `t4` where ((`test`.`t2`.`b` = `test`.`t1`.`b`) and (`test`.`t2`.`a` = `test`.`t1`.`a`) and (`test`.`t3`.`b` = `test`.`t2`.`d`) and (`test`.`t3`.`a` = `test`.`t1`.`c`) and (`test`.`t4`.`b` = `test`.`t1`.`d`) and (`test`.`t4`.`a` = `test`.`t3`.`c`))
1367 select straight_join *
1368 from t1
1369 join t1 as t2 on t2.a = t1.a and t2.b = t1.b
1370 join t1 as t3 on t3.a = t1.c and t3.b = t2.d
1371 join t1 as t4 on t4.a = t3.c and t4.b = t1.d;
1372 a b c d a b c d a b c d a b c d
1373 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1374 1 4 2 3 1 4 2 3 2 3 4 5 4 3 1 2
1375 2 1 3 4 2 1 3 4 3 4 3 4 3 4 3 4
1376 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
1377 3 2 2 3 3 2 2 3 2 3 4 5 4 3 1 2
1378 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3
1379 3 4 3 4 3 4 3 4 3 4 3 4 3 4 3 4
1380 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
1381 explain
1382 select straight_join *
1383 from t1
1384 join t1 as t2 on t2.a = t1.a and t2.b = t1.b
1385 join t1 as t3 on t3.a = t1.c and t3.b = t1.d
1386 join t1 as t4 on t4.a = t3.a and t4.b = t2.c;
1387 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
1388 1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL PRIMARY NULL NULL NULL 16 100.00 NULL
1389 1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.a,test.t1.b 1 100.00 Using join buffer (Batched Key Access)
1390 1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.c,test.t1.d 1 100.00 Using join buffer (Batched Key Access)
1391 1 SIMPLE t4 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.c,test.t2.c 1 100.00 Using join buffer (Batched Key Access)
1392 Warnings:
1393 Note 1003 Can't push table 't2' as child, access type 'Batched-key' not implemented
1394 Note 1003 Can't push table 't3' as child, access type 'Batched-key' not implemented
1395 Note 1003 Can't push table 't4' as child, access type 'Batched-key' not implemented
1396 Note 1003 /* select#1 */ select straight_join `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t1`.`d` AS `d`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t3`.`c` AS `c`,`test`.`t3`.`d` AS `d`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t4`.`c` AS `c`,`test`.`t4`.`d` AS `d` from `test`.`t1` join `test`.`t1` `t2` join `test`.`t1` `t3` join `test`.`t1` `t4` where ((`test`.`t2`.`b` = `test`.`t1`.`b`) and (`test`.`t2`.`a` = `test`.`t1`.`a`) and (`test`.`t3`.`b` = `test`.`t1`.`d`) and (`test`.`t4`.`b` = `test`.`t2`.`c`) and (`test`.`t3`.`a` = `test`.`t1`.`c`) and (`test`.`t4`.`a` = `test`.`t1`.`c`))
1397 select straight_join *
1398 from t1
1399 join t1 as t2 on t2.a = t1.a and t2.b = t1.b
1400 join t1 as t3 on t3.a = t1.c and t3.b = t1.d
1401 join t1 as t4 on t4.a = t3.a and t4.b = t2.c;
1402 a b c d a b c d a b c d a b c d
1403 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1404 1 3 1 2 1 3 1 2 1 2 5 1 1 1 1 1
1405 1 4 2 3 1 4 2 3 2 3 4 5 2 2 2 2
1406 2 1 3 4 2 1 3 4 3 4 3 4 3 3 3 3
1407 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
1408 3 1 1 2 3 1 1 2 1 2 5 1 1 1 1 1
1409 3 2 2 3 3 2 2 3 2 3 4 5 2 2 2 2
1410 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3
1411 3 4 3 4 3 4 3 4 3 4 3 4 3 3 3 3
1412 4 3 1 2 4 3 1 2 1 2 5 1 1 1 1 1
1413 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
1414 explain
1415 select straight_join *
1416 from t1
1417 join t1 as t2 on t2.a = t1.a and t2.b = t1.b
1418 join t1 as t3 on t3.a = t1.c and t3.b = t1.d
1419 join t1 as t4 on t4.a = t3.b and t4.b = t2.c;
1420 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
1421 1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL PRIMARY NULL NULL NULL 16 100.00 NULL
1422 1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.a,test.t1.b 1 100.00 Using join buffer (Batched Key Access)
1423 1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.c,test.t1.d 1 100.00 Using join buffer (Batched Key Access)
1424 1 SIMPLE t4 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.d,test.t2.c 1 100.00 Using join buffer (Batched Key Access)
1425 Warnings:
1426 Note 1003 Can't push table 't2' as child, access type 'Batched-key' not implemented
1427 Note 1003 Can't push table 't3' as child, access type 'Batched-key' not implemented
1428 Note 1003 Can't push table 't4' as child, access type 'Batched-key' not implemented
1429 Note 1003 /* select#1 */ select straight_join `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t1`.`d` AS `d`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t3`.`c` AS `c`,`test`.`t3`.`d` AS `d`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t4`.`c` AS `c`,`test`.`t4`.`d` AS `d` from `test`.`t1` join `test`.`t1` `t2` join `test`.`t1` `t3` join `test`.`t1` `t4` where ((`test`.`t2`.`b` = `test`.`t1`.`b`) and (`test`.`t2`.`a` = `test`.`t1`.`a`) and (`test`.`t3`.`a` = `test`.`t1`.`c`) and (`test`.`t4`.`b` = `test`.`t2`.`c`) and (`test`.`t3`.`b` = `test`.`t1`.`d`) and (`test`.`t4`.`a` = `test`.`t1`.`d`))
1430 select straight_join *
1431 from t1
1432 join t1 as t2 on t2.a = t1.a and t2.b = t1.b
1433 join t1 as t3 on t3.a = t1.c and t3.b = t1.d
1434 join t1 as t4 on t4.a = t3.b and t4.b = t2.c;
1435 a b c d a b c d a b c d a b c d
1436 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1437 1 3 1 2 1 3 1 2 1 2 5 1 2 1 3 4
1438 1 4 2 3 1 4 2 3 2 3 4 5 3 2 2 3
1439 2 1 3 4 2 1 3 4 3 4 3 4 4 3 1 2
1440 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
1441 3 1 1 2 3 1 1 2 1 2 5 1 2 1 3 4
1442 3 2 2 3 3 2 2 3 2 3 4 5 3 2 2 3
1443 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3
1444 3 4 3 4 3 4 3 4 3 4 3 4 4 3 1 2
1445 4 3 1 2 4 3 1 2 1 2 5 1 2 1 3 4
1446 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
1447 explain
1448 select straight_join *
1449 from t1
1450 join t1 as t2 on t2.a = t1.a and t2.b = t1.b
1451 join t1 as t3 on t3.a = t1.c and t3.b = t1.d
1452 join t1 as t4 on t4.a = t3.c and t4.b = t2.a;
1453 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
1454 1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL PRIMARY NULL NULL NULL 16 100.00 NULL
1455 1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.a,test.t1.b 1 100.00 Using join buffer (Batched Key Access)
1456 1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.c,test.t1.d 1 100.00 Using join buffer (Batched Key Access)
1457 1 SIMPLE t4 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t3.c,test.t1.a 1 100.00 Using join buffer (Batched Key Access)
1458 Warnings:
1459 Note 1003 Can't push table 't2' as child, access type 'Batched-key' not implemented
1460 Note 1003 Can't push table 't3' as child, access type 'Batched-key' not implemented
1461 Note 1003 Can't push table 't4' as child, access type 'Batched-key' not implemented
1462 Note 1003 /* select#1 */ select straight_join `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t1`.`d` AS `d`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t3`.`c` AS `c`,`test`.`t3`.`d` AS `d`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t4`.`c` AS `c`,`test`.`t4`.`d` AS `d` from `test`.`t1` join `test`.`t1` `t2` join `test`.`t1` `t3` join `test`.`t1` `t4` where ((`test`.`t2`.`b` = `test`.`t1`.`b`) and (`test`.`t3`.`b` = `test`.`t1`.`d`) and (`test`.`t3`.`a` = `test`.`t1`.`c`) and (`test`.`t2`.`a` = `test`.`t1`.`a`) and (`test`.`t4`.`b` = `test`.`t1`.`a`) and (`test`.`t4`.`a` = `test`.`t3`.`c`))
1463 select straight_join *
1464 from t1
1465 join t1 as t2 on t2.a = t1.a and t2.b = t1.b
1466 join t1 as t3 on t3.a = t1.c and t3.b = t1.d
1467 join t1 as t4 on t4.a = t3.c and t4.b = t2.a;
1468 a b c d a b c d a b c d a b c d
1469 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1470 1 4 2 3 1 4 2 3 2 3 4 5 4 1 4 5
1471 2 1 3 4 2 1 3 4 3 4 3 4 3 2 2 3
1472 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
1473 3 2 2 3 3 2 2 3 2 3 4 5 4 3 1 2
1474 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3
1475 3 4 3 4 3 4 3 4 3 4 3 4 3 3 3 3
1476 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
1477 explain
1478 select straight_join *
1479 from t1
1480 join t1 as t2 on t2.a = t1.a and t2.b = t1.b
1481 join t1 as t3 on t3.a = t1.c and t3.b = t1.d
1482 join t1 as t4 on t4.a = t3.c and t4.b = t2.b;
1483 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
1484 1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL PRIMARY NULL NULL NULL 16 100.00 NULL
1485 1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.a,test.t1.b 1 100.00 Using join buffer (Batched Key Access)
1486 1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.c,test.t1.d 1 100.00 Using join buffer (Batched Key Access)
1487 1 SIMPLE t4 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t3.c,test.t1.b 1 100.00 Using join buffer (Batched Key Access)
1488 Warnings:
1489 Note 1003 Can't push table 't2' as child, access type 'Batched-key' not implemented
1490 Note 1003 Can't push table 't3' as child, access type 'Batched-key' not implemented
1491 Note 1003 Can't push table 't4' as child, access type 'Batched-key' not implemented
1492 Note 1003 /* select#1 */ select straight_join `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t1`.`d` AS `d`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t3`.`c` AS `c`,`test`.`t3`.`d` AS `d`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t4`.`c` AS `c`,`test`.`t4`.`d` AS `d` from `test`.`t1` join `test`.`t1` `t2` join `test`.`t1` `t3` join `test`.`t1` `t4` where ((`test`.`t2`.`a` = `test`.`t1`.`a`) and (`test`.`t3`.`b` = `test`.`t1`.`d`) and (`test`.`t3`.`a` = `test`.`t1`.`c`) and (`test`.`t2`.`b` = `test`.`t1`.`b`) and (`test`.`t4`.`b` = `test`.`t1`.`b`) and (`test`.`t4`.`a` = `test`.`t3`.`c`))
1493 select straight_join *
1494 from t1
1495 join t1 as t2 on t2.a = t1.a and t2.b = t1.b
1496 join t1 as t3 on t3.a = t1.c and t3.b = t1.d
1497 join t1 as t4 on t4.a = t3.c and t4.b = t2.b;
1498 a b c d a b c d a b c d a b c d
1499 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1500 1 4 2 3 1 4 2 3 2 3 4 5 4 4 4 4
1501 2 1 3 4 2 1 3 4 3 4 3 4 3 1 1 2
1502 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
1503 3 2 2 3 3 2 2 3 2 3 4 5 4 2 5 1
1504 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3
1505 3 4 3 4 3 4 3 4 3 4 3 4 3 4 3 4
1506 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
1507 explain
1508 select straight_join *
1509 from t1
1510 join t1 as t2 on t2.a = t1.a and t2.b = t1.b
1511 join t1 as t3 on t3.a = t1.c and t3.b = t1.d
1512 join t1 as t4 on t4.a = t1.c and t4.b = t2.c;
1513 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
1514 1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL PRIMARY NULL NULL NULL 16 100.00 NULL
1515 1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.a,test.t1.b 1 100.00 Using join buffer (Batched Key Access)
1516 1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.c,test.t1.d 1 100.00 Using join buffer (Batched Key Access)
1517 1 SIMPLE t4 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.c,test.t2.c 1 100.00 Using join buffer (Batched Key Access)
1518 Warnings:
1519 Note 1003 Can't push table 't2' as child, access type 'Batched-key' not implemented
1520 Note 1003 Can't push table 't3' as child, access type 'Batched-key' not implemented
1521 Note 1003 Can't push table 't4' as child, access type 'Batched-key' not implemented
1522 Note 1003 /* select#1 */ select straight_join `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t1`.`d` AS `d`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t3`.`c` AS `c`,`test`.`t3`.`d` AS `d`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t4`.`c` AS `c`,`test`.`t4`.`d` AS `d` from `test`.`t1` join `test`.`t1` `t2` join `test`.`t1` `t3` join `test`.`t1` `t4` where ((`test`.`t2`.`b` = `test`.`t1`.`b`) and (`test`.`t2`.`a` = `test`.`t1`.`a`) and (`test`.`t3`.`b` = `test`.`t1`.`d`) and (`test`.`t4`.`b` = `test`.`t2`.`c`) and (`test`.`t3`.`a` = `test`.`t1`.`c`) and (`test`.`t4`.`a` = `test`.`t1`.`c`))
1523 select straight_join *
1524 from t1
1525 join t1 as t2 on t2.a = t1.a and t2.b = t1.b
1526 join t1 as t3 on t3.a = t1.c and t3.b = t1.d
1527 join t1 as t4 on t4.a = t1.c and t4.b = t2.c;
1528 a b c d a b c d a b c d a b c d
1529 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1530 1 3 1 2 1 3 1 2 1 2 5 1 1 1 1 1
1531 1 4 2 3 1 4 2 3 2 3 4 5 2 2 2 2
1532 2 1 3 4 2 1 3 4 3 4 3 4 3 3 3 3
1533 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
1534 3 1 1 2 3 1 1 2 1 2 5 1 1 1 1 1
1535 3 2 2 3 3 2 2 3 2 3 4 5 2 2 2 2
1536 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3
1537 3 4 3 4 3 4 3 4 3 4 3 4 3 3 3 3
1538 4 3 1 2 4 3 1 2 1 2 5 1 1 1 1 1
1539 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
1540 explain
1541 select straight_join *
1542 from t1
1543 join t1 as t2 on t2.a = t1.a and t2.b = t1.b
1544 join t1 as t3 on t3.a = t1.c and t3.b = t1.d
1545 join t1 as t4 on t4.a = t3.c and t4.b = t1.b;
1546 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
1547 1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL PRIMARY NULL NULL NULL 16 100.00 NULL
1548 1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.a,test.t1.b 1 100.00 Using join buffer (Batched Key Access)
1549 1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.c,test.t1.d 1 100.00 Using join buffer (Batched Key Access)
1550 1 SIMPLE t4 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t3.c,test.t1.b 1 100.00 Using join buffer (Batched Key Access)
1551 Warnings:
1552 Note 1003 Can't push table 't2' as child, access type 'Batched-key' not implemented
1553 Note 1003 Can't push table 't3' as child, access type 'Batched-key' not implemented
1554 Note 1003 Can't push table 't4' as child, access type 'Batched-key' not implemented
1555 Note 1003 /* select#1 */ select straight_join `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t1`.`d` AS `d`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t3`.`c` AS `c`,`test`.`t3`.`d` AS `d`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t4`.`c` AS `c`,`test`.`t4`.`d` AS `d` from `test`.`t1` join `test`.`t1` `t2` join `test`.`t1` `t3` join `test`.`t1` `t4` where ((`test`.`t2`.`a` = `test`.`t1`.`a`) and (`test`.`t3`.`b` = `test`.`t1`.`d`) and (`test`.`t3`.`a` = `test`.`t1`.`c`) and (`test`.`t2`.`b` = `test`.`t1`.`b`) and (`test`.`t4`.`b` = `test`.`t1`.`b`) and (`test`.`t4`.`a` = `test`.`t3`.`c`))
1556 select straight_join *
1557 from t1
1558 join t1 as t2 on t2.a = t1.a and t2.b = t1.b
1559 join t1 as t3 on t3.a = t1.c and t3.b = t1.d
1560 join t1 as t4 on t4.a = t3.c and t4.b = t1.b;
1561 a b c d a b c d a b c d a b c d
1562 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1563 1 4 2 3 1 4 2 3 2 3 4 5 4 4 4 4
1564 2 1 3 4 2 1 3 4 3 4 3 4 3 1 1 2
1565 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
1566 3 2 2 3 3 2 2 3 2 3 4 5 4 2 5 1
1567 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3
1568 3 4 3 4 3 4 3 4 3 4 3 4 3 4 3 4
1569 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
1570 explain
1571 select straight_join *
1572 from t1
1573 join t1 as t2 on t2.a = t1.a and t2.b = t1.b
1574 join t1 as t2x on t2x.a = t2.c and t2x.b = t2.d
1575 join t1 as t3x on t3x.a = t1.c and t3x.b = t1.d
1576 join t1 as t4 on t4.a = t3x.c and t4.b = t2x.c;
1577 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
1578 1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL PRIMARY NULL NULL NULL 16 100.00 NULL
1579 1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.a,test.t1.b 1 100.00 Using join buffer (Batched Key Access)
1580 1 SIMPLE t2x p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t2.c,test.t2.d 1 100.00 Using join buffer (Batched Key Access)
1581 1 SIMPLE t3x p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.c,test.t1.d 1 100.00 Using join buffer (Batched Key Access)
1582 1 SIMPLE t4 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t3x.c,test.t2x.c 1 100.00 Using join buffer (Batched Key Access)
1583 Warnings:
1584 Note 1003 Can't push table 't2' as child, access type 'Batched-key' not implemented
1585 Note 1003 Can't push table 't2x' as child, access type 'Batched-key' not implemented
1586 Note 1003 Can't push table 't3x' as child, access type 'Batched-key' not implemented
1587 Note 1003 Can't push table 't4' as child, access type 'Batched-key' not implemented
1588 Note 1003 /* select#1 */ select straight_join `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t1`.`d` AS `d`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d`,`test`.`t2x`.`a` AS `a`,`test`.`t2x`.`b` AS `b`,`test`.`t2x`.`c` AS `c`,`test`.`t2x`.`d` AS `d`,`test`.`t3x`.`a` AS `a`,`test`.`t3x`.`b` AS `b`,`test`.`t3x`.`c` AS `c`,`test`.`t3x`.`d` AS `d`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t4`.`c` AS `c`,`test`.`t4`.`d` AS `d` from `test`.`t1` join `test`.`t1` `t2` join `test`.`t1` `t2x` join `test`.`t1` `t3x` join `test`.`t1` `t4` where ((`test`.`t2`.`b` = `test`.`t1`.`b`) and (`test`.`t2`.`a` = `test`.`t1`.`a`) and (`test`.`t2x`.`b` = `test`.`t2`.`d`) and (`test`.`t2x`.`a` = `test`.`t2`.`c`) and (`test`.`t3x`.`b` = `test`.`t1`.`d`) and (`test`.`t3x`.`a` = `test`.`t1`.`c`) and (`test`.`t4`.`b` = `test`.`t2x`.`c`) and (`test`.`t4`.`a` = `test`.`t3x`.`c`))
1589 explain
1590 select straight_join *
1591 from t1
1592 join t1 as t2 on t2.a = t1.a and t2.b = t1.b
1593 join t1 as t2x on t2x.a = t2.c and t2x.b = t2.d
1594 join t1 as t3 on t3.a = t1.c and t3.b = t1.d
1595 join t1 as t3x on t3x.a = t3.c and t3x.b = t3.d
1596 join t1 as t4 on t4.a = t3x.c and t4.b = t2x.c;
1597 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
1598 1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL PRIMARY NULL NULL NULL 16 100.00 NULL
1599 1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.a,test.t1.b 1 100.00 Using join buffer (Batched Key Access)
1600 1 SIMPLE t2x p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t2.c,test.t2.d 1 100.00 Using join buffer (Batched Key Access)
1601 1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.c,test.t1.d 1 100.00 Using join buffer (Batched Key Access)
1602 1 SIMPLE t3x p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t3.c,test.t3.d 1 100.00 Using join buffer (Batched Key Access)
1603 1 SIMPLE t4 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t3x.c,test.t2x.c 1 100.00 Using join buffer (Batched Key Access)
1604 Warnings:
1605 Note 1003 Can't push table 't2' as child, access type 'Batched-key' not implemented
1606 Note 1003 Can't push table 't2x' as child, access type 'Batched-key' not implemented
1607 Note 1003 Can't push table 't3' as child, access type 'Batched-key' not implemented
1608 Note 1003 Can't push table 't3x' as child, access type 'Batched-key' not implemented
1609 Note 1003 Can't push table 't4' as child, access type 'Batched-key' not implemented
1610 Note 1003 /* select#1 */ select straight_join `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t1`.`d` AS `d`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d`,`test`.`t2x`.`a` AS `a`,`test`.`t2x`.`b` AS `b`,`test`.`t2x`.`c` AS `c`,`test`.`t2x`.`d` AS `d`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t3`.`c` AS `c`,`test`.`t3`.`d` AS `d`,`test`.`t3x`.`a` AS `a`,`test`.`t3x`.`b` AS `b`,`test`.`t3x`.`c` AS `c`,`test`.`t3x`.`d` AS `d`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t4`.`c` AS `c`,`test`.`t4`.`d` AS `d` from `test`.`t1` join `test`.`t1` `t2` join `test`.`t1` `t2x` join `test`.`t1` `t3` join `test`.`t1` `t3x` join `test`.`t1` `t4` where ((`test`.`t2`.`b` = `test`.`t1`.`b`) and (`test`.`t2`.`a` = `test`.`t1`.`a`) and (`test`.`t2x`.`b` = `test`.`t2`.`d`) and (`test`.`t2x`.`a` = `test`.`t2`.`c`) and (`test`.`t3`.`b` = `test`.`t1`.`d`) and (`test`.`t3`.`a` = `test`.`t1`.`c`) and (`test`.`t3x`.`b` = `test`.`t3`.`d`) and (`test`.`t3x`.`a` = `test`.`t3`.`c`) and (`test`.`t4`.`b` = `test`.`t2x`.`c`) and (`test`.`t4`.`a` = `test`.`t3x`.`c`))
1611 explain
1612 select straight_join *
1613 from t1
1614 join t1 as t2 on t2.a = t1.a and t2.b = t1.b
1615 join t1 as t3 on t3.a = t1.c and t3.b = t1.d
1616 join t1 as t2x on t2x.a = t2.c and t2x.b = t2.d
1617 join t1 as t3x on t3x.a = t3.c and t3x.b = t3.d
1618 join t1 as t4 on t4.a = t3x.c and t4.b = t2x.c;
1619 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
1620 1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL PRIMARY NULL NULL NULL 16 100.00 NULL
1621 1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.a,test.t1.b 1 100.00 Using join buffer (Batched Key Access)
1622 1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.c,test.t1.d 1 100.00 Using join buffer (Batched Key Access)
1623 1 SIMPLE t2x p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t2.c,test.t2.d 1 100.00 Using join buffer (Batched Key Access)
1624 1 SIMPLE t3x p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t3.c,test.t3.d 1 100.00 Using join buffer (Batched Key Access)
1625 1 SIMPLE t4 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t3x.c,test.t2x.c 1 100.00 Using join buffer (Batched Key Access)
1626 Warnings:
1627 Note 1003 Can't push table 't2' as child, access type 'Batched-key' not implemented
1628 Note 1003 Can't push table 't3' as child, access type 'Batched-key' not implemented
1629 Note 1003 Can't push table 't2x' as child, access type 'Batched-key' not implemented
1630 Note 1003 Can't push table 't3x' as child, access type 'Batched-key' not implemented
1631 Note 1003 Can't push table 't4' as child, access type 'Batched-key' not implemented
1632 Note 1003 /* select#1 */ select straight_join `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t1`.`d` AS `d`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t3`.`c` AS `c`,`test`.`t3`.`d` AS `d`,`test`.`t2x`.`a` AS `a`,`test`.`t2x`.`b` AS `b`,`test`.`t2x`.`c` AS `c`,`test`.`t2x`.`d` AS `d`,`test`.`t3x`.`a` AS `a`,`test`.`t3x`.`b` AS `b`,`test`.`t3x`.`c` AS `c`,`test`.`t3x`.`d` AS `d`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t4`.`c` AS `c`,`test`.`t4`.`d` AS `d` from `test`.`t1` join `test`.`t1` `t2` join `test`.`t1` `t3` join `test`.`t1` `t2x` join `test`.`t1` `t3x` join `test`.`t1` `t4` where ((`test`.`t2`.`b` = `test`.`t1`.`b`) and (`test`.`t2`.`a` = `test`.`t1`.`a`) and (`test`.`t3`.`b` = `test`.`t1`.`d`) and (`test`.`t3`.`a` = `test`.`t1`.`c`) and (`test`.`t2x`.`b` = `test`.`t2`.`d`) and (`test`.`t2x`.`a` = `test`.`t2`.`c`) and (`test`.`t3x`.`b` = `test`.`t3`.`d`) and (`test`.`t3x`.`a` = `test`.`t3`.`c`) and (`test`.`t4`.`b` = `test`.`t2x`.`c`) and (`test`.`t4`.`a` = `test`.`t3x`.`c`))
1633 explain
1634 select straight_join *
1635 from t1
1636 join t1 as t2 on t2.a = t1.a and t2.b = t1.b
1637 join t1 as t2x on t2x.a = t2.c and t2x.b = t2.d
1638 join t1 as t3 on t3.a = t1.c and t3.b = t1.d
1639 join t1 as t3x on t3x.a = t1.c and t3x.b = t1.d
1640 join t1 as t4 on t4.a = t3x.c and t4.b = t2x.c;
1641 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
1642 1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL PRIMARY NULL NULL NULL 16 100.00 NULL
1643 1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.a,test.t1.b 1 100.00 Using join buffer (Batched Key Access)
1644 1 SIMPLE t2x p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t2.c,test.t2.d 1 100.00 Using join buffer (Batched Key Access)
1645 1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.c,test.t1.d 1 100.00 Using join buffer (Batched Key Access)
1646 1 SIMPLE t3x p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.c,test.t1.d 1 100.00 Using join buffer (Batched Key Access)
1647 1 SIMPLE t4 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t3x.c,test.t2x.c 1 100.00 Using join buffer (Batched Key Access)
1648 Warnings:
1649 Note 1003 Can't push table 't2' as child, access type 'Batched-key' not implemented
1650 Note 1003 Can't push table 't2x' as child, access type 'Batched-key' not implemented
1651 Note 1003 Can't push table 't3' as child, access type 'Batched-key' not implemented
1652 Note 1003 Can't push table 't3x' as child, access type 'Batched-key' not implemented
1653 Note 1003 Can't push table 't4' as child, access type 'Batched-key' not implemented
1654 Note 1003 /* select#1 */ select straight_join `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t1`.`d` AS `d`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d`,`test`.`t2x`.`a` AS `a`,`test`.`t2x`.`b` AS `b`,`test`.`t2x`.`c` AS `c`,`test`.`t2x`.`d` AS `d`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t3`.`c` AS `c`,`test`.`t3`.`d` AS `d`,`test`.`t3x`.`a` AS `a`,`test`.`t3x`.`b` AS `b`,`test`.`t3x`.`c` AS `c`,`test`.`t3x`.`d` AS `d`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t4`.`c` AS `c`,`test`.`t4`.`d` AS `d` from `test`.`t1` join `test`.`t1` `t2` join `test`.`t1` `t2x` join `test`.`t1` `t3` join `test`.`t1` `t3x` join `test`.`t1` `t4` where ((`test`.`t2`.`b` = `test`.`t1`.`b`) and (`test`.`t2`.`a` = `test`.`t1`.`a`) and (`test`.`t2x`.`b` = `test`.`t2`.`d`) and (`test`.`t2x`.`a` = `test`.`t2`.`c`) and (`test`.`t3`.`b` = `test`.`t1`.`d`) and (`test`.`t3x`.`b` = `test`.`t1`.`d`) and (`test`.`t3`.`a` = `test`.`t1`.`c`) and (`test`.`t3x`.`a` = `test`.`t1`.`c`) and (`test`.`t4`.`b` = `test`.`t2x`.`c`) and (`test`.`t4`.`a` = `test`.`t3x`.`c`))
1655 explain
1656 select straight_join *
1657 from t1
1658 join t1 as t2 on t2.a = t1.a and t2.b = t1.b
1659 join t1 as t2x on t2x.a = t2.c and t2x.b = t2.d
1660 join t1 as t3 on t3.a = t1.c and t3.b = t1.b
1661 join t1 as t3x on t3x.a = t1.c and t3x.b = t1.d
1662 join t1 as t4 on t4.a = t3x.c and t4.b = t2x.c;
1663 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
1664 1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL PRIMARY NULL NULL NULL 16 100.00 NULL
1665 1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.a,test.t1.b 1 100.00 Using join buffer (Batched Key Access)
1666 1 SIMPLE t2x p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t2.c,test.t2.d 1 100.00 Using join buffer (Batched Key Access)
1667 1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.c,test.t1.b 1 100.00 Using join buffer (Batched Key Access)
1668 1 SIMPLE t3x p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.c,test.t1.d 1 100.00 Using join buffer (Batched Key Access)
1669 1 SIMPLE t4 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t3x.c,test.t2x.c 1 100.00 Using join buffer (Batched Key Access)
1670 Warnings:
1671 Note 1003 Can't push table 't2' as child, access type 'Batched-key' not implemented
1672 Note 1003 Can't push table 't2x' as child, access type 'Batched-key' not implemented
1673 Note 1003 Can't push table 't3' as child, access type 'Batched-key' not implemented
1674 Note 1003 Can't push table 't3x' as child, access type 'Batched-key' not implemented
1675 Note 1003 Can't push table 't4' as child, access type 'Batched-key' not implemented
1676 Note 1003 /* select#1 */ select straight_join `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t1`.`d` AS `d`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d`,`test`.`t2x`.`a` AS `a`,`test`.`t2x`.`b` AS `b`,`test`.`t2x`.`c` AS `c`,`test`.`t2x`.`d` AS `d`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t3`.`c` AS `c`,`test`.`t3`.`d` AS `d`,`test`.`t3x`.`a` AS `a`,`test`.`t3x`.`b` AS `b`,`test`.`t3x`.`c` AS `c`,`test`.`t3x`.`d` AS `d`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t4`.`c` AS `c`,`test`.`t4`.`d` AS `d` from `test`.`t1` join `test`.`t1` `t2` join `test`.`t1` `t2x` join `test`.`t1` `t3` join `test`.`t1` `t3x` join `test`.`t1` `t4` where ((`test`.`t2`.`a` = `test`.`t1`.`a`) and (`test`.`t2x`.`b` = `test`.`t2`.`d`) and (`test`.`t2x`.`a` = `test`.`t2`.`c`) and (`test`.`t2`.`b` = `test`.`t1`.`b`) and (`test`.`t3`.`b` = `test`.`t1`.`b`) and (`test`.`t3x`.`b` = `test`.`t1`.`d`) and (`test`.`t3`.`a` = `test`.`t1`.`c`) and (`test`.`t3x`.`a` = `test`.`t1`.`c`) and (`test`.`t4`.`b` = `test`.`t2x`.`c`) and (`test`.`t4`.`a` = `test`.`t3x`.`c`))
1677 explain
1678 select straight_join *
1679 from t1
1680 left join t1 as t2 on t2.a = t1.a and t2.b = t1.b
1681 join t1 as t3 on t3.a = t1.c and t3.b = t1.d
1682 left join t1 as t4 on t4.a = t3.c and t4.b = t2.c;
1683 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
1684 1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 16 100.00 NULL
1685 1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.a,test.t1.b 1 100.00 Using join buffer (Batched Key Access)
1686 1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.c,test.t1.d 1 100.00 Using join buffer (Batched Key Access)
1687 1 SIMPLE t4 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t3.c,test.t2.c 1 100.00 Using join buffer (Batched Key Access)
1688 Warnings:
1689 Note 1003 Can't push table 't2' as child, access type 'Batched-key' not implemented
1690 Note 1003 Can't push table 't3' as child, access type 'Batched-key' not implemented
1691 Note 1003 Can't push table 't4' as child, access type 'Batched-key' not implemented
1692 Note 1003 /* select#1 */ select straight_join `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t1`.`d` AS `d`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t3`.`c` AS `c`,`test`.`t3`.`d` AS `d`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t4`.`c` AS `c`,`test`.`t4`.`d` AS `d` from `test`.`t1` left join `test`.`t1` `t2` on(((`test`.`t2`.`b` = `test`.`t1`.`b`) and (`test`.`t2`.`a` = `test`.`t1`.`a`))) join `test`.`t1` `t3` left join `test`.`t1` `t4` on(((`test`.`t4`.`b` = `test`.`t2`.`c`) and (`test`.`t4`.`a` = `test`.`t3`.`c`))) where ((`test`.`t3`.`b` = `test`.`t1`.`d`) and (`test`.`t3`.`a` = `test`.`t1`.`c`))
1693 explain
1694 select straight_join *
1695 from t1
1696 join t1 as t2 on t2.a = t1.a and t2.b = t1.b
1697 left join t1 as t3 on t3.a = t1.c and t3.b = t1.d
1698 left join t1 as t4 on t4.a = t3.c and t4.b = t2.c;
1699 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
1700 1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL PRIMARY NULL NULL NULL 16 100.00 NULL
1701 1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.a,test.t1.b 1 100.00 Using join buffer (Batched Key Access)
1702 1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.c,test.t1.d 1 100.00 Using join buffer (Batched Key Access)
1703 1 SIMPLE t4 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t3.c,test.t2.c 1 100.00 Using join buffer (Batched Key Access)
1704 Warnings:
1705 Note 1003 Can't push table 't2' as child, access type 'Batched-key' not implemented
1706 Note 1003 Can't push table 't3' as child, access type 'Batched-key' not implemented
1707 Note 1003 Can't push table 't4' as child, access type 'Batched-key' not implemented
1708 Note 1003 /* select#1 */ select straight_join `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t1`.`d` AS `d`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t3`.`c` AS `c`,`test`.`t3`.`d` AS `d`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t4`.`c` AS `c`,`test`.`t4`.`d` AS `d` from `test`.`t1` join `test`.`t1` `t2` left join `test`.`t1` `t3` on(((`test`.`t3`.`b` = `test`.`t1`.`d`) and (`test`.`t3`.`a` = `test`.`t1`.`c`))) left join `test`.`t1` `t4` on(((`test`.`t4`.`b` = `test`.`t2`.`c`) and (`test`.`t4`.`a` = `test`.`t3`.`c`))) where ((`test`.`t2`.`b` = `test`.`t1`.`b`) and (`test`.`t2`.`a` = `test`.`t1`.`a`))
1709 explain
1710 select straight_join *
1711 from t1
1712 left join t1 as t2 on t2.a = t1.a and t2.b = t1.b
1713 join t1 as t3 on t3.a = t1.a
1714 left join t1 as t4 on t4.a = t3.c and t4.b = t2.c;
1715 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
1716 1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL PRIMARY NULL NULL NULL 16 100.00 NULL
1717 1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.a,test.t1.b 1 100.00 Using join buffer (Batched Key Access)
1718 1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.t1.a 1 100.00 Using join buffer (Batched Key Access)
1719 1 SIMPLE t4 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t3.c,test.t2.c 1 100.00 Using join buffer (Batched Key Access)
1720 Warnings:
1721 Note 1003 Can't push table 't2' as child, access type 'Batched-key' not implemented
1722 Note 1003 Can't push table 't3' as child, access type 'Batched-key' not implemented
1723 Note 1003 Can't push table 't4' as child, access type 'Batched-key' not implemented
1724 Note 1003 /* select#1 */ select straight_join `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t1`.`d` AS `d`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t3`.`c` AS `c`,`test`.`t3`.`d` AS `d`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t4`.`c` AS `c`,`test`.`t4`.`d` AS `d` from `test`.`t1` left join `test`.`t1` `t2` on(((`test`.`t2`.`b` = `test`.`t1`.`b`) and (`test`.`t2`.`a` = `test`.`t1`.`a`))) join `test`.`t1` `t3` left join `test`.`t1` `t4` on(((`test`.`t4`.`b` = `test`.`t2`.`c`) and (`test`.`t4`.`a` = `test`.`t3`.`c`))) where (`test`.`t3`.`a` = `test`.`t1`.`a`)
1725 explain
1726 select straight_join *
1727 from t1
1728 join t1 as t2 on t2.a = t1.a and t2.b = t1.b
1729 left join t1 as t3 on t3.a = t1.a
1730 left join t1 as t4 on t4.a = t3.c and t4.b = t2.c;
1731 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
1732 1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL PRIMARY NULL NULL NULL 16 100.00 NULL
1733 1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.a,test.t1.b 1 100.00 Using join buffer (Batched Key Access)
1734 1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.t1.a 1 100.00 Using join buffer (Batched Key Access)
1735 1 SIMPLE t4 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t3.c,test.t2.c 1 100.00 Using join buffer (Batched Key Access)
1736 Warnings:
1737 Note 1003 Can't push table 't2' as child, access type 'Batched-key' not implemented
1738 Note 1003 Can't push table 't3' as child, access type 'Batched-key' not implemented
1739 Note 1003 Can't push table 't4' as child, access type 'Batched-key' not implemented
1740 Note 1003 /* select#1 */ select straight_join `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t1`.`d` AS `d`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t3`.`c` AS `c`,`test`.`t3`.`d` AS `d`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t4`.`c` AS `c`,`test`.`t4`.`d` AS `d` from `test`.`t1` join `test`.`t1` `t2` left join `test`.`t1` `t3` on((`test`.`t3`.`a` = `test`.`t1`.`a`)) left join `test`.`t1` `t4` on(((`test`.`t4`.`b` = `test`.`t2`.`c`) and (`test`.`t4`.`a` = `test`.`t3`.`c`))) where ((`test`.`t2`.`b` = `test`.`t1`.`b`) and (`test`.`t2`.`a` = `test`.`t1`.`a`))
1741 explain
1742 select straight_join *
1743 from t1
1744 left join t1 as t2 on t2.a = t1.a and t2.b = t1.b
1745 join t1 as t3 on t3.a = t1.a
1746 left join t1 as t4 on t4.a = t3.c;
1747 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
1748 1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL PRIMARY NULL NULL NULL 16 100.00 NULL
1749 1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.a,test.t1.b 1 100.00 Using join buffer (Batched Key Access)
1750 1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.t1.a 1 100.00 Using join buffer (Batched Key Access)
1751 1 SIMPLE t4 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.t3.c 1 100.00 Using join buffer (Batched Key Access)
1752 Warnings:
1753 Note 1003 Can't push table 't2' as child, access type 'Batched-key' not implemented
1754 Note 1003 Can't push table 't3' as child, access type 'Batched-key' not implemented
1755 Note 1003 Can't push table 't4' as child, access type 'Batched-key' not implemented
1756 Note 1003 /* select#1 */ select straight_join `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t1`.`d` AS `d`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t3`.`c` AS `c`,`test`.`t3`.`d` AS `d`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t4`.`c` AS `c`,`test`.`t4`.`d` AS `d` from `test`.`t1` left join `test`.`t1` `t2` on(((`test`.`t2`.`b` = `test`.`t1`.`b`) and (`test`.`t2`.`a` = `test`.`t1`.`a`))) join `test`.`t1` `t3` left join `test`.`t1` `t4` on((`test`.`t4`.`a` = `test`.`t3`.`c`)) where (`test`.`t3`.`a` = `test`.`t1`.`a`)
1757 explain
1758 select straight_join *
1759 from t1
1760 join t1 as t2 on t2.a = t1.a and t2.b = t1.b
1761 left join t1 as t3 on t3.a = t1.a
1762 left join t1 as t4 on t4.a = t3.c;
1763 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
1764 1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL PRIMARY NULL NULL NULL 16 100.00 NULL
1765 1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.a,test.t1.b 1 100.00 Using join buffer (Batched Key Access)
1766 1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.t1.a 1 100.00 Using join buffer (Batched Key Access)
1767 1 SIMPLE t4 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.t3.c 1 100.00 Using join buffer (Batched Key Access)
1768 Warnings:
1769 Note 1003 Can't push table 't2' as child, access type 'Batched-key' not implemented
1770 Note 1003 Can't push table 't3' as child, access type 'Batched-key' not implemented
1771 Note 1003 Can't push table 't4' as child, access type 'Batched-key' not implemented
1772 Note 1003 /* select#1 */ select straight_join `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t1`.`d` AS `d`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t3`.`c` AS `c`,`test`.`t3`.`d` AS `d`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t4`.`c` AS `c`,`test`.`t4`.`d` AS `d` from `test`.`t1` join `test`.`t1` `t2` left join `test`.`t1` `t3` on((`test`.`t3`.`a` = `test`.`t1`.`a`)) left join `test`.`t1` `t4` on((`test`.`t4`.`a` = `test`.`t3`.`c`)) where ((`test`.`t2`.`b` = `test`.`t1`.`b`) and (`test`.`t2`.`a` = `test`.`t1`.`a`))
1773 explain
1774 select straight_join *
1775 from
1776 ( t1 as t0 left join t1 as t1 on t1.a = t0.a and t1.b = t0.b
1777 )
1778 left join
1779 ( t1 as t2 join t1 as t3 on t3.a = t2.c and t3.b = t2.d
1780 join t1 as t4 on t4.a = t3.c and t4.b = t2.c
1781 )
1782 on t2.a = t1.a and t2.b = t1.b;
1783 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
1784 1 SIMPLE t0 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 16 100.00 NULL
1785 1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t0.a,test.t0.b 1 100.00 Parent of 2 pushed join@1; Using join buffer (Batched Key Access)
1786 1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.a,test.t1.b 1 100.00 Child of 't1' in pushed join@1; Using join buffer (Batched Key Access)
1787 1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t2.c,test.t2.d 1 100.00 Using join buffer (Batched Key Access)
1788 1 SIMPLE t4 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t3.c,test.t2.c 1 100.00 Using join buffer (Batched Key Access)
1789 Warnings:
1790 Note 1003 Can't push table 't1' as child, access type 'Batched-key' not implemented
1791 Note 1003 Can't push table 't2' as child of 't0', it is in a batched-keys-branch which can't be referred.
1792 Note 1003 Can't push table 't3' as child, access type 'Batched-key' not implemented
1793 Note 1003 Can't push table 't4' as child, access type 'Batched-key' not implemented
1794 Note 1003 /* select#1 */ select straight_join `test`.`t0`.`a` AS `a`,`test`.`t0`.`b` AS `b`,`test`.`t0`.`c` AS `c`,`test`.`t0`.`d` AS `d`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t1`.`d` AS `d`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t3`.`c` AS `c`,`test`.`t3`.`d` AS `d`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t4`.`c` AS `c`,`test`.`t4`.`d` AS `d` from `test`.`t1` `t0` left join `test`.`t1` on(((`test`.`t1`.`b` = `test`.`t0`.`b`) and (`test`.`t1`.`a` = `test`.`t0`.`a`))) left join (`test`.`t1` `t2` join `test`.`t1` `t3` join `test`.`t1` `t4`) on(((`test`.`t3`.`b` = `test`.`t2`.`d`) and (`test`.`t3`.`a` = `test`.`t2`.`c`) and (`test`.`t4`.`b` = `test`.`t2`.`c`) and (`test`.`t4`.`a` = `test`.`t3`.`c`) and (`test`.`t2`.`b` = `test`.`t1`.`b`) and (`test`.`t2`.`a` = `test`.`t1`.`a`))) where true
1795 explain
1796 select straight_join *
1797 from
1798 t1 as x1
1799 left join
1800 ( t1 as x2 join t1 as x3 on x3.a=x2.c
1801 join t1 as x4 on x4.a=x2.d
1802 join t1 as x5 on x5.a=x3.d and x5.b=x4.d
1803 )
1804 on x2.a=x1.c and x2.b=x1.c and
1805 x3.b=x1.d and
1806 x4.b=x1.d;
1807 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
1808 1 SIMPLE x1 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 16 100.00 Parent of 2 pushed join@1
1809 1 SIMPLE x2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.x1.c,test.x1.c 1 100.00 Child of 'x1' in pushed join@1; Using join buffer (Batched Key Access)
1810 1 SIMPLE x3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.x2.c,test.x1.d 1 100.00 Using join buffer (Batched Key Access)
1811 1 SIMPLE x4 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.x2.d,test.x3.b 1 100.00 Using pushed condition (`test`.`x4`.`b` = `test`.`x1`.`d`); Using join buffer (Batched Key Access)
1812 1 SIMPLE x5 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.x3.d,test.x4.d 1 100.00 Using join buffer (Batched Key Access)
1813 Warnings:
1814 Note 1003 Can't push table 'x3' as child, access type 'Batched-key' not implemented
1815 Note 1003 Can't push table 'x4' as child, access type 'Batched-key' not implemented
1816 Note 1003 Can't push table 'x5' as child, access type 'Batched-key' not implemented
1817 Note 1003 /* select#1 */ select straight_join `test`.`x1`.`a` AS `a`,`test`.`x1`.`b` AS `b`,`test`.`x1`.`c` AS `c`,`test`.`x1`.`d` AS `d`,`test`.`x2`.`a` AS `a`,`test`.`x2`.`b` AS `b`,`test`.`x2`.`c` AS `c`,`test`.`x2`.`d` AS `d`,`test`.`x3`.`a` AS `a`,`test`.`x3`.`b` AS `b`,`test`.`x3`.`c` AS `c`,`test`.`x3`.`d` AS `d`,`test`.`x4`.`a` AS `a`,`test`.`x4`.`b` AS `b`,`test`.`x4`.`c` AS `c`,`test`.`x4`.`d` AS `d`,`test`.`x5`.`a` AS `a`,`test`.`x5`.`b` AS `b`,`test`.`x5`.`c` AS `c`,`test`.`x5`.`d` AS `d` from `test`.`t1` `x1` left join (`test`.`t1` `x2` join `test`.`t1` `x3` join `test`.`t1` `x4` join `test`.`t1` `x5`) on(((`test`.`x3`.`a` = `test`.`x2`.`c`) and (`test`.`x4`.`a` = `test`.`x2`.`d`) and (`test`.`x5`.`b` = `test`.`x4`.`d`) and (`test`.`x5`.`a` = `test`.`x3`.`d`) and (`test`.`x3`.`b` = `test`.`x1`.`d`) and (`test`.`x4`.`b` = `test`.`x1`.`d`) and (`test`.`x2`.`a` = `test`.`x1`.`c`) and (`test`.`x2`.`b` = `test`.`x1`.`c`))) where true
1818 explain
1819 select straight_join * from
1820 (t1 left join t1 as t2 on t2.a = t1.c and t2.b = t1.d)
1821 inner join t1 as t3 on t3.a = t1.b and t3.b = t1.c
1822 left join t1 as t4 on t4.a = t2.c and t4.b = t1.c;
1823 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
1824 1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 16 100.00 NULL
1825 1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.c,test.t1.d 1 100.00 Using join buffer (Batched Key Access)
1826 1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.b,test.t1.c 1 100.00 Using join buffer (Batched Key Access)
1827 1 SIMPLE t4 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t2.c,test.t1.c 1 100.00 Using join buffer (Batched Key Access)
1828 Warnings:
1829 Note 1003 Can't push table 't2' as child, access type 'Batched-key' not implemented
1830 Note 1003 Can't push table 't3' as child, access type 'Batched-key' not implemented
1831 Note 1003 Can't push table 't4' as child, access type 'Batched-key' not implemented
1832 Note 1003 /* select#1 */ select straight_join `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t1`.`d` AS `d`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t3`.`c` AS `c`,`test`.`t3`.`d` AS `d`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t4`.`c` AS `c`,`test`.`t4`.`d` AS `d` from `test`.`t1` left join `test`.`t1` `t2` on(((`test`.`t2`.`b` = `test`.`t1`.`d`) and (`test`.`t2`.`a` = `test`.`t1`.`c`))) join `test`.`t1` `t3` left join `test`.`t1` `t4` on(((`test`.`t4`.`b` = `test`.`t1`.`c`) and (`test`.`t4`.`a` = `test`.`t2`.`c`))) where ((`test`.`t3`.`b` = `test`.`t1`.`c`) and (`test`.`t3`.`a` = `test`.`t1`.`b`))
1833 select straight_join * from
1834 (t1 left join t1 as t2 on t2.a = t1.c and t2.b = t1.d)
1835 inner join t1 as t3 on t3.a = t1.b and t3.b = t1.c
1836 left join t1 as t4 on t4.a = t2.c and t4.b = t1.c;
1837 a b c d a b c d a b c d a b c d
1838 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1839 1 3 1 2 1 2 5 1 3 1 1 2 NULL NULL NULL NULL
1840 1 4 2 3 2 3 4 5 4 2 5 1 4 2 5 1
1841 2 1 3 4 3 4 3 4 1 3 1 2 3 3 3 3
1842 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
1843 2 3 4 5 NULL NULL NULL NULL 3 4 3 4 NULL NULL NULL NULL
1844 3 1 1 2 1 2 5 1 1 1 1 1 NULL NULL NULL NULL
1845 3 2 2 3 2 3 4 5 2 2 2 2 4 2 5 1
1846 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3
1847 3 4 3 4 3 4 3 4 4 3 1 2 3 3 3 3
1848 4 1 4 5 NULL NULL NULL NULL 1 4 2 3 NULL NULL NULL NULL
1849 4 3 1 2 1 2 5 1 3 1 1 2 NULL NULL NULL NULL
1850 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
1851 explain
1852 select straight_join * from
1853 (t1 left join t1 as t2 on t2.a = t1.c and t2.b = t1.d)
1854 inner join t1 as t3 on t3.a = t2.b and t3.b = t1.c
1855 left join t1 as t4 on t4.a = t2.c and t4.b = t1.c;
1856 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
1857 1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 16 100.00 NULL
1858 1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.c,test.t1.d 1 100.00 Using join buffer (Batched Key Access)
1859 1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.d,test.t1.c 1 100.00 Using join buffer (Batched Key Access)
1860 1 SIMPLE t4 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t2.c,test.t1.c 1 100.00 Using join buffer (Batched Key Access)
1861 Warnings:
1862 Note 1003 Can't push table 't2' as child, access type 'Batched-key' not implemented
1863 Note 1003 Can't push table 't3' as child, access type 'Batched-key' not implemented
1864 Note 1003 Can't push table 't4' as child, access type 'Batched-key' not implemented
1865 Note 1003 /* select#1 */ select straight_join `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t1`.`d` AS `d`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t3`.`c` AS `c`,`test`.`t3`.`d` AS `d`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t4`.`c` AS `c`,`test`.`t4`.`d` AS `d` from `test`.`t1` join `test`.`t1` `t2` join `test`.`t1` `t3` left join `test`.`t1` `t4` on(((`test`.`t4`.`b` = `test`.`t1`.`c`) and (`test`.`t4`.`a` = `test`.`t2`.`c`))) where ((`test`.`t2`.`a` = `test`.`t1`.`c`) and (`test`.`t3`.`b` = `test`.`t1`.`c`) and (`test`.`t2`.`b` = `test`.`t1`.`d`) and (`test`.`t3`.`a` = `test`.`t1`.`d`))
1866 select straight_join * from
1867 (t1 left join t1 as t2 on t2.a = t1.c and t2.b = t1.d)
1868 inner join t1 as t3 on t3.a = t2.b and t3.b = t1.c
1869 left join t1 as t4 on t4.a = t2.c and t4.b = t1.c;
1870 a b c d a b c d a b c d a b c d
1871 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1872 1 3 1 2 1 2 5 1 2 1 3 4 NULL NULL NULL NULL
1873 1 4 2 3 2 3 4 5 3 2 2 3 4 2 5 1
1874 2 1 3 4 3 4 3 4 4 3 1 2 3 3 3 3
1875 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
1876 3 1 1 2 1 2 5 1 2 1 3 4 NULL NULL NULL NULL
1877 3 2 2 3 2 3 4 5 3 2 2 3 4 2 5 1
1878 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3
1879 3 4 3 4 3 4 3 4 4 3 1 2 3 3 3 3
1880 4 3 1 2 1 2 5 1 2 1 3 4 NULL NULL NULL NULL
1881 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
1882 set ndb_join_pushdown=true;
1883 explain
1884 select * from t1 x, t1 y, t1 z, t1 where
1885 y.a=x.d and y.b=x.b and
1886 z.a=y.d and
1887 t1.a = z.d and t1.b=z.b;
1888 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
1889 1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 16 100.00 NULL
1890 1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.x.d,test.x.b 1 100.00 Using join buffer (Batched Key Access)
1891 1 SIMPLE z p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.y.d 1 100.00 Using join buffer (Batched Key Access)
1892 1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.z.d,test.z.b 1 100.00 Using join buffer (Batched Key Access)
1893 Warnings:
1894 Note 1003 Can't push table 'y' as child, access type 'Batched-key' not implemented
1895 Note 1003 Can't push table 'z' as child, access type 'Batched-key' not implemented
1896 Note 1003 Can't push table 't1' as child, access type 'Batched-key' not implemented
1897 Note 1003 /* select#1 */ select `test`.`x`.`a` AS `a`,`test`.`x`.`b` AS `b`,`test`.`x`.`c` AS `c`,`test`.`x`.`d` AS `d`,`test`.`y`.`a` AS `a`,`test`.`y`.`b` AS `b`,`test`.`y`.`c` AS `c`,`test`.`y`.`d` AS `d`,`test`.`z`.`a` AS `a`,`test`.`z`.`b` AS `b`,`test`.`z`.`c` AS `c`,`test`.`z`.`d` AS `d`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t1`.`d` AS `d` from `test`.`t1` `x` join `test`.`t1` `y` join `test`.`t1` `z` join `test`.`t1` where ((`test`.`t1`.`b` = `test`.`z`.`b`) and (`test`.`t1`.`a` = `test`.`z`.`d`) and (`test`.`z`.`a` = `test`.`y`.`d`) and (`test`.`y`.`b` = `test`.`x`.`b`) and (`test`.`y`.`a` = `test`.`x`.`d`))
1898 select * from t1 x, t1 y, t1 z, t1 where
1899 y.a=x.d and y.b=x.b and
1900 z.a=y.d and
1901 t1.a = z.d and t1.b=z.b;
1902 a b c d a b c d a b c d a b c d
1903 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1904 1 1 1 1 1 1 1 1 1 2 5 1 1 2 5 1
1905 1 1 1 1 1 1 1 1 1 3 1 2 2 3 4 5
1906 1 1 1 1 1 1 1 1 1 4 2 3 3 4 3 4
1907 1 2 5 1 1 2 5 1 1 1 1 1 1 1 1 1
1908 1 2 5 1 1 2 5 1 1 2 5 1 1 2 5 1
1909 1 2 5 1 1 2 5 1 1 3 1 2 2 3 4 5
1910 1 2 5 1 1 2 5 1 1 4 2 3 3 4 3 4
1911 1 4 2 3 3 4 3 4 4 2 5 1 1 2 5 1
1912 1 4 2 3 3 4 3 4 4 3 1 2 2 3 4 5
1913 1 4 2 3 3 4 3 4 4 4 4 4 4 4 4 4
1914 2 2 2 2 2 2 2 2 2 1 3 4 4 1 4 5
1915 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
1916 2 2 2 2 2 2 2 2 2 4 5 1 1 4 2 3
1917 2 4 5 1 1 4 2 3 3 1 1 2 2 1 3 4
1918 2 4 5 1 1 4 2 3 3 2 2 3 3 2 2 3
1919 2 4 5 1 1 4 2 3 3 3 3 3 3 3 3 3
1920 2 4 5 1 1 4 2 3 3 4 3 4 4 4 4 4
1921 3 1 1 2 2 1 3 4 4 2 5 1 1 2 5 1
1922 3 1 1 2 2 1 3 4 4 3 1 2 2 3 4 5
1923 3 1 1 2 2 1 3 4 4 4 4 4 4 4 4 4
1924 3 2 2 3 3 2 2 3 3 1 1 2 2 1 3 4
1925 3 2 2 3 3 2 2 3 3 2 2 3 3 2 2 3
1926 3 2 2 3 3 2 2 3 3 3 3 3 3 3 3 3
1927 3 2 2 3 3 2 2 3 3 4 3 4 4 4 4 4
1928 3 3 3 3 3 3 3 3 3 1 1 2 2 1 3 4
1929 3 3 3 3 3 3 3 3 3 2 2 3 3 2 2 3
1930 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3
1931 3 3 3 3 3 3 3 3 3 4 3 4 4 4 4 4
1932 3 4 3 4 4 4 4 4 4 2 5 1 1 2 5 1
1933 3 4 3 4 4 4 4 4 4 3 1 2 2 3 4 5
1934 3 4 3 4 4 4 4 4 4 4 4 4 4 4 4 4
1935 4 2 5 1 1 2 5 1 1 1 1 1 1 1 1 1
1936 4 2 5 1 1 2 5 1 1 2 5 1 1 2 5 1
1937 4 2 5 1 1 2 5 1 1 3 1 2 2 3 4 5
1938 4 2 5 1 1 2 5 1 1 4 2 3 3 4 3 4
1939 4 4 4 4 4 4 4 4 4 2 5 1 1 2 5 1
1940 4 4 4 4 4 4 4 4 4 3 1 2 2 3 4 5
1941 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
1942 explain
1943 select * from t1 x, t1 y where
1944 x.a <= 2 and
1945 y.a=x.d and y.b=x.b;
1946 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
1947 1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 range PRIMARY PRIMARY 4 NULL 3 100.00 Using pushed condition (`test`.`x`.`a` <= 2); Using MRR
1948 1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.x.d,test.x.b 1 100.00 Using join buffer (Batched Key Access)
1949 Warnings:
1950 Note 1003 Can't push table 'y' as child, access type 'Batched-key' not implemented
1951 Note 1003 /* select#1 */ select `test`.`x`.`a` AS `a`,`test`.`x`.`b` AS `b`,`test`.`x`.`c` AS `c`,`test`.`x`.`d` AS `d`,`test`.`y`.`a` AS `a`,`test`.`y`.`b` AS `b`,`test`.`y`.`c` AS `c`,`test`.`y`.`d` AS `d` from `test`.`t1` `x` join `test`.`t1` `y` where ((`test`.`y`.`b` = `test`.`x`.`b`) and (`test`.`y`.`a` = `test`.`x`.`d`) and (`test`.`x`.`a` <= 2))
1952 select * from t1 x, t1 y where
1953 x.a <= 2 and
1954 y.a=x.d and y.b=x.b;
1955 a b c d a b c d
1956 1 1 1 1 1 1 1 1
1957 1 2 5 1 1 2 5 1
1958 1 3 1 2 2 3 4 5
1959 1 4 2 3 3 4 3 4
1960 2 1 3 4 4 1 4 5
1961 2 2 2 2 2 2 2 2
1962 2 4 5 1 1 4 2 3
1963 explain
1964 select * from t1 x, t1 y where
1965 (x.a <= 2 or x.a > 3) and
1966 y.a=x.d and y.b=x.b;
1967 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
1968 1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 range PRIMARY PRIMARY 4 NULL 6 100.00 Using pushed condition ((`test`.`x`.`a` <= 2) or (`test`.`x`.`a` > 3)); Using MRR
1969 1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.x.d,test.x.b 1 100.00 Using join buffer (Batched Key Access)
1970 Warnings:
1971 Note 1003 Can't push table 'y' as child, access type 'Batched-key' not implemented
1972 Note 1003 /* select#1 */ select `test`.`x`.`a` AS `a`,`test`.`x`.`b` AS `b`,`test`.`x`.`c` AS `c`,`test`.`x`.`d` AS `d`,`test`.`y`.`a` AS `a`,`test`.`y`.`b` AS `b`,`test`.`y`.`c` AS `c`,`test`.`y`.`d` AS `d` from `test`.`t1` `x` join `test`.`t1` `y` where ((`test`.`y`.`b` = `test`.`x`.`b`) and (`test`.`y`.`a` = `test`.`x`.`d`) and ((`test`.`x`.`a` <= 2) or (`test`.`x`.`a` > 3)))
1973 select * from t1 x, t1 y where
1974 (x.a <= 2 or x.a > 3) and
1975 y.a=x.d and y.b=x.b;
1976 a b c d a b c d
1977 1 1 1 1 1 1 1 1
1978 1 2 5 1 1 2 5 1
1979 1 3 1 2 2 3 4 5
1980 1 4 2 3 3 4 3 4
1981 2 1 3 4 4 1 4 5
1982 2 2 2 2 2 2 2 2
1983 2 4 5 1 1 4 2 3
1984 4 2 5 1 1 2 5 1
1985 4 3 1 2 2 3 4 5
1986 4 4 4 4 4 4 4 4
1987 explain
1988 select * from t1 x, t1 y where
1989 (x.a >= 2 or x.a < 3) and
1990 y.a=x.d and y.b=x.b;
1991 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
1992 1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 ALL PRIMARY NULL NULL NULL # # Using pushed condition ((`test`.`x`.`a` >= 2) or (`test`.`x`.`a` < 3))
1993 1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.x.d,test.x.b # # Using join buffer (Batched Key Access)
1994 Warnings:
1995 Note 1003 Can't push table 'y' as child, access type 'Batched-key' not implemented
1996 Note 1003 /* select#1 */ select `test`.`x`.`a` AS `a`,`test`.`x`.`b` AS `b`,`test`.`x`.`c` AS `c`,`test`.`x`.`d` AS `d`,`test`.`y`.`a` AS `a`,`test`.`y`.`b` AS `b`,`test`.`y`.`c` AS `c`,`test`.`y`.`d` AS `d` from `test`.`t1` `x` join `test`.`t1` `y` where ((`test`.`y`.`b` = `test`.`x`.`b`) and (`test`.`y`.`a` = `test`.`x`.`d`) and ((`test`.`x`.`a` >= 2) or (`test`.`x`.`a` < 3)))
1997 select * from t1 x, t1 y where
1998 (x.a >= 2 or x.a < 3) and
1999 y.a=x.d and y.b=x.b;
2000 a b c d a b c d
2001 1 1 1 1 1 1 1 1
2002 1 2 5 1 1 2 5 1
2003 1 3 1 2 2 3 4 5
2004 1 4 2 3 3 4 3 4
2005 2 1 3 4 4 1 4 5
2006 2 2 2 2 2 2 2 2
2007 2 4 5 1 1 4 2 3
2008 3 1 1 2 2 1 3 4
2009 3 2 2 3 3 2 2 3
2010 3 3 3 3 3 3 3 3
2011 3 4 3 4 4 4 4 4
2012 4 2 5 1 1 2 5 1
2013 4 3 1 2 2 3 4 5
2014 4 4 4 4 4 4 4 4
2015 explain
2016 select * from t1 x, t1 y where
2017 (x.a <= 2 or x.a in (0,5,4)) and
2018 y.a=x.d and y.b=x.b;
2019 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
2020 1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 range PRIMARY PRIMARY 4 NULL 9 100.00 Using pushed condition ((`test`.`x`.`a` <= 2) or (`test`.`x`.`a` in (0,5,4))); Using MRR
2021 1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.x.d,test.x.b 1 100.00 Using join buffer (Batched Key Access)
2022 Warnings:
2023 Note 1003 Can't push table 'y' as child, access type 'Batched-key' not implemented
2024 Note 1003 /* select#1 */ select `test`.`x`.`a` AS `a`,`test`.`x`.`b` AS `b`,`test`.`x`.`c` AS `c`,`test`.`x`.`d` AS `d`,`test`.`y`.`a` AS `a`,`test`.`y`.`b` AS `b`,`test`.`y`.`c` AS `c`,`test`.`y`.`d` AS `d` from `test`.`t1` `x` join `test`.`t1` `y` where ((`test`.`y`.`b` = `test`.`x`.`b`) and (`test`.`y`.`a` = `test`.`x`.`d`) and ((`test`.`x`.`a` <= 2) or (`test`.`x`.`a` in (0,5,4))))
2025 select * from t1 x, t1 y where
2026 (x.a <= 2 or x.a in (0,5,4)) and
2027 y.a=x.d and y.b=x.b;
2028 a b c d a b c d
2029 1 1 1 1 1 1 1 1
2030 1 2 5 1 1 2 5 1
2031 1 3 1 2 2 3 4 5
2032 1 4 2 3 3 4 3 4
2033 2 1 3 4 4 1 4 5
2034 2 2 2 2 2 2 2 2
2035 2 4 5 1 1 4 2 3
2036 4 2 5 1 1 2 5 1
2037 4 3 1 2 2 3 4 5
2038 4 4 4 4 4 4 4 4
2039 explain
2040 select * from t1 x, t1 y where
2041 (x.a <= 2 or (x.a,x.b) in ((0,0),(5,0),(4,3))) and
2042 y.a=x.d and y.b=x.b;
2043 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
2044 1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 range PRIMARY PRIMARY 8 NULL 5 100.00 Using where; Using MRR
2045 1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.x.d,test.x.b 1 100.00 Using join buffer (Batched Key Access)
2046 Warnings:
2047 Note 1003 Can't push table 'y' as child, access type 'Batched-key' not implemented
2048 Note 1003 /* select#1 */ select `test`.`x`.`a` AS `a`,`test`.`x`.`b` AS `b`,`test`.`x`.`c` AS `c`,`test`.`x`.`d` AS `d`,`test`.`y`.`a` AS `a`,`test`.`y`.`b` AS `b`,`test`.`y`.`c` AS `c`,`test`.`y`.`d` AS `d` from `test`.`t1` `x` join `test`.`t1` `y` where ((`test`.`y`.`b` = `test`.`x`.`b`) and (`test`.`y`.`a` = `test`.`x`.`d`) and ((`test`.`x`.`a` <= 2) or ((`test`.`x`.`a`,`test`.`x`.`b`) in ((0,0),(5,0),(4,3)))))
2049 select * from t1 x, t1 y where
2050 (x.a <= 2 or (x.a,x.b) in ((0,0),(5,0),(4,3))) and
2051 y.a=x.d and y.b=x.b;
2052 a b c d a b c d
2053 1 1 1 1 1 1 1 1
2054 1 2 5 1 1 2 5 1
2055 1 3 1 2 2 3 4 5
2056 1 4 2 3 3 4 3 4
2057 2 1 3 4 4 1 4 5
2058 2 2 2 2 2 2 2 2
2059 2 4 5 1 1 4 2 3
2060 4 3 1 2 2 3 4 5
2061 explain format=tree
2062 select straight_join t1.b, count(distinct t2.b) as cnt
2063 from t1
2064 join t1 as t2 on t2.a = t1.c
2065 group by t1.b
2066 order by t1.b, cnt;
2067 EXPLAIN
2068 -> Sort: t1.b, cnt
2069 -> Stream results
2070 -> Group aggregate: count(distinct t1.b)
2071 -> Sort: t1.b
2072 -> Stream results
2073 -> Batched key access inner join
2074 -> Batch input rows
2075 -> Table scan on t1 (cost=4002 rows=16)
2076 -> Multi-range index lookup on t2 using PRIMARY (a=t1.c) (cost=0.506 rows=1)
2077
2078 Warnings:
2079 Note 1003 Can't push table 't2' as child, access type 'Multi-range' not implemented
2080 select straight_join t1.b, count(distinct t2.b) as cnt
2081 from t1
2082 join t1 as t2 on t2.a = t1.c
2083 group by t1.b
2084 order by t1.b, cnt;
2085 b cnt
2086 1 4
2087 2 4
2088 3 4
2089 4 4
2090 explain
2091 select *
2092 from t1
2093 join t1 as t2 on t2.a = t1.b and t2.b = t1.c
2094 join t1 as t3 on t3.a = t2.a and t3.b = t2.b
2095 order by t1.c,t1.d,
2096 t1.a, t1.b;
2097 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
2098 1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 16 100.00 Using temporary; Using filesort
2099 1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.b,test.t1.c 1 100.00 Using join buffer (Batched Key Access)
2100 1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.b,test.t1.c 1 100.00 Using join buffer (Batched Key Access)
2101 Warnings:
2102 Note 1003 Can't push table 't2' as child, access type 'Batched-key' not implemented
2103 Note 1003 Can't push table 't3' as child, access type 'Batched-key' not implemented
2104 Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t1`.`d` AS `d`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t3`.`c` AS `c`,`test`.`t3`.`d` AS `d` from `test`.`t1` join `test`.`t1` `t2` join `test`.`t1` `t3` where ((`test`.`t2`.`b` = `test`.`t1`.`c`) and (`test`.`t3`.`b` = `test`.`t1`.`c`) and (`test`.`t2`.`a` = `test`.`t1`.`b`) and (`test`.`t3`.`a` = `test`.`t1`.`b`)) order by `test`.`t1`.`c`,`test`.`t1`.`d`,`test`.`t1`.`a`,`test`.`t1`.`b`
2105 select *
2106 from t1
2107 join t1 as t2 on t2.a = t1.b and t2.b = t1.c
2108 join t1 as t3 on t3.a = t2.a and t3.b = t2.b
2109 order by t1.c,t1.d,
2110 t1.a, t1.b;
2111 a b c d a b c d a b c d
2112 1 1 1 1 1 1 1 1 1 1 1 1
2113 1 3 1 2 3 1 1 2 3 1 1 2
2114 3 1 1 2 1 1 1 1 1 1 1 1
2115 4 3 1 2 3 1 1 2 3 1 1 2
2116 2 2 2 2 2 2 2 2 2 2 2 2
2117 1 4 2 3 4 2 5 1 4 2 5 1
2118 3 2 2 3 2 2 2 2 2 2 2 2
2119 3 3 3 3 3 3 3 3 3 3 3 3
2120 2 1 3 4 1 3 1 2 1 3 1 2
2121 3 4 3 4 4 3 1 2 4 3 1 2
2122 4 4 4 4 4 4 4 4 4 4 4 4
2123 2 3 4 5 3 4 3 4 3 4 3 4
2124 4 1 4 5 1 4 2 3 1 4 2 3
2125 explain
2126 select *
2127 from t1
2128 join t1 as t2 on t2.a = t1.b and t2.b = t1.c
2129 join t1 as t3 on t3.a = t2.a and t3.b = t2.b
2130 order by t1.c,t2.d,
2131 t1.a, t1.b;
2132 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
2133 1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 16 100.00 Using temporary; Using filesort
2134 1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.b,test.t1.c 1 100.00 Using join buffer (Batched Key Access)
2135 1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.b,test.t1.c 1 100.00 Using join buffer (Batched Key Access)
2136 Warnings:
2137 Note 1003 Can't push table 't2' as child, access type 'Batched-key' not implemented
2138 Note 1003 Can't push table 't3' as child, access type 'Batched-key' not implemented
2139 Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t1`.`d` AS `d`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t3`.`c` AS `c`,`test`.`t3`.`d` AS `d` from `test`.`t1` join `test`.`t1` `t2` join `test`.`t1` `t3` where ((`test`.`t2`.`b` = `test`.`t1`.`c`) and (`test`.`t3`.`b` = `test`.`t1`.`c`) and (`test`.`t2`.`a` = `test`.`t1`.`b`) and (`test`.`t3`.`a` = `test`.`t1`.`b`)) order by `test`.`t1`.`c`,`test`.`t2`.`d`,`test`.`t1`.`a`,`test`.`t1`.`b`
2140 select *
2141 from t1
2142 join t1 as t2 on t2.a = t1.b and t2.b = t1.c
2143 join t1 as t3 on t3.a = t2.a and t3.b = t2.b
2144 order by t1.c,t2.d,
2145 t1.a, t1.b;
2146 a b c d a b c d a b c d
2147 1 1 1 1 1 1 1 1 1 1 1 1
2148 3 1 1 2 1 1 1 1 1 1 1 1
2149 1 3 1 2 3 1 1 2 3 1 1 2
2150 4 3 1 2 3 1 1 2 3 1 1 2
2151 1 4 2 3 4 2 5 1 4 2 5 1
2152 2 2 2 2 2 2 2 2 2 2 2 2
2153 3 2 2 3 2 2 2 2 2 2 2 2
2154 2 1 3 4 1 3 1 2 1 3 1 2
2155 3 4 3 4 4 3 1 2 4 3 1 2
2156 3 3 3 3 3 3 3 3 3 3 3 3
2157 4 1 4 5 1 4 2 3 1 4 2 3
2158 2 3 4 5 3 4 3 4 3 4 3 4
2159 4 4 4 4 4 4 4 4 4 4 4 4
2160 explain
2161 select *
2162 from t1
2163 join t1 as t2 on t2.a = t1.b and t2.b = t1.c
2164 join t1 as t3 on t3.a = t2.a and t3.b = t2.b
2165 order by t1.a,t1.b;
2166 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
2167 1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 16 100.00 Using temporary; Using filesort
2168 1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.b,test.t1.c 1 100.00 Using join buffer (Batched Key Access)
2169 1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.b,test.t1.c 1 100.00 Using join buffer (Batched Key Access)
2170 Warnings:
2171 Note 1003 Can't push table 't2' as child, access type 'Batched-key' not implemented
2172 Note 1003 Can't push table 't3' as child, access type 'Batched-key' not implemented
2173 Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t1`.`d` AS `d`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t3`.`c` AS `c`,`test`.`t3`.`d` AS `d` from `test`.`t1` join `test`.`t1` `t2` join `test`.`t1` `t3` where ((`test`.`t2`.`b` = `test`.`t1`.`c`) and (`test`.`t3`.`b` = `test`.`t1`.`c`) and (`test`.`t2`.`a` = `test`.`t1`.`b`) and (`test`.`t3`.`a` = `test`.`t1`.`b`)) order by `test`.`t1`.`a`,`test`.`t1`.`b`
2174 select *
2175 from t1
2176 join t1 as t2 on t2.a = t1.b and t2.b = t1.c
2177 join t1 as t3 on t3.a = t2.a and t3.b = t2.b
2178 order by t1.a,t1.b;
2179 a b c d a b c d a b c d
2180 1 1 1 1 1 1 1 1 1 1 1 1
2181 1 3 1 2 3 1 1 2 3 1 1 2
2182 1 4 2 3 4 2 5 1 4 2 5 1
2183 2 1 3 4 1 3 1 2 1 3 1 2
2184 2 2 2 2 2 2 2 2 2 2 2 2
2185 2 3 4 5 3 4 3 4 3 4 3 4
2186 3 1 1 2 1 1 1 1 1 1 1 1
2187 3 2 2 3 2 2 2 2 2 2 2 2
2188 3 3 3 3 3 3 3 3 3 3 3 3
2189 3 4 3 4 4 3 1 2 4 3 1 2
2190 4 1 4 5 1 4 2 3 1 4 2 3
2191 4 3 1 2 3 1 1 2 3 1 1 2
2192 4 4 4 4 4 4 4 4 4 4 4 4
2193 explain
2194 select *
2195 from t1
2196 join t1 as t2 on t2.a = t1.b and t2.b = t1.c
2197 join t1 as t3 on t3.a = t2.a and t3.b = t2.b
2198 order by t1.a,t2.b,
2199 t1.a, t1.b;
2200 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
2201 1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 16 100.00 Using temporary; Using filesort
2202 1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.b,test.t1.c 1 100.00 Using join buffer (Batched Key Access)
2203 1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.b,test.t1.c 1 100.00 Using join buffer (Batched Key Access)
2204 Warnings:
2205 Note 1003 Can't push table 't2' as child, access type 'Batched-key' not implemented
2206 Note 1003 Can't push table 't3' as child, access type 'Batched-key' not implemented
2207 Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t1`.`d` AS `d`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t3`.`c` AS `c`,`test`.`t3`.`d` AS `d` from `test`.`t1` join `test`.`t1` `t2` join `test`.`t1` `t3` where ((`test`.`t2`.`b` = `test`.`t1`.`c`) and (`test`.`t3`.`b` = `test`.`t1`.`c`) and (`test`.`t2`.`a` = `test`.`t1`.`b`) and (`test`.`t3`.`a` = `test`.`t1`.`b`)) order by `test`.`t1`.`a`,`test`.`t2`.`b`,`test`.`t1`.`b`
2208 select *
2209 from t1
2210 join t1 as t2 on t2.a = t1.b and t2.b = t1.c
2211 join t1 as t3 on t3.a = t2.a and t3.b = t2.b
2212 order by t1.a,t2.b,
2213 t1.a, t1.b;
2214 a b c d a b c d a b c d
2215 1 1 1 1 1 1 1 1 1 1 1 1
2216 1 3 1 2 3 1 1 2 3 1 1 2
2217 1 4 2 3 4 2 5 1 4 2 5 1
2218 2 2 2 2 2 2 2 2 2 2 2 2
2219 2 1 3 4 1 3 1 2 1 3 1 2
2220 2 3 4 5 3 4 3 4 3 4 3 4
2221 3 1 1 2 1 1 1 1 1 1 1 1
2222 3 2 2 3 2 2 2 2 2 2 2 2
2223 3 3 3 3 3 3 3 3 3 3 3 3
2224 3 4 3 4 4 3 1 2 4 3 1 2
2225 4 3 1 2 3 1 1 2 3 1 1 2
2226 4 1 4 5 1 4 2 3 1 4 2 3
2227 4 4 4 4 4 4 4 4 4 4 4 4
2228 explain
2229 select *
2230 from t1
2231 join t1 as t2 on t2.a = t1.b and t2.b = t1.c
2232 join t1 as t3 on t3.a = t2.a and t3.b = t2.b
2233 order by t1.a desc,t1.b desc;
2234 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
2235 1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 16 100.00 Using temporary; Using filesort
2236 1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.b,test.t1.c 1 100.00 Using join buffer (Batched Key Access)
2237 1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.b,test.t1.c 1 100.00 Using join buffer (Batched Key Access)
2238 Warnings:
2239 Note 1003 Can't push table 't2' as child, access type 'Batched-key' not implemented
2240 Note 1003 Can't push table 't3' as child, access type 'Batched-key' not implemented
2241 Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t1`.`d` AS `d`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t3`.`c` AS `c`,`test`.`t3`.`d` AS `d` from `test`.`t1` join `test`.`t1` `t2` join `test`.`t1` `t3` where ((`test`.`t2`.`b` = `test`.`t1`.`c`) and (`test`.`t3`.`b` = `test`.`t1`.`c`) and (`test`.`t2`.`a` = `test`.`t1`.`b`) and (`test`.`t3`.`a` = `test`.`t1`.`b`)) order by `test`.`t1`.`a` desc,`test`.`t1`.`b` desc
2242 select *
2243 from t1
2244 join t1 as t2 on t2.a = t1.b and t2.b = t1.c
2245 join t1 as t3 on t3.a = t2.a and t3.b = t2.b
2246 order by t1.a desc,t1.b desc;
2247 a b c d a b c d a b c d
2248 4 4 4 4 4 4 4 4 4 4 4 4
2249 4 3 1 2 3 1 1 2 3 1 1 2
2250 4 1 4 5 1 4 2 3 1 4 2 3
2251 3 4 3 4 4 3 1 2 4 3 1 2
2252 3 3 3 3 3 3 3 3 3 3 3 3
2253 3 2 2 3 2 2 2 2 2 2 2 2
2254 3 1 1 2 1 1 1 1 1 1 1 1
2255 2 3 4 5 3 4 3 4 3 4 3 4
2256 2 2 2 2 2 2 2 2 2 2 2 2
2257 2 1 3 4 1 3 1 2 1 3 1 2
2258 1 4 2 3 4 2 5 1 4 2 5 1
2259 1 3 1 2 3 1 1 2 3 1 1 2
2260 1 1 1 1 1 1 1 1 1 1 1 1
2261 explain
2262 select *
2263 from t1
2264 join t1 as t2 on t2.a = t1.b and t2.b = t1.c
2265 join t1 as t3 on t3.a = t2.a and t3.b = t2.b
2266 order by t1.b,t1.a;
2267 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
2268 1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 16 100.00 Using temporary; Using filesort
2269 1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.b,test.t1.c 1 100.00 Using join buffer (Batched Key Access)
2270 1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.b,test.t1.c 1 100.00 Using join buffer (Batched Key Access)
2271 Warnings:
2272 Note 1003 Can't push table 't2' as child, access type 'Batched-key' not implemented
2273 Note 1003 Can't push table 't3' as child, access type 'Batched-key' not implemented
2274 Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t1`.`d` AS `d`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t3`.`c` AS `c`,`test`.`t3`.`d` AS `d` from `test`.`t1` join `test`.`t1` `t2` join `test`.`t1` `t3` where ((`test`.`t2`.`b` = `test`.`t1`.`c`) and (`test`.`t3`.`b` = `test`.`t1`.`c`) and (`test`.`t2`.`a` = `test`.`t1`.`b`) and (`test`.`t3`.`a` = `test`.`t1`.`b`)) order by `test`.`t1`.`b`,`test`.`t1`.`a`
2275 select *
2276 from t1
2277 join t1 as t2 on t2.a = t1.b and t2.b = t1.c
2278 join t1 as t3 on t3.a = t2.a and t3.b = t2.b
2279 order by t1.b,t1.a;
2280 a b c d a b c d a b c d
2281 1 1 1 1 1 1 1 1 1 1 1 1
2282 2 1 3 4 1 3 1 2 1 3 1 2
2283 3 1 1 2 1 1 1 1 1 1 1 1
2284 4 1 4 5 1 4 2 3 1 4 2 3
2285 2 2 2 2 2 2 2 2 2 2 2 2
2286 3 2 2 3 2 2 2 2 2 2 2 2
2287 1 3 1 2 3 1 1 2 3 1 1 2
2288 2 3 4 5 3 4 3 4 3 4 3 4
2289 3 3 3 3 3 3 3 3 3 3 3 3
2290 4 3 1 2 3 1 1 2 3 1 1 2
2291 1 4 2 3 4 2 5 1 4 2 5 1
2292 3 4 3 4 4 3 1 2 4 3 1 2
2293 4 4 4 4 4 4 4 4 4 4 4 4
2294 explain
2295 select *
2296 from t1
2297 join t1 as t2 on t2.a = t1.b and t2.b = t1.c
2298 join t1 as t3 on t3.a = t2.a and t3.b = t2.b
2299 order by t1.a;
2300 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
2301 1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 16 100.00 Using temporary; Using filesort
2302 1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.b,test.t1.c 1 100.00 Using join buffer (Batched Key Access)
2303 1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.b,test.t1.c 1 100.00 Using join buffer (Batched Key Access)
2304 Warnings:
2305 Note 1003 Can't push table 't2' as child, access type 'Batched-key' not implemented
2306 Note 1003 Can't push table 't3' as child, access type 'Batched-key' not implemented
2307 Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t1`.`d` AS `d`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t3`.`c` AS `c`,`test`.`t3`.`d` AS `d` from `test`.`t1` join `test`.`t1` `t2` join `test`.`t1` `t3` where ((`test`.`t2`.`b` = `test`.`t1`.`c`) and (`test`.`t3`.`b` = `test`.`t1`.`c`) and (`test`.`t2`.`a` = `test`.`t1`.`b`) and (`test`.`t3`.`a` = `test`.`t1`.`b`)) order by `test`.`t1`.`a`
2308 explain
2309 select *
2310 from t1
2311 join t1 as t2 on t2.a = t1.b and t2.b = t1.c
2312 join t1 as t3 on t3.a = t2.a and t3.b = t2.b
2313 order by t1.b;
2314 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
2315 1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 16 100.00 Using temporary; Using filesort
2316 1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.b,test.t1.c 1 100.00 Using join buffer (Batched Key Access)
2317 1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.b,test.t1.c 1 100.00 Using join buffer (Batched Key Access)
2318 Warnings:
2319 Note 1003 Can't push table 't2' as child, access type 'Batched-key' not implemented
2320 Note 1003 Can't push table 't3' as child, access type 'Batched-key' not implemented
2321 Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t1`.`d` AS `d`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t3`.`c` AS `c`,`test`.`t3`.`d` AS `d` from `test`.`t1` join `test`.`t1` `t2` join `test`.`t1` `t3` where ((`test`.`t2`.`b` = `test`.`t1`.`c`) and (`test`.`t3`.`b` = `test`.`t1`.`c`) and (`test`.`t2`.`a` = `test`.`t1`.`b`) and (`test`.`t3`.`a` = `test`.`t1`.`b`)) order by `test`.`t1`.`b`
2322 explain
2323 select t1.a, t1.b, count(*)
2324 from t1
2325 join t1 as t2 on t2.a = t1.b and t2.b = t1.c
2326 join t1 as t3 on t3.a = t2.a and t3.b = t2.b
2327 group by t1.a, t1.b;
2328 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
2329 1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL PRIMARY NULL NULL NULL 16 100.00 Using temporary
2330 1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.b,test.t1.c 1 100.00 Using join buffer (Batched Key Access)
2331 1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.b,test.t1.c 1 100.00 Using join buffer (Batched Key Access)
2332 Warnings:
2333 Note 1003 Can't push table 't2' as child, access type 'Batched-key' not implemented
2334 Note 1003 Can't push table 't3' as child, access type 'Batched-key' not implemented
2335 Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,count(0) AS `count(*)` from `test`.`t1` join `test`.`t1` `t2` join `test`.`t1` `t3` where ((`test`.`t2`.`b` = `test`.`t1`.`c`) and (`test`.`t3`.`b` = `test`.`t1`.`c`) and (`test`.`t2`.`a` = `test`.`t1`.`b`) and (`test`.`t3`.`a` = `test`.`t1`.`b`)) group by `test`.`t1`.`a`,`test`.`t1`.`b`
2336 select t1.a, t1.b, count(*)
2337 from t1
2338 join t1 as t2 on t2.a = t1.b and t2.b = t1.c
2339 join t1 as t3 on t3.a = t2.a and t3.b = t2.b
2340 group by t1.a, t1.b;
2341 a b count(*)
2342 1 1 1
2343 1 3 1
2344 1 4 1
2345 2 1 1
2346 2 2 1
2347 2 3 1
2348 3 1 1
2349 3 2 1
2350 3 3 1
2351 3 4 1
2352 4 1 1
2353 4 3 1
2354 4 4 1
2355 explain
2356 select t1.a, count(*)
2357 from t1
2358 join t1 as t2 on t2.a = t1.b and t2.b = t1.c
2359 join t1 as t3 on t3.a = t2.a and t3.b = t2.b
2360 group by t1.a;
2361 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
2362 1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL PRIMARY NULL NULL NULL 16 100.00 Using temporary
2363 1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.b,test.t1.c 1 100.00 Using join buffer (Batched Key Access)
2364 1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.b,test.t1.c 1 100.00 Using join buffer (Batched Key Access)
2365 Warnings:
2366 Note 1003 Can't push table 't2' as child, access type 'Batched-key' not implemented
2367 Note 1003 Can't push table 't3' as child, access type 'Batched-key' not implemented
2368 Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,count(0) AS `count(*)` from `test`.`t1` join `test`.`t1` `t2` join `test`.`t1` `t3` where ((`test`.`t2`.`b` = `test`.`t1`.`c`) and (`test`.`t3`.`b` = `test`.`t1`.`c`) and (`test`.`t2`.`a` = `test`.`t1`.`b`) and (`test`.`t3`.`a` = `test`.`t1`.`b`)) group by `test`.`t1`.`a`
2369 select t1.a, count(*)
2370 from t1
2371 join t1 as t2 on t2.a = t1.b and t2.b = t1.c
2372 join t1 as t3 on t3.a = t2.a and t3.b = t2.b
2373 group by t1.a;
2374 a count(*)
2375 1 3
2376 2 3
2377 3 4
2378 4 3
2379 explain
2380 select t1.b, count(*)
2381 from t1
2382 join t1 as t2 on t2.a = t1.b and t2.b = t1.c
2383 join t1 as t3 on t3.a = t2.a and t3.b = t2.b
2384 group by t1.b;
2385 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
2386 1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL PRIMARY NULL NULL NULL 16 100.00 Using temporary
2387 1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.b,test.t1.c 1 100.00 Using join buffer (Batched Key Access)
2388 1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.b,test.t1.c 1 100.00 Using join buffer (Batched Key Access)
2389 Warnings:
2390 Note 1003 Can't push table 't2' as child, access type 'Batched-key' not implemented
2391 Note 1003 Can't push table 't3' as child, access type 'Batched-key' not implemented
2392 Note 1003 /* select#1 */ select `test`.`t1`.`b` AS `b`,count(0) AS `count(*)` from `test`.`t1` join `test`.`t1` `t2` join `test`.`t1` `t3` where ((`test`.`t2`.`b` = `test`.`t1`.`c`) and (`test`.`t3`.`b` = `test`.`t1`.`c`) and (`test`.`t2`.`a` = `test`.`t1`.`b`) and (`test`.`t3`.`a` = `test`.`t1`.`b`)) group by `test`.`t1`.`b`
2393 select t1.b, count(*)
2394 from t1
2395 join t1 as t2 on t2.a = t1.b and t2.b = t1.c
2396 join t1 as t3 on t3.a = t2.a and t3.b = t2.b
2397 group by t1.b;
2398 b count(*)
2399 1 4
2400 2 2
2401 3 4
2402 4 3
2403 explain
2404 select t2.c, count(distinct t2.a)
2405 from t1
2406 join t1 as t2 on t1.a = t2.c and t1.b = t2.d
2407 where t2.a = 4 and t2.b=4
2408 group by t2.c;
2409 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
2410 1 SIMPLE t2 pX eq_ref PRIMARY PRIMARY 8 const,const 1 100.00 Using temporary; Using filesort
2411 1 SIMPLE t1 pXYZ eq_ref PRIMARY PRIMARY 8 test.t2.c,test.t2.d 1 100.00 Using join buffer (Batched Key Access)
2412 Warnings:
2413 Note 1003 Can't push table 't1' as child, access type 'Batched-key' not implemented
2414 Note 1003 /* select#1 */ select `test`.`t2`.`c` AS `c`,count(distinct `test`.`t1`.`a`) AS `count(distinct t2.a)` from `test`.`t1` join `test`.`t1` `t2` where ((`test`.`t1`.`b` = `test`.`t2`.`d`) and (`test`.`t1`.`a` = `test`.`t2`.`c`) and (`test`.`t2`.`b` = 4) and (`test`.`t2`.`a` = 4)) group by `test`.`t2`.`c`
2415 select t2.c, count(distinct t2.a)
2416 from t1
2417 join t1 as t2 on t1.a = t2.c and t1.b = t2.d
2418 where t2.a = 4 and t2.b=4
2419 group by t2.c;
2420 c count(distinct t2.a)
2421 4 1
2422 explain
2423 select t2.c, count(distinct t2.a)
2424 from t1
2425 join t1 as t2 on t1.a = t2.c and t1.b = t2.d
2426 where t2.a = 4
2427 group by t2.c;
2428 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
2429 1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 const 3 100.00 Using temporary; Using filesort
2430 1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t2.c,test.t2.d 1 100.00 Using join buffer (Batched Key Access)
2431 Warnings:
2432 Note 1003 Can't push table 't1' as child, access type 'Batched-key' not implemented
2433 Note 1003 /* select#1 */ select `test`.`t2`.`c` AS `c`,count(distinct `test`.`t1`.`a`) AS `count(distinct t2.a)` from `test`.`t1` join `test`.`t1` `t2` where ((`test`.`t1`.`b` = `test`.`t2`.`d`) and (`test`.`t1`.`a` = `test`.`t2`.`c`) and (`test`.`t2`.`a` = 4)) group by `test`.`t2`.`c`
2434 select t2.c, count(distinct t2.a)
2435 from t1
2436 join t1 as t2 on t1.a = t2.c and t1.b = t2.d
2437 where t2.a = 4
2438 group by t2.c;
2439 c count(distinct t2.a)
2440 1 1
2441 4 1
2442 explain
2443 select t2.c, count(distinct t2.a)
2444 from t1
2445 join t1 as t2 on t1.a = t2.c and t1.b = t2.d
2446 where t2.a = 4 and t2.b=4
2447 group by t2.c order by t2.c;
2448 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
2449 1 SIMPLE t2 pX eq_ref PRIMARY PRIMARY 8 const,const 1 100.00 Using temporary; Using filesort
2450 1 SIMPLE t1 pXYZ eq_ref PRIMARY PRIMARY 8 test.t2.c,test.t2.d 1 100.00 Using join buffer (Batched Key Access)
2451 Warnings:
2452 Note 1003 Can't push table 't1' as child, access type 'Batched-key' not implemented
2453 Note 1003 /* select#1 */ select `test`.`t2`.`c` AS `c`,count(distinct `test`.`t1`.`a`) AS `count(distinct t2.a)` from `test`.`t1` join `test`.`t1` `t2` where ((`test`.`t1`.`b` = `test`.`t2`.`d`) and (`test`.`t1`.`a` = `test`.`t2`.`c`) and (`test`.`t2`.`b` = 4) and (`test`.`t2`.`a` = 4)) group by `test`.`t2`.`c` order by `test`.`t2`.`c`
2454 select t2.c, count(distinct t2.a)
2455 from t1
2456 join t1 as t2 on t1.a = t2.c and t1.b = t2.d
2457 where t2.a = 4 and t2.b=4
2458 group by t2.c order by t2.c;
2459 c count(distinct t2.a)
2460 4 1
2461 create table tx like t1;
2462 insert into tx
2463 select x1.a+x2.a*16, x1.b+x2.b*16, x1.c+x2.c*16, x1.d+x2.d*16
2464 from t1 as x1 cross join t1 as x2;
2465 explain select count(*) from tx as x1
2466 left join tx as x2 on x1.c=x2.a and x1.d=x2.d;
2467 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
2468 1 SIMPLE x1 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 256 100.00 NULL
2469 1 SIMPLE x2 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.x1.c 2 100.00 Using where; Using join buffer (Batched Key Access)
2470 Warnings:
2471 Note 1003 Can't push table 'x2' as child, access type 'Batched-key' not implemented
2472 Note 1003 /* select#1 */ select count(0) AS `count(*)` from `test`.`tx` `x1` left join `test`.`tx` `x2` on(((`test`.`x2`.`d` = `test`.`x1`.`d`) and (`test`.`x2`.`a` = `test`.`x1`.`c`))) where true
2473 select count(*) from tx as x1
2474 left join tx as x2 on x1.c=x2.a and x1.d=x2.d;
2475 count(*)
2476 304
2477 drop table tx;
2478 alter table t1 partition by key(a);
2479 explain select count(*) from t1
2480 join t1 as t2 on t2.a = t1.c
2481 join t1 as t3 on t3.a = t1.d;
2482 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
2483 1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 16 100.00 NULL
2484 1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.t1.c 1 100.00 Using join buffer (Batched Key Access)
2485 1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.t1.d 1 100.00 Using join buffer (Batched Key Access)
2486 Warnings:
2487 Note 1003 Can't push table 't2' as child, access type 'Batched-key' not implemented
2488 Note 1003 Can't push table 't3' as child, access type 'Batched-key' not implemented
2489 Note 1003 /* select#1 */ select count(0) AS `count(*)` from `test`.`t1` join `test`.`t1` `t2` join `test`.`t1` `t3` where ((`test`.`t2`.`a` = `test`.`t1`.`c`) and (`test`.`t3`.`a` = `test`.`t1`.`d`))
2490 select count(*) from t1
2491 join t1 as t2 on t2.a = t1.c
2492 join t1 as t3 on t3.a = t1.d;
2493 count(*)
2494 176
2495 CREATE TABLE tx (
2496 a int NOT NULL,
2497 PRIMARY KEY (`a`)
2498 ) comment="NDB_TABLE=PARTITION_BALANCE=FOR_RP_BY_LDM";
2499 delete from t1;
2500 insert into tx values (0), (1), (2), (3), (4), (5), (6), (7), (8), (9);
2501 insert into t1 select 1, x1.a * 10+x2.a, 1, 1 from tx as x1 cross join tx as x2;
2502 set global debug='+d,max_64rows_in_spj_batches';
2503 explain select count(*) from t1 as x1
2504 join t1 as x2 on x2.a = x1.c and x1.b < 2
2505 join t1 as x3 on x3.a = x1.d;
2506 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
2507 1 SIMPLE x1 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL # # Using pushed condition (`test`.`x1`.`b` < 2)
2508 1 SIMPLE x2 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.x1.c # # Using join buffer (Batched Key Access)
2509 1 SIMPLE x3 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.x1.d # # Using join buffer (Batched Key Access)
2510 Warnings:
2511 Note 1003 Can't push table 'x2' as child, access type 'Batched-key' not implemented
2512 Note 1003 Can't push table 'x3' as child, access type 'Batched-key' not implemented
2513 Note 1003 /* select#1 */ select count(0) AS `count(*)` from `test`.`t1` `x1` join `test`.`t1` `x2` join `test`.`t1` `x3` where ((`test`.`x2`.`a` = `test`.`x1`.`c`) and (`test`.`x3`.`a` = `test`.`x1`.`d`) and (`test`.`x1`.`b` < 2))
2514 select count(*) from t1 as x1
2515 join t1 as x2 on x2.a = x1.c and x1.b < 2
2516 join t1 as x3 on x3.a = x1.d;
2517 count(*)
2518 20000
2519 set global debug=@save_debug;
2520 drop table t1;
2521 drop table tx;
2522 create table t1 (
2523 a int not null,
2524 b int not null,
2525 c int not null,
2526 d int not null,
2527 primary key (`a`,`b`)
2528 ) engine=ndbcluster
2529 comment="NDB_TABLE=PARTITION_BALANCE=FOR_RP_BY_LDM"
2530 partition by key(a);
2531 insert into t1 values
2532 (1,1,1,1), (2,2,2,2), (3,3,3,3), (4,4,4,4),
2533 (1,2,5,1), (1,3,1,2), (1,4,2,3),
2534 (2,1,3,4), (2,3,4,5), (2,4,5,1),
2535 (3,1,1,2), (3,2,2,3), (3,4,3,4),
2536 (4,1,4,5), (4,2,5,1), (4,3,1,2);
2537 explain
2538 select *
2539 from t1
2540 join t1 as t2 on t2.a = t1.b and t2.b = t1.c;
2541 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
2542 1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 16 100.00 NULL
2543 1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.b,test.t1.c 1 100.00 Using join buffer (Batched Key Access)
2544 Warnings:
2545 Note 1003 Can't push table 't2' as child, access type 'Batched-key' not implemented
2546 Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t1`.`d` AS `d`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d` from `test`.`t1` join `test`.`t1` `t2` where ((`test`.`t2`.`b` = `test`.`t1`.`c`) and (`test`.`t2`.`a` = `test`.`t1`.`b`))
2547 set new=on;
2548 Warnings:
2549 Warning 1287 '@@new' is deprecated and will be removed in a future release.
2550 alter table t1 partition by hash(a);
2551 explain
2552 select *
2553 from t1
2554 join t1 as t2 on t2.a = t1.b and t2.b = t1.c;
2555 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
2556 1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 16 100.00 NULL
2557 1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.b,test.t1.c 1 100.00 Using join buffer (Batched Key Access)
2558 Warnings:
2559 Note 1003 Table 't1' is not pushable: has user defined partioning
2560 Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t1`.`d` AS `d`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d` from `test`.`t1` join `test`.`t1` `t2` where ((`test`.`t2`.`b` = `test`.`t1`.`c`) and (`test`.`t2`.`a` = `test`.`t1`.`b`))
2561 alter table t1 partition by list(a) (
2562 partition p1 values in (1),
2563 partition p2 values in (2),
2564 partition p3 values in (3),
2565 partition p4 values in (4)
2566 );
2567 explain
2568 select *
2569 from t1
2570 join t1 as t2 on t2.a = t1.b and t2.b = t1.c;
2571 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
2572 1 SIMPLE t1 p1,p2,p3,p4 ALL NULL NULL NULL NULL 16 100.00 NULL
2573 1 SIMPLE t2 p1,p2,p3,p4 eq_ref PRIMARY PRIMARY 8 test.t1.b,test.t1.c 1 100.00 Using join buffer (Batched Key Access)
2574 Warnings:
2575 Note 1003 Table 't1' is not pushable: has user defined partioning
2576 Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t1`.`d` AS `d`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d` from `test`.`t1` join `test`.`t1` `t2` where ((`test`.`t2`.`b` = `test`.`t1`.`c`) and (`test`.`t2`.`a` = `test`.`t1`.`b`))
2577 alter table t1 partition by range(a) partitions 4 (
2578 partition p1 values less than (0),
2579 partition p2 values less than (2),
2580 partition p3 values less than (4),
2581 partition p4 values less than (99999)
2582 );
2583 explain
2584 select *
2585 from t1
2586 join t1 as t2 on t2.a = t1.b and t2.b = t1.c;
2587 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
2588 1 SIMPLE t1 p1,p2,p3,p4 ALL NULL NULL NULL NULL 16 100.00 NULL
2589 1 SIMPLE t2 p1,p2,p3,p4 eq_ref PRIMARY PRIMARY 8 test.t1.b,test.t1.c 1 100.00 Using join buffer (Batched Key Access)
2590 Warnings:
2591 Note 1003 Table 't1' is not pushable: has user defined partioning
2592 Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t1`.`d` AS `d`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d` from `test`.`t1` join `test`.`t1` `t2` where ((`test`.`t2`.`b` = `test`.`t1`.`c`) and (`test`.`t2`.`a` = `test`.`t1`.`b`))
2593 drop table t1;
2594 set new=default;
2595 Warnings:
2596 Warning 1287 '@@new' is deprecated and will be removed in a future release.
2597 create table t1 (a int, b int, primary key(a) using hash) engine = ndb
2598 comment="NDB_TABLE=PARTITION_BALANCE=FOR_RP_BY_LDM";
2599 insert into t1 values (1, 2);
2600 insert into t1 values (2, 3);
2601 insert into t1 values (3, 1);
2602 set ndb_join_pushdown=true;
2603 set autocommit=off;
2604 explain
2605 select *
2606 from t1, t1 as t2
2607 where t1.a in (1,3,5)
2608 and t2.a = t1.b;
2609 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
2610 1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 range PRIMARY PRIMARY 4 NULL 3 100.00 Using pushed condition ((`test`.`t1`.`a` in (1,3,5)) and (`test`.`t1`.`b` is not null)); Using MRR
2611 1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.t1.b 1 100.00 Using join buffer (Batched Key Access)
2612 Warnings:
2613 Note 1003 Can't push table 't2' as child, access type 'Batched-key' not implemented
2614 Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t1` join `test`.`t1` `t2` where ((`test`.`t2`.`a` = `test`.`t1`.`b`) and (`test`.`t1`.`a` in (1,3,5)))
2615 select *
2616 from t1, t1 as t2
2617 where t1.a in (1,3,5)
2618 and t2.a = t1.b;
2619 a b a b
2620 1 2 2 3
2621 3 1 1 2
2622 ndb_execute_count
2623 2
2624 This should yield 3 executes (for now...buh)
2625 set autocommit=on;
2626 drop table t1;
2627 create table t1 (a int, b int, primary key(a)) engine = ndb
2628 comment="NDB_TABLE=PARTITION_BALANCE=FOR_RP_BY_LDM";
2629 insert into t1 values (1, 2);
2630 insert into t1 values (2, 3);
2631 insert into t1 values (3, 1);
2632 set ndb_join_pushdown=true;
2633 set autocommit=off;
2634 explain
2635 select *
2636 from t1, t1 as t2
2637 where t1.a in (1,3,5)
2638 and t2.a = t1.b;
2639 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
2640 1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 range PRIMARY PRIMARY 4 NULL 3 100.00 Using pushed condition ((`test`.`t1`.`a` in (1,3,5)) and (`test`.`t1`.`b` is not null)); Using MRR
2641 1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.t1.b 1 100.00 Using join buffer (Batched Key Access)
2642 Warnings:
2643 Note 1003 Can't push table 't2' as child, access type 'Batched-key' not implemented
2644 Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t1` join `test`.`t1` `t2` where ((`test`.`t2`.`a` = `test`.`t1`.`b`) and (`test`.`t1`.`a` in (1,3,5)))
2645 select *
2646 from t1, t1 as t2
2647 where t1.a in (1,3,5)
2648 and t2.a = t1.b;
2649 a b a b
2650 1 2 2 3
2651 3 1 1 2
2652 ndb_execute_count
2653 2
2654 This should yield 1 execute (but inefficient since it's based on scan)
2655 set autocommit=on;
2656 explain
2657 select *
2658 from t1, t1 as t2
2659 where t1.a in (1,3,5)
2660 and t2.a = t1.b
2661 order by t1.a desc;
2662 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
2663 1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 range PRIMARY PRIMARY 4 NULL 3 100.00 Using pushed condition ((`test`.`t1`.`a` in (1,3,5)) and (`test`.`t1`.`b` is not null)); Using MRR; Using temporary; Using filesort
2664 1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.t1.b 1 100.00 Using join buffer (Batched Key Access)
2665 Warnings:
2666 Note 1003 Can't push table 't2' as child, access type 'Batched-key' not implemented
2667 Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t1` join `test`.`t1` `t2` where ((`test`.`t2`.`a` = `test`.`t1`.`b`) and (`test`.`t1`.`a` in (1,3,5))) order by `test`.`t1`.`a` desc
2668 select *
2669 from t1, t1 as t2
2670 where t1.a in (1,3,5)
2671 and t2.a = t1.b
2672 order by t1.a desc;
2673 a b a b
2674 3 1 1 2
2675 1 2 2 3
2676 drop table t1;
2677 set ndb_join_pushdown=true;
2678 create table t1 (a int, b int, primary key(a)) engine = ndb
2679 comment="NDB_TABLE=PARTITION_BALANCE=FOR_RP_BY_LDM";
2680 create table t2 (c int, d int, primary key(c)) engine = ndb
2681 comment="NDB_TABLE=PARTITION_BALANCE=FOR_RP_BY_LDM";
2682 create table t3 (a3 int, b3 int, c3 int not null, d3 int not null,
2683 primary key(a3, b3)) engine = ndb
2684 comment="NDB_TABLE=PARTITION_BALANCE=FOR_RP_BY_LDM";
2685 create table t3_hash (a3 int, b3 int, c3 int not null, d3 int not null,
2686 primary key(a3, b3) using hash) engine = ndb
2687 comment="NDB_TABLE=PARTITION_BALANCE=FOR_RP_BY_LDM";
2688 insert into t1 values (0x1f, 0x2f);
2689 insert into t1 values (0x2f, 0x3f);
2690 insert into t1 values (0x3f, 0x1f);
2691 insert into t2 values (0x1f, 0x2f);
2692 insert into t2 values (0x2f, 0x3f);
2693 insert into t2 values (0x3f, 0x1f);
2694 insert into t3 values (0x1f, 0x2f, 1, 0x1f);
2695 insert into t3 values (0x2f, 0x3f, 2, 0x2f);
2696 insert into t3 values (0x3f, 0x1f, 3, 0x3f);
2697 insert into t3_hash values (0x1f, 0x2f, 1, 0x1f);
2698 insert into t3_hash values (0x2f, 0x3f, 2, 0x2f);
2699 insert into t3_hash values (0x3f, 0x1f, 3, 0x3f);
2700 explain
2701 select * from t3 x, t3 y, t1 where y.a3=x.d3 and y.b3=x.b3 and t1.a = y.d3;
2702 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
2703 1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 3 100.00 NULL
2704 1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.x.d3,test.x.b3 1 100.00 Using join buffer (Batched Key Access)
2705 1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.y.d3 1 100.00 Using join buffer (Batched Key Access)
2706 Warnings:
2707 Note 1003 Can't push table 'y' as child, access type 'Batched-key' not implemented
2708 Note 1003 Can't push table 't1' as child, access type 'Batched-key' not implemented
2709 Note 1003 /* select#1 */ select `test`.`x`.`a3` AS `a3`,`test`.`x`.`b3` AS `b3`,`test`.`x`.`c3` AS `c3`,`test`.`x`.`d3` AS `d3`,`test`.`y`.`a3` AS `a3`,`test`.`y`.`b3` AS `b3`,`test`.`y`.`c3` AS `c3`,`test`.`y`.`d3` AS `d3`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t3` `x` join `test`.`t3` `y` join `test`.`t1` where ((`test`.`t1`.`a` = `test`.`y`.`d3`) and (`test`.`y`.`b3` = `test`.`x`.`b3`) and (`test`.`y`.`a3` = `test`.`x`.`d3`))
2710 select * from t3 x, t3 y, t1 where y.a3=x.d3 and y.b3=x.b3 and t1.a = y.d3;
2711 a3 b3 c3 d3 a3 b3 c3 d3 a b
2712 31 47 1 31 31 47 1 31 31 47
2713 47 63 2 47 47 63 2 47 47 63
2714 63 31 3 63 63 31 3 63 63 31
2715 explain
2716 select *
2717 from t3 x, t3 y, t3 z, t3 z2, t1
2718 where y.a3=x.d3 and y.b3=x.b3 and
2719 z.a3=y.d3 and z.b3=y.b3 and
2720 z2.a3=z.d3 and z2.b3=z.b3 and
2721 t1.a = z2.d3;
2722 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
2723 1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 3 100.00 NULL
2724 1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.x.d3,test.x.b3 1 100.00 Using join buffer (Batched Key Access)
2725 1 SIMPLE z p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.y.d3,test.x.b3 1 100.00 Using join buffer (Batched Key Access)
2726 1 SIMPLE z2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.z.d3,test.x.b3 1 100.00 Using join buffer (Batched Key Access)
2727 1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.z2.d3 1 100.00 Using join buffer (Batched Key Access)
2728 Warnings:
2729 Note 1003 Can't push table 'y' as child, access type 'Batched-key' not implemented
2730 Note 1003 Can't push table 'z' as child, access type 'Batched-key' not implemented
2731 Note 1003 Can't push table 'z2' as child, access type 'Batched-key' not implemented
2732 Note 1003 Can't push table 't1' as child, access type 'Batched-key' not implemented
2733 Note 1003 /* select#1 */ select `test`.`x`.`a3` AS `a3`,`test`.`x`.`b3` AS `b3`,`test`.`x`.`c3` AS `c3`,`test`.`x`.`d3` AS `d3`,`test`.`y`.`a3` AS `a3`,`test`.`y`.`b3` AS `b3`,`test`.`y`.`c3` AS `c3`,`test`.`y`.`d3` AS `d3`,`test`.`z`.`a3` AS `a3`,`test`.`z`.`b3` AS `b3`,`test`.`z`.`c3` AS `c3`,`test`.`z`.`d3` AS `d3`,`test`.`z2`.`a3` AS `a3`,`test`.`z2`.`b3` AS `b3`,`test`.`z2`.`c3` AS `c3`,`test`.`z2`.`d3` AS `d3`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t3` `x` join `test`.`t3` `y` join `test`.`t3` `z` join `test`.`t3` `z2` join `test`.`t1` where ((`test`.`t1`.`a` = `test`.`z2`.`d3`) and (`test`.`z2`.`a3` = `test`.`z`.`d3`) and (`test`.`z`.`a3` = `test`.`y`.`d3`) and (`test`.`y`.`b3` = `test`.`x`.`b3`) and (`test`.`z`.`b3` = `test`.`x`.`b3`) and (`test`.`z2`.`b3` = `test`.`x`.`b3`) and (`test`.`y`.`a3` = `test`.`x`.`d3`))
2734 select *
2735 from t3 x, t3 y, t3 z, t3 z2, t1
2736 where y.a3=x.d3 and y.b3=x.b3 and
2737 z.a3=y.d3 and z.b3=y.b3 and
2738 z2.a3=z.d3 and z2.b3=z.b3 and
2739 t1.a = z2.d3;
2740 a3 b3 c3 d3 a3 b3 c3 d3 a3 b3 c3 d3 a3 b3 c3 d3 a b
2741 31 47 1 31 31 47 1 31 31 47 1 31 31 47 1 31 31 47
2742 47 63 2 47 47 63 2 47 47 63 2 47 47 63 2 47 47 63
2743 63 31 3 63 63 31 3 63 63 31 3 63 63 31 3 63 63 31
2744 explain
2745 select straight_join * from t1 x, t1 y where y.a=0x1f and x.b = 0x1f;
2746 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
2747 1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL # # Using pushed condition (`test`.`x`.`b` = 0x1f)
2748 1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 const # # Using join buffer (Batched Key Access)
2749 Warnings:
2750 Note 1003 Can't push table 'y' as child, access type 'Batched-key' not implemented
2751 Note 1003 /* select#1 */ select straight_join `test`.`x`.`a` AS `a`,`test`.`x`.`b` AS `b`,`test`.`y`.`a` AS `a`,`test`.`y`.`b` AS `b` from `test`.`t1` `x` join `test`.`t1` `y` where ((`test`.`y`.`a` = 0x1f) and (`test`.`x`.`b` = 0x1f))
2752 select straight_join * from t1 x, t1 y where y.a=0x1f and x.b = 0x1f;
2753 a b a b
2754 63 31 31 47
2755 explain
2756 select straight_join * from t1 x, t1 y where y.a=x.b and x.b = 0x1f;
2757 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
2758 1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL # # Using pushed condition (`test`.`x`.`b` = 0x1f)
2759 1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 const # # Using where; Using join buffer (Batched Key Access)
2760 Warnings:
2761 Note 1003 Can't push table 'y' as child, access type 'Batched-key' not implemented
2762 Note 1003 /* select#1 */ select straight_join `test`.`x`.`a` AS `a`,`test`.`x`.`b` AS `b`,`test`.`y`.`a` AS `a`,`test`.`y`.`b` AS `b` from `test`.`t1` `x` join `test`.`t1` `y` where ((`test`.`y`.`a` = `test`.`x`.`b`) and (`test`.`x`.`b` = 0x1f))
2763 select straight_join * from t1 x, t1 y where y.a=x.b and x.b = 0x1f;
2764 a b a b
2765 63 31 31 47
2766 create unique index t3_d3 on t3(d3);
2767 create unique index t3_d3 on t3_hash(d3);
2768 commit;
2769 explain
2770 select * from t3 x, t3 y where x.d3=31 and y.a3=x.d3 and y.b3=x.b3;
2771 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
2772 1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 eq_ref t3_d3 t3_d3 4 const 1 100.00 NULL
2773 1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 const,test.x.b3 1 100.00 Using join buffer (Batched Key Access)
2774 Warnings:
2775 Note 1003 Can't push table 'y' as child, access type 'Batched-key' not implemented
2776 Note 1003 /* select#1 */ select `test`.`x`.`a3` AS `a3`,`test`.`x`.`b3` AS `b3`,`test`.`x`.`c3` AS `c3`,`test`.`x`.`d3` AS `d3`,`test`.`y`.`a3` AS `a3`,`test`.`y`.`b3` AS `b3`,`test`.`y`.`c3` AS `c3`,`test`.`y`.`d3` AS `d3` from `test`.`t3` `x` join `test`.`t3` `y` where ((`test`.`y`.`b3` = `test`.`x`.`b3`) and (`test`.`x`.`d3` = 31) and (`test`.`y`.`a3` = 31))
2777 select * from t3 x, t3 y where x.d3=31 and y.a3=x.d3 and y.b3=x.b3;
2778 a3 b3 c3 d3 a3 b3 c3 d3
2779 31 47 1 31 31 47 1 31
2780 explain
2781 select * from t3 x, t3 y where x.d3=0 and y.a3=x.d3 and y.b3=x.b3;
2782 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
2783 1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 eq_ref t3_d3 t3_d3 4 const 1 100.00 NULL
2784 1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 const,test.x.b3 1 100.00 Using join buffer (Batched Key Access)
2785 Warnings:
2786 Note 1003 Can't push table 'y' as child, access type 'Batched-key' not implemented
2787 Note 1003 /* select#1 */ select `test`.`x`.`a3` AS `a3`,`test`.`x`.`b3` AS `b3`,`test`.`x`.`c3` AS `c3`,`test`.`x`.`d3` AS `d3`,`test`.`y`.`a3` AS `a3`,`test`.`y`.`b3` AS `b3`,`test`.`y`.`c3` AS `c3`,`test`.`y`.`d3` AS `d3` from `test`.`t3` `x` join `test`.`t3` `y` where ((`test`.`y`.`b3` = `test`.`x`.`b3`) and (`test`.`x`.`d3` = 0) and (`test`.`y`.`a3` = 0))
2788 select * from t3 x, t3 y where x.d3=0 and y.a3=x.d3 and y.b3=x.b3;
2789 a3 b3 c3 d3 a3 b3 c3 d3
2790 explain
2791 select * from t1 x, t3 y where y.d3=x.b;
2792 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
2793 1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 3 100.00 Using pushed condition (`test`.`x`.`b` is not null)
2794 1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref t3_d3 t3_d3 4 test.x.b 1 100.00 Using join buffer (Batched Key Access)
2795 Warnings:
2796 Note 1003 Can't push table 'y' as child, access type 'Batched-key' not implemented
2797 Note 1003 /* select#1 */ select `test`.`x`.`a` AS `a`,`test`.`x`.`b` AS `b`,`test`.`y`.`a3` AS `a3`,`test`.`y`.`b3` AS `b3`,`test`.`y`.`c3` AS `c3`,`test`.`y`.`d3` AS `d3` from `test`.`t1` `x` join `test`.`t3` `y` where (`test`.`y`.`d3` = `test`.`x`.`b`)
2798 select * from t1 x, t3 y where y.d3=x.b;
2799 a b a3 b3 c3 d3
2800 31 47 47 63 2 47
2801 47 63 63 31 3 63
2802 63 31 31 47 1 31
2803 explain
2804 select * from t3 x, t3 y where x.d3=31 and y.d3=x.b3;
2805 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
2806 1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 eq_ref t3_d3 t3_d3 4 const 1 100.00 NULL
2807 1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref t3_d3 t3_d3 4 test.x.b3 1 100.00 Using join buffer (Batched Key Access)
2808 Warnings:
2809 Note 1003 Can't push table 'y' as child, access type 'Batched-key' not implemented
2810 Note 1003 /* select#1 */ select `test`.`x`.`a3` AS `a3`,`test`.`x`.`b3` AS `b3`,`test`.`x`.`c3` AS `c3`,`test`.`x`.`d3` AS `d3`,`test`.`y`.`a3` AS `a3`,`test`.`y`.`b3` AS `b3`,`test`.`y`.`c3` AS `c3`,`test`.`y`.`d3` AS `d3` from `test`.`t3` `x` join `test`.`t3` `y` where ((`test`.`y`.`d3` = `test`.`x`.`b3`) and (`test`.`x`.`d3` = 31))
2811 select * from t3 x, t3 y where x.d3=31 and y.d3=x.b3;
2812 a3 b3 c3 d3 a3 b3 c3 d3
2813 31 47 1 31 47 63 2 47
2814 explain
2815 select * from t3 x, t3 y where x.d3=31 and y.d3=x.c3;
2816 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
2817 1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 eq_ref t3_d3 t3_d3 4 const 1 100.00 NULL
2818 1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref t3_d3 t3_d3 4 test.x.c3 1 100.00 Using join buffer (Batched Key Access)
2819 Warnings:
2820 Note 1003 Can't push table 'y' as child, access type 'Batched-key' not implemented
2821 Note 1003 /* select#1 */ select `test`.`x`.`a3` AS `a3`,`test`.`x`.`b3` AS `b3`,`test`.`x`.`c3` AS `c3`,`test`.`x`.`d3` AS `d3`,`test`.`y`.`a3` AS `a3`,`test`.`y`.`b3` AS `b3`,`test`.`y`.`c3` AS `c3`,`test`.`y`.`d3` AS `d3` from `test`.`t3` `x` join `test`.`t3` `y` where ((`test`.`y`.`d3` = `test`.`x`.`c3`) and (`test`.`x`.`d3` = 31))
2822 select * from t3 x, t3 y where x.d3=31 and y.d3=x.c3;
2823 a3 b3 c3 d3 a3 b3 c3 d3
2824 explain
2825 select * from t3 x, t3 y
2826 where ((x.a3=0x2f and x.b3=0x3f) or x.d3=0x1f)
2827 and (y.a3=x.d3 and y.b3=x.b3);
2828 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
2829 1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 index_merge PRIMARY,t3_d3 t3_d3,PRIMARY 4,8 NULL 2 100.00 Using sort_union(t3_d3,PRIMARY); Using pushed condition (((`test`.`x`.`a3` = 0x2f) and (`test`.`x`.`b3` = 0x3f)) or (`test`.`x`.`d3` = 0x1f))
2830 1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.x.d3,test.x.b3 1 100.00 Using join buffer (Batched Key Access)
2831 Warnings:
2832 Note 1003 Can't push table 'y' as child, access type 'Batched-key' not implemented
2833 Note 1003 /* select#1 */ select `test`.`x`.`a3` AS `a3`,`test`.`x`.`b3` AS `b3`,`test`.`x`.`c3` AS `c3`,`test`.`x`.`d3` AS `d3`,`test`.`y`.`a3` AS `a3`,`test`.`y`.`b3` AS `b3`,`test`.`y`.`c3` AS `c3`,`test`.`y`.`d3` AS `d3` from `test`.`t3` `x` join `test`.`t3` `y` where ((`test`.`y`.`b3` = `test`.`x`.`b3`) and (`test`.`y`.`a3` = `test`.`x`.`d3`) and (((`test`.`x`.`a3` = 0x2f) and (`test`.`x`.`b3` = 0x3f)) or (`test`.`x`.`d3` = 0x1f)))
2834 select * from t3 x, t3 y
2835 where ((x.a3=0x2f and x.b3=0x3f) or x.d3=0x1f)
2836 and (y.a3=x.d3 and y.b3=x.b3);
2837 a3 b3 c3 d3 a3 b3 c3 d3
2838 31 47 1 31 31 47 1 31
2839 47 63 2 47 47 63 2 47
2840 explain
2841 select * from t3_hash x, t3_hash y
2842 where ((x.a3=0x2f and x.b3=0x3f) or x.d3=0x1f)
2843 and (y.a3=x.d3 and y.b3=x.b3);
2844 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
2845 1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 index_merge PRIMARY,t3_d3 PRIMARY,t3_d3 8,4 NULL 2 100.00 Using sort_union(PRIMARY,t3_d3); Using pushed condition (((`test`.`x`.`a3` = 0x2f) and (`test`.`x`.`b3` = 0x3f)) or (`test`.`x`.`d3` = 0x1f))
2846 1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.x.d3,test.x.b3 1 100.00 Using join buffer (Batched Key Access)
2847 Warnings:
2848 Note 1003 Can't push table 'y' as child, access type 'Batched-key' not implemented
2849 Note 1003 /* select#1 */ select `test`.`x`.`a3` AS `a3`,`test`.`x`.`b3` AS `b3`,`test`.`x`.`c3` AS `c3`,`test`.`x`.`d3` AS `d3`,`test`.`y`.`a3` AS `a3`,`test`.`y`.`b3` AS `b3`,`test`.`y`.`c3` AS `c3`,`test`.`y`.`d3` AS `d3` from `test`.`t3_hash` `x` join `test`.`t3_hash` `y` where ((`test`.`y`.`b3` = `test`.`x`.`b3`) and (`test`.`y`.`a3` = `test`.`x`.`d3`) and (((`test`.`x`.`a3` = 0x2f) and (`test`.`x`.`b3` = 0x3f)) or (`test`.`x`.`d3` = 0x1f)))
2850 select * from t3_hash x, t3_hash y
2851 where ((x.a3=0x2f and x.b3=0x3f) or x.d3=0x1f)
2852 and (y.a3=x.d3 and y.b3=x.b3);
2853 a3 b3 c3 d3 a3 b3 c3 d3
2854 31 47 1 31 31 47 1 31
2855 47 63 2 47 47 63 2 47
2856 explain
2857 select * from t3 x, t3 y where x.d3>=31 and y.d3=x.b3;
2858 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
2859 1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 range t3_d3 t3_d3 4 NULL 3 100.00 Using pushed condition (`test`.`x`.`d3` >= 31); Using MRR
2860 1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref t3_d3 t3_d3 4 test.x.b3 1 100.00 Using join buffer (Batched Key Access)
2861 Warnings:
2862 Note 1003 Can't push table 'y' as child, access type 'Batched-key' not implemented
2863 Note 1003 /* select#1 */ select `test`.`x`.`a3` AS `a3`,`test`.`x`.`b3` AS `b3`,`test`.`x`.`c3` AS `c3`,`test`.`x`.`d3` AS `d3`,`test`.`y`.`a3` AS `a3`,`test`.`y`.`b3` AS `b3`,`test`.`y`.`c3` AS `c3`,`test`.`y`.`d3` AS `d3` from `test`.`t3` `x` join `test`.`t3` `y` where ((`test`.`y`.`d3` = `test`.`x`.`b3`) and (`test`.`x`.`d3` >= 31))
2864 select * from t3 x, t3 y where x.d3>=31 and y.d3=x.b3;
2865 a3 b3 c3 d3 a3 b3 c3 d3
2866 31 47 1 31 47 63 2 47
2867 47 63 2 47 63 31 3 63
2868 63 31 3 63 31 47 1 31
2869 insert into t1 values (0x4f, null);
2870 select * from t1 left join t1 as t2 on t2.a = t1.b;
2871 a b a b
2872 31 47 47 63
2873 47 63 63 31
2874 63 31 31 47
2875 79 NULL NULL NULL
2876 insert into t3 values (8,8,8,8);
2877 explain select count(*) from t3 as x0
2878 join t3 as x1 on x0.b3=x1.d3 and x0.d3=8
2879 join t3 as x2 on x1.b3=x2.d3
2880 join t3 as x3 on x2.b3=x3.d3
2881 join t3 as x4 on x3.b3=x4.d3
2882 join t3 as x5 on x4.b3=x5.d3
2883 join t3 as x6 on x5.b3=x6.d3
2884 join t3 as x7 on x6.b3=x7.d3
2885 join t3 as x8 on x7.b3=x8.d3
2886 join t3 as x9 on x8.b3=x9.d3
2887 join t3 as x10 on x9.b3=x10.d3
2888 join t3 as x11 on x10.b3=x11.d3
2889 join t3 as x12 on x11.b3=x12.d3
2890 join t3 as x13 on x12.b3=x13.d3
2891 join t3 as x14 on x13.b3=x14.d3
2892 join t3 as x15 on x14.b3=x15.d3
2893 join t3 as x16 on x15.b3=x16.d3
2894 join t3 as x17 on x16.b3=x17.d3;
2895 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
2896 1 SIMPLE x0 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref t3_d3 t3_d3 4 const 1 100.00 NULL
2897 1 SIMPLE x1 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref t3_d3 t3_d3 4 test.x0.b3 1 100.00 Using join buffer (Batched Key Access)
2898 1 SIMPLE x2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref t3_d3 t3_d3 4 test.x1.b3 1 100.00 Using join buffer (Batched Key Access)
2899 1 SIMPLE x3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref t3_d3 t3_d3 4 test.x2.b3 1 100.00 Using join buffer (Batched Key Access)
2900 1 SIMPLE x4 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref t3_d3 t3_d3 4 test.x3.b3 1 100.00 Using join buffer (Batched Key Access)
2901 1 SIMPLE x5 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref t3_d3 t3_d3 4 test.x4.b3 1 100.00 Using join buffer (Batched Key Access)
2902 1 SIMPLE x6 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref t3_d3 t3_d3 4 test.x5.b3 1 100.00 Using join buffer (Batched Key Access)
2903 1 SIMPLE x7 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref t3_d3 t3_d3 4 test.x6.b3 1 100.00 Using join buffer (Batched Key Access)
2904 1 SIMPLE x8 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref t3_d3 t3_d3 4 test.x7.b3 1 100.00 Using join buffer (Batched Key Access)
2905 1 SIMPLE x9 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref t3_d3 t3_d3 4 test.x8.b3 1 100.00 Using join buffer (Batched Key Access)
2906 1 SIMPLE x10 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref t3_d3 t3_d3 4 test.x9.b3 1 100.00 Using join buffer (Batched Key Access)
2907 1 SIMPLE x11 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref t3_d3 t3_d3 4 test.x10.b3 1 100.00 Using join buffer (Batched Key Access)
2908 1 SIMPLE x12 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref t3_d3 t3_d3 4 test.x11.b3 1 100.00 Using join buffer (Batched Key Access)
2909 1 SIMPLE x13 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref t3_d3 t3_d3 4 test.x12.b3 1 100.00 Using join buffer (Batched Key Access)
2910 1 SIMPLE x14 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref t3_d3 t3_d3 4 test.x13.b3 1 100.00 Using join buffer (Batched Key Access)
2911 1 SIMPLE x15 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref t3_d3 t3_d3 4 test.x14.b3 1 100.00 Using join buffer (Batched Key Access)
2912 1 SIMPLE x16 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref t3_d3 t3_d3 4 test.x15.b3 1 100.00 Using join buffer (Batched Key Access)
2913 1 SIMPLE x17 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref t3_d3 t3_d3 4 test.x16.b3 1 100.00 Using join buffer (Batched Key Access)
2914 Warnings:
2915 Note 1003 Can't push table 'x1' as child, access type 'Batched-key' not implemented
2916 Note 1003 Can't push table 'x2' as child, access type 'Batched-key' not implemented
2917 Note 1003 Can't push table 'x3' as child, access type 'Batched-key' not implemented
2918 Note 1003 Can't push table 'x4' as child, access type 'Batched-key' not implemented
2919 Note 1003 Can't push table 'x5' as child, access type 'Batched-key' not implemented
2920 Note 1003 Can't push table 'x6' as child, access type 'Batched-key' not implemented
2921 Note 1003 Can't push table 'x7' as child, access type 'Batched-key' not implemented
2922 Note 1003 Can't push table 'x8' as child, access type 'Batched-key' not implemented
2923 Note 1003 Can't push table 'x9' as child, access type 'Batched-key' not implemented
2924 Note 1003 Can't push table 'x10' as child, access type 'Batched-key' not implemented
2925 Note 1003 Can't push table 'x11' as child, access type 'Batched-key' not implemented
2926 Note 1003 Can't push table 'x12' as child, access type 'Batched-key' not implemented
2927 Note 1003 Can't push table 'x13' as child, access type 'Batched-key' not implemented
2928 Note 1003 Can't push table 'x14' as child, access type 'Batched-key' not implemented
2929 Note 1003 Can't push table 'x15' as child, access type 'Batched-key' not implemented
2930 Note 1003 Can't push table 'x16' as child, access type 'Batched-key' not implemented
2931 Note 1003 Can't push table 'x17' as child, access type 'Batched-key' not implemented
2932 Note 1003 /* select#1 */ select count(0) AS `count(*)` from `test`.`t3` `x0` join `test`.`t3` `x1` join `test`.`t3` `x2` join `test`.`t3` `x3` join `test`.`t3` `x4` join `test`.`t3` `x5` join `test`.`t3` `x6` join `test`.`t3` `x7` join `test`.`t3` `x8` join `test`.`t3` `x9` join `test`.`t3` `x10` join `test`.`t3` `x11` join `test`.`t3` `x12` join `test`.`t3` `x13` join `test`.`t3` `x14` join `test`.`t3` `x15` join `test`.`t3` `x16` join `test`.`t3` `x17` where ((`test`.`x0`.`d3` = 8) and (`test`.`x1`.`d3` = `test`.`x0`.`b3`) and (`test`.`x2`.`d3` = `test`.`x1`.`b3`) and (`test`.`x3`.`d3` = `test`.`x2`.`b3`) and (`test`.`x4`.`d3` = `test`.`x3`.`b3`) and (`test`.`x5`.`d3` = `test`.`x4`.`b3`) and (`test`.`x6`.`d3` = `test`.`x5`.`b3`) and (`test`.`x7`.`d3` = `test`.`x6`.`b3`) and (`test`.`x8`.`d3` = `test`.`x7`.`b3`) and (`test`.`x9`.`d3` = `test`.`x8`.`b3`) and (`test`.`x10`.`d3` = `test`.`x9`.`b3`) and (`test`.`x11`.`d3` = `test`.`x10`.`b3`) and (`test`.`x12`.`d3` = `test`.`x11`.`b3`) and (`test`.`x13`.`d3` = `test`.`x12`.`b3`) and (`test`.`x14`.`d3` = `test`.`x13`.`b3`) and (`test`.`x15`.`d3` = `test`.`x14`.`b3`) and (`test`.`x16`.`d3` = `test`.`x15`.`b3`) and (`test`.`x17`.`d3` = `test`.`x16`.`b3`))
2933 select count(*) from t3 as x0
2934 join t3 as x1 on x0.b3=x1.d3 and x0.d3=8
2935 join t3 as x2 on x1.b3=x2.d3
2936 join t3 as x3 on x2.b3=x3.d3
2937 join t3 as x4 on x3.b3=x4.d3
2938 join t3 as x5 on x4.b3=x5.d3
2939 join t3 as x6 on x5.b3=x6.d3
2940 join t3 as x7 on x6.b3=x7.d3
2941 join t3 as x8 on x7.b3=x8.d3
2942 join t3 as x9 on x8.b3=x9.d3
2943 join t3 as x10 on x9.b3=x10.d3
2944 join t3 as x11 on x10.b3=x11.d3
2945 join t3 as x12 on x11.b3=x12.d3
2946 join t3 as x13 on x12.b3=x13.d3
2947 join t3 as x14 on x13.b3=x14.d3
2948 join t3 as x15 on x14.b3=x15.d3
2949 join t3 as x16 on x15.b3=x16.d3
2950 join t3 as x17 on x16.b3=x17.d3;
2951 count(*)
2952 1
2953 explain select count(*) from t3 as x0
2954 join t3 as x1 on x0.c3=x1.a3
2955 join t3 as x2 on x1.c3=x2.a3
2956 join t3 as x3 on x2.c3=x3.a3
2957 join t3 as x4 on x3.c3=x4.a3
2958 join t3 as x5 on x4.c3=x5.a3
2959 join t3 as x6 on x5.c3=x6.a3
2960 join t3 as x7 on x6.c3=x7.a3
2961 join t3 as x8 on x7.c3=x8.a3
2962 join t3 as x9 on x8.c3=x9.a3
2963 join t3 as x10 on x9.c3=x10.a3
2964 join t3 as x11 on x10.c3=x11.a3
2965 join t3 as x12 on x11.c3=x12.a3
2966 join t3 as x13 on x12.c3=x13.a3
2967 join t3 as x14 on x13.c3=x14.a3
2968 join t3 as x15 on x14.c3=x15.a3
2969 join t3 as x16 on x15.c3=x16.a3
2970 join t3 as x17 on x16.c3=x17.a3
2971 join t3 as x18 on x17.c3=x18.a3
2972 join t3 as x19 on x18.c3=x19.a3
2973 join t3 as x20 on x19.c3=x20.a3
2974 join t3 as x21 on x20.c3=x21.a3
2975 join t3 as x22 on x21.c3=x22.a3
2976 join t3 as x23 on x22.c3=x23.a3
2977 join t3 as x24 on x23.c3=x24.a3
2978 join t3 as x25 on x24.c3=x25.a3
2979 join t3 as x26 on x25.c3=x26.a3
2980 join t3 as x27 on x26.c3=x27.a3
2981 join t3 as x28 on x27.c3=x28.a3
2982 join t3 as x29 on x28.c3=x29.a3
2983 join t3 as x30 on x29.c3=x30.a3
2984 join t3 as x31 on x30.c3=x31.a3
2985 join t3 as x32 on x31.c3=x32.a3
2986 join t3 as x33 on x32.c3=x33.a3;
2987 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
2988 1 SIMPLE x0 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 4 100.00 NULL
2989 1 SIMPLE x1 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.x0.c3 1 100.00 Using join buffer (Batched Key Access)
2990 1 SIMPLE x2 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.x1.c3 1 100.00 Using join buffer (Batched Key Access)
2991 1 SIMPLE x3 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.x2.c3 1 100.00 Using join buffer (Batched Key Access)
2992 1 SIMPLE x4 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.x3.c3 1 100.00 Using join buffer (Batched Key Access)
2993 1 SIMPLE x5 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.x4.c3 1 100.00 Using join buffer (Batched Key Access)
2994 1 SIMPLE x6 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.x5.c3 1 100.00 Using join buffer (Batched Key Access)
2995 1 SIMPLE x7 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.x6.c3 1 100.00 Using join buffer (Batched Key Access)
2996 1 SIMPLE x8 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.x7.c3 1 100.00 Using join buffer (Batched Key Access)
2997 1 SIMPLE x9 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.x8.c3 1 100.00 Using join buffer (Batched Key Access)
2998 1 SIMPLE x10 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.x9.c3 1 100.00 Using join buffer (Batched Key Access)
2999 1 SIMPLE x11 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.x10.c3 1 100.00 Using join buffer (Batched Key Access)
3000 1 SIMPLE x12 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.x11.c3 1 100.00 Using join buffer (Batched Key Access)
3001 1 SIMPLE x13 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.x12.c3 1 100.00 Using join buffer (Batched Key Access)
3002 1 SIMPLE x14 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.x13.c3 1 100.00 Using join buffer (Batched Key Access)
3003 1 SIMPLE x15 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.x14.c3 1 100.00 Using join buffer (Batched Key Access)
3004 1 SIMPLE x16 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.x15.c3 1 100.00 Using join buffer (Batched Key Access)
3005 1 SIMPLE x17 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.x16.c3 1 100.00 Using join buffer (Batched Key Access)
3006 1 SIMPLE x18 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.x17.c3 1 100.00 Using join buffer (Batched Key Access)
3007 1 SIMPLE x19 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.x18.c3 1 100.00 Using join buffer (Batched Key Access)
3008 1 SIMPLE x20 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.x19.c3 1 100.00 Using join buffer (Batched Key Access)
3009 1 SIMPLE x21 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.x20.c3 1 100.00 Using join buffer (Batched Key Access)
3010 1 SIMPLE x22 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.x21.c3 1 100.00 Using join buffer (Batched Key Access)
3011 1 SIMPLE x23 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.x22.c3 1 100.00 Using join buffer (Batched Key Access)
3012 1 SIMPLE x24 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.x23.c3 1 100.00 Using join buffer (Batched Key Access)
3013 1 SIMPLE x25 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.x24.c3 1 100.00 Using join buffer (Batched Key Access)
3014 1 SIMPLE x26 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.x25.c3 1 100.00 Using join buffer (Batched Key Access)
3015 1 SIMPLE x27 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.x26.c3 1 100.00 Using join buffer (Batched Key Access)
3016 1 SIMPLE x28 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.x27.c3 1 100.00 Using join buffer (Batched Key Access)
3017 1 SIMPLE x29 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.x28.c3 1 100.00 Using join buffer (Batched Key Access)
3018 1 SIMPLE x30 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.x29.c3 1 100.00 Using join buffer (Batched Key Access)
3019 1 SIMPLE x31 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.x30.c3 1 100.00 Using join buffer (Batched Key Access)
3020 1 SIMPLE x32 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.x31.c3 1 100.00 Using join buffer (Batched Key Access)
3021 1 SIMPLE x33 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.x32.c3 1 100.00 Using join buffer (Batched Key Access)
3022 Warnings:
3023 Note 1003 Can't push table 'x1' as child, access type 'Batched-key' not implemented
3024 Note 1003 Can't push table 'x2' as child, access type 'Batched-key' not implemented
3025 Note 1003 Can't push table 'x3' as child, access type 'Batched-key' not implemented
3026 Note 1003 Can't push table 'x4' as child, access type 'Batched-key' not implemented
3027 Note 1003 Can't push table 'x5' as child, access type 'Batched-key' not implemented
3028 Note 1003 Can't push table 'x6' as child, access type 'Batched-key' not implemented
3029 Note 1003 Can't push table 'x7' as child, access type 'Batched-key' not implemented
3030 Note 1003 Can't push table 'x8' as child, access type 'Batched-key' not implemented
3031 Note 1003 Can't push table 'x9' as child, access type 'Batched-key' not implemented
3032 Note 1003 Can't push table 'x10' as child, access type 'Batched-key' not implemented
3033 Note 1003 Can't push table 'x11' as child, access type 'Batched-key' not implemented
3034 Note 1003 Can't push table 'x12' as child, access type 'Batched-key' not implemented
3035 Note 1003 Can't push table 'x13' as child, access type 'Batched-key' not implemented
3036 Note 1003 Can't push table 'x14' as child, access type 'Batched-key' not implemented
3037 Note 1003 Can't push table 'x15' as child, access type 'Batched-key' not implemented
3038 Note 1003 Can't push table 'x16' as child, access type 'Batched-key' not implemented
3039 Note 1003 Can't push table 'x17' as child, access type 'Batched-key' not implemented
3040 Note 1003 Can't push table 'x18' as child, access type 'Batched-key' not implemented
3041 Note 1003 Can't push table 'x19' as child, access type 'Batched-key' not implemented
3042 Note 1003 Can't push table 'x20' as child, access type 'Batched-key' not implemented
3043 Note 1003 Can't push table 'x21' as child, access type 'Batched-key' not implemented
3044 Note 1003 Can't push table 'x22' as child, access type 'Batched-key' not implemented
3045 Note 1003 Can't push table 'x23' as child, access type 'Batched-key' not implemented
3046 Note 1003 Can't push table 'x24' as child, access type 'Batched-key' not implemented
3047 Note 1003 Can't push table 'x25' as child, access type 'Batched-key' not implemented
3048 Note 1003 Can't push table 'x26' as child, access type 'Batched-key' not implemented
3049 Note 1003 Can't push table 'x27' as child, access type 'Batched-key' not implemented
3050 Note 1003 Can't push table 'x28' as child, access type 'Batched-key' not implemented
3051 Note 1003 Can't push table 'x29' as child, access type 'Batched-key' not implemented
3052 Note 1003 Can't push table 'x30' as child, access type 'Batched-key' not implemented
3053 Note 1003 Can't push table 'x31' as child, access type 'Batched-key' not implemented
3054 Note 1003 Can't push table 'x32' as child, access type 'Batched-key' not implemented
3055 Note 1003 Can't push table 'x33' as child, access type 'Batched-key' not implemented
3056 Note 1003 /* select#1 */ select count(0) AS `count(*)` from `test`.`t3` `x0` join `test`.`t3` `x1` join `test`.`t3` `x2` join `test`.`t3` `x3` join `test`.`t3` `x4` join `test`.`t3` `x5` join `test`.`t3` `x6` join `test`.`t3` `x7` join `test`.`t3` `x8` join `test`.`t3` `x9` join `test`.`t3` `x10` join `test`.`t3` `x11` join `test`.`t3` `x12` join `test`.`t3` `x13` join `test`.`t3` `x14` join `test`.`t3` `x15` join `test`.`t3` `x16` join `test`.`t3` `x17` join `test`.`t3` `x18` join `test`.`t3` `x19` join `test`.`t3` `x20` join `test`.`t3` `x21` join `test`.`t3` `x22` join `test`.`t3` `x23` join `test`.`t3` `x24` join `test`.`t3` `x25` join `test`.`t3` `x26` join `test`.`t3` `x27` join `test`.`t3` `x28` join `test`.`t3` `x29` join `test`.`t3` `x30` join `test`.`t3` `x31` join `test`.`t3` `x32` join `test`.`t3` `x33` where ((`test`.`x1`.`a3` = `test`.`x0`.`c3`) and (`test`.`x2`.`a3` = `test`.`x1`.`c3`) and (`test`.`x3`.`a3` = `test`.`x2`.`c3`) and (`test`.`x4`.`a3` = `test`.`x3`.`c3`) and (`test`.`x5`.`a3` = `test`.`x4`.`c3`) and (`test`.`x6`.`a3` = `test`.`x5`.`c3`) and (`test`.`x7`.`a3` = `test`.`x6`.`c3`) and (`test`.`x8`.`a3` = `test`.`x7`.`c3`) and (`test`.`x9`.`a3` = `test`.`x8`.`c3`) and (`test`.`x10`.`a3` = `test`.`x9`.`c3`) and (`test`.`x11`.`a3` = `test`.`x10`.`c3`) and (`test`.`x12`.`a3` = `test`.`x11`.`c3`) and (`test`.`x13`.`a3` = `test`.`x12`.`c3`) and (`test`.`x14`.`a3` = `test`.`x13`.`c3`) and (`test`.`x15`.`a3` = `test`.`x14`.`c3`) and (`test`.`x16`.`a3` = `test`.`x15`.`c3`) and (`test`.`x17`.`a3` = `test`.`x16`.`c3`) and (`test`.`x18`.`a3` = `test`.`x17`.`c3`) and (`test`.`x19`.`a3` = `test`.`x18`.`c3`) and (`test`.`x20`.`a3` = `test`.`x19`.`c3`) and (`test`.`x21`.`a3` = `test`.`x20`.`c3`) and (`test`.`x22`.`a3` = `test`.`x21`.`c3`) and (`test`.`x23`.`a3` = `test`.`x22`.`c3`) and (`test`.`x24`.`a3` = `test`.`x23`.`c3`) and (`test`.`x25`.`a3` = `test`.`x24`.`c3`) and (`test`.`x26`.`a3` = `test`.`x25`.`c3`) and (`test`.`x27`.`a3` = `test`.`x26`.`c3`) and (`test`.`x28`.`a3` = `test`.`x27`.`c3`) and (`test`.`x29`.`a3` = `test`.`x28`.`c3`) and (`test`.`x30`.`a3` = `test`.`x29`.`c3`) and (`test`.`x31`.`a3` = `test`.`x30`.`c3`) and (`test`.`x32`.`a3` = `test`.`x31`.`c3`) and (`test`.`x33`.`a3` = `test`.`x32`.`c3`))
3057 select count(*) from t3 as x0
3058 join t3 as x1 on x0.c3=x1.a3
3059 join t3 as x2 on x1.c3=x2.a3
3060 join t3 as x3 on x2.c3=x3.a3
3061 join t3 as x4 on x3.c3=x4.a3
3062 join t3 as x5 on x4.c3=x5.a3
3063 join t3 as x6 on x5.c3=x6.a3
3064 join t3 as x7 on x6.c3=x7.a3
3065 join t3 as x8 on x7.c3=x8.a3
3066 join t3 as x9 on x8.c3=x9.a3
3067 join t3 as x10 on x9.c3=x10.a3
3068 join t3 as x11 on x10.c3=x11.a3
3069 join t3 as x12 on x11.c3=x12.a3
3070 join t3 as x13 on x12.c3=x13.a3
3071 join t3 as x14 on x13.c3=x14.a3
3072 join t3 as x15 on x14.c3=x15.a3
3073 join t3 as x16 on x15.c3=x16.a3
3074 join t3 as x17 on x16.c3=x17.a3
3075 join t3 as x18 on x17.c3=x18.a3
3076 join t3 as x19 on x18.c3=x19.a3
3077 join t3 as x20 on x19.c3=x20.a3
3078 join t3 as x21 on x20.c3=x21.a3
3079 join t3 as x22 on x21.c3=x22.a3
3080 join t3 as x23 on x22.c3=x23.a3
3081 join t3 as x24 on x23.c3=x24.a3
3082 join t3 as x25 on x24.c3=x25.a3
3083 join t3 as x26 on x25.c3=x26.a3
3084 join t3 as x27 on x26.c3=x27.a3
3085 join t3 as x28 on x27.c3=x28.a3
3086 join t3 as x29 on x28.c3=x29.a3
3087 join t3 as x30 on x29.c3=x30.a3
3088 join t3 as x31 on x30.c3=x31.a3
3089 join t3 as x32 on x31.c3=x32.a3
3090 join t3 as x33 on x32.c3=x33.a3;
3091 count(*)
3092 1
3093 explain select count(*) from t3 as x0
3094 join t3 as x1 on x0.b3=x1.d3
3095 join t3 as x2 on x1.b3=x2.d3
3096 join t3 as x3 on x2.b3=x3.d3
3097 join t3 as x4 on x3.b3=x4.d3
3098 join t3 as x5 on x4.b3=x5.d3
3099 join t3 as x6 on x5.b3=x6.d3
3100 join t3 as x7 on x6.b3=x7.d3
3101 join t3 as x8 on x7.b3=x8.d3
3102 join t3 as x9 on x8.b3=x9.d3
3103 join t3 as x10 on x9.b3=x10.d3
3104 join t3 as x11 on x10.b3=x11.d3
3105 join t3 as x12 on x11.b3=x12.d3
3106 join t3 as x13 on x12.b3=x13.d3
3107 join t3 as x14 on x13.b3=x14.d3
3108 join t3 as x15 on x14.b3=x15.d3
3109 join t3 as x16 on x15.b3=x16.d3
3110 join t3 as x17 on x15.b3=x17.a3
3111 join t3 as x18 on x16.b3=x18.d3;
3112 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
3113 1 SIMPLE x0 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 4 100.00 NULL
3114 1 SIMPLE x1 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref t3_d3 t3_d3 4 test.x0.b3 1 100.00 Using join buffer (Batched Key Access)
3115 1 SIMPLE x2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref t3_d3 t3_d3 4 test.x1.b3 1 100.00 Using join buffer (Batched Key Access)
3116 1 SIMPLE x3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref t3_d3 t3_d3 4 test.x2.b3 1 100.00 Using join buffer (Batched Key Access)
3117 1 SIMPLE x4 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref t3_d3 t3_d3 4 test.x3.b3 1 100.00 Using join buffer (Batched Key Access)
3118 1 SIMPLE x5 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref t3_d3 t3_d3 4 test.x4.b3 1 100.00 Using join buffer (Batched Key Access)
3119 1 SIMPLE x6 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref t3_d3 t3_d3 4 test.x5.b3 1 100.00 Using join buffer (Batched Key Access)
3120 1 SIMPLE x7 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref t3_d3 t3_d3 4 test.x6.b3 1 100.00 Using join buffer (Batched Key Access)
3121 1 SIMPLE x8 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref t3_d3 t3_d3 4 test.x7.b3 1 100.00 Using join buffer (Batched Key Access)
3122 1 SIMPLE x9 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref t3_d3 t3_d3 4 test.x8.b3 1 100.00 Using join buffer (Batched Key Access)
3123 1 SIMPLE x10 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref t3_d3 t3_d3 4 test.x9.b3 1 100.00 Using join buffer (Batched Key Access)
3124 1 SIMPLE x11 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref t3_d3 t3_d3 4 test.x10.b3 1 100.00 Using join buffer (Batched Key Access)
3125 1 SIMPLE x12 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref t3_d3 t3_d3 4 test.x11.b3 1 100.00 Using join buffer (Batched Key Access)
3126 1 SIMPLE x13 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref t3_d3 t3_d3 4 test.x12.b3 1 100.00 Using join buffer (Batched Key Access)
3127 1 SIMPLE x14 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref t3_d3 t3_d3 4 test.x13.b3 1 100.00 Using join buffer (Batched Key Access)
3128 1 SIMPLE x15 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref t3_d3 t3_d3 4 test.x14.b3 1 100.00 Using join buffer (Batched Key Access)
3129 1 SIMPLE x16 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref t3_d3 t3_d3 4 test.x15.b3 1 100.00 Using join buffer (Batched Key Access)
3130 1 SIMPLE x18 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref t3_d3 t3_d3 4 test.x16.b3 1 100.00 Using join buffer (Batched Key Access)
3131 1 SIMPLE x17 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.x15.b3 1 100.00 Using join buffer (Batched Key Access)
3132 Warnings:
3133 Note 1003 Can't push table 'x1' as child, access type 'Batched-key' not implemented
3134 Note 1003 Can't push table 'x2' as child, access type 'Batched-key' not implemented
3135 Note 1003 Can't push table 'x3' as child, access type 'Batched-key' not implemented
3136 Note 1003 Can't push table 'x4' as child, access type 'Batched-key' not implemented
3137 Note 1003 Can't push table 'x5' as child, access type 'Batched-key' not implemented
3138 Note 1003 Can't push table 'x6' as child, access type 'Batched-key' not implemented
3139 Note 1003 Can't push table 'x7' as child, access type 'Batched-key' not implemented
3140 Note 1003 Can't push table 'x8' as child, access type 'Batched-key' not implemented
3141 Note 1003 Can't push table 'x9' as child, access type 'Batched-key' not implemented
3142 Note 1003 Can't push table 'x10' as child, access type 'Batched-key' not implemented
3143 Note 1003 Can't push table 'x11' as child, access type 'Batched-key' not implemented
3144 Note 1003 Can't push table 'x12' as child, access type 'Batched-key' not implemented
3145 Note 1003 Can't push table 'x13' as child, access type 'Batched-key' not implemented
3146 Note 1003 Can't push table 'x14' as child, access type 'Batched-key' not implemented
3147 Note 1003 Can't push table 'x15' as child, access type 'Batched-key' not implemented
3148 Note 1003 Can't push table 'x16' as child, access type 'Batched-key' not implemented
3149 Note 1003 Can't push table 'x18' as child, access type 'Batched-key' not implemented
3150 Note 1003 Can't push table 'x17' as child, access type 'Batched-key' not implemented
3151 Note 1003 /* select#1 */ select count(0) AS `count(*)` from `test`.`t3` `x0` join `test`.`t3` `x1` join `test`.`t3` `x2` join `test`.`t3` `x3` join `test`.`t3` `x4` join `test`.`t3` `x5` join `test`.`t3` `x6` join `test`.`t3` `x7` join `test`.`t3` `x8` join `test`.`t3` `x9` join `test`.`t3` `x10` join `test`.`t3` `x11` join `test`.`t3` `x12` join `test`.`t3` `x13` join `test`.`t3` `x14` join `test`.`t3` `x15` join `test`.`t3` `x16` join `test`.`t3` `x17` join `test`.`t3` `x18` where ((`test`.`x1`.`d3` = `test`.`x0`.`b3`) and (`test`.`x2`.`d3` = `test`.`x1`.`b3`) and (`test`.`x3`.`d3` = `test`.`x2`.`b3`) and (`test`.`x4`.`d3` = `test`.`x3`.`b3`) and (`test`.`x5`.`d3` = `test`.`x4`.`b3`) and (`test`.`x6`.`d3` = `test`.`x5`.`b3`) and (`test`.`x7`.`d3` = `test`.`x6`.`b3`) and (`test`.`x8`.`d3` = `test`.`x7`.`b3`) and (`test`.`x9`.`d3` = `test`.`x8`.`b3`) and (`test`.`x10`.`d3` = `test`.`x9`.`b3`) and (`test`.`x11`.`d3` = `test`.`x10`.`b3`) and (`test`.`x12`.`d3` = `test`.`x11`.`b3`) and (`test`.`x13`.`d3` = `test`.`x12`.`b3`) and (`test`.`x14`.`d3` = `test`.`x13`.`b3`) and (`test`.`x15`.`d3` = `test`.`x14`.`b3`) and (`test`.`x16`.`d3` = `test`.`x15`.`b3`) and (`test`.`x17`.`a3` = `test`.`x15`.`b3`) and (`test`.`x18`.`d3` = `test`.`x16`.`b3`))
3152 select count(*) from t3 as x0
3153 join t3 as x1 on x0.b3=x1.d3
3154 join t3 as x2 on x1.b3=x2.d3
3155 join t3 as x3 on x2.b3=x3.d3
3156 join t3 as x4 on x3.b3=x4.d3
3157 join t3 as x5 on x4.b3=x5.d3
3158 join t3 as x6 on x5.b3=x6.d3
3159 join t3 as x7 on x6.b3=x7.d3
3160 join t3 as x8 on x7.b3=x8.d3
3161 join t3 as x9 on x8.b3=x9.d3
3162 join t3 as x10 on x9.b3=x10.d3
3163 join t3 as x11 on x10.b3=x11.d3
3164 join t3 as x12 on x11.b3=x12.d3
3165 join t3 as x13 on x12.b3=x13.d3
3166 join t3 as x14 on x13.b3=x14.d3
3167 join t3 as x15 on x14.b3=x15.d3
3168 join t3 as x16 on x15.b3=x16.d3
3169 join t3 as x17 on x15.b3=x17.a3
3170 join t3 as x18 on x16.b3=x18.d3;
3171 count(*)
3172 4
3173 drop table t1,t2,t3, t3_hash;
3174 create table t3 (a3 int, b3 int, c3 int, d3 int,
3175 primary key(b3, a3)) engine = ndb
3176 comment="NDB_TABLE=PARTITION_BALANCE=FOR_RP_BY_LDM";
3177 create table t3_hash (a3 int, b3 int, c3 int, d3 int,
3178 primary key(b3,a3) using hash) engine = ndb
3179 comment="NDB_TABLE=PARTITION_BALANCE=FOR_RP_BY_LDM";
3180 create table t3_unq (pk int, a3 int not null, b3 int not null, c3 int, d3 int,
3181 primary key(pk) using hash, unique key(b3,a3) using hash) engine = ndb
3182 comment="NDB_TABLE=PARTITION_BALANCE=FOR_RP_BY_LDM";
3183 insert into t3 values (0x1f, 0x2f, 1, 0x1f);
3184 insert into t3 values (0x2f, 0x3f, 2, 0x2f);
3185 insert into t3 values (0x3f, 0x1f, 3, 0x3f);
3186 insert into t3_hash values (0x1f, 0x2f, 1, 0x1f);
3187 insert into t3_hash values (0x2f, 0x3f, 2, 0x2f);
3188 insert into t3_hash values (0x3f, 0x1f, 3, 0x3f);
3189 insert into t3_unq values (1001, 0x1f, 0x2f, 1, 0x1f);
3190 insert into t3_unq values (1002, 0x2f, 0x3f, 2, 0x2f);
3191 insert into t3_unq values (1003, 0x3f, 0x1f, 3, 0x3f);
3192 explain
3193 select * from t3 x, t3 y where y.a3=x.d3 and y.b3=x.b3;
3194 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
3195 1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 ALL PRIMARY NULL NULL NULL 3 100.00 Using pushed condition (`test`.`x`.`d3` is not null)
3196 1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.x.b3,test.x.d3 1 100.00 Using join buffer (Batched Key Access)
3197 Warnings:
3198 Note 1003 Can't push table 'y' as child, access type 'Batched-key' not implemented
3199 Note 1003 /* select#1 */ select `test`.`x`.`a3` AS `a3`,`test`.`x`.`b3` AS `b3`,`test`.`x`.`c3` AS `c3`,`test`.`x`.`d3` AS `d3`,`test`.`y`.`a3` AS `a3`,`test`.`y`.`b3` AS `b3`,`test`.`y`.`c3` AS `c3`,`test`.`y`.`d3` AS `d3` from `test`.`t3` `x` join `test`.`t3` `y` where ((`test`.`y`.`b3` = `test`.`x`.`b3`) and (`test`.`y`.`a3` = `test`.`x`.`d3`))
3200 select * from t3 x, t3 y where y.a3=x.d3 and y.b3=x.b3;
3201 a3 b3 c3 d3 a3 b3 c3 d3
3202 31 47 1 31 31 47 1 31
3203 47 63 2 47 47 63 2 47
3204 63 31 3 63 63 31 3 63
3205 explain
3206 select * from t3_hash x, t3_hash y where y.a3=x.d3 and y.b3=x.b3;
3207 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
3208 1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 ALL PRIMARY NULL NULL NULL 3 100.00 Using pushed condition (`test`.`x`.`d3` is not null)
3209 1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.x.b3,test.x.d3 1 100.00 Using join buffer (Batched Key Access)
3210 Warnings:
3211 Note 1003 Can't push table 'y' as child, access type 'Batched-key' not implemented
3212 Note 1003 /* select#1 */ select `test`.`x`.`a3` AS `a3`,`test`.`x`.`b3` AS `b3`,`test`.`x`.`c3` AS `c3`,`test`.`x`.`d3` AS `d3`,`test`.`y`.`a3` AS `a3`,`test`.`y`.`b3` AS `b3`,`test`.`y`.`c3` AS `c3`,`test`.`y`.`d3` AS `d3` from `test`.`t3_hash` `x` join `test`.`t3_hash` `y` where ((`test`.`y`.`b3` = `test`.`x`.`b3`) and (`test`.`y`.`a3` = `test`.`x`.`d3`))
3213 select * from t3_hash x, t3_hash y where y.a3=x.d3 and y.b3=x.b3;
3214 a3 b3 c3 d3 a3 b3 c3 d3
3215 31 47 1 31 31 47 1 31
3216 47 63 2 47 47 63 2 47
3217 63 31 3 63 63 31 3 63
3218 explain
3219 select * from t3_unq x, t3_unq y where y.a3=x.d3 and y.b3=x.b3;
3220 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
3221 1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 ALL b3 NULL NULL NULL 3 100.00 Using pushed condition (`test`.`x`.`d3` is not null)
3222 1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref b3 b3 8 test.x.b3,test.x.d3 1 100.00 Using join buffer (Batched Key Access)
3223 Warnings:
3224 Note 1003 Can't push table 'y' as child, access type 'Batched-key' not implemented
3225 Note 1003 /* select#1 */ select `test`.`x`.`pk` AS `pk`,`test`.`x`.`a3` AS `a3`,`test`.`x`.`b3` AS `b3`,`test`.`x`.`c3` AS `c3`,`test`.`x`.`d3` AS `d3`,`test`.`y`.`pk` AS `pk`,`test`.`y`.`a3` AS `a3`,`test`.`y`.`b3` AS `b3`,`test`.`y`.`c3` AS `c3`,`test`.`y`.`d3` AS `d3` from `test`.`t3_unq` `x` join `test`.`t3_unq` `y` where ((`test`.`y`.`b3` = `test`.`x`.`b3`) and (`test`.`y`.`a3` = `test`.`x`.`d3`))
3226 select * from t3_unq x, t3_unq y where y.a3=x.d3 and y.b3=x.b3;
3227 pk a3 b3 c3 d3 pk a3 b3 c3 d3
3228 1001 31 47 1 31 1001 31 47 1 31
3229 1002 47 63 2 47 1002 47 63 2 47
3230 1003 63 31 3 63 1003 63 31 3 63
3231 explain
3232 select * from t3 x, t3 y where y.a3=x.d3 and y.b3=x.b3
3233 and x.a3=0x2f and x.b3=0x3f;
3234 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
3235 1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 const,const 1 100.00 Using where
3236 1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 const,test.x.d3 1 100.00 Using where; Using join buffer (Batched Key Access)
3237 Warnings:
3238 Note 1003 Can't push table 'y' as child, access type 'Batched-key' not implemented
3239 Note 1003 /* select#1 */ select `test`.`x`.`a3` AS `a3`,`test`.`x`.`b3` AS `b3`,`test`.`x`.`c3` AS `c3`,`test`.`x`.`d3` AS `d3`,`test`.`y`.`a3` AS `a3`,`test`.`y`.`b3` AS `b3`,`test`.`y`.`c3` AS `c3`,`test`.`y`.`d3` AS `d3` from `test`.`t3` `x` join `test`.`t3` `y` where ((`test`.`y`.`b3` = `test`.`x`.`b3`) and (`test`.`y`.`a3` = `test`.`x`.`d3`) and (`test`.`x`.`a3` = 0x2f) and (`test`.`x`.`b3` = 0x3f))
3240 select * from t3 x, t3 y where y.a3=x.d3 and y.b3=x.b3
3241 and x.a3=0x2f and x.b3=0x3f;
3242 a3 b3 c3 d3 a3 b3 c3 d3
3243 47 63 2 47 47 63 2 47
3244 explain
3245 select * from t3_hash x, t3_hash y where y.a3=x.d3 and y.b3=x.b3
3246 and x.a3=0x2f and x.b3=0x3f;
3247 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
3248 1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 const,const 1 100.00 Using where
3249 1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 const,test.x.d3 1 100.00 Using where; Using join buffer (Batched Key Access)
3250 Warnings:
3251 Note 1003 Can't push table 'y' as child, access type 'Batched-key' not implemented
3252 Note 1003 /* select#1 */ select `test`.`x`.`a3` AS `a3`,`test`.`x`.`b3` AS `b3`,`test`.`x`.`c3` AS `c3`,`test`.`x`.`d3` AS `d3`,`test`.`y`.`a3` AS `a3`,`test`.`y`.`b3` AS `b3`,`test`.`y`.`c3` AS `c3`,`test`.`y`.`d3` AS `d3` from `test`.`t3_hash` `x` join `test`.`t3_hash` `y` where ((`test`.`y`.`b3` = `test`.`x`.`b3`) and (`test`.`y`.`a3` = `test`.`x`.`d3`) and (`test`.`x`.`a3` = 0x2f) and (`test`.`x`.`b3` = 0x3f))
3253 select * from t3_hash x, t3_hash y where y.a3=x.d3 and y.b3=x.b3
3254 and x.a3=0x2f and x.b3=0x3f;
3255 a3 b3 c3 d3 a3 b3 c3 d3
3256 47 63 2 47 47 63 2 47
3257 explain
3258 select * from t3_unq x, t3_unq y where y.a3=x.d3 and y.b3=x.b3
3259 and x.a3=0x2f and x.b3=0x3f;
3260 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
3261 1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 eq_ref b3 b3 8 const,const 1 100.00 Using where
3262 1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref b3 b3 8 const,test.x.d3 1 100.00 Using where; Using join buffer (Batched Key Access)
3263 Warnings:
3264 Note 1003 Can't push table 'y' as child, access type 'Batched-key' not implemented
3265 Note 1003 /* select#1 */ select `test`.`x`.`pk` AS `pk`,`test`.`x`.`a3` AS `a3`,`test`.`x`.`b3` AS `b3`,`test`.`x`.`c3` AS `c3`,`test`.`x`.`d3` AS `d3`,`test`.`y`.`pk` AS `pk`,`test`.`y`.`a3` AS `a3`,`test`.`y`.`b3` AS `b3`,`test`.`y`.`c3` AS `c3`,`test`.`y`.`d3` AS `d3` from `test`.`t3_unq` `x` join `test`.`t3_unq` `y` where ((`test`.`y`.`b3` = `test`.`x`.`b3`) and (`test`.`y`.`a3` = `test`.`x`.`d3`) and (`test`.`x`.`a3` = 0x2f) and (`test`.`x`.`b3` = 0x3f))
3266 select * from t3_unq x, t3_unq y where y.a3=x.d3 and y.b3=x.b3
3267 and x.a3=0x2f and x.b3=0x3f;
3268 pk a3 b3 c3 d3 pk a3 b3 c3 d3
3269 1002 47 63 2 47 1002 47 63 2 47
3270 drop table t3, t3_hash, t3_unq;
3271 create table t3 (a3 int, b3 int, c3 int, d3 int,
3272 primary key(a3), unique key(d3)) engine = ndb
3273 comment="NDB_TABLE=PARTITION_BALANCE=FOR_RP_BY_LDM";
3274 insert into t3 values (0x1f, 0x2f, 1, 0x1f);
3275 insert into t3 values (0x2f, 0x3f, 2, 0x2f);
3276 insert into t3 values (0x3f, 0x1f, 3, 0x3f);
3277 insert into t3 values (0x4f, 0, null, null);
3278 explain
3279 select * from t3 as t1
3280 left outer join t3 as t2 on t2.d3 = t1.d3
3281 left outer join t3 as t3 on t3.a3 = t2.d3;
3282 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
3283 1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 4 100.00 NULL
3284 1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref d3 d3 5 test.t1.d3 1 100.00 Using join buffer (Batched Key Access)
3285 1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.t2.d3 1 100.00 Using join buffer (Batched Key Access)
3286 Warnings:
3287 Note 1003 Can't push table 't2' as child, access type 'Batched-key' not implemented
3288 Note 1003 Can't push table 't3' as child, access type 'Batched-key' not implemented
3289 Note 1003 /* select#1 */ select `test`.`t1`.`a3` AS `a3`,`test`.`t1`.`b3` AS `b3`,`test`.`t1`.`c3` AS `c3`,`test`.`t1`.`d3` AS `d3`,`test`.`t2`.`a3` AS `a3`,`test`.`t2`.`b3` AS `b3`,`test`.`t2`.`c3` AS `c3`,`test`.`t2`.`d3` AS `d3`,`test`.`t3`.`a3` AS `a3`,`test`.`t3`.`b3` AS `b3`,`test`.`t3`.`c3` AS `c3`,`test`.`t3`.`d3` AS `d3` from `test`.`t3` `t1` left join `test`.`t3` `t2` on((`test`.`t2`.`d3` = `test`.`t1`.`d3`)) left join `test`.`t3` on((`test`.`t3`.`a3` = `test`.`t2`.`d3`)) where true
3290 select * from t3 as t1
3291 left outer join t3 as t2 on t2.d3 = t1.d3
3292 left outer join t3 as t3 on t3.a3 = t2.d3;
3293 a3 b3 c3 d3 a3 b3 c3 d3 a3 b3 c3 d3
3294 31 47 1 31 31 47 1 31 31 47 1 31
3295 47 63 2 47 47 63 2 47 47 63 2 47
3296 63 31 3 63 63 31 3 63 63 31 3 63
3297 79 0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
3298 explain
3299 select * from t3 as t1
3300 left outer join t3 as t2 on t2.d3 = t1.a3
3301 left outer join t3 as t3 on t3.a3 = t2.d3
3302 where t1.d3 = 47;
3303 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
3304 1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref d3 d3 5 const 1 100.00 NULL
3305 1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref d3 d3 5 test.t1.a3 1 100.00 Using join buffer (Batched Key Access)
3306 1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.t2.d3 1 100.00 Using join buffer (Batched Key Access)
3307 Warnings:
3308 Note 1003 Can't push table 't2' as child, access type 'Batched-key' not implemented
3309 Note 1003 Can't push table 't3' as child, access type 'Batched-key' not implemented
3310 Note 1003 /* select#1 */ select `test`.`t1`.`a3` AS `a3`,`test`.`t1`.`b3` AS `b3`,`test`.`t1`.`c3` AS `c3`,`test`.`t1`.`d3` AS `d3`,`test`.`t2`.`a3` AS `a3`,`test`.`t2`.`b3` AS `b3`,`test`.`t2`.`c3` AS `c3`,`test`.`t2`.`d3` AS `d3`,`test`.`t3`.`a3` AS `a3`,`test`.`t3`.`b3` AS `b3`,`test`.`t3`.`c3` AS `c3`,`test`.`t3`.`d3` AS `d3` from `test`.`t3` `t1` left join `test`.`t3` `t2` on((`test`.`t2`.`d3` = `test`.`t1`.`a3`)) left join `test`.`t3` on((`test`.`t3`.`a3` = `test`.`t2`.`d3`)) where (`test`.`t1`.`d3` = 47)
3311 select * from t3 as t1
3312 left outer join t3 as t2 on t2.d3 = t1.a3
3313 left outer join t3 as t3 on t3.a3 = t2.d3
3314 where t1.d3 = 47;
3315 a3 b3 c3 d3 a3 b3 c3 d3 a3 b3 c3 d3
3316 47 63 2 47 47 63 2 47 47 63 2 47
3317 explain
3318 select * from t3 as t1
3319 left outer join t3 as t2 on t2.d3 = t1.a3
3320 left outer join t3 as t3 on t3.a3 = t2.d3
3321 where t1.d3 >= 47;
3322 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
3323 1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 range d3 d3 5 NULL 3 100.00 Using pushed condition (`test`.`t1`.`d3` >= 47); Using MRR
3324 1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref d3 d3 5 test.t1.a3 1 100.00 Using join buffer (Batched Key Access)
3325 1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.t2.d3 1 100.00 Using join buffer (Batched Key Access)
3326 Warnings:
3327 Note 1003 Can't push table 't2' as child, access type 'Batched-key' not implemented
3328 Note 1003 Can't push table 't3' as child, access type 'Batched-key' not implemented
3329 Note 1003 /* select#1 */ select `test`.`t1`.`a3` AS `a3`,`test`.`t1`.`b3` AS `b3`,`test`.`t1`.`c3` AS `c3`,`test`.`t1`.`d3` AS `d3`,`test`.`t2`.`a3` AS `a3`,`test`.`t2`.`b3` AS `b3`,`test`.`t2`.`c3` AS `c3`,`test`.`t2`.`d3` AS `d3`,`test`.`t3`.`a3` AS `a3`,`test`.`t3`.`b3` AS `b3`,`test`.`t3`.`c3` AS `c3`,`test`.`t3`.`d3` AS `d3` from `test`.`t3` `t1` left join `test`.`t3` `t2` on((`test`.`t2`.`d3` = `test`.`t1`.`a3`)) left join `test`.`t3` on((`test`.`t3`.`a3` = `test`.`t2`.`d3`)) where (`test`.`t1`.`d3` >= 47)
3330 select * from t3 as t1
3331 left outer join t3 as t2 on t2.d3 = t1.a3
3332 left outer join t3 as t3 on t3.a3 = t2.d3
3333 where t1.d3 >= 47;
3334 a3 b3 c3 d3 a3 b3 c3 d3 a3 b3 c3 d3
3335 47 63 2 47 47 63 2 47 47 63 2 47
3336 63 31 3 63 63 31 3 63 63 31 3 63
3337 explain
3338 select * from t3 as t1
3339 left outer join t3 as t2 on t2.d3 = t1.a3
3340 left outer join t3 as t3 on t3.a3 = t2.d3
3341 where t1.d3 is null;
3342 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
3343 1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ref d3 d3 5 const 3 100.00 Using pushed condition (`test`.`t1`.`d3` is null)
3344 1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref d3 d3 5 test.t1.a3 1 100.00 Using join buffer (Batched Key Access)
3345 1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.t2.d3 1 100.00 Using join buffer (Batched Key Access)
3346 Warnings:
3347 Note 1003 Can't push table 't2' as child, access type 'Batched-key' not implemented
3348 Note 1003 Can't push table 't3' as child, access type 'Batched-key' not implemented
3349 Note 1003 /* select#1 */ select `test`.`t1`.`a3` AS `a3`,`test`.`t1`.`b3` AS `b3`,`test`.`t1`.`c3` AS `c3`,`test`.`t1`.`d3` AS `d3`,`test`.`t2`.`a3` AS `a3`,`test`.`t2`.`b3` AS `b3`,`test`.`t2`.`c3` AS `c3`,`test`.`t2`.`d3` AS `d3`,`test`.`t3`.`a3` AS `a3`,`test`.`t3`.`b3` AS `b3`,`test`.`t3`.`c3` AS `c3`,`test`.`t3`.`d3` AS `d3` from `test`.`t3` `t1` left join `test`.`t3` `t2` on((`test`.`t2`.`d3` = `test`.`t1`.`a3`)) left join `test`.`t3` on((`test`.`t3`.`a3` = `test`.`t2`.`d3`)) where (`test`.`t1`.`d3` is null)
3350 select * from t3 as t1
3351 left outer join t3 as t2 on t2.d3 = t1.a3
3352 left outer join t3 as t3 on t3.a3 = t2.d3
3353 where t1.d3 is null;
3354 a3 b3 c3 d3 a3 b3 c3 d3 a3 b3 c3 d3
3355 79 0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
3356 explain
3357 select * from t3 as t1
3358 left outer join t3 as t2 on t2.d3 = t1.a3
3359 left outer join t3 as t3 on t3.a3 = t2.d3
3360 where t1.d3 is not null;
3361 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
3362 1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 range d3 d3 5 NULL 3 100.00 Using pushed condition (`test`.`t1`.`d3` is not null); Using MRR
3363 1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref d3 d3 5 test.t1.a3 1 100.00 Using join buffer (Batched Key Access)
3364 1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.t2.d3 1 100.00 Using join buffer (Batched Key Access)
3365 Warnings:
3366 Note 1003 Can't push table 't2' as child, access type 'Batched-key' not implemented
3367 Note 1003 Can't push table 't3' as child, access type 'Batched-key' not implemented
3368 Note 1003 /* select#1 */ select `test`.`t1`.`a3` AS `a3`,`test`.`t1`.`b3` AS `b3`,`test`.`t1`.`c3` AS `c3`,`test`.`t1`.`d3` AS `d3`,`test`.`t2`.`a3` AS `a3`,`test`.`t2`.`b3` AS `b3`,`test`.`t2`.`c3` AS `c3`,`test`.`t2`.`d3` AS `d3`,`test`.`t3`.`a3` AS `a3`,`test`.`t3`.`b3` AS `b3`,`test`.`t3`.`c3` AS `c3`,`test`.`t3`.`d3` AS `d3` from `test`.`t3` `t1` left join `test`.`t3` `t2` on((`test`.`t2`.`d3` = `test`.`t1`.`a3`)) left join `test`.`t3` on((`test`.`t3`.`a3` = `test`.`t2`.`d3`)) where (`test`.`t1`.`d3` is not null)
3369 select * from t3 as t1
3370 left outer join t3 as t2 on t2.d3 = t1.a3
3371 left outer join t3 as t3 on t3.a3 = t2.d3
3372 where t1.d3 is not null;
3373 a3 b3 c3 d3 a3 b3 c3 d3 a3 b3 c3 d3
3374 31 47 1 31 31 47 1 31 31 47 1 31
3375 47 63 2 47 47 63 2 47 47 63 2 47
3376 63 31 3 63 63 31 3 63 63 31 3 63
3377 insert into t3 values (0x5f, 0x5f, 4, null);
3378 alter table t3 add index ix(b3);
3379 explain select straight_join *
3380 from t3 as t1
3381 left join t3 as t2 on t2.b3 = t1.a3
3382 left join t3 as t3 on t3.b3 = t2.d3
3383 where t1.d3 is null;
3384 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
3385 1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ref d3 d3 5 const 3 100.00 Using pushed condition (`test`.`t1`.`d3` is null)
3386 1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 ref ix ix 5 test.t1.a3 2 100.00 Using join buffer (Batched Key Access)
3387 1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 ref ix ix 5 test.t2.d3 2 100.00 Using join buffer (Batched Key Access)
3388 Warnings:
3389 Note 1003 Can't push table 't2' as child, access type 'Batched-key' not implemented
3390 Note 1003 Can't push table 't3' as child, access type 'Batched-key' not implemented
3391 Note 1003 /* select#1 */ select straight_join `test`.`t1`.`a3` AS `a3`,`test`.`t1`.`b3` AS `b3`,`test`.`t1`.`c3` AS `c3`,`test`.`t1`.`d3` AS `d3`,`test`.`t2`.`a3` AS `a3`,`test`.`t2`.`b3` AS `b3`,`test`.`t2`.`c3` AS `c3`,`test`.`t2`.`d3` AS `d3`,`test`.`t3`.`a3` AS `a3`,`test`.`t3`.`b3` AS `b3`,`test`.`t3`.`c3` AS `c3`,`test`.`t3`.`d3` AS `d3` from `test`.`t3` `t1` left join `test`.`t3` `t2` on((`test`.`t2`.`b3` = `test`.`t1`.`a3`)) left join `test`.`t3` on((`test`.`t3`.`b3` = `test`.`t2`.`d3`)) where (`test`.`t1`.`d3` is null)
3392 select straight_join *
3393 from t3 as t1
3394 left join t3 as t2 on t2.b3 = t1.a3
3395 left join t3 as t3 on t3.b3 = t2.d3
3396 where t1.d3 is null;
3397 a3 b3 c3 d3 a3 b3 c3 d3 a3 b3 c3 d3
3398 79 0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
3399 95 95 4 NULL 95 95 4 NULL NULL NULL NULL NULL
3400 explain select straight_join *
3401 from t3 as t1
3402 left join t3 as t2 on t2.d3 = t1.a3
3403 left join t3 as t3 on t3.d3 = t2.d3
3404 where t1.d3 is null;
3405 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
3406 1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ref d3 d3 5 const 3 100.00 Using pushed condition (`test`.`t1`.`d3` is null)
3407 1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref d3 d3 5 test.t1.a3 1 100.00 Using join buffer (Batched Key Access)
3408 1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref d3 d3 5 test.t2.d3 1 100.00 Using join buffer (Batched Key Access)
3409 Warnings:
3410 Note 1003 Can't push table 't2' as child, access type 'Batched-key' not implemented
3411 Note 1003 Can't push table 't3' as child, access type 'Batched-key' not implemented
3412 Note 1003 /* select#1 */ select straight_join `test`.`t1`.`a3` AS `a3`,`test`.`t1`.`b3` AS `b3`,`test`.`t1`.`c3` AS `c3`,`test`.`t1`.`d3` AS `d3`,`test`.`t2`.`a3` AS `a3`,`test`.`t2`.`b3` AS `b3`,`test`.`t2`.`c3` AS `c3`,`test`.`t2`.`d3` AS `d3`,`test`.`t3`.`a3` AS `a3`,`test`.`t3`.`b3` AS `b3`,`test`.`t3`.`c3` AS `c3`,`test`.`t3`.`d3` AS `d3` from `test`.`t3` `t1` left join `test`.`t3` `t2` on((`test`.`t2`.`d3` = `test`.`t1`.`a3`)) left join `test`.`t3` on((`test`.`t3`.`d3` = `test`.`t2`.`d3`)) where (`test`.`t1`.`d3` is null)
3413 select straight_join *
3414 from t3 as t1
3415 left join t3 as t2 on t2.d3 = t1.a3
3416 left join t3 as t3 on t3.d3 = t2.d3
3417 where t1.d3 is null;
3418 a3 b3 c3 d3 a3 b3 c3 d3 a3 b3 c3 d3
3419 79 0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
3420 95 95 4 NULL NULL NULL NULL NULL NULL NULL NULL NULL
3421 alter table t3 drop index d3;
3422 alter table t3 add unique key(d3) using hash;
3423 Warnings:
3424 Warning 1121 Ndb does not support unique index on NULL valued attributes, index access with NULL value will become full table scan
3425 explain select straight_join *
3426 from t3 as t1
3427 left join t3 as t2 on t2.b3 = t1.a3
3428 left join t3 as t3 on t3.b3 = t2.d3
3429 where t1.d3 is null;
3430 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
3431 1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL d3 NULL NULL NULL 5 20.00 Using pushed condition (`test`.`t1`.`d3` is null)
3432 1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 ref ix ix 5 test.t1.a3 2 100.00 Using join buffer (Batched Key Access)
3433 1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 ref ix ix 5 test.t2.d3 2 100.00 Using join buffer (Batched Key Access)
3434 Warnings:
3435 Note 1003 Can't push table 't2' as child, access type 'Batched-key' not implemented
3436 Note 1003 Can't push table 't3' as child, access type 'Batched-key' not implemented
3437 Note 1003 /* select#1 */ select straight_join `test`.`t1`.`a3` AS `a3`,`test`.`t1`.`b3` AS `b3`,`test`.`t1`.`c3` AS `c3`,`test`.`t1`.`d3` AS `d3`,`test`.`t2`.`a3` AS `a3`,`test`.`t2`.`b3` AS `b3`,`test`.`t2`.`c3` AS `c3`,`test`.`t2`.`d3` AS `d3`,`test`.`t3`.`a3` AS `a3`,`test`.`t3`.`b3` AS `b3`,`test`.`t3`.`c3` AS `c3`,`test`.`t3`.`d3` AS `d3` from `test`.`t3` `t1` left join `test`.`t3` `t2` on((`test`.`t2`.`b3` = `test`.`t1`.`a3`)) left join `test`.`t3` on((`test`.`t3`.`b3` = `test`.`t2`.`d3`)) where (`test`.`t1`.`d3` is null)
3438 select straight_join *
3439 from t3 as t1
3440 left join t3 as t2 on t2.b3 = t1.a3
3441 left join t3 as t3 on t3.b3 = t2.d3
3442 where t1.d3 is null;
3443 a3 b3 c3 d3 a3 b3 c3 d3 a3 b3 c3 d3
3444 79 0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
3445 95 95 4 NULL 95 95 4 NULL NULL NULL NULL NULL
3446 explain select straight_join *
3447 from t3 as t1
3448 left join t3 as t2 on t2.d3 = t1.a3
3449 left join t3 as t3 on t3.d3 = t2.d3
3450 where t1.d3 is null;
3451 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
3452 1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL d3 NULL NULL NULL 5 20.00 Using pushed condition (`test`.`t1`.`d3` is null)
3453 1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref d3 d3 5 test.t1.a3 1 100.00 Using join buffer (Batched Key Access)
3454 1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref d3 d3 5 test.t2.d3 1 100.00 Using join buffer (Batched Key Access)
3455 Warnings:
3456 Note 1003 Can't push table 't2' as child, access type 'Batched-key' not implemented
3457 Note 1003 Can't push table 't3' as child, access type 'Batched-key' not implemented
3458 Note 1003 /* select#1 */ select straight_join `test`.`t1`.`a3` AS `a3`,`test`.`t1`.`b3` AS `b3`,`test`.`t1`.`c3` AS `c3`,`test`.`t1`.`d3` AS `d3`,`test`.`t2`.`a3` AS `a3`,`test`.`t2`.`b3` AS `b3`,`test`.`t2`.`c3` AS `c3`,`test`.`t2`.`d3` AS `d3`,`test`.`t3`.`a3` AS `a3`,`test`.`t3`.`b3` AS `b3`,`test`.`t3`.`c3` AS `c3`,`test`.`t3`.`d3` AS `d3` from `test`.`t3` `t1` left join `test`.`t3` `t2` on((`test`.`t2`.`d3` = `test`.`t1`.`a3`)) left join `test`.`t3` on((`test`.`t3`.`d3` = `test`.`t2`.`d3`)) where (`test`.`t1`.`d3` is null)
3459 select straight_join *
3460 from t3 as t1
3461 left join t3 as t2 on t2.d3 = t1.a3
3462 left join t3 as t3 on t3.d3 = t2.d3
3463 where t1.d3 is null;
3464 a3 b3 c3 d3 a3 b3 c3 d3 a3 b3 c3 d3
3465 79 0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
3466 95 95 4 NULL NULL NULL NULL NULL NULL NULL NULL NULL
3467 drop table t3;
3468 create table t3 (a3 int not null, b3 int not null, c3 int, d3 int,
3469 primary key(a3), unique key(b3,d3), unique key(c3,b3), unique key(c3,d3)) engine = ndb
3470 comment="NDB_TABLE=PARTITION_BALANCE=FOR_RP_BY_LDM";
3471 insert into t3 values (0x1f, 0x2f, 1, 0x1f);
3472 insert into t3 values (0x2f, 0x3f, 2, 0x2f);
3473 insert into t3 values (0x3f, 0x1f, 3, 0x3f);
3474 insert into t3 values (0x40, 0, null, null);
3475 insert into t3 values (0x41, 0, null, null);
3476 insert into t3 values (0x42, 0, 4, null);
3477 insert into t3 values (0x43, 0, null, 0x43);
3478 explain
3479 select straight_join *
3480 from t3 as x join t3 as y on x.b3 = y.b3;
3481 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
3482 1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 ALL b3 NULL NULL NULL 7 100.00 NULL
3483 1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 ref b3 b3 4 test.x.b3 1 100.00 Using join buffer (Batched Key Access)
3484 Warnings:
3485 Note 1003 Can't push table 'y' as child, access type 'Batched-key' not implemented
3486 Note 1003 /* select#1 */ select straight_join `test`.`x`.`a3` AS `a3`,`test`.`x`.`b3` AS `b3`,`test`.`x`.`c3` AS `c3`,`test`.`x`.`d3` AS `d3`,`test`.`y`.`a3` AS `a3`,`test`.`y`.`b3` AS `b3`,`test`.`y`.`c3` AS `c3`,`test`.`y`.`d3` AS `d3` from `test`.`t3` `x` join `test`.`t3` `y` where (`test`.`y`.`b3` = `test`.`x`.`b3`)
3487 select straight_join *
3488 from t3 as x join t3 as y on x.b3 = y.b3;
3489 a3 b3 c3 d3 a3 b3 c3 d3
3490 31 47 1 31 31 47 1 31
3491 47 63 2 47 47 63 2 47
3492 63 31 3 63 63 31 3 63
3493 64 0 NULL NULL 64 0 NULL NULL
3494 64 0 NULL NULL 65 0 NULL NULL
3495 64 0 NULL NULL 66 0 4 NULL
3496 64 0 NULL NULL 67 0 NULL 67
3497 65 0 NULL NULL 64 0 NULL NULL
3498 65 0 NULL NULL 65 0 NULL NULL
3499 65 0 NULL NULL 66 0 4 NULL
3500 65 0 NULL NULL 67 0 NULL 67
3501 66 0 4 NULL 64 0 NULL NULL
3502 66 0 4 NULL 65 0 NULL NULL
3503 66 0 4 NULL 66 0 4 NULL
3504 66 0 4 NULL 67 0 NULL 67
3505 67 0 NULL 67 64 0 NULL NULL
3506 67 0 NULL 67 65 0 NULL NULL
3507 67 0 NULL 67 66 0 4 NULL
3508 67 0 NULL 67 67 0 NULL 67
3509 explain
3510 select straight_join *
3511 from t3 as x join t3 as y on x.b3 = y.b3
3512 where y.d3 = 0x2f;
3513 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
3514 1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 ALL b3 NULL NULL NULL 7 100.00 NULL
3515 1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref b3 b3 9 test.x.b3,const 1 100.00 Using join buffer (Batched Key Access)
3516 Warnings:
3517 Note 1003 Can't push table 'y' as child, access type 'Batched-key' not implemented
3518 Note 1003 /* select#1 */ select straight_join `test`.`x`.`a3` AS `a3`,`test`.`x`.`b3` AS `b3`,`test`.`x`.`c3` AS `c3`,`test`.`x`.`d3` AS `d3`,`test`.`y`.`a3` AS `a3`,`test`.`y`.`b3` AS `b3`,`test`.`y`.`c3` AS `c3`,`test`.`y`.`d3` AS `d3` from `test`.`t3` `x` join `test`.`t3` `y` where ((`test`.`y`.`b3` = `test`.`x`.`b3`) and (`test`.`y`.`d3` = 0x2f))
3519 select straight_join *
3520 from t3 as x join t3 as y on x.b3 = y.b3
3521 where y.d3 = 0x2f;
3522 a3 b3 c3 d3 a3 b3 c3 d3
3523 47 63 2 47 47 63 2 47
3524 explain
3525 select straight_join *
3526 from t3 as x join t3 as y on x.c3 = y.c3
3527 where y.d3 = 0x2f;
3528 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
3529 1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 ALL c3,c3_2 NULL NULL NULL # # Using pushed condition (`test`.`x`.`c3` is not null)
3530 1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref c3,c3_2 c3_2 10 test.x.c3,const # # Using join buffer (Batched Key Access)
3531 Warnings:
3532 Note 1003 Can't push table 'y' as child, access type 'Batched-key' not implemented
3533 Note 1003 /* select#1 */ select straight_join `test`.`x`.`a3` AS `a3`,`test`.`x`.`b3` AS `b3`,`test`.`x`.`c3` AS `c3`,`test`.`x`.`d3` AS `d3`,`test`.`y`.`a3` AS `a3`,`test`.`y`.`b3` AS `b3`,`test`.`y`.`c3` AS `c3`,`test`.`y`.`d3` AS `d3` from `test`.`t3` `x` join `test`.`t3` `y` where ((`test`.`y`.`c3` = `test`.`x`.`c3`) and (`test`.`y`.`d3` = 0x2f))
3534 select straight_join *
3535 from t3 as x join t3 as y on x.c3 = y.c3
3536 where y.d3 = 0x2f;
3537 a3 b3 c3 d3 a3 b3 c3 d3
3538 47 63 2 47 47 63 2 47
3539 explain
3540 select straight_join *
3541 from t3 as x join t3 as y on x.d3 = y.d3
3542 where y.b3 = 0x2f;
3543 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
3544 1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 7 100.00 Using pushed condition (`test`.`x`.`d3` is not null)
3545 1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref b3 b3 9 const,test.x.d3 1 100.00 Using join buffer (Batched Key Access)
3546 Warnings:
3547 Note 1003 Can't push table 'y' as child, access type 'Batched-key' not implemented
3548 Note 1003 /* select#1 */ select straight_join `test`.`x`.`a3` AS `a3`,`test`.`x`.`b3` AS `b3`,`test`.`x`.`c3` AS `c3`,`test`.`x`.`d3` AS `d3`,`test`.`y`.`a3` AS `a3`,`test`.`y`.`b3` AS `b3`,`test`.`y`.`c3` AS `c3`,`test`.`y`.`d3` AS `d3` from `test`.`t3` `x` join `test`.`t3` `y` where ((`test`.`y`.`d3` = `test`.`x`.`d3`) and (`test`.`y`.`b3` = 0x2f))
3549 select straight_join *
3550 from t3 as x join t3 as y on x.d3 = y.d3
3551 where y.b3 = 0x2f;
3552 a3 b3 c3 d3 a3 b3 c3 d3
3553 31 47 1 31 31 47 1 31
3554 explain
3555 select straight_join *
3556 from t3 as x join t3 as y on x.d3 = y.d3
3557 where y.b3 = 0x20+0x2f;
3558 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
3559 1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 7 100.00 Using pushed condition (`test`.`x`.`d3` is not null)
3560 1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref b3 b3 9 const,test.x.d3 1 100.00 Using join buffer (Batched Key Access)
3561 Warnings:
3562 Note 1003 Can't push table 'y' as child, access type 'Batched-key' not implemented
3563 Note 1003 /* select#1 */ select straight_join `test`.`x`.`a3` AS `a3`,`test`.`x`.`b3` AS `b3`,`test`.`x`.`c3` AS `c3`,`test`.`x`.`d3` AS `d3`,`test`.`y`.`a3` AS `a3`,`test`.`y`.`b3` AS `b3`,`test`.`y`.`c3` AS `c3`,`test`.`y`.`d3` AS `d3` from `test`.`t3` `x` join `test`.`t3` `y` where ((`test`.`y`.`d3` = `test`.`x`.`d3`) and (`test`.`y`.`b3` = (0x20 + 0x2f)))
3564 select straight_join *
3565 from t3 as x join t3 as y on x.d3 = y.d3
3566 where y.b3 = 0x20+0x2f;
3567 a3 b3 c3 d3 a3 b3 c3 d3
3568 explain
3569 select straight_join *
3570 from t3 as x join t3 as y on x.b3 = y.b3
3571 where y.d3 is not null;
3572 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
3573 1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 ALL b3 NULL NULL NULL # # NULL
3574 1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 ref b3 b3 4 test.x.b3 # # Using pushed condition (`test`.`y`.`d3` is not null); Using join buffer (Batched Key Access)
3575 Warnings:
3576 Note 1003 Can't push table 'y' as child, access type 'Batched-key' not implemented
3577 Note 1003 /* select#1 */ select straight_join `test`.`x`.`a3` AS `a3`,`test`.`x`.`b3` AS `b3`,`test`.`x`.`c3` AS `c3`,`test`.`x`.`d3` AS `d3`,`test`.`y`.`a3` AS `a3`,`test`.`y`.`b3` AS `b3`,`test`.`y`.`c3` AS `c3`,`test`.`y`.`d3` AS `d3` from `test`.`t3` `x` join `test`.`t3` `y` where ((`test`.`y`.`b3` = `test`.`x`.`b3`) and (`test`.`y`.`d3` is not null))
3578 select straight_join *
3579 from t3 as x join t3 as y on x.b3 = y.b3
3580 where y.d3 is not null;
3581 a3 b3 c3 d3 a3 b3 c3 d3
3582 31 47 1 31 31 47 1 31
3583 47 63 2 47 47 63 2 47
3584 63 31 3 63 63 31 3 63
3585 64 0 NULL NULL 67 0 NULL 67
3586 65 0 NULL NULL 67 0 NULL 67
3587 66 0 4 NULL 67 0 NULL 67
3588 67 0 NULL 67 67 0 NULL 67
3589 explain
3590 select straight_join *
3591 from t3 as x join t3 as y on x.b3 = y.b3
3592 where y.d3 is null;
3593 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
3594 1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 ALL b3 NULL NULL NULL 7 100.00 NULL
3595 1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 ref b3 b3 9 test.x.b3,const 1 100.00 Using pushed condition (`test`.`y`.`d3` is null); Using join buffer (Batched Key Access)
3596 Warnings:
3597 Note 1003 Can't push table 'y' as child, access type 'Batched-key' not implemented
3598 Note 1003 /* select#1 */ select straight_join `test`.`x`.`a3` AS `a3`,`test`.`x`.`b3` AS `b3`,`test`.`x`.`c3` AS `c3`,`test`.`x`.`d3` AS `d3`,`test`.`y`.`a3` AS `a3`,`test`.`y`.`b3` AS `b3`,`test`.`y`.`c3` AS `c3`,`test`.`y`.`d3` AS `d3` from `test`.`t3` `x` join `test`.`t3` `y` where ((`test`.`y`.`b3` = `test`.`x`.`b3`) and (`test`.`y`.`d3` is null))
3599 select straight_join *
3600 from t3 as x join t3 as y on x.b3 = y.b3
3601 where y.d3 is null;
3602 a3 b3 c3 d3 a3 b3 c3 d3
3603 64 0 NULL NULL 64 0 NULL NULL
3604 64 0 NULL NULL 65 0 NULL NULL
3605 64 0 NULL NULL 66 0 4 NULL
3606 65 0 NULL NULL 64 0 NULL NULL
3607 65 0 NULL NULL 65 0 NULL NULL
3608 65 0 NULL NULL 66 0 4 NULL
3609 66 0 4 NULL 64 0 NULL NULL
3610 66 0 4 NULL 65 0 NULL NULL
3611 66 0 4 NULL 66 0 4 NULL
3612 67 0 NULL 67 64 0 NULL NULL
3613 67 0 NULL 67 65 0 NULL NULL
3614 67 0 NULL 67 66 0 4 NULL
3615 explain
3616 select straight_join *
3617 from t3 as x join t3 as y on x.c3 = y.c3
3618 where y.b3 = 0;
3619 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
3620 1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 ALL c3,c3_2 NULL NULL NULL 7 100.00 Using pushed condition (`test`.`x`.`c3` is not null)
3621 1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref b3,c3,c3_2 c3 9 test.x.c3,const 1 100.00 Using join buffer (Batched Key Access)
3622 Warnings:
3623 Note 1003 Can't push table 'y' as child, access type 'Batched-key' not implemented
3624 Note 1003 /* select#1 */ select straight_join `test`.`x`.`a3` AS `a3`,`test`.`x`.`b3` AS `b3`,`test`.`x`.`c3` AS `c3`,`test`.`x`.`d3` AS `d3`,`test`.`y`.`a3` AS `a3`,`test`.`y`.`b3` AS `b3`,`test`.`y`.`c3` AS `c3`,`test`.`y`.`d3` AS `d3` from `test`.`t3` `x` join `test`.`t3` `y` where ((`test`.`y`.`c3` = `test`.`x`.`c3`) and (`test`.`y`.`b3` = 0))
3625 select straight_join *
3626 from t3 as x join t3 as y on x.c3 = y.c3
3627 where y.b3 = 0;
3628 a3 b3 c3 d3 a3 b3 c3 d3
3629 66 0 4 NULL 66 0 4 NULL
3630 explain
3631 select straight_join *
3632 from t3 as x join t3 as y on x.c3 = y.c3
3633 where y.b3 is null;
3634 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
3635 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
3636 Warnings:
3637 Note 1003 /* select#1 */ select straight_join `test`.`x`.`a3` AS `a3`,`test`.`x`.`b3` AS `b3`,`test`.`x`.`c3` AS `c3`,`test`.`x`.`d3` AS `d3`,`test`.`y`.`a3` AS `a3`,`test`.`y`.`b3` AS `b3`,`test`.`y`.`c3` AS `c3`,`test`.`y`.`d3` AS `d3` from `test`.`t3` `x` join `test`.`t3` `y` where false
3638 select straight_join *
3639 from t3 as x join t3 as y on x.c3 = y.c3
3640 where y.b3 is null;
3641 a3 b3 c3 d3 a3 b3 c3 d3
3642 explain
3643 select straight_join * from
3644 t3 as x1
3645 join t3 as y1 on y1.b3 = x1.b3 and y1.d3 = x1.d3
3646 join t3 as x2 on x2.b3 = y1.b3+0
3647 join t3 as y2 on y2.b3 = x2.c3 and y2.d3 = x1.c3;
3648 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
3649 1 SIMPLE x1 p0,p1,p2,p3,p4,p5,p6,p7 ALL b3,c3,c3_2 NULL NULL NULL 7 100.00 Using pushed condition ((`test`.`x1`.`d3` is not null) and (`test`.`x1`.`c3` is not null))
3650 1 SIMPLE y1 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref b3 b3 9 test.x1.b3,test.x1.d3 1 100.00 Using join buffer (Batched Key Access)
3651 1 SIMPLE x2 p0,p1,p2,p3,p4,p5,p6,p7 ref b3,c3,c3_2 b3 4 func 1 100.00 Using where; Using pushed condition (`test`.`x2`.`c3` is not null); Using join buffer (Batched Key Access)
3652 1 SIMPLE y2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref b3 b3 9 test.x2.c3,test.x1.c3 1 100.00 Using join buffer (Batched Key Access)
3653 Warnings:
3654 Note 1003 Can't push table 'y1' as child, access type 'Batched-key' not implemented
3655 Note 1003 Can't push table 'x2' as child, access type 'Batched-key' not implemented
3656 Note 1003 Can't push table 'y2' as child, access type 'Batched-key' not implemented
3657 Note 1003 /* select#1 */ select straight_join `test`.`x1`.`a3` AS `a3`,`test`.`x1`.`b3` AS `b3`,`test`.`x1`.`c3` AS `c3`,`test`.`x1`.`d3` AS `d3`,`test`.`y1`.`a3` AS `a3`,`test`.`y1`.`b3` AS `b3`,`test`.`y1`.`c3` AS `c3`,`test`.`y1`.`d3` AS `d3`,`test`.`x2`.`a3` AS `a3`,`test`.`x2`.`b3` AS `b3`,`test`.`x2`.`c3` AS `c3`,`test`.`x2`.`d3` AS `d3`,`test`.`y2`.`a3` AS `a3`,`test`.`y2`.`b3` AS `b3`,`test`.`y2`.`c3` AS `c3`,`test`.`y2`.`d3` AS `d3` from `test`.`t3` `x1` join `test`.`t3` `y1` join `test`.`t3` `x2` join `test`.`t3` `y2` where ((`test`.`y1`.`d3` = `test`.`x1`.`d3`) and (`test`.`y1`.`b3` = `test`.`x1`.`b3`) and (`test`.`y2`.`d3` = `test`.`x1`.`c3`) and (`test`.`y2`.`b3` = `test`.`x2`.`c3`) and (`test`.`x2`.`b3` = (`test`.`x1`.`b3` + 0)))
3658 select straight_join * from
3659 t3 as x1
3660 join t3 as y1 on y1.b3 = x1.b3 and y1.d3 = x1.d3
3661 join t3 as x2 on x2.b3 = y1.b3+0
3662 join t3 as y2 on y2.b3 = x2.c3 and y2.d3 = x1.c3;
3663 a3 b3 c3 d3 a3 b3 c3 d3 a3 b3 c3 d3 a3 b3 c3 d3
3664 prepare stmt1 from
3665 'select straight_join *
3666 from t3 as x join t3 as y on x.b3 = y.b3
3667 where y.d3 = 0x2f';
3668 execute stmt1;
3669 a3 b3 c3 d3 a3 b3 c3 d3
3670 47 63 2 47 47 63 2 47
3671 execute stmt1;
3672 a3 b3 c3 d3 a3 b3 c3 d3
3673 47 63 2 47 47 63 2 47
3674 drop prepare stmt1;
3675 execute stmt1;
3676 ERROR HY000: Unknown prepared statement handler (stmt1) given to EXECUTE
3677 prepare stmt1 from
3678 'select straight_join *
3679 from t3 as x join t3 as y on x.b3 = y.b3
3680 where y.d3 = 0x2f';
3681 prepare stmt1 from
3682 'select straight_join *
3683 from t3 as x join t3 as y on x.b3 = y.b3
3684 where y.d3 = 0x2f';
3685 drop prepare stmt1;
3686 prepare stmt1 from
3687 'explain select straight_join *
3688 from t3 as x join t3 as y on x.b3 = y.b3
3689 where y.d3 = 0x2f';
3690 execute stmt1;
3691 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
3692 1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 ALL b3 NULL NULL NULL 7 100.00 NULL
3693 1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref b3 b3 9 test.x.b3,const 1 100.00 Using join buffer (Batched Key Access)
3694 Warnings:
3695 Note 1003 Can't push table 'y' as child, access type 'Batched-key' not implemented
3696 Note 1003 /* select#1 */ select straight_join `test`.`x`.`a3` AS `a3`,`test`.`x`.`b3` AS `b3`,`test`.`x`.`c3` AS `c3`,`test`.`x`.`d3` AS `d3`,`test`.`y`.`a3` AS `a3`,`test`.`y`.`b3` AS `b3`,`test`.`y`.`c3` AS `c3`,`test`.`y`.`d3` AS `d3` from `test`.`t3` `x` join `test`.`t3` `y` where ((`test`.`y`.`b3` = `test`.`x`.`b3`) and (`test`.`y`.`d3` = 0x2f))
3697 execute stmt1;
3698 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
3699 1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 ALL b3 NULL NULL NULL 7 100.00 NULL
3700 1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref b3 b3 9 test.x.b3,const 1 100.00 Using join buffer (Batched Key Access)
3701 Warnings:
3702 Note 1003 Can't push table 'y' as child, access type 'Batched-key' not implemented
3703 Note 1003 /* select#1 */ select straight_join `test`.`x`.`a3` AS `a3`,`test`.`x`.`b3` AS `b3`,`test`.`x`.`c3` AS `c3`,`test`.`x`.`d3` AS `d3`,`test`.`y`.`a3` AS `a3`,`test`.`y`.`b3` AS `b3`,`test`.`y`.`c3` AS `c3`,`test`.`y`.`d3` AS `d3` from `test`.`t3` `x` join `test`.`t3` `y` where ((`test`.`y`.`b3` = `test`.`x`.`b3`) and (`test`.`y`.`d3` = 0x2f))
3704 commit;
3705 execute stmt1;
3706 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
3707 1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 ALL b3 NULL NULL NULL 7 100.00 NULL
3708 1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref b3 b3 9 test.x.b3,const 1 100.00 Using join buffer (Batched Key Access)
3709 Warnings:
3710 Note 1003 Can't push table 'y' as child, access type 'Batched-key' not implemented
3711 Note 1003 /* select#1 */ select straight_join `test`.`x`.`a3` AS `a3`,`test`.`x`.`b3` AS `b3`,`test`.`x`.`c3` AS `c3`,`test`.`x`.`d3` AS `d3`,`test`.`y`.`a3` AS `a3`,`test`.`y`.`b3` AS `b3`,`test`.`y`.`c3` AS `c3`,`test`.`y`.`d3` AS `d3` from `test`.`t3` `x` join `test`.`t3` `y` where ((`test`.`y`.`b3` = `test`.`x`.`b3`) and (`test`.`y`.`d3` = 0x2f))
3712 drop index b3 on t3;
3713 execute stmt1;
3714 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
3715 1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL # # NULL
3716 1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL # # Using pushed condition (`test`.`y`.`d3` = 0x2f); Using join buffer (hash join)
3717 Warnings:
3718 Note 1003 Can't push table 'y' as child, 'type' must be a 'ref' access
3719 Note 1003 /* select#1 */ select straight_join `test`.`x`.`a3` AS `a3`,`test`.`x`.`b3` AS `b3`,`test`.`x`.`c3` AS `c3`,`test`.`x`.`d3` AS `d3`,`test`.`y`.`a3` AS `a3`,`test`.`y`.`b3` AS `b3`,`test`.`y`.`c3` AS `c3`,`test`.`y`.`d3` AS `d3` from `test`.`t3` `x` join `test`.`t3` `y` where ((`test`.`y`.`b3` = `test`.`x`.`b3`) and (`test`.`y`.`d3` = 0x2f))
3720 create unique index b3 on t3(b3,d3);
3721 execute stmt1;
3722 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
3723 1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 ALL b3 NULL NULL NULL 7 100.00 NULL
3724 1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref b3 b3 9 test.x.b3,const 1 100.00 Using join buffer (Batched Key Access)
3725 Warnings:
3726 Note 1003 Can't push table 'y' as child, access type 'Batched-key' not implemented
3727 Note 1003 /* select#1 */ select straight_join `test`.`x`.`a3` AS `a3`,`test`.`x`.`b3` AS `b3`,`test`.`x`.`c3` AS `c3`,`test`.`x`.`d3` AS `d3`,`test`.`y`.`a3` AS `a3`,`test`.`y`.`b3` AS `b3`,`test`.`y`.`c3` AS `c3`,`test`.`y`.`d3` AS `d3` from `test`.`t3` `x` join `test`.`t3` `y` where ((`test`.`y`.`b3` = `test`.`x`.`b3`) and (`test`.`y`.`d3` = 0x2f))
3728 drop prepare stmt1;
3729 prepare stmt1 from
3730 'explain select straight_join *
3731 from t3 as x join t3 as y on x.b3 = y.b3
3732 where y.d3 = ?';
3733 set @a=47;
3734 execute stmt1 using @a;
3735 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
3736 1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 ALL b3 NULL NULL NULL 7 100.00 NULL
3737 1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref b3 b3 9 test.x.b3,const 1 100.00 Using join buffer (Batched Key Access)
3738 Warnings:
3739 Note 1003 Can't push table 'y' as child, access type 'Batched-key' not implemented
3740 Note 1003 /* select#1 */ select straight_join `test`.`x`.`a3` AS `a3`,`test`.`x`.`b3` AS `b3`,`test`.`x`.`c3` AS `c3`,`test`.`x`.`d3` AS `d3`,`test`.`y`.`a3` AS `a3`,`test`.`y`.`b3` AS `b3`,`test`.`y`.`c3` AS `c3`,`test`.`y`.`d3` AS `d3` from `test`.`t3` `x` join `test`.`t3` `y` where ((`test`.`y`.`b3` = `test`.`x`.`b3`) and (`test`.`y`.`d3` = 47))
3741 set @a=0;
3742 execute stmt1 using @a;
3743 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
3744 1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 ALL b3 NULL NULL NULL 7 100.00 NULL
3745 1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref b3 b3 9 test.x.b3,const 1 100.00 Using join buffer (Batched Key Access)
3746 Warnings:
3747 Note 1003 Can't push table 'y' as child, access type 'Batched-key' not implemented
3748 Note 1003 /* select#1 */ select straight_join `test`.`x`.`a3` AS `a3`,`test`.`x`.`b3` AS `b3`,`test`.`x`.`c3` AS `c3`,`test`.`x`.`d3` AS `d3`,`test`.`y`.`a3` AS `a3`,`test`.`y`.`b3` AS `b3`,`test`.`y`.`c3` AS `c3`,`test`.`y`.`d3` AS `d3` from `test`.`t3` `x` join `test`.`t3` `y` where ((`test`.`y`.`b3` = `test`.`x`.`b3`) and (`test`.`y`.`d3` = 0))
3749 set @a=null;
3750 execute stmt1 using @a;
3751 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
3752 1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 ALL b3 NULL NULL NULL 7 100.00 NULL
3753 1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref b3 b3 9 test.x.b3,const 1 100.00 Using pushed condition (`test`.`y`.`d3` = NULL); Using join buffer (Batched Key Access)
3754 Warnings:
3755 Note 1003 Can't push table 'y' as child, access type 'Batched-key' not implemented
3756 Note 1003 /* select#1 */ select straight_join `test`.`x`.`a3` AS `a3`,`test`.`x`.`b3` AS `b3`,`test`.`x`.`c3` AS `c3`,`test`.`x`.`d3` AS `d3`,`test`.`y`.`a3` AS `a3`,`test`.`y`.`b3` AS `b3`,`test`.`y`.`c3` AS `c3`,`test`.`y`.`d3` AS `d3` from `test`.`t3` `x` join `test`.`t3` `y` where ((`test`.`y`.`b3` = `test`.`x`.`b3`) and (`test`.`y`.`d3` = NULL))
3757 prepare stmt1 from
3758 'select straight_join *
3759 from t3 as x join t3 as y on x.b3 = y.b3
3760 where y.d3 = ?';
3761 set @a=47;
3762 execute stmt1 using @a;
3763 a3 b3 c3 d3 a3 b3 c3 d3
3764 47 63 2 47 47 63 2 47
3765 set @a=0;
3766 execute stmt1 using @a;
3767 a3 b3 c3 d3 a3 b3 c3 d3
3768 set @a=null;
3769 execute stmt1 using @a;
3770 a3 b3 c3 d3 a3 b3 c3 d3
3771 prepare stmt1 from
3772 'explain select straight_join *
3773 from t3 as x join t3 as y on x.b3 = y.b3 and x.d3 = y.d3
3774 where x.a3 = ?';
3775 set @a=47;
3776 execute stmt1 using @a;
3777 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
3778 1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY,b3 PRIMARY 4 const 1 100.00 Using where
3779 1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref b3 b3 9 test.x.b3,test.x.d3 1 100.00 Using join buffer (Batched Key Access)
3780 Warnings:
3781 Note 1003 Can't push table 'y' as child, access type 'Batched-key' not implemented
3782 Note 1003 /* select#1 */ select straight_join `test`.`x`.`a3` AS `a3`,`test`.`x`.`b3` AS `b3`,`test`.`x`.`c3` AS `c3`,`test`.`x`.`d3` AS `d3`,`test`.`y`.`a3` AS `a3`,`test`.`y`.`b3` AS `b3`,`test`.`y`.`c3` AS `c3`,`test`.`y`.`d3` AS `d3` from `test`.`t3` `x` join `test`.`t3` `y` where ((`test`.`y`.`d3` = `test`.`x`.`d3`) and (`test`.`y`.`b3` = `test`.`x`.`b3`) and (`test`.`x`.`a3` = 47))
3783 set @a=0;
3784 execute stmt1 using @a;
3785 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
3786 1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY,b3 PRIMARY 4 const 1 100.00 Using where
3787 1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref b3 b3 9 test.x.b3,test.x.d3 1 100.00 Using join buffer (Batched Key Access)
3788 Warnings:
3789 Note 1003 Can't push table 'y' as child, access type 'Batched-key' not implemented
3790 Note 1003 /* select#1 */ select straight_join `test`.`x`.`a3` AS `a3`,`test`.`x`.`b3` AS `b3`,`test`.`x`.`c3` AS `c3`,`test`.`x`.`d3` AS `d3`,`test`.`y`.`a3` AS `a3`,`test`.`y`.`b3` AS `b3`,`test`.`y`.`c3` AS `c3`,`test`.`y`.`d3` AS `d3` from `test`.`t3` `x` join `test`.`t3` `y` where ((`test`.`y`.`d3` = `test`.`x`.`d3`) and (`test`.`y`.`b3` = `test`.`x`.`b3`) and (`test`.`x`.`a3` = 0))
3791 set @a=null;
3792 execute stmt1 using @a;
3793 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
3794 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table
3795 Warnings:
3796 Note 1003 /* select#1 */ select straight_join `test`.`x`.`a3` AS `a3`,`test`.`x`.`b3` AS `b3`,`test`.`x`.`c3` AS `c3`,`test`.`x`.`d3` AS `d3`,`test`.`y`.`a3` AS `a3`,`test`.`y`.`b3` AS `b3`,`test`.`y`.`c3` AS `c3`,`test`.`y`.`d3` AS `d3` from `test`.`t3` `x` join `test`.`t3` `y` where (multiple equal(NULL, `test`.`x`.`a3`) and multiple equal(`test`.`x`.`b3`, `test`.`y`.`b3`) and multiple equal(`test`.`x`.`d3`, `test`.`y`.`d3`))
3797 prepare stmt1 from
3798 'select straight_join *
3799 from t3 as x join t3 as y on x.b3 = y.b3 and x.d3 = y.d3
3800 where x.a3 = ?';
3801 set @a=47;
3802 execute stmt1 using @a;
3803 a3 b3 c3 d3 a3 b3 c3 d3
3804 47 63 2 47 47 63 2 47
3805 set @a=0;
3806 execute stmt1 using @a;
3807 a3 b3 c3 d3 a3 b3 c3 d3
3808 set @a=null;
3809 execute stmt1 using @a;
3810 a3 b3 c3 d3 a3 b3 c3 d3
3811 drop table t3;
3812 set @a=47;
3813 execute stmt1 using @a;
3814 ERROR 42S02: Table 'test.t3' doesn't exist
3815 create table t1 (a int primary key, b int, c int, index(b,c)) engine = ndb
3816 comment="NDB_TABLE=PARTITION_BALANCE=FOR_RP_BY_LDM";
3817 insert into t1 values (1,null, 2);
3818 insert into t1 values (2,1, null);
3819 insert into t1 values (3,2,2);
3820 insert into t1 values (4,null, 2);
3821 insert into t1 values (5,1, null);
3822 insert into t1 values (6,2,2);
3823 set ndb_join_pushdown=false;
3824 select *
3825 from t1
3826 join t1 as t2 on (t2.b = t1.b or t2.b = t1.a)
3827 join t1 as t3 on t3.a = t2.a
3828 join t1 as t4 on t4.a = t3.b /* index scan disguised as JT_ALL, pushdown=off */;
3829 a b c a b c a b c a b c
3830 1 NULL 2 2 1 NULL 2 1 NULL 1 NULL 2
3831 1 NULL 2 5 1 NULL 5 1 NULL 1 NULL 2
3832 2 1 NULL 2 1 NULL 2 1 NULL 1 NULL 2
3833 2 1 NULL 3 2 2 3 2 2 2 1 NULL
3834 2 1 NULL 5 1 NULL 5 1 NULL 1 NULL 2
3835 2 1 NULL 6 2 2 6 2 2 2 1 NULL
3836 3 2 2 3 2 2 3 2 2 2 1 NULL
3837 3 2 2 6 2 2 6 2 2 2 1 NULL
3838 5 1 NULL 2 1 NULL 2 1 NULL 1 NULL 2
3839 5 1 NULL 5 1 NULL 5 1 NULL 1 NULL 2
3840 6 2 2 3 2 2 3 2 2 2 1 NULL
3841 6 2 2 6 2 2 6 2 2 2 1 NULL
3842 set ndb_join_pushdown=true;
3843 explain
3844 select *
3845 from t1
3846 join t1 as t2 on (t2.b = t1.b or t2.b = t1.a)
3847 join t1 as t3 on t3.a = t2.a
3848 join t1 as t4 on t4.a = t3.b /* index scan disguised as JT_ALL, pushdown=on */;
3849 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
3850 1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL PRIMARY,b NULL NULL NULL 6 100.00 NULL
3851 1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 ALL PRIMARY,b NULL NULL NULL 6 30.56 Range checked for each record (index map: 0x3); Using pushed condition ((`test`.`t2`.`b` = `test`.`t1`.`b`) or (`test`.`t2`.`b` = `test`.`t1`.`a`))
3852 1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY,b PRIMARY 4 test.t2.a 1 100.00 Using pushed condition (`test`.`t3`.`b` is not null); Using join buffer (Batched Key Access)
3853 1 SIMPLE t4 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.t3.b 1 100.00 Using join buffer (Batched Key Access)
3854 Warnings:
3855 Note 1003 Table 't2' is not pushable: Access type was not chosen at 'prepare' time
3856 Note 1003 Can't push table 't3' as child, access type 'Batched-key' not implemented
3857 Note 1003 Can't push table 't4' as child, access type 'Batched-key' not implemented
3858 Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t3`.`c` AS `c`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t4`.`c` AS `c` from `test`.`t1` join `test`.`t1` `t2` join `test`.`t1` `t3` join `test`.`t1` `t4` where ((`test`.`t3`.`a` = `test`.`t2`.`a`) and (`test`.`t4`.`a` = `test`.`t3`.`b`) and ((`test`.`t2`.`b` = `test`.`t1`.`b`) or (`test`.`t2`.`b` = `test`.`t1`.`a`)))
3859 select *
3860 from t1
3861 join t1 as t2 on (t2.b = t1.b or t2.b = t1.a)
3862 join t1 as t3 on t3.a = t2.a
3863 join t1 as t4 on t4.a = t3.b /* index scan disguised as JT_ALL, pushdown=on */;
3864 a b c a b c a b c a b c
3865 1 NULL 2 2 1 NULL 2 1 NULL 1 NULL 2
3866 1 NULL 2 5 1 NULL 5 1 NULL 1 NULL 2
3867 2 1 NULL 2 1 NULL 2 1 NULL 1 NULL 2
3868 2 1 NULL 3 2 2 3 2 2 2 1 NULL
3869 2 1 NULL 5 1 NULL 5 1 NULL 1 NULL 2
3870 2 1 NULL 6 2 2 6 2 2 2 1 NULL
3871 3 2 2 3 2 2 3 2 2 2 1 NULL
3872 3 2 2 6 2 2 6 2 2 2 1 NULL
3873 5 1 NULL 2 1 NULL 2 1 NULL 1 NULL 2
3874 5 1 NULL 5 1 NULL 5 1 NULL 1 NULL 2
3875 6 2 2 3 2 2 3 2 2 2 1 NULL
3876 6 2 2 6 2 2 6 2 2 2 1 NULL
3877 explain
3878 select *
3879 from t1 where b in
3880 (select x.a from t1 as x join t1 as y on (y.a = x.b))
3881 xor c > 5;
3882 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
3883 1 PRIMARY t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 6 100.00 Using where
3884 2 DEPENDENT SUBQUERY x p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY,b PRIMARY 4 func 1 100.00 Using where; Full scan on NULL key
3885 2 DEPENDENT SUBQUERY y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.x.b 1 100.00 Using join buffer (Batched Key Access)
3886 Warnings:
3887 Note 1003 Can't push table 'y' as child, access type 'Batched-key' not implemented
3888 Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c` from `test`.`t1` where (<in_optimizer>(`test`.`t1`.`b`,<exists>(/* select#2 */ select `test`.`x`.`a` from `test`.`t1` `x` join `test`.`t1` `y` where ((`test`.`y`.`a` = `test`.`x`.`b`) and <if>(outer_field_is_not_null, (<cache>(`test`.`t1`.`b`) = `test`.`x`.`a`), true)))) xor (`test`.`t1`.`c` > 5))
3889 select *
3890 from t1 where b in
3891 (select x.a from t1 as x join t1 as y on (y.a = x.b))
3892 xor c > 5;
3893 a b c
3894 3 2 2
3895 6 2 2
3896 explain
3897 select t1.a, (select straight_join x.a from t1 as x join t1 as y on x.a=y.b where y.a = t1.b) from t1;
3898 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
3899 1 PRIMARY t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL # # NULL
3900 2 DEPENDENT SUBQUERY x p0,p1,p2,p3,p4,p5,p6,p7 ALL PRIMARY NULL NULL NULL # # NULL
3901 2 DEPENDENT SUBQUERY y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY,b PRIMARY 4 test.t1.b # # Using where; Using join buffer (Batched Key Access)
3902 Warnings:
3903 Note 1276 Field or reference 'test.t1.b' of SELECT #2 was resolved in SELECT #1
3904 Note 1003 Can't push table 'y' as child, access type 'Batched-key' not implemented
3905 Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,(/* select#2 */ select straight_join `test`.`x`.`a` from `test`.`t1` `x` join `test`.`t1` `y` where ((`test`.`y`.`b` = `test`.`x`.`a`) and (`test`.`y`.`a` = `test`.`t1`.`b`))) AS `(select straight_join x.a from t1 as x join t1 as y on x.a=y.b where y.a = t1.b)` from `test`.`t1`
3906 select t1.a, (select straight_join x.a from t1 as x join t1 as y on x.a=y.b where y.a = t1.b) from t1;
3907 a (select straight_join x.a from t1 as x join t1 as y on x.a=y.b where y.a = t1.b)
3908 1 NULL
3909 2 NULL
3910 3 1
3911 4 NULL
3912 5 NULL
3913 6 1
3914 drop table t1;
3915 create table t1 (a int primary key, b int) engine = ndb
3916 comment="NDB_TABLE=PARTITION_BALANCE=FOR_RP_BY_LDM";
3917 create table t2 (a int primary key, b int) engine = myisam;
3918 insert into t1 values(1,1), (2,2), (3,3), (4,4);
3919 insert into t2 values(1,1), (2,2), (3,3), (4,4);
3920 explain
3921 select * from t1, t2, t1 as t3
3922 where t2.a = t1.b
3923 and t3.a = t2.b /* mixed engines */;
3924 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
3925 1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 4 100.00 Using pushed condition (`test`.`t1`.`b` is not null)
3926 1 SIMPLE t2 NULL eq_ref PRIMARY PRIMARY 4 test.t1.b 1 100.00 Using where
3927 1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.t2.b 1 100.00 Using join buffer (Batched Key Access)
3928 Warnings:
3929 Note 1003 Can't push table 't3' as child, access type 'Batched-key' not implemented
3930 Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b` from `test`.`t1` join `test`.`t2` join `test`.`t1` `t3` where ((`test`.`t3`.`a` = `test`.`t2`.`b`) and (`test`.`t2`.`a` = `test`.`t1`.`b`))
3931 select * from t1, t2, t1 as t3
3932 where t2.a = t1.b
3933 and t3.a = t2.b /* mixed engines */;
3934 a b a b a b
3935 1 1 1 1 1 1
3936 2 2 2 2 2 2
3937 3 3 3 3 3 3
3938 4 4 4 4 4 4
3939 drop table t1, t2;
3940 create table t1 (a int primary key, b int, c blob) engine = ndb
3941 comment="NDB_TABLE=PARTITION_BALANCE=FOR_RP_BY_LDM";
3942 create table t2 (a int primary key, b int) engine = ndb
3943 comment="NDB_TABLE=PARTITION_BALANCE=FOR_RP_BY_LDM";
3944 insert into t1 values (1,1, 'kalle');
3945 insert into t1 values (2,1, 'kalle');
3946 insert into t1 values (3,3, 'kalle');
3947 insert into t1 values (4,1, 'kalle');
3948 insert into t2 values (1,1);
3949 insert into t2 values (2,1);
3950 insert into t2 values (3,3);
3951 insert into t2 values (4,1);
3952 set ndb_join_pushdown=true;
3953 explain
3954 select t1.a, t1.b, t2.a, t2.b
3955 from t1, t2
3956 where t2.a = t1.b;
3957 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
3958 1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 4 100.00 Using pushed condition (`test`.`t1`.`b` is not null)
3959 1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.t1.b 1 100.00 Using join buffer (Batched Key Access)
3960 Warnings:
3961 Note 1003 Can't push table 't2' as child, access type 'Batched-key' not implemented
3962 Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t1` join `test`.`t2` where (`test`.`t2`.`a` = `test`.`t1`.`b`)
3963 select t1.a, t1.b, t2.a, t2.b
3964 from t1, t2
3965 where t2.a = t1.b;
3966 a b a b
3967 1 1 1 1
3968 2 1 1 1
3969 3 3 3 3
3970 4 1 1 1
3971 explain
3972 select t1.a, t1.b, t2.a, t2.b
3973 from t1, t2
3974 where t2.a = t1.b
3975 and t1.a = 2;
3976 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
3977 1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 const 1 100.00 Using where
3978 1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.t1.b 1 100.00 Using join buffer (Batched Key Access)
3979 Warnings:
3980 Note 1003 Can't push table 't2' as child, access type 'Batched-key' not implemented
3981 Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t1` join `test`.`t2` where ((`test`.`t1`.`a` = 2) and (`test`.`t2`.`a` = `test`.`t1`.`b`))
3982 select t1.a, t1.b, t2.a, t2.b
3983 from t1, t2
3984 where t2.a = t1.b
3985 and t1.a = 2;
3986 a b a b
3987 2 1 1 1
3988 explain
3989 select t1.a, t1.b, t2.a, t2.b
3990 from t1, t2
3991 where t1.a = t2.b;
3992 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
3993 1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 4 100.00 Using pushed condition (`test`.`t2`.`b` is not null)
3994 1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.t2.b 1 100.00 Using join buffer (Batched Key Access)
3995 Warnings:
3996 Note 1003 Can't push table 't1' as child, access type 'Batched-key' not implemented
3997 Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t1` join `test`.`t2` where (`test`.`t1`.`a` = `test`.`t2`.`b`)
3998 select t1.a, t1.b, t2.a, t2.b
3999 from t1, t2
4000 where t2.a = t1.b;
4001 a b a b
4002 1 1 1 1
4003 2 1 1 1
4004 3 3 3 3
4005 4 1 1 1
4006 explain
4007 select t1.a, t1.b, t2.a, t2.b
4008 from t1, t2
4009 where t1.a = t2.b
4010 and t2.a = 3;
4011 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
4012 1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 const 1 100.00 Using where
4013 1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.t2.b 1 100.00 Using join buffer (Batched Key Access)
4014 Warnings:
4015 Note 1003 Can't push table 't1' as child, access type 'Batched-key' not implemented
4016 Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t1` join `test`.`t2` where ((`test`.`t2`.`a` = 3) and (`test`.`t1`.`a` = `test`.`t2`.`b`))
4017 select t1.a, t1.b, t2.a, t2.b
4018 from t1, t2
4019 where t1.a = t2.b
4020 and t2.a = 3;
4021 a b a b
4022 3 3 3 3
4023 explain
4024 select *
4025 from t1, t2
4026 where t2.a = t1.b;
4027 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
4028 1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 4 100.00 Using pushed condition (`test`.`t1`.`b` is not null)
4029 1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.t1.b 1 100.00 Using join buffer (Batched Key Access)
4030 Warnings:
4031 Note 1003 Table 't1' is not pushable: select list can't contain BLOB columns
4032 Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t1` join `test`.`t2` where (`test`.`t2`.`a` = `test`.`t1`.`b`)
4033 select *
4034 from t1, t2
4035 where t2.a = t1.b;
4036 a b c a b
4037 1 1 kalle 1 1
4038 2 1 kalle 1 1
4039 3 3 kalle 3 3
4040 4 1 kalle 1 1
4041 explain
4042 select *
4043 from t1, t2
4044 where t2.a = t1.b
4045 and t1.a = 2;
4046 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
4047 1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 const 1 100.00 Using where
4048 1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.t1.b 1 100.00 Using join buffer (Batched Key Access)
4049 Warnings:
4050 Note 1003 Table 't1' is not pushable: select list can't contain BLOB columns
4051 Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t1` join `test`.`t2` where ((`test`.`t1`.`a` = 2) and (`test`.`t2`.`a` = `test`.`t1`.`b`))
4052 select *
4053 from t1, t2
4054 where t2.a = t1.b
4055 and t1.a = 2;
4056 a b c a b
4057 2 1 kalle 1 1
4058 explain
4059 select *
4060 from t1, t2
4061 where t1.a = t2.b;
4062 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
4063 1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 4 100.00 Using pushed condition (`test`.`t2`.`b` is not null)
4064 1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.t2.b 1 100.00 NULL
4065 Warnings:
4066 Note 1003 Table 't1' is not pushable: select list can't contain BLOB columns
4067 Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t1` join `test`.`t2` where (`test`.`t1`.`a` = `test`.`t2`.`b`)
4068 select *
4069 from t1, t2
4070 where t2.a = t1.b;
4071 a b c a b
4072 1 1 kalle 1 1
4073 2 1 kalle 1 1
4074 3 3 kalle 3 3
4075 4 1 kalle 1 1
4076 explain
4077 select *
4078 from t1, t2
4079 where t1.a = t2.b
4080 and t2.a = 3;
4081 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
4082 1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 const 1 100.00 Using where
4083 1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.t2.b 1 100.00 NULL
4084 Warnings:
4085 Note 1003 Table 't1' is not pushable: select list can't contain BLOB columns
4086 Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t1` join `test`.`t2` where ((`test`.`t2`.`a` = 3) and (`test`.`t1`.`a` = `test`.`t2`.`b`))
4087 select *
4088 from t1, t2
4089 where t1.a = t2.b
4090 and t2.a = 3;
4091 a b c a b
4092 3 3 kalle 3 3
4093 drop table t1, t2;
4094 create table t3 (a3 int, b3 tinyint, c3 int not null, d3 int not null,
4095 primary key(a3,b3)) engine = ndb
4096 comment="NDB_TABLE=PARTITION_BALANCE=FOR_RP_BY_LDM";
4097 insert into t3 values (0x1f, 0x2f, 1, 0x1f);
4098 insert into t3 values (0x2f, 0x3f, 2, 0x2f);
4099 insert into t3 values (0x3f, 0x1f, 3, 0x3f);
4100 explain
4101 select * from t3 x, t3 y where x.a3=0x2f and y.a3=x.d3 and y.b3="63";
4102 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
4103 1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 const 3 100.00 NULL
4104 1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 5 test.x.d3,const 1 100.00 Using join buffer (Batched Key Access)
4105 Warnings:
4106 Note 1003 Can't push table 'y' as child, access type 'Batched-key' not implemented
4107 Note 1003 /* select#1 */ select `test`.`x`.`a3` AS `a3`,`test`.`x`.`b3` AS `b3`,`test`.`x`.`c3` AS `c3`,`test`.`x`.`d3` AS `d3`,`test`.`y`.`a3` AS `a3`,`test`.`y`.`b3` AS `b3`,`test`.`y`.`c3` AS `c3`,`test`.`y`.`d3` AS `d3` from `test`.`t3` `x` join `test`.`t3` `y` where ((`test`.`y`.`a3` = `test`.`x`.`d3`) and (`test`.`x`.`a3` = 0x2f) and (`test`.`y`.`b3` = 63))
4108 select * from t3 x, t3 y where x.a3=0x2f and y.a3=x.d3 and y.b3="63";
4109 a3 b3 c3 d3 a3 b3 c3 d3
4110 47 63 2 47 47 63 2 47
4111 drop table t3;
4112 create table t3 (a3 int, b3 tinyint unsigned, c3 int not null, d3 int not null,
4113 primary key(a3,b3)) engine = ndb
4114 comment="NDB_TABLE=PARTITION_BALANCE=FOR_RP_BY_LDM";
4115 insert into t3 values (0x1f, 0x2f, 1, 0x1f);
4116 insert into t3 values (0x2f, 0x3f, 2, 0x2f);
4117 insert into t3 values (0x3f, 0x1f, 3, 0x3f);
4118 explain
4119 select * from t3 x, t3 y where x.a3=0x2f and y.a3=x.d3 and y.b3=(60+3);
4120 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
4121 1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 const 3 100.00 NULL
4122 1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 5 test.x.d3,const 1 100.00 Using join buffer (Batched Key Access)
4123 Warnings:
4124 Note 1003 Can't push table 'y' as child, access type 'Batched-key' not implemented
4125 Note 1003 /* select#1 */ select `test`.`x`.`a3` AS `a3`,`test`.`x`.`b3` AS `b3`,`test`.`x`.`c3` AS `c3`,`test`.`x`.`d3` AS `d3`,`test`.`y`.`a3` AS `a3`,`test`.`y`.`b3` AS `b3`,`test`.`y`.`c3` AS `c3`,`test`.`y`.`d3` AS `d3` from `test`.`t3` `x` join `test`.`t3` `y` where ((`test`.`y`.`b3` = (60 + 3)) and (`test`.`y`.`a3` = `test`.`x`.`d3`) and (`test`.`x`.`a3` = 0x2f))
4126 select * from t3 x, t3 y where x.a3=0x2f and y.a3=x.d3 and y.b3=(60+3);
4127 a3 b3 c3 d3 a3 b3 c3 d3
4128 47 63 2 47 47 63 2 47
4129 drop table t3;
4130 create table t3 (a3 int, b3 smallint, c3 int not null, d3 int not null,
4131 primary key(a3,b3)) engine = ndb
4132 comment="NDB_TABLE=PARTITION_BALANCE=FOR_RP_BY_LDM";
4133 insert into t3 values (0x1f, 0x2f, 1, 0x1f);
4134 insert into t3 values (0x2f, 0x3f, 2, 0x2f);
4135 insert into t3 values (0x3f, 0x1f, 3, 0x3f);
4136 explain
4137 select * from t3 x, t3 y where x.a3=0x2f and y.a3=x.d3 and y.b3=(60+3);
4138 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
4139 1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 const 3 100.00 NULL
4140 1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 6 test.x.d3,const 1 100.00 Using join buffer (Batched Key Access)
4141 Warnings:
4142 Note 1003 Can't push table 'y' as child, access type 'Batched-key' not implemented
4143 Note 1003 /* select#1 */ select `test`.`x`.`a3` AS `a3`,`test`.`x`.`b3` AS `b3`,`test`.`x`.`c3` AS `c3`,`test`.`x`.`d3` AS `d3`,`test`.`y`.`a3` AS `a3`,`test`.`y`.`b3` AS `b3`,`test`.`y`.`c3` AS `c3`,`test`.`y`.`d3` AS `d3` from `test`.`t3` `x` join `test`.`t3` `y` where ((`test`.`y`.`b3` = (60 + 3)) and (`test`.`y`.`a3` = `test`.`x`.`d3`) and (`test`.`x`.`a3` = 0x2f))
4144 select * from t3 x, t3 y where x.a3=0x2f and y.a3=x.d3 and y.b3=(60+3);
4145 a3 b3 c3 d3 a3 b3 c3 d3
4146 47 63 2 47 47 63 2 47
4147 drop table t3;
4148 create table t3 (a3 int, b3 smallint unsigned, c3 int not null, d3 int not null,
4149 primary key(a3,b3)) engine = ndb
4150 comment="NDB_TABLE=PARTITION_BALANCE=FOR_RP_BY_LDM";
4151 insert into t3 values (0x1f, 0x2f, 1, 0x1f);
4152 insert into t3 values (0x2f, 0x3f, 2, 0x2f);
4153 insert into t3 values (0x3f, 0x1f, 3, 0x3f);
4154 explain
4155 select * from t3 x, t3 y where x.a3=0x2f and y.a3=x.d3 and y.b3=(60+3);
4156 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
4157 1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 const 3 100.00 NULL
4158 1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 6 test.x.d3,const 1 100.00 Using join buffer (Batched Key Access)
4159 Warnings:
4160 Note 1003 Can't push table 'y' as child, access type 'Batched-key' not implemented
4161 Note 1003 /* select#1 */ select `test`.`x`.`a3` AS `a3`,`test`.`x`.`b3` AS `b3`,`test`.`x`.`c3` AS `c3`,`test`.`x`.`d3` AS `d3`,`test`.`y`.`a3` AS `a3`,`test`.`y`.`b3` AS `b3`,`test`.`y`.`c3` AS `c3`,`test`.`y`.`d3` AS `d3` from `test`.`t3` `x` join `test`.`t3` `y` where ((`test`.`y`.`b3` = (60 + 3)) and (`test`.`y`.`a3` = `test`.`x`.`d3`) and (`test`.`x`.`a3` = 0x2f))
4162 select * from t3 x, t3 y where x.a3=0x2f and y.a3=x.d3 and y.b3=(60+3);
4163 a3 b3 c3 d3 a3 b3 c3 d3
4164 47 63 2 47 47 63 2 47
4165 drop table t3;
4166 create table t3 (a3 int, b3 mediumint, c3 int not null, d3 int not null,
4167 primary key(a3,b3)) engine = ndb
4168 comment="NDB_TABLE=PARTITION_BALANCE=FOR_RP_BY_LDM";
4169 insert into t3 values (0x1f, 0x2f, 1, 0x1f);
4170 insert into t3 values (0x2f, 0x3f, 2, 0x2f);
4171 insert into t3 values (0x3f, 0x1f, 3, 0x3f);
4172 explain
4173 select * from t3 x, t3 y where x.a3=0x2f and y.a3=x.d3 and y.b3=(60+3);
4174 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
4175 1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 const 3 100.00 NULL
4176 1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 7 test.x.d3,const 1 100.00 Using join buffer (Batched Key Access)
4177 Warnings:
4178 Note 1003 Can't push table 'y' as child, access type 'Batched-key' not implemented
4179 Note 1003 /* select#1 */ select `test`.`x`.`a3` AS `a3`,`test`.`x`.`b3` AS `b3`,`test`.`x`.`c3` AS `c3`,`test`.`x`.`d3` AS `d3`,`test`.`y`.`a3` AS `a3`,`test`.`y`.`b3` AS `b3`,`test`.`y`.`c3` AS `c3`,`test`.`y`.`d3` AS `d3` from `test`.`t3` `x` join `test`.`t3` `y` where ((`test`.`y`.`b3` = (60 + 3)) and (`test`.`y`.`a3` = `test`.`x`.`d3`) and (`test`.`x`.`a3` = 0x2f))
4180 select * from t3 x, t3 y where x.a3=0x2f and y.a3=x.d3 and y.b3=(60+3);
4181 a3 b3 c3 d3 a3 b3 c3 d3
4182 47 63 2 47 47 63 2 47
4183 drop table t3;
4184 create table t3 (a3 int, b3 mediumint unsigned, c3 int not null, d3 int not null,
4185 primary key(a3,b3)) engine = ndb
4186 comment="NDB_TABLE=PARTITION_BALANCE=FOR_RP_BY_LDM";
4187 insert into t3 values (0x1f, 0x2f, 1, 0x1f);
4188 insert into t3 values (0x2f, 0x3f, 2, 0x2f);
4189 insert into t3 values (0x3f, 0x1f, 3, 0x3f);
4190 explain
4191 select * from t3 x, t3 y where x.a3=0x2f and y.a3=x.d3 and y.b3=(60+3);
4192 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
4193 1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 const 3 100.00 NULL
4194 1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 7 test.x.d3,const 1 100.00 Using join buffer (Batched Key Access)
4195 Warnings:
4196 Note 1003 Can't push table 'y' as child, access type 'Batched-key' not implemented
4197 Note 1003 /* select#1 */ select `test`.`x`.`a3` AS `a3`,`test`.`x`.`b3` AS `b3`,`test`.`x`.`c3` AS `c3`,`test`.`x`.`d3` AS `d3`,`test`.`y`.`a3` AS `a3`,`test`.`y`.`b3` AS `b3`,`test`.`y`.`c3` AS `c3`,`test`.`y`.`d3` AS `d3` from `test`.`t3` `x` join `test`.`t3` `y` where ((`test`.`y`.`b3` = (60 + 3)) and (`test`.`y`.`a3` = `test`.`x`.`d3`) and (`test`.`x`.`a3` = 0x2f))
4198 select * from t3 x, t3 y where x.a3=0x2f and y.a3=x.d3 and y.b3=(60+3);
4199 a3 b3 c3 d3 a3 b3 c3 d3
4200 47 63 2 47 47 63 2 47
4201 drop table t3;
4202 create table t3 (a3 int, b3 int, c3 int not null, d3 int not null,
4203 primary key(a3,b3)) engine = ndb
4204 comment="NDB_TABLE=PARTITION_BALANCE=FOR_RP_BY_LDM";
4205 insert into t3 values (0x1f, 0x2f, 1, 0x1f);
4206 insert into t3 values (0x2f, 0x3f, 2, 0x2f);
4207 insert into t3 values (0x3f, 0x1f, 3, 0x3f);
4208 explain
4209 select * from t3 x, t3 y where x.a3=0x2f and y.a3=x.d3 and y.b3=(60+3);
4210 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
4211 1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 const 3 100.00 NULL
4212 1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.x.d3,const 1 100.00 Using join buffer (Batched Key Access)
4213 Warnings:
4214 Note 1003 Can't push table 'y' as child, access type 'Batched-key' not implemented
4215 Note 1003 /* select#1 */ select `test`.`x`.`a3` AS `a3`,`test`.`x`.`b3` AS `b3`,`test`.`x`.`c3` AS `c3`,`test`.`x`.`d3` AS `d3`,`test`.`y`.`a3` AS `a3`,`test`.`y`.`b3` AS `b3`,`test`.`y`.`c3` AS `c3`,`test`.`y`.`d3` AS `d3` from `test`.`t3` `x` join `test`.`t3` `y` where ((`test`.`y`.`b3` = (60 + 3)) and (`test`.`y`.`a3` = `test`.`x`.`d3`) and (`test`.`x`.`a3` = 0x2f))
4216 select * from t3 x, t3 y where x.a3=0x2f and y.a3=x.d3 and y.b3=(60+3);
4217 a3 b3 c3 d3 a3 b3 c3 d3
4218 47 63 2 47 47 63 2 47
4219 drop table t3;
4220 create table t3 (a3 int, b3 int unsigned, c3 int not null, d3 int not null,
4221 primary key(a3,b3)) engine = ndb
4222 comment="NDB_TABLE=PARTITION_BALANCE=FOR_RP_BY_LDM";
4223 insert into t3 values (0x1f, 0x2f, 1, 0x1f);
4224 insert into t3 values (0x2f, 0x3f, 2, 0x2f);
4225 insert into t3 values (0x3f, 0x1f, 3, 0x3f);
4226 explain
4227 select * from t3 x, t3 y where x.a3=0x2f and y.a3=x.d3 and y.b3=(60+3);
4228 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
4229 1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 const 3 100.00 NULL
4230 1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.x.d3,const 1 100.00 Using join buffer (Batched Key Access)
4231 Warnings:
4232 Note 1003 Can't push table 'y' as child, access type 'Batched-key' not implemented
4233 Note 1003 /* select#1 */ select `test`.`x`.`a3` AS `a3`,`test`.`x`.`b3` AS `b3`,`test`.`x`.`c3` AS `c3`,`test`.`x`.`d3` AS `d3`,`test`.`y`.`a3` AS `a3`,`test`.`y`.`b3` AS `b3`,`test`.`y`.`c3` AS `c3`,`test`.`y`.`d3` AS `d3` from `test`.`t3` `x` join `test`.`t3` `y` where ((`test`.`y`.`b3` = (60 + 3)) and (`test`.`y`.`a3` = `test`.`x`.`d3`) and (`test`.`x`.`a3` = 0x2f))
4234 select * from t3 x, t3 y where x.a3=0x2f and y.a3=x.d3 and y.b3=(60+3);
4235 a3 b3 c3 d3 a3 b3 c3 d3
4236 47 63 2 47 47 63 2 47
4237 drop table t3;
4238 create table t3 (a3 int, b3 bigint, c3 int not null, d3 int not null,
4239 primary key(a3,b3)) engine = ndb
4240 comment="NDB_TABLE=PARTITION_BALANCE=FOR_RP_BY_LDM";
4241 insert into t3 values (0x1f, 0x2f, 1, 0x1f);
4242 insert into t3 values (0x2f, 0x3f, 2, 0x2f);
4243 insert into t3 values (0x3f, 0x1f, 3, 0x3f);
4244 explain
4245 select * from t3 x, t3 y where x.a3=0x2f and y.a3=x.d3 and y.b3=(60+3);
4246 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
4247 1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 const 3 100.00 NULL
4248 1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 12 test.x.d3,const 1 100.00 Using pushed condition (`test`.`y`.`b3` = 63); Using join buffer (Batched Key Access)
4249 Warnings:
4250 Note 1003 Can't push table 'y' as child, access type 'Batched-key' not implemented
4251 Note 1003 /* select#1 */ select `test`.`x`.`a3` AS `a3`,`test`.`x`.`b3` AS `b3`,`test`.`x`.`c3` AS `c3`,`test`.`x`.`d3` AS `d3`,`test`.`y`.`a3` AS `a3`,`test`.`y`.`b3` AS `b3`,`test`.`y`.`c3` AS `c3`,`test`.`y`.`d3` AS `d3` from `test`.`t3` `x` join `test`.`t3` `y` where ((`test`.`y`.`b3` = 63) and (`test`.`y`.`a3` = `test`.`x`.`d3`) and (`test`.`x`.`a3` = 0x2f))
4252 select * from t3 x, t3 y where x.a3=0x2f and y.a3=x.d3 and y.b3=(60+3);
4253 a3 b3 c3 d3 a3 b3 c3 d3
4254 47 63 2 47 47 63 2 47
4255 drop table t3;
4256 create table t3 (a3 int, b3 bigint unsigned, c3 int not null, d3 int not null,
4257 primary key(a3,b3)) engine = ndb
4258 comment="NDB_TABLE=PARTITION_BALANCE=FOR_RP_BY_LDM";
4259 insert into t3 values (0x1f, 0x2f, 1, 0x1f);
4260 insert into t3 values (0x2f, 0x3f, 2, 0x2f);
4261 insert into t3 values (0x3f, 0x1f, 3, 0x3f);
4262 explain
4263 select * from t3 x, t3 y where x.a3=0x2f and y.a3=x.d3 and y.b3=(60+3);
4264 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
4265 1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 const 3 100.00 NULL
4266 1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 12 test.x.d3,const 1 100.00 Using pushed condition (`test`.`y`.`b3` = 63); Using join buffer (Batched Key Access)
4267 Warnings:
4268 Note 1003 Can't push table 'y' as child, access type 'Batched-key' not implemented
4269 Note 1003 /* select#1 */ select `test`.`x`.`a3` AS `a3`,`test`.`x`.`b3` AS `b3`,`test`.`x`.`c3` AS `c3`,`test`.`x`.`d3` AS `d3`,`test`.`y`.`a3` AS `a3`,`test`.`y`.`b3` AS `b3`,`test`.`y`.`c3` AS `c3`,`test`.`y`.`d3` AS `d3` from `test`.`t3` `x` join `test`.`t3` `y` where ((`test`.`y`.`b3` = 63) and (`test`.`y`.`a3` = `test`.`x`.`d3`) and (`test`.`x`.`a3` = 0x2f))
4270 select * from t3 x, t3 y where x.a3=0x2f and y.a3=x.d3 and y.b3=(60+3);
4271 a3 b3 c3 d3 a3 b3 c3 d3
4272 47 63 2 47 47 63 2 47
4273 drop table t3;
4274 create table t3 (a3 int, b3 boolean, c3 int not null, d3 int not null,
4275 primary key(a3,b3)) engine = ndb
4276 comment="NDB_TABLE=PARTITION_BALANCE=FOR_RP_BY_LDM";
4277 insert into t3 values (0x1f, 0, 1, 0x1f);
4278 insert into t3 values (0x2f, 1, 2, 0x2f);
4279 insert into t3 values (0x3f, 0, 3, 0x3f);
4280 explain
4281 select * from t3 x, t3 y where x.a3=0x2f and y.a3=x.d3 and y.b3=1;
4282 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
4283 1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 const 3 100.00 NULL
4284 1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 5 test.x.d3,const 1 100.00 Using join buffer (Batched Key Access)
4285 Warnings:
4286 Note 1003 Can't push table 'y' as child, access type 'Batched-key' not implemented
4287 Note 1003 /* select#1 */ select `test`.`x`.`a3` AS `a3`,`test`.`x`.`b3` AS `b3`,`test`.`x`.`c3` AS `c3`,`test`.`x`.`d3` AS `d3`,`test`.`y`.`a3` AS `a3`,`test`.`y`.`b3` AS `b3`,`test`.`y`.`c3` AS `c3`,`test`.`y`.`d3` AS `d3` from `test`.`t3` `x` join `test`.`t3` `y` where ((`test`.`y`.`b3` = 1) and (`test`.`y`.`a3` = `test`.`x`.`d3`) and (`test`.`x`.`a3` = 0x2f))
4288 select * from t3 x, t3 y where x.a3=0x2f and y.a3=x.d3 and y.b3=1;
4289 a3 b3 c3 d3 a3 b3 c3 d3
4290 47 1 2 47 47 1 2 47
4291 drop table t3;
4292 create table t3 (a3 int, b3 float, c3 int not null, d3 int not null,
4293 primary key(a3,b3)) engine = ndb
4294 comment="NDB_TABLE=PARTITION_BALANCE=FOR_RP_BY_LDM";
4295 insert into t3 values (0x1f, 2.71, 1, 0x1f);
4296 insert into t3 values (0x2f, 3.00, 2, 0x2f);
4297 insert into t3 values (0x3f, 0.50, 3, 0x3f);
4298 explain
4299 select * from t3 x, t3 y where x.a3=0x2f and y.a3=x.d3 and y.b3=3.0;
4300 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
4301 1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 const 3 100.00 NULL
4302 1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.x.d3,const 1 100.00 Using pushed condition (`test`.`y`.`b3` = 3); Using join buffer (Batched Key Access)
4303 Warnings:
4304 Note 1003 Can't push table 'y' as child, access type 'Batched-key' not implemented
4305 Note 1003 /* select#1 */ select `test`.`x`.`a3` AS `a3`,`test`.`x`.`b3` AS `b3`,`test`.`x`.`c3` AS `c3`,`test`.`x`.`d3` AS `d3`,`test`.`y`.`a3` AS `a3`,`test`.`y`.`b3` AS `b3`,`test`.`y`.`c3` AS `c3`,`test`.`y`.`d3` AS `d3` from `test`.`t3` `x` join `test`.`t3` `y` where ((`test`.`y`.`a3` = `test`.`x`.`d3`) and (`test`.`x`.`a3` = 0x2f) and (`test`.`y`.`b3` = 3))
4306 select * from t3 x, t3 y where x.a3=0x2f and y.a3=x.d3 and y.b3=3.0;
4307 a3 b3 c3 d3 a3 b3 c3 d3
4308 47 3 2 47 47 3 2 47
4309 drop table t3;
4310 create table t3 (a3 int, b3 float unsigned, c3 int not null, d3 int not null,
4311 primary key(a3,b3)) engine = ndb
4312 comment="NDB_TABLE=PARTITION_BALANCE=FOR_RP_BY_LDM";
4313 Warnings:
4314 Warning 1681 UNSIGNED for decimal and floating point data types is deprecated and support for it will be removed in a future release.
4315 insert into t3 values (0x1f, 2.71, 1, 0x1f);
4316 insert into t3 values (0x2f, 3.00, 2, 0x2f);
4317 insert into t3 values (0x3f, 0.50, 3, 0x3f);
4318 explain
4319 select * from t3 x, t3 y where x.a3=0x2f and y.a3=x.d3 and y.b3=3.0;
4320 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
4321 1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 const 3 100.00 NULL
4322 1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.x.d3,const 1 100.00 Using pushed condition (`test`.`y`.`b3` = 3); Using join buffer (Batched Key Access)
4323 Warnings:
4324 Note 1003 Can't push table 'y' as child, access type 'Batched-key' not implemented
4325 Note 1003 /* select#1 */ select `test`.`x`.`a3` AS `a3`,`test`.`x`.`b3` AS `b3`,`test`.`x`.`c3` AS `c3`,`test`.`x`.`d3` AS `d3`,`test`.`y`.`a3` AS `a3`,`test`.`y`.`b3` AS `b3`,`test`.`y`.`c3` AS `c3`,`test`.`y`.`d3` AS `d3` from `test`.`t3` `x` join `test`.`t3` `y` where ((`test`.`y`.`a3` = `test`.`x`.`d3`) and (`test`.`x`.`a3` = 0x2f) and (`test`.`y`.`b3` = 3))
4326 select * from t3 x, t3 y where x.a3=0x2f and y.a3=x.d3 and y.b3=3.0;
4327 a3 b3 c3 d3 a3 b3 c3 d3
4328 47 3 2 47 47 3 2 47
4329 drop table t3;
4330 create table t3 (a3 int, b3 double, c3 int not null, d3 int not null,
4331 primary key(a3,b3)) engine = ndb
4332 comment="NDB_TABLE=PARTITION_BALANCE=FOR_RP_BY_LDM";
4333 insert into t3 values (0x1f, 2.71, 1, 0x1f);
4334 insert into t3 values (0x2f, 3.14, 2, 0x2f);
4335 insert into t3 values (0x3f, 0.50, 3, 0x3f);
4336 explain
4337 select * from t3 x, t3 y where x.a3=0x2f and y.a3=x.d3 and y.b3=3.14;
4338 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
4339 1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 const 3 100.00 NULL
4340 1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 12 test.x.d3,const 1 100.00 Using join buffer (Batched Key Access)
4341 Warnings:
4342 Note 1003 Can't push table 'y' as child, access type 'Batched-key' not implemented
4343 Note 1003 /* select#1 */ select `test`.`x`.`a3` AS `a3`,`test`.`x`.`b3` AS `b3`,`test`.`x`.`c3` AS `c3`,`test`.`x`.`d3` AS `d3`,`test`.`y`.`a3` AS `a3`,`test`.`y`.`b3` AS `b3`,`test`.`y`.`c3` AS `c3`,`test`.`y`.`d3` AS `d3` from `test`.`t3` `x` join `test`.`t3` `y` where ((`test`.`y`.`a3` = `test`.`x`.`d3`) and (`test`.`x`.`a3` = 0x2f) and (`test`.`y`.`b3` = 3.14))
4344 select * from t3 x, t3 y where x.a3=0x2f and y.a3=x.d3 and y.b3=3.14;
4345 a3 b3 c3 d3 a3 b3 c3 d3
4346 47 3.14 2 47 47 3.14 2 47
4347 drop table t3;
4348 create table t3 (a3 int, b3 double unsigned, c3 int not null, d3 int not null,
4349 primary key(a3,b3)) engine = ndb
4350 comment="NDB_TABLE=PARTITION_BALANCE=FOR_RP_BY_LDM";
4351 Warnings:
4352 Warning 1681 UNSIGNED for decimal and floating point data types is deprecated and support for it will be removed in a future release.
4353 insert into t3 values (0x1f, 2.71, 1, 0x1f);
4354 insert into t3 values (0x2f, 3.14, 2, 0x2f);
4355 insert into t3 values (0x3f, 0.50, 3, 0x3f);
4356 explain
4357 select * from t3 x, t3 y where x.a3=0x2f and y.a3=x.d3 and y.b3=3.14;
4358 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
4359 1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 const 3 100.00 NULL
4360 1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 12 test.x.d3,const 1 100.00 Using join buffer (Batched Key Access)
4361 Warnings:
4362 Note 1003 Can't push table 'y' as child, access type 'Batched-key' not implemented
4363 Note 1003 /* select#1 */ select `test`.`x`.`a3` AS `a3`,`test`.`x`.`b3` AS `b3`,`test`.`x`.`c3` AS `c3`,`test`.`x`.`d3` AS `d3`,`test`.`y`.`a3` AS `a3`,`test`.`y`.`b3` AS `b3`,`test`.`y`.`c3` AS `c3`,`test`.`y`.`d3` AS `d3` from `test`.`t3` `x` join `test`.`t3` `y` where ((`test`.`y`.`a3` = `test`.`x`.`d3`) and (`test`.`x`.`a3` = 0x2f) and (`test`.`y`.`b3` = 3.14))
4364 select * from t3 x, t3 y where x.a3=0x2f and y.a3=x.d3 and y.b3=3.14;
4365 a3 b3 c3 d3 a3 b3 c3 d3
4366 47 3.14 2 47 47 3.14 2 47
4367 drop table t3;
4368 create table t3 (a3 int, b3 decimal, c3 int not null, d3 int not null,
4369 primary key(a3,b3)) engine = ndb
4370 comment="NDB_TABLE=PARTITION_BALANCE=FOR_RP_BY_LDM";
4371 insert into t3 values (0x1f, 0x2f, 1, 0x1f);
4372 insert into t3 values (0x2f, 0x3f, 2, 0x2f);
4373 insert into t3 values (0x3f, 0x1f, 3, 0x3f);
4374 explain
4375 select * from t3 x, t3 y where x.a3=0x2f and y.a3=x.d3 and y.b3=63;
4376 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
4377 1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 const 3 100.00 NULL
4378 1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 9 test.x.d3,const 1 100.00 Using join buffer (Batched Key Access)
4379 Warnings:
4380 Note 1003 Can't push table 'y' as child, access type 'Batched-key' not implemented
4381 Note 1003 /* select#1 */ select `test`.`x`.`a3` AS `a3`,`test`.`x`.`b3` AS `b3`,`test`.`x`.`c3` AS `c3`,`test`.`x`.`d3` AS `d3`,`test`.`y`.`a3` AS `a3`,`test`.`y`.`b3` AS `b3`,`test`.`y`.`c3` AS `c3`,`test`.`y`.`d3` AS `d3` from `test`.`t3` `x` join `test`.`t3` `y` where ((`test`.`y`.`a3` = `test`.`x`.`d3`) and (`test`.`x`.`a3` = 0x2f) and (`test`.`y`.`b3` = 63))
4382 select * from t3 x, t3 y where x.a3=0x2f and y.a3=x.d3 and y.b3=63;
4383 a3 b3 c3 d3 a3 b3 c3 d3
4384 47 63 2 47 47 63 2 47
4385 drop table t3;
4386 create table t3 (a3 int, b3 decimal(12,4), c3 int not null, d3 int not null,
4387 primary key(a3,b3)) engine = ndb
4388 comment="NDB_TABLE=PARTITION_BALANCE=FOR_RP_BY_LDM";
4389 insert into t3 values (0x1f, 2.71, 1, 0x1f);
4390 insert into t3 values (0x2f, 3.14, 2, 0x2f);
4391 insert into t3 values (0x3f, 0.50, 3, 0x3f);
4392 explain
4393 select * from t3 x, t3 y where x.a3=0x2f and y.a3=x.d3 and y.b3=3.14;
4394 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
4395 1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 const 3 100.00 NULL
4396 1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 10 test.x.d3,const 1 100.00 Using join buffer (Batched Key Access)
4397 Warnings:
4398 Note 1003 Can't push table 'y' as child, access type 'Batched-key' not implemented
4399 Note 1003 /* select#1 */ select `test`.`x`.`a3` AS `a3`,`test`.`x`.`b3` AS `b3`,`test`.`x`.`c3` AS `c3`,`test`.`x`.`d3` AS `d3`,`test`.`y`.`a3` AS `a3`,`test`.`y`.`b3` AS `b3`,`test`.`y`.`c3` AS `c3`,`test`.`y`.`d3` AS `d3` from `test`.`t3` `x` join `test`.`t3` `y` where ((`test`.`y`.`b3` = 3.1400) and (`test`.`y`.`a3` = `test`.`x`.`d3`) and (`test`.`x`.`a3` = 0x2f))
4400 select * from t3 x, t3 y where x.a3=0x2f and y.a3=x.d3 and y.b3=3.14;
4401 a3 b3 c3 d3 a3 b3 c3 d3
4402 47 3.1400 2 47 47 3.1400 2 47
4403 drop table t3;
4404 create table t3 (a3 int, b3 date, c3 int not null, d3 int not null,
4405 primary key(a3,b3)) engine = ndb
4406 comment="NDB_TABLE=PARTITION_BALANCE=FOR_RP_BY_LDM";
4407 insert into t3 values (0x1f, '1905-05-17', 1, 0x1f);
4408 insert into t3 values (0x2f, '2000-02-28', 2, 0x2f);
4409 insert into t3 values (0x3f, '2000-02-29', 3, 0x3f);
4410 explain
4411 select * from t3 x, t3 y where x.a3=0x2f and y.a3=x.d3 and y.b3='2000-02-28';
4412 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
4413 1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 const 3 100.00 NULL
4414 1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 7 test.x.d3,const 1 100.00 Using join buffer (Batched Key Access)
4415 Warnings:
4416 Note 1003 Can't push table 'y' as child, access type 'Batched-key' not implemented
4417 Note 1003 /* select#1 */ select `test`.`x`.`a3` AS `a3`,`test`.`x`.`b3` AS `b3`,`test`.`x`.`c3` AS `c3`,`test`.`x`.`d3` AS `d3`,`test`.`y`.`a3` AS `a3`,`test`.`y`.`b3` AS `b3`,`test`.`y`.`c3` AS `c3`,`test`.`y`.`d3` AS `d3` from `test`.`t3` `x` join `test`.`t3` `y` where ((`test`.`y`.`b3` = DATE'2000-02-28') and (`test`.`y`.`a3` = `test`.`x`.`d3`) and (`test`.`x`.`a3` = 0x2f))
4418 select * from t3 x, t3 y where x.a3=0x2f and y.a3=x.d3 and y.b3='2000-02-28';
4419 a3 b3 c3 d3 a3 b3 c3 d3
4420 47 2000-02-28 2 47 47 2000-02-28 2 47
4421 drop table t3;
4422 create table t3 (a3 int, b3 char(16), c3 int not null, d3 int not null,
4423 primary key(a3,b3)) engine = ndb
4424 comment="NDB_TABLE=PARTITION_BALANCE=FOR_RP_BY_LDM";
4425 insert into t3 values (0x1f, 'Ole', 1, 0x1f);
4426 insert into t3 values (0x2f, 'Dole', 2, 0x2f);
4427 insert into t3 values (0x3f, 'Doffen', 2, 0x3f);
4428 explain
4429 select * from t3 x, t3 y where x.a3=0x2f and y.a3=x.d3 and y.b3='Dole';
4430 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
4431 1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 const 3 100.00 NULL
4432 1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 68 test.x.d3,const 1 100.00 Using pushed condition (`test`.`y`.`b3` = 'Dole'); Using join buffer (Batched Key Access)
4433 Warnings:
4434 Note 1003 Can't push table 'y' as child, access type 'Batched-key' not implemented
4435 Note 1003 /* select#1 */ select `test`.`x`.`a3` AS `a3`,`test`.`x`.`b3` AS `b3`,`test`.`x`.`c3` AS `c3`,`test`.`x`.`d3` AS `d3`,`test`.`y`.`a3` AS `a3`,`test`.`y`.`b3` AS `b3`,`test`.`y`.`c3` AS `c3`,`test`.`y`.`d3` AS `d3` from `test`.`t3` `x` join `test`.`t3` `y` where ((`test`.`y`.`b3` = 'Dole') and (`test`.`y`.`a3` = `test`.`x`.`d3`) and (`test`.`x`.`a3` = 0x2f))
4436 select * from t3 x, t3 y where x.a3=0x2f and y.a3=x.d3 and y.b3='Dole';
4437 a3 b3 c3 d3 a3 b3 c3 d3
4438 47 Dole 2 47 47 Dole 2 47
4439 drop table t3;
4440 create table t3 (a3 int, b3 varchar(16), c3 int not null, d3 int not null,
4441 primary key(a3,b3)) engine = ndb
4442 comment="NDB_TABLE=PARTITION_BALANCE=FOR_RP_BY_LDM";
4443 insert into t3 values (0x1f, 'Ole', 1, 0x1f);
4444 insert into t3 values (0x2f, 'Dole', 2, 0x2f);
4445 insert into t3 values (0x3f, 'Doffen', 2, 0x3f);
4446 explain
4447 select * from t3 x, t3 y where x.a3=0x2f and y.a3=x.d3 and y.b3='Dole';
4448 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
4449 1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 const 3 100.00 NULL
4450 1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 70 test.x.d3,const 1 100.00 Using join buffer (Batched Key Access)
4451 Warnings:
4452 Note 1003 Can't push table 'y' as child, access type 'Batched-key' not implemented
4453 Note 1003 /* select#1 */ select `test`.`x`.`a3` AS `a3`,`test`.`x`.`b3` AS `b3`,`test`.`x`.`c3` AS `c3`,`test`.`x`.`d3` AS `d3`,`test`.`y`.`a3` AS `a3`,`test`.`y`.`b3` AS `b3`,`test`.`y`.`c3` AS `c3`,`test`.`y`.`d3` AS `d3` from `test`.`t3` `x` join `test`.`t3` `y` where ((`test`.`y`.`b3` = 'Dole') and (`test`.`y`.`a3` = `test`.`x`.`d3`) and (`test`.`x`.`a3` = 0x2f))
4454 select * from t3 x, t3 y where x.a3=0x2f and y.a3=x.d3 and y.b3='Dole';
4455 a3 b3 c3 d3 a3 b3 c3 d3
4456 47 Dole 2 47 47 Dole 2 47
4457 drop table t3;
4458 create table t3 (a3 int, b3 varchar(512), c3 int not null, d3 int not null,
4459 primary key(a3,b3)) engine = ndb
4460 comment="NDB_TABLE=PARTITION_BALANCE=FOR_RP_BY_LDM";
4461 insert into t3 values (0x1f, 'Ole', 1, 0x1f);
4462 insert into t3 values (0x2f, 'Dole', 2, 0x2f);
4463 insert into t3 values (0x3f, 'Doffen', 2, 0x3f);
4464 explain
4465 select * from t3 x, t3 y where x.a3=0x2f and y.a3=x.d3 and y.b3='Dole';
4466 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
4467 1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 const 3 100.00 NULL
4468 1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 2054 test.x.d3,const 1 100.00 Using join buffer (Batched Key Access)
4469 Warnings:
4470 Note 1003 Can't push table 'y' as child, access type 'Batched-key' not implemented
4471 Note 1003 /* select#1 */ select `test`.`x`.`a3` AS `a3`,`test`.`x`.`b3` AS `b3`,`test`.`x`.`c3` AS `c3`,`test`.`x`.`d3` AS `d3`,`test`.`y`.`a3` AS `a3`,`test`.`y`.`b3` AS `b3`,`test`.`y`.`c3` AS `c3`,`test`.`y`.`d3` AS `d3` from `test`.`t3` `x` join `test`.`t3` `y` where ((`test`.`y`.`b3` = 'Dole') and (`test`.`y`.`a3` = `test`.`x`.`d3`) and (`test`.`x`.`a3` = 0x2f))
4472 select * from t3 x, t3 y where x.a3=0x2f and y.a3=x.d3 and y.b3='Dole';
4473 a3 b3 c3 d3 a3 b3 c3 d3
4474 47 Dole 2 47 47 Dole 2 47
4475 drop table t3;
4476 create table t3 (a3 int, b3 binary(16), c3 int not null, d3 int not null,
4477 primary key(a3,b3)) engine = ndb
4478 comment="NDB_TABLE=PARTITION_BALANCE=FOR_RP_BY_LDM";
4479 insert into t3 values (0x1f, 'Ole', 1, 0x1f);
4480 insert into t3 values (0x2f, 'Dole', 2, 0x2f);
4481 insert into t3 values (0x3f, 'Doffen', 2, 0x3f);
4482 explain
4483 select * from t3 x, t3 y where x.a3=0x2f and y.a3=x.d3 and y.b3='Dole';
4484 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
4485 1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 const 3 100.00 NULL
4486 1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 20 test.x.d3,const 1 100.00 Using where; Using join buffer (Batched Key Access)
4487 Warnings:
4488 Note 1003 Can't push table 'y' as child, access type 'Batched-key' not implemented
4489 Note 1003 /* select#1 */ select `test`.`x`.`a3` AS `a3`,`test`.`x`.`b3` AS `b3`,`test`.`x`.`c3` AS `c3`,`test`.`x`.`d3` AS `d3`,`test`.`y`.`a3` AS `a3`,`test`.`y`.`b3` AS `b3`,`test`.`y`.`c3` AS `c3`,`test`.`y`.`d3` AS `d3` from `test`.`t3` `x` join `test`.`t3` `y` where ((`test`.`y`.`b3` = 'Dole') and (`test`.`y`.`a3` = `test`.`x`.`d3`) and (`test`.`x`.`a3` = 0x2f))
4490 select * from t3 x, t3 y where x.a3=0x2f and y.a3=x.d3 and y.b3='Dole';
4491 a3 b3 c3 d3 a3 b3 c3 d3
4492 drop table t3;
4493 create table t3 (a3 int, b3 varbinary(16), c3 int not null, d3 int not null,
4494 primary key(a3,b3)) engine = ndb
4495 comment="NDB_TABLE=PARTITION_BALANCE=FOR_RP_BY_LDM";
4496 insert into t3 values (0x1f, 'Ole', 1, 0x1f);
4497 insert into t3 values (0x2f, 'Dole', 2, 0x2f);
4498 insert into t3 values (0x3f, 'Doffen', 2, 0x3f);
4499 explain
4500 select * from t3 x, t3 y where x.a3=0x2f and y.a3=x.d3 and y.b3='Dole';
4501 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
4502 1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 const 3 100.00 NULL
4503 1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 22 test.x.d3,const 1 100.00 Using where; Using join buffer (Batched Key Access)
4504 Warnings:
4505 Note 1003 Can't push table 'y' as child, access type 'Batched-key' not implemented
4506 Note 1003 /* select#1 */ select `test`.`x`.`a3` AS `a3`,`test`.`x`.`b3` AS `b3`,`test`.`x`.`c3` AS `c3`,`test`.`x`.`d3` AS `d3`,`test`.`y`.`a3` AS `a3`,`test`.`y`.`b3` AS `b3`,`test`.`y`.`c3` AS `c3`,`test`.`y`.`d3` AS `d3` from `test`.`t3` `x` join `test`.`t3` `y` where ((`test`.`y`.`b3` = 'Dole') and (`test`.`y`.`a3` = `test`.`x`.`d3`) and (`test`.`x`.`a3` = 0x2f))
4507 select * from t3 x, t3 y where x.a3=0x2f and y.a3=x.d3 and y.b3='Dole';
4508 a3 b3 c3 d3 a3 b3 c3 d3
4509 47 Dole 2 47 47 Dole 2 47
4510 drop table t3;
4511 create table t3 (a3 int, b3 tinyint, c3 int not null, d3 int not null,
4512 primary key(a3,b3)) engine = ndb
4513 comment="NDB_TABLE=PARTITION_BALANCE=FOR_RP_BY_LDM";
4514 insert into t3 values (0x1f, 0x2f, 1, 0x1f);
4515 insert into t3 values (0x2f, 0x3f, 2, 0x2f);
4516 insert into t3 values (0x3f, 0x1f, 3, 0x3f);
4517 explain
4518 select * from t3 x, t3 y where y.a3=x.b3 and y.b3="63";
4519 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
4520 1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 3 100.00 NULL
4521 1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 5 test.x.b3,const 1 100.00 Using where; Using join buffer (Batched Key Access)
4522 Warnings:
4523 Note 1003 Can't push table 'y' as child, access type 'Batched-key' not implemented
4524 Note 1003 /* select#1 */ select `test`.`x`.`a3` AS `a3`,`test`.`x`.`b3` AS `b3`,`test`.`x`.`c3` AS `c3`,`test`.`x`.`d3` AS `d3`,`test`.`y`.`a3` AS `a3`,`test`.`y`.`b3` AS `b3`,`test`.`y`.`c3` AS `c3`,`test`.`y`.`d3` AS `d3` from `test`.`t3` `x` join `test`.`t3` `y` where ((`test`.`y`.`a3` = `test`.`x`.`b3`) and (`test`.`y`.`b3` = 63))
4525 select * from t3 x, t3 y where y.a3=x.b3 and y.b3="63";
4526 a3 b3 c3 d3 a3 b3 c3 d3
4527 31 47 1 31 47 63 2 47
4528 drop table t3;
4529 create table t3 (a3 varchar(16), b3 int, c3 int not null, d3 int not null,
4530 primary key(a3,b3)) engine = ndb
4531 comment="NDB_TABLE=PARTITION_BALANCE=FOR_RP_BY_LDM";
4532 insert into t3 values ('Ole', 0x1f, 1, 0x1f);
4533 insert into t3 values ('Dole', 0x2f, 2, 0x2f);
4534 insert into t3 values ('Doffen', 0x3f, 2, 0x3f);
4535 explain
4536 select * from t3 x, t3 y where x.a3='Dole' and x.b3=0x2f and y.a3=x.a3 and y.b3=x.d3;
4537 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
4538 1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 70 const,const 1 100.00 NULL
4539 1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 70 const,test.x.d3 1 100.00 Using join buffer (Batched Key Access)
4540 Warnings:
4541 Note 1003 Can't push table 'y' as child, access type 'Batched-key' not implemented
4542 Note 1003 /* select#1 */ select `test`.`x`.`a3` AS `a3`,`test`.`x`.`b3` AS `b3`,`test`.`x`.`c3` AS `c3`,`test`.`x`.`d3` AS `d3`,`test`.`y`.`a3` AS `a3`,`test`.`y`.`b3` AS `b3`,`test`.`y`.`c3` AS `c3`,`test`.`y`.`d3` AS `d3` from `test`.`t3` `x` join `test`.`t3` `y` where ((`test`.`y`.`b3` = `test`.`x`.`d3`) and (`test`.`x`.`a3` = 'Dole') and (`test`.`y`.`a3` = 'Dole') and (`test`.`x`.`b3` = 0x2f))
4543 select * from t3 x, t3 y where x.a3='Dole' and x.b3=0x2f and y.a3=x.a3 and y.b3=x.d3;
4544 a3 b3 c3 d3 a3 b3 c3 d3
4545 Dole 47 2 47 Dole 47 2 47
4546 explain
4547 select * from t3 x, t3 y where x.a3='Dole' and y.a3=x.a3 and y.b3=x.d3;
4548 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
4549 1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 66 const 3 100.00 NULL
4550 1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 70 const,test.x.d3 1 100.00 Using join buffer (Batched Key Access)
4551 Warnings:
4552 Note 1003 Can't push table 'y' as child, access type 'Batched-key' not implemented
4553 Note 1003 /* select#1 */ select `test`.`x`.`a3` AS `a3`,`test`.`x`.`b3` AS `b3`,`test`.`x`.`c3` AS `c3`,`test`.`x`.`d3` AS `d3`,`test`.`y`.`a3` AS `a3`,`test`.`y`.`b3` AS `b3`,`test`.`y`.`c3` AS `c3`,`test`.`y`.`d3` AS `d3` from `test`.`t3` `x` join `test`.`t3` `y` where ((`test`.`y`.`b3` = `test`.`x`.`d3`) and (`test`.`x`.`a3` = 'Dole') and (`test`.`y`.`a3` = 'Dole'))
4554 select * from t3 x, t3 y where x.a3='Dole' and y.a3=x.a3 and y.b3=x.d3;
4555 a3 b3 c3 d3 a3 b3 c3 d3
4556 Dole 47 2 47 Dole 47 2 47
4557 drop table t3;
4558 create table t1 (k int primary key, b int) engine = ndb
4559 comment="NDB_TABLE=PARTITION_BALANCE=FOR_RP_BY_LDM";
4560 insert into t1 values (1,1), (2,1), (3,1), (4,1);
4561 explain
4562 select *
4563 from t1
4564 straight_join t1 as t2 on t2.k = t1.b+0
4565 straight_join t1 as t3 on t3.k = t2.b
4566 straight_join t1 as t4 on t4.k = t1.b;
4567 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
4568 1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 4 100.00 Using pushed condition (`test`.`t1`.`b` is not null)
4569 1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 func 1 100.00 Using where; Using pushed condition (`test`.`t2`.`b` is not null); Using join buffer (Batched Key Access)
4570 1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.t2.b 1 100.00 Using join buffer (Batched Key Access)
4571 1 SIMPLE t4 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.t1.b 1 100.00 Using join buffer (Batched Key Access)
4572 Warnings:
4573 Note 1003 Can't push table 't2' as child, access type 'Batched-key' not implemented
4574 Note 1003 Can't push table 't3' as child, access type 'Batched-key' not implemented
4575 Note 1003 Can't push table 't4' as child, access type 'Batched-key' not implemented
4576 Note 1003 /* select#1 */ select `test`.`t1`.`k` AS `k`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`k` AS `k`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`k` AS `k`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`k` AS `k`,`test`.`t4`.`b` AS `b` from `test`.`t1` straight_join `test`.`t1` `t2` straight_join `test`.`t1` `t3` straight_join `test`.`t1` `t4` where ((`test`.`t3`.`k` = `test`.`t2`.`b`) and (`test`.`t4`.`k` = `test`.`t1`.`b`) and (`test`.`t2`.`k` = (`test`.`t1`.`b` + 0)))
4577 select *
4578 from t1
4579 straight_join t1 as t2 on t2.k = t1.b+0
4580 straight_join t1 as t3 on t3.k = t2.b
4581 straight_join t1 as t4 on t4.k = t1.b;
4582 k b k b k b k b
4583 1 1 1 1 1 1 1 1
4584 2 1 1 1 1 1 1 1
4585 3 1 1 1 1 1 1 1
4586 4 1 1 1 1 1 1 1
4587 explain
4588 select *
4589 from t1
4590 straight_join t1 as t2 on t2.k = t1.b+0
4591 straight_join t1 as t3 on t3.k = t2.b
4592 straight_join t1 as t4 on t4.k = t1.b
4593 where t2.k = 1;
4594 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
4595 1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 4 100.00 Using where; Using pushed condition (`test`.`t1`.`b` is not null)
4596 1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 const 1 100.00 Using pushed condition (`test`.`t2`.`b` is not null); Using join buffer (Batched Key Access)
4597 1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.t2.b 1 100.00 Using join buffer (Batched Key Access)
4598 1 SIMPLE t4 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.t1.b 1 100.00 Using join buffer (Batched Key Access)
4599 Warnings:
4600 Note 1003 Can't push table 't2' as child, access type 'Batched-key' not implemented
4601 Note 1003 Can't push table 't3' as child, access type 'Batched-key' not implemented
4602 Note 1003 Can't push table 't4' as child, access type 'Batched-key' not implemented
4603 Note 1003 /* select#1 */ select `test`.`t1`.`k` AS `k`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`k` AS `k`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`k` AS `k`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`k` AS `k`,`test`.`t4`.`b` AS `b` from `test`.`t1` straight_join `test`.`t1` `t2` straight_join `test`.`t1` `t3` straight_join `test`.`t1` `t4` where ((`test`.`t3`.`k` = `test`.`t2`.`b`) and (`test`.`t4`.`k` = `test`.`t1`.`b`) and (`test`.`t2`.`k` = 1) and (1 = (`test`.`t1`.`b` + 0)))
4604 select *
4605 from t1
4606 straight_join t1 as t2 on t2.k = t1.b+0
4607 straight_join t1 as t3 on t3.k = t2.b
4608 straight_join t1 as t4 on t4.k = t1.b
4609 where t2.k = 1;
4610 k b k b k b k b
4611 1 1 1 1 1 1 1 1
4612 2 1 1 1 1 1 1 1
4613 3 1 1 1 1 1 1 1
4614 4 1 1 1 1 1 1 1
4615 drop table t1;
4616 set global debug='+d,max_64rows_in_spj_batches';
4617 create table t1 (
4618 a int not null auto_increment,
4619 b char(255) not null,
4620 c int not null,
4621 d char(255) not null,
4622 primary key (`a`,`b`)
4623 ) engine=ndbcluster
4624 comment="NDB_TABLE=PARTITION_BALANCE=FOR_RP_BY_LDM";
4625 explain
4626 select count(*)
4627 from t1
4628 join t1 as t2 on t2.a = t1.c and t2.b = t1.d
4629 join t1 as t3 on t3.a = t2.c and t3.b = t2.d;
4630 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
4631 1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 3000 100.00 NULL
4632 1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 1024 test.t1.c,test.t1.d 1 100.00 Using join buffer (Batched Key Access)
4633 1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 1024 test.t2.c,test.t2.d 1 100.00 Using join buffer (Batched Key Access)
4634 Warnings:
4635 Note 1003 Can't push table 't2' as child, access type 'Batched-key' not implemented
4636 Note 1003 Can't push table 't3' as child, access type 'Batched-key' not implemented
4637 Note 1003 /* select#1 */ select count(0) AS `count(*)` from `test`.`t1` join `test`.`t1` `t2` join `test`.`t1` `t3` where ((`test`.`t2`.`b` = `test`.`t1`.`d`) and (`test`.`t2`.`a` = `test`.`t1`.`c`) and (`test`.`t3`.`b` = `test`.`t2`.`d`) and (`test`.`t3`.`a` = `test`.`t2`.`c`))
4638 select count(*)
4639 from t1
4640 join t1 as t2 on t2.a = t1.c and t2.b = t1.d
4641 join t1 as t3 on t3.a = t2.c and t3.b = t2.d;
4642 count(*)
4643 2996
4644 explain
4645 select count(*)
4646 from t1
4647 join t1 as t2 on t2.a = t1.c
4648 join t1 as t3 on t3.a = t2.c and t3.b = t2.d;
4649 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
4650 1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 3000 100.00 NULL
4651 1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.t1.c 30 100.00 Using join buffer (Batched Key Access)
4652 1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 1024 test.t2.c,test.t2.d 1 100.00 Using join buffer (Batched Key Access)
4653 Warnings:
4654 Note 1003 Can't push table 't2' as child, access type 'Batched-key' not implemented
4655 Note 1003 Can't push table 't3' as child, access type 'Batched-key' not implemented
4656 Note 1003 /* select#1 */ select count(0) AS `count(*)` from `test`.`t1` join `test`.`t1` `t2` join `test`.`t1` `t3` where ((`test`.`t2`.`a` = `test`.`t1`.`c`) and (`test`.`t3`.`b` = `test`.`t2`.`d`) and (`test`.`t3`.`a` = `test`.`t2`.`c`))
4657 select count(*)
4658 from t1
4659 join t1 as t2 on t2.a = t1.c
4660 join t1 as t3 on t3.a = t2.c and t3.b = t2.d;
4661 count(*)
4662 8990
4663 explain
4664 select count(*)
4665 from t1
4666 join t1 as t2 on t2.a = t1.c and t2.b = t1.d
4667 join t1 as t3 on t3.a = t2.c;
4668 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
4669 1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 3000 100.00 NULL
4670 1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 1024 test.t1.c,test.t1.d 1 100.00 Using join buffer (Batched Key Access)
4671 1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.t2.c 30 100.00 Using join buffer (Batched Key Access)
4672 Warnings:
4673 Note 1003 Can't push table 't2' as child, access type 'Batched-key' not implemented
4674 Note 1003 Can't push table 't3' as child, access type 'Batched-key' not implemented
4675 Note 1003 /* select#1 */ select count(0) AS `count(*)` from `test`.`t1` join `test`.`t1` `t2` join `test`.`t1` `t3` where ((`test`.`t2`.`b` = `test`.`t1`.`d`) and (`test`.`t2`.`a` = `test`.`t1`.`c`) and (`test`.`t3`.`a` = `test`.`t2`.`c`))
4676 select count(*)
4677 from t1
4678 join t1 as t2 on t2.a = t1.c and t2.b = t1.d
4679 join t1 as t3 on t3.a = t2.c;
4680 count(*)
4681 8988
4682 alter table t1 partition by key(a);
4683 explain
4684 select count(*)
4685 from t1
4686 join t1 as t2 on t2.a = t1.c
4687 join t1 as t3 on t3.a = t2.c and t3.b = t2.d;
4688 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
4689 1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 3000 100.00 NULL
4690 1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.t1.c 30 100.00 Using join buffer (Batched Key Access)
4691 1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 1024 test.t2.c,test.t2.d 1 100.00 Using join buffer (Batched Key Access)
4692 Warnings:
4693 Note 1003 Can't push table 't2' as child, access type 'Batched-key' not implemented
4694 Note 1003 Can't push table 't3' as child, access type 'Batched-key' not implemented
4695 Note 1003 /* select#1 */ select count(0) AS `count(*)` from `test`.`t1` join `test`.`t1` `t2` join `test`.`t1` `t3` where ((`test`.`t2`.`a` = `test`.`t1`.`c`) and (`test`.`t3`.`b` = `test`.`t2`.`d`) and (`test`.`t3`.`a` = `test`.`t2`.`c`))
4696 select count(*)
4697 from t1
4698 join t1 as t2 on t2.a = t1.c
4699 join t1 as t3 on t3.a = t2.c and t3.b = t2.d;
4700 count(*)
4701 8990
4702 drop table t1;
4703 set global debug=@save_debug;
4704 create logfile group lg1
4705 add undofile 'undofile.dat'
4706 initial_size 1m
4707 undo_buffer_size = 1m
4708 engine=ndb;
4709 create tablespace ts1
4710 add datafile 'datafile.dat'
4711 use logfile group lg1
4712 initial_size 6m
4713 engine ndb;
4714 create table t1 (a int not null,
4715 b int not null storage disk,
4716 c int not null storage memory,
4717 primary key(a))
4718 tablespace ts1 storage disk engine = ndb
4719 comment="NDB_TABLE=PARTITION_BALANCE=FOR_RP_BY_LDM";
4720 insert into t1 values (10, 11, 11);
4721 insert into t1 values (11, 12, 12);
4722 insert into t1 values (12, 13, 13);
4723 create table t2 (a int not null,
4724 b int not null, primary key(a)) engine = ndb
4725 comment="NDB_TABLE=PARTITION_BALANCE=FOR_RP_BY_LDM";
4726 insert into t2 values (10, 11);
4727 insert into t2 values (11, 12);
4728 insert into t2 values (12, 13);
4729 explain select * from t1, t2 where t1.c = t2.a;
4730 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
4731 1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 3 100.00 NULL
4732 1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.t1.c 1 100.00 Using join buffer (Batched Key Access)
4733 Warnings:
4734 Note 1003 Can't push table 't2' as child, access type 'Batched-key' not implemented
4735 Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t1` join `test`.`t2` where (`test`.`t2`.`a` = `test`.`t1`.`c`)
4736 select * from t1, t2 where t1.c = t2.a;
4737 a b c a b
4738 10 11 11 11 12
4739 11 12 12 12 13
4740 explain select * from t1, t2 where t1.a=11 and t1.c = t2.a;
4741 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
4742 1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 const 1 100.00 NULL
4743 1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.t1.c 1 100.00 Using join buffer (Batched Key Access)
4744 Warnings:
4745 Note 1003 Can't push table 't2' as child, access type 'Batched-key' not implemented
4746 Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t1` join `test`.`t2` where ((`test`.`t2`.`a` = `test`.`t1`.`c`) and (`test`.`t1`.`a` = 11))
4747 select * from t1, t2 where t1.a=11 and t1.c = t2.a;
4748 a b c a b
4749 11 12 12 12 13
4750 explain select * from t2, t1 where t2.b = t1.a;
4751 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
4752 1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 3 100.00 NULL
4753 1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.t2.b 1 100.00 Using join buffer (Batched Key Access)
4754 Warnings:
4755 Note 1003 Can't push table 't1' as child, access type 'Batched-key' not implemented
4756 Note 1003 /* select#1 */ select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c` from `test`.`t2` join `test`.`t1` where (`test`.`t1`.`a` = `test`.`t2`.`b`)
4757 select * from t2, t1 where t2.b = t1.a;
4758 a b a b c
4759 10 11 11 12 12
4760 11 12 12 13 13
4761 explain select * from t2, t1 where t2.a=11 and t2.b = t1.a;
4762 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
4763 1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 const 1 100.00 NULL
4764 1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.t2.b 1 100.00 Using join buffer (Batched Key Access)
4765 Warnings:
4766 Note 1003 Can't push table 't1' as child, access type 'Batched-key' not implemented
4767 Note 1003 /* select#1 */ select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c` from `test`.`t2` join `test`.`t1` where ((`test`.`t1`.`a` = `test`.`t2`.`b`) and (`test`.`t2`.`a` = 11))
4768 select * from t2, t1 where t2.a=11 and t2.b = t1.a;
4769 a b a b c
4770 11 12 12 13 13
4771 explain select t1.a, t1.c, t2.a, t2.b from t1, t2 where t1.b = t2.a;
4772 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
4773 1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 3 100.00 NULL
4774 1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.t1.b 1 100.00 Using join buffer (Batched Key Access)
4775 Warnings:
4776 Note 1003 Can't push table 't2' as child, access type 'Batched-key' not implemented
4777 Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`c` AS `c`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t1` join `test`.`t2` where (`test`.`t2`.`a` = `test`.`t1`.`b`)
4778 select t1.a, t1.c, t2.a, t2.b from t1, t2 where t1.b = t2.a;
4779 a c a b
4780 10 11 11 12
4781 11 12 12 13
4782 explain select t1.a, t1.c, t2.a, t2.b from t1, t2 where t1.a=11 and t1.b = t2.a;
4783 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
4784 1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 const 1 100.00 NULL
4785 1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.t1.b 1 100.00 Using join buffer (Batched Key Access)
4786 Warnings:
4787 Note 1003 Can't push table 't2' as child, access type 'Batched-key' not implemented
4788 Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`c` AS `c`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t1` join `test`.`t2` where ((`test`.`t2`.`a` = `test`.`t1`.`b`) and (`test`.`t1`.`a` = 11))
4789 select t1.a, t1.c, t2.a, t2.b from t1, t2 where t1.a=11 and t1.b = t2.a;
4790 a c a b
4791 11 12 12 13
4792 drop table t1;
4793 drop table t2;
4794 alter tablespace ts1
4795 drop datafile 'datafile.dat';
4796 drop tablespace ts1;
4797 drop logfile group lg1
4798 engine ndb;
4799 create temporary table old_count
4800 select counter_name, sum(val) as val
4801 from ndbinfo.counters
4802 where block_name='DBSPJ'
4803 group by counter_name;
4804 create table t1 (a int not null,
4805 b int not null,
4806 c int not null,
4807 primary key(a))
4808 engine = ndb
4809 partition by key() partitions 8;
4810 insert into t1 values (1, 2, 2);
4811 insert into t1 values (2, 3, 3);
4812 insert into t1 values (3, 4, 4);
4813 select * from t1 t1, t1 t2 where t1.a = 2 and t2.a = t1.b;
4814 a b c a b c
4815 2 3 3 3 4 4
4816 select count(*) from t1 t1, t1 t2 where t2.a = t1.b;
4817 count(*)
4818 2
4819 select count(*) from t1 t1, t1 t2 where t1.a >= 2 and t2.a = t1.b;
4820 count(*)
4821 1
4822 create temporary table new_count
4823 select counter_name, sum(val) as val
4824 from ndbinfo.counters
4825 where block_name='DBSPJ'
4826 group by counter_name;
4827 select new_count.counter_name, new_count.val - old_count.val
4828 from new_count, old_count
4829 where new_count.counter_name = old_count.counter_name
4830 and new_count.counter_name <> 'LOCAL_READS_SENT'
4831 and new_count.counter_name <> 'REMOTE_READS_SENT';
4832 counter_name new_count.val - old_count.val
4833 CONST_PRUNED_RANGE_SCANS_RECEIVED 0
4834 LOCAL_RANGE_SCANS_SENT 0
4835 LOCAL_TABLE_SCANS_SENT 0
4836 PRUNED_RANGE_SCANS_RECEIVED 0
4837 RANGE_SCANS_RECEIVED 0
4838 READS_NOT_FOUND 0
4839 READS_RECEIVED 0
4840 REMOTE_RANGE_SCANS_SENT 0
4841 SCAN_BATCHES_RETURNED 0
4842 SCAN_ROWS_RETURNED 0
4843 TABLE_SCANS_RECEIVED 0
4844 select 'READS_SENT', sum(new_count.val - old_count.val)
4845 from new_count, old_count
4846 where new_count.counter_name = old_count.counter_name
4847 and (new_count.counter_name = 'LOCAL_READS_SENT'
4848 or new_count.counter_name = 'REMOTE_READS_SENT');
4849 READS_SENT sum(new_count.val - old_count.val)
4850 READS_SENT 0
4851 drop table old_count;
4852 drop table new_count;
4853 drop table t1;
4854 create table t1 (
4855 a int primary key,
4856 b int,
4857 c int) engine = ndb
4858 comment="NDB_TABLE=PARTITION_BALANCE=FOR_RP_BY_LDM";
4859 insert into t1 values (1, 2, 3);
4860 insert into t1 values (2, 3, 4);
4861 insert into t1 values (3, 4, 5);
4862 explain select * from t1 x, t1 y where x.b=y.a and x.c=4;
4863 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
4864 1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL # # Using pushed condition ((`test`.`x`.`c` = 4) and (`test`.`x`.`b` is not null))
4865 1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.x.b # # Using join buffer (Batched Key Access)
4866 Warnings:
4867 Note 1003 Can't push table 'y' as child, access type 'Batched-key' not implemented
4868 Note 1003 /* select#1 */ select `test`.`x`.`a` AS `a`,`test`.`x`.`b` AS `b`,`test`.`x`.`c` AS `c`,`test`.`y`.`a` AS `a`,`test`.`y`.`b` AS `b`,`test`.`y`.`c` AS `c` from `test`.`t1` `x` join `test`.`t1` `y` where ((`test`.`x`.`c` = 4) and (`test`.`y`.`a` = `test`.`x`.`b`))
4869 select * from t1 x, t1 y where x.b=y.a and x.c=4;
4870 a b c a b c
4871 2 3 4 3 4 5
4872 lookups
4873 0
4874 explain select * from t1 x, t1 y, t1 z where x.b=y.a and y.c=4 and y.b=z.a;
4875 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
4876 1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL # # Using pushed condition (`test`.`x`.`b` is not null)
4877 1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.x.b # # Using pushed condition ((`test`.`y`.`c` = 4) and (`test`.`y`.`b` is not null)); Using join buffer (Batched Key Access)
4878 1 SIMPLE z p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.y.b # # Using join buffer (Batched Key Access)
4879 Warnings:
4880 Note 1003 Can't push table 'y' as child, access type 'Batched-key' not implemented
4881 Note 1003 Can't push table 'z' as child, access type 'Batched-key' not implemented
4882 Note 1003 /* select#1 */ select `test`.`x`.`a` AS `a`,`test`.`x`.`b` AS `b`,`test`.`x`.`c` AS `c`,`test`.`y`.`a` AS `a`,`test`.`y`.`b` AS `b`,`test`.`y`.`c` AS `c`,`test`.`z`.`a` AS `a`,`test`.`z`.`b` AS `b`,`test`.`z`.`c` AS `c` from `test`.`t1` `x` join `test`.`t1` `y` join `test`.`t1` `z` where ((`test`.`z`.`a` = `test`.`y`.`b`) and (`test`.`y`.`c` = 4) and (`test`.`y`.`a` = `test`.`x`.`b`))
4883 select * from t1 x, t1 y, t1 z where x.b=y.a and y.c=4 and y.b=z.a;
4884 a b c a b c a b c
4885 1 2 3 2 3 4 3 4 5
4886 lookups
4887 0
4888 drop table t1;
4889 create table t1(
4890 a int not null,
4891 b int not null,
4892 c int not null,
4893 primary key(a,b))
4894 engine = ndb
4895 comment="NDB_TABLE=PARTITION_BALANCE=FOR_RP_BY_LDM"
4896 partition by key (a);
4897 insert into t1 values (10, 10, 11);
4898 insert into t1 values (11, 11, 12);
4899 insert into t1 values (12, 12, 13);
4900 select * from t1 t1, t1 t2
4901 where t1.a = 10 and t1.b = 10 and
4902 t2.a = t1.c and t2.b = t1.c;
4903 a b c a b c
4904 10 10 11 11 11 12
4905 create temporary table server_counts
4906 select * from performance_schema.global_status
4907 where variable_name in
4908 ('Ndb_scan_count',
4909 'Ndb_pruned_scan_count',
4910 'Ndb_sorted_scan_count',
4911 'Ndb_pushed_queries_defined',
4912 'Ndb_pushed_queries_dropped',
4913 'Ndb_pushed_reads');
4914 select * from t1 t1, t1 t2
4915 where t1.a = 11 and t1.b = 11 and
4916 t2.a = t1.c and t2.b = t1.c;
4917 a b c a b c
4918 11 11 12 12 12 13
4919 select * from t1 t1, t1 t2
4920 where t2.a = t1.c and t2.b = t1.c
4921 order by t1.a;
4922 a b c a b c
4923 10 10 11 11 11 12
4924 11 11 12 12 12 13
4925 select count(*) from t1 t1, t1 t2
4926 where t1.a = 11 and
4927 t2.a = t1.c and t2.b = t1.c;
4928 count(*)
4929 1
4930 select new.variable_name, new.variable_value - old.variable_value
4931 from server_counts as old,
4932 performance_schema.global_status as new
4933 where new.variable_name = old.variable_name
4934 order by new.variable_name;
4935 variable_name new.variable_value - old.variable_value
4936 Ndb_pruned_scan_count 1
4937 Ndb_pushed_queries_defined 0
4938 Ndb_pushed_queries_dropped 0
4939 Ndb_pushed_reads 0
4940 Ndb_scan_count 2
4941 Ndb_sorted_scan_count 0
4942 drop table server_counts;
4943 drop table t1;
4944 create table t1(
4945 d int not null,
4946 c int not null,
4947 a int not null,
4948 b int not null,
4949 primary key using hash (a,b))
4950 engine = ndb
4951 comment="NDB_TABLE=PARTITION_BALANCE=FOR_RP_BY_LDM"
4952 partition by key (a);
4953 insert into t1(a,b,c,d) values (10, 10, 11, 11);
4954 insert into t1(a,b,c,d) values (11, 11, 12, 12);
4955 insert into t1(a,b,c,d) values (12, 12, 13, 13);
4956 create index i1 on t1(c,a);
4957 select count(*) from t1 t1, t1 t2 where t1.c = 12 and t1.a = 11 and t2.a = t1.d and t2.b = t1.d;
4958 count(*)
4959 1
4960 drop index i1 on t1;
4961 pruned_scan_count
4962 1
4963 create index i2 on t1(a,b);
4964 select count(*) from t1 t1, t1 t2 where t1.a = 11 and t1.b<13 and t2.a = t1.c and t2.b = t1.c;
4965 count(*)
4966 1
4967 pruned_scan_count
4968 1
4969 select count(*) from t1 t1, t1 t2 where t1.a >= 12 and t1.a<=12 and t2.a = t1.c and t2.b = t1.c;
4970 count(*)
4971 0
4972 pruned_scan_count
4973 1
4974 select count(*) from t1 t1, t1 t2 where t1.a >= 11 and t1.a<=12 and t2.a = t1.c and t2.b = t1.c;
4975 count(*)
4976 1
4977 pruned_scan_count
4978 0
4979 select count(*) from t1 t1, t1 t2 where (t1.a = 10 or t1.a=12) and t1.b<13 and t2.a = t1.c and t2.b = t1.c;
4980 count(*)
4981 1
4982 pruned_scan_count
4983 0
4984 select count(*) from t1 t1, t1 t2 where t1.a = 10 and (t1.b<11 or t1.b>11) and t2.a = t1.c and t2.b = t1.c;
4985 count(*)
4986 1
4987 pruned_scan_count
4988 1
4989 drop table t1;
4990 create table t2(
4991 d int not null,
4992 e int not null,
4993 f int not null,
4994 a int not null,
4995 b int not null,
4996 c int not null,
4997 primary key using hash (a,b,c))
4998 engine = ndb
4999 comment="NDB_TABLE=PARTITION_BALANCE=FOR_RP_BY_LDM"
5000 partition by key (b,a);
5001 insert into t2(a,b,c,d,e,f) values (1, 2, 3, 1, 2, 3);
5002 insert into t2(a,b,c,d,e,f) values (1, 2, 4, 1, 2, 3);
5003 insert into t2(a,b,c,d,e,f) values (2, 3, 4, 1, 2, 3);
5004 insert into t2(a,b,c,d,e,f) values (3, 4, 5, 1, 2, 3);
5005 insert into t2(a,b,c,d,e,f) values (4, 5, 6, 1, 2, 3);
5006 insert into t2(a,b,c,d,e,f) values (5, 6, 7, 1, 2, 3);
5007 insert into t2(a,b,c,d,e,f) values (6, 7, 8, 1, 2, 3);
5008 insert into t2(a,b,c,d,e,f) values (7, 8, 9, 1, 2, 3);
5009 create index i2_1 on t2(d, a, b, e);
5010 select count(*) from t2 x, t2 y where x.d=1 and x.a=1 and x.b=2 and y.a=x.d and y.b=x.e and y.c=3;
5011 count(*)
5012 2
5013 pruned_scan_count
5014 1
5015 drop index i2_1 on t2;
5016 create index i2_3 on t2(a, d, b, e);
5017 set optimizer_switch='condition_fanout_filter=off';
5018 select count(*) from t2 x, t2 y where x.d=1 and x.a=1 and x.b=2 and y.a=x.d and y.b=x.e and y.c=3;
5019 count(*)
5020 2
5021 set optimizer_switch='condition_fanout_filter=default';
5022 pruned_scan_count
5023 1
5024 drop table t2;
5025 create table t1 (a binary(10) primary key, b binary(10) not null) engine = ndb
5026 comment="NDB_TABLE=PARTITION_BALANCE=FOR_RP_BY_LDM";
5027 insert into t1 values ('\0123456789', '1234567890');
5028 insert into t1 values ('1234567890', '\0123456789');
5029 explain
5030 select count(*)
5031 from t1 join t1 as t2 on t2.a = t1.b
5032 where t1.a = '\0123456789';
5033 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
5034 1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 10 const 1 100.00 Using where
5035 1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 10 test.t1.b 1 100.00 Using join buffer (Batched Key Access)
5036 Warnings:
5037 Note 1003 Can't push table 't2' as child, access type 'Batched-key' not implemented
5038 Note 1003 /* select#1 */ select count(0) AS `count(*)` from `test`.`t1` join `test`.`t1` `t2` where ((`test`.`t2`.`a` = `test`.`t1`.`b`) and (`test`.`t1`.`a` = '\0123456789'))
5039 select count(*)
5040 from t1 join t1 as t2 on t2.a = t1.b
5041 where t1.a = '\0123456789';
5042 count(*)
5043 1
5044 drop table t1;
5045 create table t1 (pk int primary key, a int unique key) engine = ndb
5046 comment="NDB_TABLE=PARTITION_BALANCE=FOR_RP_BY_LDM";
5047 insert into t1 values (1,10), (2,20), (3,30);
5048 set ndb_join_pushdown = false;
5049 explain
5050 select * from t1 as x right join t1 as y
5051 on x.pk = y.pk
5052 and x.pk = y.a
5053 and x.a = y.pk
5054 where y.pk = 2;
5055 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
5056 1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 const PRIMARY PRIMARY 4 const 1 100.00 NULL
5057 1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 const PRIMARY,a PRIMARY 4 const 1 100.00 Impossible ON condition
5058 Warnings:
5059 Note 1003 /* select#1 */ select NULL AS `pk`,NULL AS `a`,'2' AS `pk`,'20' AS `a` from `test`.`t1` `y` left join `test`.`t1` `x` on((multiple equal(2, NULL, NULL))) where true
5060 select * from t1 as x right join t1 as y
5061 on x.pk = y.pk
5062 and x.pk = y.a
5063 and x.a = y.pk
5064 where y.pk = 2;
5065 pk a pk a
5066 NULL NULL 2 20
5067 set ndb_join_pushdown = true;
5068 explain
5069 select * from t1 as x right join t1 as y
5070 on x.pk = y.pk
5071 and x.pk = y.a
5072 and x.a = y.pk
5073 where y.pk = 2;
5074 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
5075 1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 const 1 100.00 NULL
5076 1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY,a PRIMARY 4 const 1 100.00 Using where; Using pushed condition (`test`.`x`.`a` = 2); Using join buffer (Batched Key Access)
5077 Warnings:
5078 Note 1003 Can't push table 'x' as child, access type 'Batched-key' not implemented
5079 Note 1003 /* select#1 */ select `test`.`x`.`pk` AS `pk`,`test`.`x`.`a` AS `a`,`test`.`y`.`pk` AS `pk`,`test`.`y`.`a` AS `a` from `test`.`t1` `y` left join `test`.`t1` `x` on(((`test`.`y`.`a` = 2) and (`test`.`x`.`pk` = 2) and (`test`.`x`.`a` = 2))) where (`test`.`y`.`pk` = 2)
5080 select * from t1 as x right join t1 as y
5081 on x.pk = y.pk
5082 and x.pk = y.a
5083 and x.a = y.pk
5084 where y.pk = 2;
5085 pk a pk a
5086 NULL NULL 2 20
5087 drop table t1;
5088 create table t1 (pk int primary key, u int not null, a int, b int) engine=ndb
5089 comment="NDB_TABLE=PARTITION_BALANCE=FOR_RP_BY_LDM";
5090 create index ix1 on t1(b,a);
5091 insert into t1 values (0,1,10,20);
5092 insert into t1 values (1,2,20,30);
5093 insert into t1 values (2,3,30,40);
5094 explain select * from t1 as x join t1 as y join t1 as z on x.u=y.pk and y.a=z.b;
5095 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
5096 1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL # # NULL
5097 1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.x.u # # Using pushed condition (`test`.`y`.`a` is not null); Using join buffer (Batched Key Access)
5098 1 SIMPLE z p0,p1,p2,p3,p4,p5,p6,p7 ref ix1 ix1 5 test.y.a # # Using join buffer (Batched Key Access)
5099 Warnings:
5100 Note 1003 Can't push table 'y' as child, access type 'Batched-key' not implemented
5101 Note 1003 Can't push table 'z' as child, access type 'Batched-key' not implemented
5102 Note 1003 /* select#1 */ select `test`.`x`.`pk` AS `pk`,`test`.`x`.`u` AS `u`,`test`.`x`.`a` AS `a`,`test`.`x`.`b` AS `b`,`test`.`y`.`pk` AS `pk`,`test`.`y`.`u` AS `u`,`test`.`y`.`a` AS `a`,`test`.`y`.`b` AS `b`,`test`.`z`.`pk` AS `pk`,`test`.`z`.`u` AS `u`,`test`.`z`.`a` AS `a`,`test`.`z`.`b` AS `b` from `test`.`t1` `x` join `test`.`t1` `y` join `test`.`t1` `z` where ((`test`.`z`.`b` = `test`.`y`.`a`) and (`test`.`y`.`pk` = `test`.`x`.`u`))
5103 select * from t1 as x join t1 as y join t1 as z on x.u=y.pk and y.a=z.b;
5104 pk u a b pk u a b pk u a b
5105 0 1 10 20 1 2 20 30 0 1 10 20
5106 1 2 20 30 2 3 30 40 1 2 20 30
5107 drop table t1;
5108 create table t1 (pk int primary key, u int not null) engine=ndb
5109 comment="NDB_TABLE=PARTITION_BALANCE=FOR_RP_BY_LDM";
5110 insert into t1 values (0,-1), (1,-1), (2,-1), (3,-1), (4,-1), (5,-1), (6,-1),
5111 (7,-1), (8,-1), (9,-1), (10,-1), (11,-1), (12,-1), (13,-1), (14,-1), (15,-1),
5112 (16,-1), (17,-1), (18,-1), (19,-1), (20,-1), (21,-1), (22,-1), (23,-1),
5113 (24,-1), (25,-1), (26,-1), (27,-1), (28,-1), (29,-1), (30,-1), (31,-1),
5114 (32,-1), (33,-1), (34,-1), (35,-1), (36,-1), (37,-1), (38,-1), (39,-1),
5115 (40,-1), (41,-1), (42,-1), (43,-1), (44,-1), (45,-1), (46,-1), (47,-1),
5116 (48,-1), (49,-1), (50,-1), (51,-1), (52,-1), (53,-1), (54,-1), (55,-1),
5117 (56,-1), (57,-1), (58,-1), (59,-1), (60,-1), (61,-1), (62,-1), (63,-1),
5118 (64,-1), (65,-1), (66,-1), (67,-1), (68,-1), (69,-1), (70,-1), (71,-1),
5119 (72,-1), (73,-1), (74,-1), (75,-1), (76,-1), (77,-1), (78,-1), (79,-1),
5120 (80,-1), (81,-1), (82,-1), (83,-1), (84,-1), (85,-1), (86,-1), (87,-1),
5121 (88,-1), (89,-1), (90,-1), (91,-1), (92,-1), (93,-1), (94,-1), (95,-1),
5122 (96,-1), (97,-1), (98,-1), (99,-1), (100,-1), (101,-1), (102,-1), (103,-1),
5123 (104,-1), (105,-1), (106,-1), (107,-1), (108,-1), (109,-1), (110,-1),
5124 (111,-1), (112,-1), (113,-1), (114,-1), (115,-1), (116,-1), (117,-1),
5125 (118,-1), (119,-1), (120,-1), (121,-1), (122,-1), (123,-1), (124,-1),
5126 (125,-1), (126,-1), (127,-1), (128,-1), (129,-1), (130,-1), (131,-1),
5127 (132,-1), (133,-1), (134,-1), (135,-1), (136,-1), (137,-1), (138,-1), (139,-1);
5128 set global debug='+d,max_64rows_in_spj_batches';
5129 explain select * from t1 as x join t1 as y on x.u=y.pk order by(x.pk);
5130 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
5131 1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 140 100.00 Using temporary; Using filesort
5132 1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.x.u 1 100.00 Using join buffer (Batched Key Access)
5133 Warnings:
5134 Note 1003 Can't push table 'y' as child, access type 'Batched-key' not implemented
5135 Note 1003 /* select#1 */ select `test`.`x`.`pk` AS `pk`,`test`.`x`.`u` AS `u`,`test`.`y`.`pk` AS `pk`,`test`.`y`.`u` AS `u` from `test`.`t1` `x` join `test`.`t1` `y` where (`test`.`y`.`pk` = `test`.`x`.`u`) order by `test`.`x`.`pk`
5136 select * from t1 as x join t1 as y on x.u=y.pk order by(x.pk);
5137 pk u pk u
5138 set global debug=@save_debug;
5139 drop table t1;
5140 create table t1 (pk int primary key, u int not null, a int, b int) engine=ndb
5141 comment="NDB_TABLE=PARTITION_BALANCE=FOR_RP_BY_LDM";
5142 create index ix1 on t1(b,a);
5143 create unique index ix2 on t1(u);
5144 insert into t1 values (0,0,10,10);
5145 insert into t1 values (1,1,10,10);
5146 insert into t1 values (2,2,10,10);
5147 insert into t1 values (3,3,10,10);
5148 insert into t1 values (4,4,10,10);
5149 insert into t1 values (5,5,10,10);
5150 insert into t1 values (6,6,10,10);
5151 insert into t1 values (7,7,10,10);
5152 insert into t1 values (8,8,10,10);
5153 insert into t1 values (9,9,10,10);
5154 insert into t1 values (10,10,10,10);
5155 insert into t1 values (11,11,10,10);
5156 explain select count(*) from t1 as x1 join t1 as x2 join t1 as x3
5157 on x1.a=x2.u and x2.a = x3.b;
5158 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
5159 1 SIMPLE x1 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 12 100.00 Using pushed condition (`test`.`x1`.`a` is not null)
5160 1 SIMPLE x2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref ix2 ix2 4 test.x1.a 1 100.00 Using pushed condition (`test`.`x2`.`a` is not null); Using join buffer (Batched Key Access)
5161 1 SIMPLE x3 p0,p1,p2,p3,p4,p5,p6,p7 ref ix1 ix1 5 test.x2.a 2 100.00 Using join buffer (Batched Key Access)
5162 Warnings:
5163 Note 1003 Can't push table 'x2' as child, access type 'Batched-key' not implemented
5164 Note 1003 Can't push table 'x3' as child, access type 'Batched-key' not implemented
5165 Note 1003 /* select#1 */ select count(0) AS `count(*)` from `test`.`t1` `x1` join `test`.`t1` `x2` join `test`.`t1` `x3` where ((`test`.`x3`.`b` = `test`.`x2`.`a`) and (`test`.`x2`.`u` = `test`.`x1`.`a`))
5166 select count(*) from t1 as x1 join t1 as x2 join t1 as x3
5167 on x1.a=x2.u and x2.a = x3.b;
5168 count(*)
5169 144
5170 explain select count(*) from t1 as x1, t1 as x2, t1 as x3
5171 where x1.u=x2.pk and x1.a=x3.b;
5172 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
5173 1 SIMPLE x1 p0,p1,p2,p3,p4,p5,p6,p7 ALL ix2 NULL NULL NULL 12 100.00 Using pushed condition (`test`.`x1`.`a` is not null)
5174 1 SIMPLE x2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.x1.u 1 100.00 Using join buffer (Batched Key Access)
5175 1 SIMPLE x3 p0,p1,p2,p3,p4,p5,p6,p7 ref ix1 ix1 5 test.x1.a 2 100.00 Using join buffer (Batched Key Access)
5176 Warnings:
5177 Note 1003 Can't push table 'x2' as child, access type 'Batched-key' not implemented
5178 Note 1003 Can't push table 'x3' as child, access type 'Batched-key' not implemented
5179 Note 1003 /* select#1 */ select count(0) AS `count(*)` from `test`.`t1` `x1` join `test`.`t1` `x2` join `test`.`t1` `x3` where ((`test`.`x3`.`b` = `test`.`x1`.`a`) and (`test`.`x2`.`pk` = `test`.`x1`.`u`))
5180 select count(*) from t1 as x1, t1 as x2, t1 as x3
5181 where x1.u=x2.pk and x1.a=x3.b;
5182 count(*)
5183 144
5184 insert into t1 values (12,12,20,10);
5185 explain select count(*) from t1 as x1 left join t1 as x2 on x1.a=x2.b;
5186 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
5187 1 SIMPLE x1 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 13 100.00 NULL
5188 1 SIMPLE x2 p0,p1,p2,p3,p4,p5,p6,p7 ref ix1 ix1 5 test.x1.a 2 100.00 Using join buffer (Batched Key Access)
5189 Warnings:
5190 Note 1003 Can't push table 'x2' as child, access type 'Batched-key' not implemented
5191 Note 1003 /* select#1 */ select count(0) AS `count(*)` from `test`.`t1` `x1` left join `test`.`t1` `x2` on((`test`.`x2`.`b` = `test`.`x1`.`a`)) where true
5192 select count(*) from t1 as x1 left join t1 as x2 on x1.a=x2.b;
5193 count(*)
5194 157
5195 set ndb_join_pushdown=off;
5196 select count(*) from t1 as x1 left join t1 as x2 on x1.a=x2.b;
5197 count(*)
5198 157
5199 set ndb_join_pushdown=on;
5200 explain select count(*) from t1 as x1
5201 left join t1 as x2 on x1.u=x2.pk
5202 left join t1 as x3 on x2.a=x3.b;
5203 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
5204 1 SIMPLE x1 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 13 100.00 NULL
5205 1 SIMPLE x2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.x1.u 1 100.00 Using join buffer (Batched Key Access)
5206 1 SIMPLE x3 p0,p1,p2,p3,p4,p5,p6,p7 ref ix1 ix1 5 test.x2.a 2 100.00 Using join buffer (Batched Key Access)
5207 Warnings:
5208 Note 1003 Can't push table 'x2' as child, access type 'Batched-key' not implemented
5209 Note 1003 Can't push table 'x3' as child, access type 'Batched-key' not implemented
5210 Note 1003 /* select#1 */ select count(0) AS `count(*)` from `test`.`t1` `x1` left join `test`.`t1` `x2` on((`test`.`x2`.`pk` = `test`.`x1`.`u`)) left join `test`.`t1` `x3` on((`test`.`x3`.`b` = `test`.`x2`.`a`)) where true
5211 select count(*) from t1 as x1
5212 left join t1 as x2 on x1.u=x2.pk
5213 left join t1 as x3 on x2.a=x3.b;
5214 count(*)
5215 157
5216 set ndb_join_pushdown=off;
5217 select count(*) from t1 as x1
5218 left join t1 as x2 on x1.u=x2.pk
5219 left join t1 as x3 on x2.a=x3.b;
5220 count(*)
5221 157
5222 set ndb_join_pushdown=on;
5223 explain select count(*) from t1 as x1
5224 left join t1 as x2 on x1.u=x2.pk
5225 left join t1 as x3 on x2.a=x3.b
5226 left join t1 as x4 on x3.u=x4.pk
5227 left join t1 as x5 on x4.a=x5.b;
5228 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
5229 1 SIMPLE x1 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 13 100.00 NULL
5230 1 SIMPLE x2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.x1.u 1 100.00 Using join buffer (Batched Key Access)
5231 1 SIMPLE x3 p0,p1,p2,p3,p4,p5,p6,p7 ref ix1 ix1 5 test.x2.a 2 100.00 Using join buffer (Batched Key Access)
5232 1 SIMPLE x4 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.x3.u 1 100.00 Using join buffer (Batched Key Access)
5233 1 SIMPLE x5 p0,p1,p2,p3,p4,p5,p6,p7 ref ix1 ix1 5 test.x4.a 2 100.00 Using join buffer (Batched Key Access)
5234 Warnings:
5235 Note 1003 Can't push table 'x2' as child, access type 'Batched-key' not implemented
5236 Note 1003 Can't push table 'x3' as child, access type 'Batched-key' not implemented
5237 Note 1003 Can't push table 'x4' as child, access type 'Batched-key' not implemented
5238 Note 1003 Can't push table 'x5' as child, access type 'Batched-key' not implemented
5239 Note 1003 /* select#1 */ select count(0) AS `count(*)` from `test`.`t1` `x1` left join `test`.`t1` `x2` on((`test`.`x2`.`pk` = `test`.`x1`.`u`)) left join `test`.`t1` `x3` on((`test`.`x3`.`b` = `test`.`x2`.`a`)) left join `test`.`t1` `x4` on((`test`.`x4`.`pk` = `test`.`x3`.`u`)) left join `test`.`t1` `x5` on((`test`.`x5`.`b` = `test`.`x4`.`a`)) where true
5240 select count(*) from t1 as x1
5241 left join t1 as x2 on x1.u=x2.pk
5242 left join t1 as x3 on x2.a=x3.b
5243 left join t1 as x4 on x3.u=x4.pk
5244 left join t1 as x5 on x4.a=x5.b;
5245 count(*)
5246 1885
5247 set ndb_join_pushdown=off;
5248 select count(*) from t1 as x1
5249 left join t1 as x2 on x1.u=x2.pk
5250 left join t1 as x3 on x2.a=x3.b
5251 left join t1 as x4 on x3.u=x4.pk
5252 left join t1 as x5 on x4.a=x5.b;
5253 count(*)
5254 1885
5255 set ndb_join_pushdown=on;
5256 explain select count(*) from t1 as x1
5257 join t1 as x2 on x1.a=x2.b
5258 where x1.pk = 1 or x1.u=1;
5259 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
5260 1 SIMPLE x1 p0,p1,p2,p3,p4,p5,p6,p7 index_merge PRIMARY,ix2 ix2,PRIMARY 4,4 NULL 2 100.00 Using sort_union(ix2,PRIMARY); Using pushed condition (((`test`.`x1`.`pk` = 1) or (`test`.`x1`.`u` = 1)) and (`test`.`x1`.`a` is not null))
5261 1 SIMPLE x2 p0,p1,p2,p3,p4,p5,p6,p7 ref ix1 ix1 5 test.x1.a 2 100.00 Using join buffer (Batched Key Access)
5262 Warnings:
5263 Note 1003 Can't push table 'x2' as child, access type 'Batched-key' not implemented
5264 Note 1003 /* select#1 */ select count(0) AS `count(*)` from `test`.`t1` `x1` join `test`.`t1` `x2` where ((`test`.`x2`.`b` = `test`.`x1`.`a`) and ((`test`.`x1`.`pk` = 1) or (`test`.`x1`.`u` = 1)))
5265 select count(*) from t1 as x1
5266 join t1 as x2 on x1.a=x2.b
5267 where x1.pk = 1 or x1.u=1;
5268 count(*)
5269 13
5270 set global debug='+d,max_4rows_in_spj_batches';
5271 set ndb_join_pushdown=on;
5272 explain
5273 select straight_join * from t1 as table1
5274 left join
5275 (t1 as table2 join t1 as table3 on table2.pk = table3.b)
5276 on table1.pk = table2.b;
5277 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
5278 1 SIMPLE table1 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 13 100.00 NULL
5279 1 SIMPLE table2 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY,ix1 ix1 5 test.table1.pk 2 100.00 Using join buffer (Batched Key Access)
5280 1 SIMPLE table3 p0,p1,p2,p3,p4,p5,p6,p7 ref ix1 ix1 5 test.table2.pk 2 100.00 Using join buffer (Batched Key Access)
5281 Warnings:
5282 Note 1003 Can't push table 'table3' as child, access type 'Batched-key' not implemented
5283 Note 1003 Can't push outer joined table 'table2' as child of 'table1', some tables in embedding join-nest(s) are not part of pushed join
5284 Note 1003 /* select#1 */ select straight_join `test`.`table1`.`pk` AS `pk`,`test`.`table1`.`u` AS `u`,`test`.`table1`.`a` AS `a`,`test`.`table1`.`b` AS `b`,`test`.`table2`.`pk` AS `pk`,`test`.`table2`.`u` AS `u`,`test`.`table2`.`a` AS `a`,`test`.`table2`.`b` AS `b`,`test`.`table3`.`pk` AS `pk`,`test`.`table3`.`u` AS `u`,`test`.`table3`.`a` AS `a`,`test`.`table3`.`b` AS `b` from `test`.`t1` `table1` left join (`test`.`t1` `table2` join `test`.`t1` `table3`) on(((`test`.`table3`.`b` = `test`.`table2`.`pk`) and (`test`.`table2`.`b` = `test`.`table1`.`pk`))) where true
5285 select straight_join * from t1 as table1
5286 left join
5287 (t1 as table2 join t1 as table3 on table2.pk = table3.b)
5288 on table1.pk = table2.b;
5289 pk u a b pk u a b pk u a b
5290 0 0 10 10 NULL NULL NULL NULL NULL NULL NULL NULL
5291 1 1 10 10 NULL NULL NULL NULL NULL NULL NULL NULL
5292 10 10 10 10 10 10 10 10 0 0 10 10
5293 10 10 10 10 10 10 10 10 1 1 10 10
5294 10 10 10 10 10 10 10 10 10 10 10 10
5295 10 10 10 10 10 10 10 10 11 11 10 10
5296 10 10 10 10 10 10 10 10 12 12 20 10
5297 10 10 10 10 10 10 10 10 2 2 10 10
5298 10 10 10 10 10 10 10 10 3 3 10 10
5299 10 10 10 10 10 10 10 10 4 4 10 10
5300 10 10 10 10 10 10 10 10 5 5 10 10
5301 10 10 10 10 10 10 10 10 6 6 10 10
5302 10 10 10 10 10 10 10 10 7 7 10 10
5303 10 10 10 10 10 10 10 10 8 8 10 10
5304 10 10 10 10 10 10 10 10 9 9 10 10
5305 11 11 10 10 NULL NULL NULL NULL NULL NULL NULL NULL
5306 12 12 20 10 NULL NULL NULL NULL NULL NULL NULL NULL
5307 2 2 10 10 NULL NULL NULL NULL NULL NULL NULL NULL
5308 3 3 10 10 NULL NULL NULL NULL NULL NULL NULL NULL
5309 4 4 10 10 NULL NULL NULL NULL NULL NULL NULL NULL
5310 5 5 10 10 NULL NULL NULL NULL NULL NULL NULL NULL
5311 6 6 10 10 NULL NULL NULL NULL NULL NULL NULL NULL
5312 7 7 10 10 NULL NULL NULL NULL NULL NULL NULL NULL
5313 8 8 10 10 NULL NULL NULL NULL NULL NULL NULL NULL
5314 9 9 10 10 NULL NULL NULL NULL NULL NULL NULL NULL
5315 set global debug=@save_debug;
5316 explain select straight_join * from t1 as x1
5317 inner join t1 as x2 on x2.b = x1.a;
5318 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
5319 1 SIMPLE x1 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 13 100.00 Using pushed condition (`test`.`x1`.`a` is not null)
5320 1 SIMPLE x2 p0,p1,p2,p3,p4,p5,p6,p7 ref ix1 ix1 5 test.x1.a 2 100.00 Using join buffer (Batched Key Access)
5321 Warnings:
5322 Note 1003 Can't push table 'x2' as child, access type 'Batched-key' not implemented
5323 Note 1003 /* select#1 */ select straight_join `test`.`x1`.`pk` AS `pk`,`test`.`x1`.`u` AS `u`,`test`.`x1`.`a` AS `a`,`test`.`x1`.`b` AS `b`,`test`.`x2`.`pk` AS `pk`,`test`.`x2`.`u` AS `u`,`test`.`x2`.`a` AS `a`,`test`.`x2`.`b` AS `b` from `test`.`t1` `x1` join `test`.`t1` `x2` where (`test`.`x2`.`b` = `test`.`x1`.`a`)
5324 explain select straight_join * from t1 as x1
5325 left join t1 as x2 on x2.b = x1.a;
5326 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
5327 1 SIMPLE x1 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 13 100.00 NULL
5328 1 SIMPLE x2 p0,p1,p2,p3,p4,p5,p6,p7 ref ix1 ix1 5 test.x1.a 2 100.00 Using join buffer (Batched Key Access)
5329 Warnings:
5330 Note 1003 Can't push table 'x2' as child, access type 'Batched-key' not implemented
5331 Note 1003 /* select#1 */ select straight_join `test`.`x1`.`pk` AS `pk`,`test`.`x1`.`u` AS `u`,`test`.`x1`.`a` AS `a`,`test`.`x1`.`b` AS `b`,`test`.`x2`.`pk` AS `pk`,`test`.`x2`.`u` AS `u`,`test`.`x2`.`a` AS `a`,`test`.`x2`.`b` AS `b` from `test`.`t1` `x1` left join `test`.`t1` `x2` on((`test`.`x2`.`b` = `test`.`x1`.`a`)) where true
5332 explain select straight_join * from t1 as x1
5333 right join t1 as x2 on x2.b = x1.a;
5334 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
5335 1 SIMPLE x2 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 13 100.00 NULL
5336 1 SIMPLE x1 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 13 100.00 Using where; Using join buffer (hash join)
5337 Warnings:
5338 Note 1003 Can't push table 'x1' as child, 'type' must be a 'ref' access
5339 Note 1003 /* select#1 */ select straight_join `test`.`x1`.`pk` AS `pk`,`test`.`x1`.`u` AS `u`,`test`.`x1`.`a` AS `a`,`test`.`x1`.`b` AS `b`,`test`.`x2`.`pk` AS `pk`,`test`.`x2`.`u` AS `u`,`test`.`x2`.`a` AS `a`,`test`.`x2`.`b` AS `b` from `test`.`t1` `x2` left join `test`.`t1` `x1` on((`test`.`x1`.`a` = `test`.`x2`.`b`)) where true
5340 explain select straight_join * from
5341 t1 as x1 inner join
5342 (t1 as x2 inner join t1 as x3 on x3.b = x2.a)
5343 on x2.pk = x1.a;
5344 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
5345 1 SIMPLE x1 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 13 100.00 Using pushed condition (`test`.`x1`.`a` is not null)
5346 1 SIMPLE x2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.x1.a 1 100.00 Using pushed condition (`test`.`x2`.`a` is not null); Using join buffer (Batched Key Access)
5347 1 SIMPLE x3 p0,p1,p2,p3,p4,p5,p6,p7 ref ix1 ix1 5 test.x2.a 2 100.00 Using join buffer (Batched Key Access)
5348 Warnings:
5349 Note 1003 Can't push table 'x2' as child, access type 'Batched-key' not implemented
5350 Note 1003 Can't push table 'x3' as child, access type 'Batched-key' not implemented
5351 Note 1003 /* select#1 */ select straight_join `test`.`x1`.`pk` AS `pk`,`test`.`x1`.`u` AS `u`,`test`.`x1`.`a` AS `a`,`test`.`x1`.`b` AS `b`,`test`.`x2`.`pk` AS `pk`,`test`.`x2`.`u` AS `u`,`test`.`x2`.`a` AS `a`,`test`.`x2`.`b` AS `b`,`test`.`x3`.`pk` AS `pk`,`test`.`x3`.`u` AS `u`,`test`.`x3`.`a` AS `a`,`test`.`x3`.`b` AS `b` from `test`.`t1` `x1` join `test`.`t1` `x2` join `test`.`t1` `x3` where ((`test`.`x3`.`b` = `test`.`x2`.`a`) and (`test`.`x2`.`pk` = `test`.`x1`.`a`))
5352 explain select straight_join * from
5353 t1 as x1 left join
5354 (t1 as x2 inner join t1 as x3 on x3.b = x2.a)
5355 on x2.pk = x1.a;
5356 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
5357 1 SIMPLE x1 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 13 100.00 Parent of 2 pushed join@1
5358 1 SIMPLE x2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.x1.a 1 100.00 Child of 'x1' in pushed join@1; Using join buffer (Batched Key Access)
5359 1 SIMPLE x3 p0,p1,p2,p3,p4,p5,p6,p7 ref ix1 ix1 5 test.x2.a 2 100.00 Using join buffer (Batched Key Access)
5360 Warnings:
5361 Note 1003 Can't push table 'x3' as child, access type 'Batched-key' not implemented
5362 Note 1003 /* select#1 */ select straight_join `test`.`x1`.`pk` AS `pk`,`test`.`x1`.`u` AS `u`,`test`.`x1`.`a` AS `a`,`test`.`x1`.`b` AS `b`,`test`.`x2`.`pk` AS `pk`,`test`.`x2`.`u` AS `u`,`test`.`x2`.`a` AS `a`,`test`.`x2`.`b` AS `b`,`test`.`x3`.`pk` AS `pk`,`test`.`x3`.`u` AS `u`,`test`.`x3`.`a` AS `a`,`test`.`x3`.`b` AS `b` from `test`.`t1` `x1` left join (`test`.`t1` `x2` join `test`.`t1` `x3`) on(((`test`.`x3`.`b` = `test`.`x2`.`a`) and (`test`.`x2`.`pk` = `test`.`x1`.`a`))) where true
5363 explain select straight_join count(*) from t1 as x1
5364 join t1 as x2 on x2.b = x1.a
5365 join t1 as x3 on x3.b = x1.b;
5366 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
5367 1 SIMPLE x1 p0,p1,p2,p3,p4,p5,p6,p7 ALL ix1 NULL NULL NULL 13 100.00 Using pushed condition ((`test`.`x1`.`a` is not null) and (`test`.`x1`.`b` is not null))
5368 1 SIMPLE x2 p0,p1,p2,p3,p4,p5,p6,p7 ref ix1 ix1 5 test.x1.a 2 100.00 Using join buffer (Batched Key Access)
5369 1 SIMPLE x3 p0,p1,p2,p3,p4,p5,p6,p7 ref ix1 ix1 5 test.x1.b 2 100.00 Using join buffer (Batched Key Access)
5370 Warnings:
5371 Note 1003 Can't push table 'x2' as child, access type 'Batched-key' not implemented
5372 Note 1003 Can't push table 'x3' as child, access type 'Batched-key' not implemented
5373 Note 1003 /* select#1 */ select straight_join count(0) AS `count(*)` from `test`.`t1` `x1` join `test`.`t1` `x2` join `test`.`t1` `x3` where ((`test`.`x2`.`b` = `test`.`x1`.`a`) and (`test`.`x3`.`b` = `test`.`x1`.`b`))
5374 set ndb_join_pushdown=off;
5375 select straight_join count(*) from t1 as x1
5376 join t1 as x2 on x2.b = x1.a
5377 join t1 as x3 on x3.b = x1.b;
5378 count(*)
5379 2028
5380 set ndb_join_pushdown=on;
5381 select straight_join count(*) from t1 as x1
5382 join t1 as x2 on x2.b = x1.a
5383 join t1 as x3 on x3.b = x1.b;
5384 count(*)
5385 2028
5386 explain select straight_join count(*) from t1 as x1
5387 join t1 as x2 on x2.b = x1.a
5388 join t1 as x3 on x3.b = x1.a
5389 join t1 as x4 on x4.b = x1.a
5390 join t1 as x5 on x5.b = x1.a
5391 join t1 as x6 on x6.b = x1.a
5392 join t1 as x7 on x7.b = x1.a
5393 where x3.a < x2.pk and x4.a < x3.pk;
5394 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
5395 1 SIMPLE x1 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL # # Using pushed condition (`test`.`x1`.`a` is not null)
5396 1 SIMPLE x2 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY,ix1 ix1 5 test.x1.a # # Using join buffer (Batched Key Access)
5397 1 SIMPLE x3 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY,ix1 ix1 5 test.x1.a # # Using where; Using join buffer (Batched Key Access)
5398 1 SIMPLE x4 p0,p1,p2,p3,p4,p5,p6,p7 ref ix1 ix1 5 test.x1.a # # Using where; Using join buffer (Batched Key Access)
5399 1 SIMPLE x5 p0,p1,p2,p3,p4,p5,p6,p7 ref ix1 ix1 5 test.x1.a # # Using join buffer (Batched Key Access)
5400 1 SIMPLE x6 p0,p1,p2,p3,p4,p5,p6,p7 ref ix1 ix1 5 test.x1.a # # Using join buffer (Batched Key Access)
5401 1 SIMPLE x7 p0,p1,p2,p3,p4,p5,p6,p7 ref ix1 ix1 5 test.x1.a # # Using join buffer (Batched Key Access)
5402 Warnings:
5403 Note 1003 Can't push table 'x2' as child, access type 'Batched-key' not implemented
5404 Note 1003 Can't push table 'x3' as child, access type 'Batched-key' not implemented
5405 Note 1003 Can't push table 'x4' as child, access type 'Batched-key' not implemented
5406 Note 1003 Can't push table 'x5' as child, access type 'Batched-key' not implemented
5407 Note 1003 Can't push table 'x6' as child, access type 'Batched-key' not implemented
5408 Note 1003 Can't push table 'x7' as child, access type 'Batched-key' not implemented
5409 Note 1003 /* select#1 */ select straight_join count(0) AS `count(*)` from `test`.`t1` `x1` join `test`.`t1` `x2` join `test`.`t1` `x3` join `test`.`t1` `x4` join `test`.`t1` `x5` join `test`.`t1` `x6` join `test`.`t1` `x7` where ((`test`.`x2`.`b` = `test`.`x1`.`a`) and (`test`.`x3`.`b` = `test`.`x1`.`a`) and (`test`.`x4`.`b` = `test`.`x1`.`a`) and (`test`.`x5`.`b` = `test`.`x1`.`a`) and (`test`.`x6`.`b` = `test`.`x1`.`a`) and (`test`.`x7`.`b` = `test`.`x1`.`a`) and (`test`.`x3`.`a` < `test`.`x2`.`pk`) and (`test`.`x4`.`a` < `test`.`x3`.`pk`))
5410 set global debug='+d,max_64rows_in_spj_batches';
5411 select straight_join count(*) from t1 as x1
5412 join t1 as x2 on x2.b = x1.a
5413 join t1 as x3 on x3.b = x1.a
5414 join t1 as x4 on x4.b = x1.a
5415 join t1 as x5 on x5.b = x1.a
5416 join t1 as x6 on x6.b = x1.a
5417 join t1 as x7 on x7.b = x1.a
5418 where x3.a < x2.pk and x4.a < x3.pk;
5419 count(*)
5420 632736
5421 set global debug=@save_debug;
5422 explain select straight_join count(*) from t1 as x1
5423 left join t1 as x2 on x2.b = x1.a
5424 join t1 as x3 on x3.b = x1.b;
5425 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
5426 1 SIMPLE x1 p0,p1,p2,p3,p4,p5,p6,p7 ALL ix1 NULL NULL NULL 13 100.00 Using pushed condition (`test`.`x1`.`b` is not null)
5427 1 SIMPLE x2 p0,p1,p2,p3,p4,p5,p6,p7 ref ix1 ix1 5 test.x1.a 2 100.00 Using join buffer (Batched Key Access)
5428 1 SIMPLE x3 p0,p1,p2,p3,p4,p5,p6,p7 ref ix1 ix1 5 test.x1.b 2 100.00 Using join buffer (Batched Key Access)
5429 Warnings:
5430 Note 1003 Can't push table 'x2' as child, access type 'Batched-key' not implemented
5431 Note 1003 Can't push table 'x3' as child, access type 'Batched-key' not implemented
5432 Note 1003 /* select#1 */ select straight_join count(0) AS `count(*)` from `test`.`t1` `x1` left join `test`.`t1` `x2` on((`test`.`x2`.`b` = `test`.`x1`.`a`)) join `test`.`t1` `x3` where (`test`.`x3`.`b` = `test`.`x1`.`b`)
5433 set ndb_join_pushdown=off;
5434 select straight_join count(*) from t1 as x1
5435 left join t1 as x2 on x2.b = x1.a
5436 join t1 as x3 on x3.b = x1.b;
5437 count(*)
5438 2041
5439 set ndb_join_pushdown=on;
5440 select straight_join count(*) from t1 as x1
5441 left join t1 as x2 on x2.b = x1.a
5442 join t1 as x3 on x3.b = x1.b;
5443 count(*)
5444 2041
5445 explain select straight_join count(*) from t1 as x1
5446 join t1 as x2 on x2.b = x1.a
5447 left join t1 as x3 on x3.b = x1.b;
5448 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
5449 1 SIMPLE x1 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 13 100.00 Using pushed condition (`test`.`x1`.`a` is not null)
5450 1 SIMPLE x2 p0,p1,p2,p3,p4,p5,p6,p7 ref ix1 ix1 5 test.x1.a 2 100.00 Using join buffer (Batched Key Access)
5451 1 SIMPLE x3 p0,p1,p2,p3,p4,p5,p6,p7 ref ix1 ix1 5 test.x1.b 2 100.00 Using join buffer (Batched Key Access)
5452 Warnings:
5453 Note 1003 Can't push table 'x2' as child, access type 'Batched-key' not implemented
5454 Note 1003 Can't push table 'x3' as child, access type 'Batched-key' not implemented
5455 Note 1003 /* select#1 */ select straight_join count(0) AS `count(*)` from `test`.`t1` `x1` join `test`.`t1` `x2` left join `test`.`t1` `x3` on((`test`.`x3`.`b` = `test`.`x1`.`b`)) where (`test`.`x2`.`b` = `test`.`x1`.`a`)
5456 set ndb_join_pushdown=off;
5457 select straight_join count(*) from t1 as x1
5458 join t1 as x2 on x2.b = x1.a
5459 left join t1 as x3 on x3.b = x1.b;
5460 count(*)
5461 2028
5462 set ndb_join_pushdown=on;
5463 select straight_join count(*) from t1 as x1
5464 join t1 as x2 on x2.b = x1.a
5465 left join t1 as x3 on x3.b = x1.b;
5466 count(*)
5467 2028
5468 explain
5469 select straight_join count(*) from t1 as x1
5470 join t1 as x2 on x2.b = x1.a
5471 join t1 as x3 on x3.pk = x1.a join t1 as x4 on x4.b = x3.a;
5472 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
5473 1 SIMPLE x1 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 13 100.00 Using pushed condition (`test`.`x1`.`a` is not null)
5474 1 SIMPLE x2 p0,p1,p2,p3,p4,p5,p6,p7 ref ix1 ix1 5 test.x1.a 2 100.00 Using join buffer (Batched Key Access)
5475 1 SIMPLE x3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.x1.a 1 100.00 Using pushed condition (`test`.`x3`.`a` is not null); Using join buffer (Batched Key Access)
5476 1 SIMPLE x4 p0,p1,p2,p3,p4,p5,p6,p7 ref ix1 ix1 5 test.x3.a 2 100.00 Using join buffer (Batched Key Access)
5477 Warnings:
5478 Note 1003 Can't push table 'x2' as child, access type 'Batched-key' not implemented
5479 Note 1003 Can't push table 'x3' as child, access type 'Batched-key' not implemented
5480 Note 1003 Can't push table 'x4' as child, access type 'Batched-key' not implemented
5481 Note 1003 /* select#1 */ select straight_join count(0) AS `count(*)` from `test`.`t1` `x1` join `test`.`t1` `x2` join `test`.`t1` `x3` join `test`.`t1` `x4` where ((`test`.`x2`.`b` = `test`.`x1`.`a`) and (`test`.`x3`.`pk` = `test`.`x1`.`a`) and (`test`.`x4`.`b` = `test`.`x3`.`a`))
5482 set ndb_join_pushdown=off;
5483 select straight_join count(*) from t1 as x1
5484 join t1 as x2 on x2.b = x1.a
5485 join t1 as x3 on x3.pk = x1.a join t1 as x4 on x4.b = x3.a;
5486 count(*)
5487 2028
5488 set ndb_join_pushdown=on;
5489 select straight_join count(*) from t1 as x1
5490 join t1 as x2 on x2.b = x1.a
5491 join t1 as x3 on x3.pk = x1.a join t1 as x4 on x4.b = x3.a;
5492 count(*)
5493 2028
5494 explain select straight_join count(*) from t1 as x1
5495 left join t1 as x3 on x3.b = x1.a
5496 join t1 as x2 on x2.pk = x1.a;
5497 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
5498 1 SIMPLE x1 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 13 100.00 Using pushed condition (`test`.`x1`.`a` is not null)
5499 1 SIMPLE x3 p0,p1,p2,p3,p4,p5,p6,p7 ref ix1 ix1 5 test.x1.a 2 100.00 Using join buffer (Batched Key Access)
5500 1 SIMPLE x2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.x1.a 1 100.00 Using join buffer (Batched Key Access)
5501 Warnings:
5502 Note 1003 Can't push table 'x3' as child, access type 'Batched-key' not implemented
5503 Note 1003 Can't push table 'x2' as child, access type 'Batched-key' not implemented
5504 Note 1003 /* select#1 */ select straight_join count(0) AS `count(*)` from `test`.`t1` `x1` left join `test`.`t1` `x3` on((`test`.`x3`.`b` = `test`.`x1`.`a`)) join `test`.`t1` `x2` where (`test`.`x2`.`pk` = `test`.`x1`.`a`)
5505 select straight_join count(*) from t1 as x1
5506 left join t1 as x3 on x3.b = x1.a
5507 join t1 as x2 on x2.pk = x1.a;
5508 count(*)
5509 156
5510 update t1 set b=b+10;
5511 select straight_join count(*) from t1 as x1
5512 left join t1 as x3 on x3.b = x1.a
5513 join t1 as x2 on x2.pk = x1.a;
5514 count(*)
5515 12
5516 update t1 set b=b-10;
5517 update t1 set u=u+100;
5518 set ndb_join_pushdown=on;
5519 set global debug='+d,max_64rows_in_spj_batches';
5520 explain select straight_join count(*) from
5521 (t1 as x join t1 as y on y.b = x.a)
5522 left outer join t1 as z on z.u = x.a;
5523 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
5524 1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 13 100.00 Using pushed condition (`test`.`x`.`a` is not null)
5525 1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 ref ix1 ix1 5 test.x.a 2 100.00 Using join buffer (Batched Key Access)
5526 1 SIMPLE z p0,p1,p2,p3,p4,p5,p6,p7 eq_ref ix2 ix2 4 test.x.a 1 100.00 Using join buffer (Batched Key Access)
5527 Warnings:
5528 Note 1003 Can't push table 'y' as child, access type 'Batched-key' not implemented
5529 Note 1003 Can't push table 'z' as child, access type 'Batched-key' not implemented
5530 Note 1003 /* select#1 */ select straight_join count(0) AS `count(*)` from `test`.`t1` `x` join `test`.`t1` `y` left join `test`.`t1` `z` on((`test`.`z`.`u` = `test`.`x`.`a`)) where (`test`.`y`.`b` = `test`.`x`.`a`)
5531 select straight_join count(*) from
5532 (t1 as x join t1 as y on y.b = x.a)
5533 left outer join t1 as z on z.u = x.a;
5534 count(*)
5535 156
5536 set global debug=@save_debug;
5537 update t1 set u=u-100;
5538 update t1 set a=a+pk;
5539 set ndb_join_pushdown=on;
5540 explain
5541 select straight_join count(*) from t1 as x
5542 left join t1 as y on y.pk = x.a
5543 join t1 as z on z.b = x.b;
5544 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
5545 1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 ALL ix1 NULL NULL NULL 13 100.00 Using pushed condition (`test`.`x`.`b` is not null)
5546 1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.x.a 1 100.00 Using join buffer (Batched Key Access)
5547 1 SIMPLE z p0,p1,p2,p3,p4,p5,p6,p7 ref ix1 ix1 5 test.x.b 2 100.00 Using join buffer (Batched Key Access)
5548 Warnings:
5549 Note 1003 Can't push table 'y' as child, access type 'Batched-key' not implemented
5550 Note 1003 Can't push table 'z' as child, access type 'Batched-key' not implemented
5551 Note 1003 /* select#1 */ select straight_join count(0) AS `count(*)` from `test`.`t1` `x` left join `test`.`t1` `y` on((`test`.`y`.`pk` = `test`.`x`.`a`)) join `test`.`t1` `z` where (`test`.`z`.`b` = `test`.`x`.`b`)
5552 select straight_join count(*) from t1 as x
5553 left join t1 as y on y.pk = x.a
5554 join t1 as z on z.b = x.b;
5555 count(*)
5556 169
5557 explain
5558 select straight_join count(*) from t1 as x
5559 left join t1 as y1 on y1.pk = x.a
5560 left join t1 as y2 on y2.pk = x.a
5561 join t1 as z on z.b = x.b;
5562 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
5563 1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 ALL ix1 NULL NULL NULL 13 100.00 Using pushed condition (`test`.`x`.`b` is not null)
5564 1 SIMPLE y1 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.x.a 1 100.00 Using join buffer (Batched Key Access)
5565 1 SIMPLE y2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.x.a 1 100.00 Using join buffer (Batched Key Access)
5566 1 SIMPLE z p0,p1,p2,p3,p4,p5,p6,p7 ref ix1 ix1 5 test.x.b 2 100.00 Using join buffer (Batched Key Access)
5567 Warnings:
5568 Note 1003 Can't push table 'y1' as child, access type 'Batched-key' not implemented
5569 Note 1003 Can't push table 'y2' as child, access type 'Batched-key' not implemented
5570 Note 1003 Can't push table 'z' as child, access type 'Batched-key' not implemented
5571 Note 1003 /* select#1 */ select straight_join count(0) AS `count(*)` from `test`.`t1` `x` left join `test`.`t1` `y1` on((`test`.`y1`.`pk` = `test`.`x`.`a`)) left join `test`.`t1` `y2` on((`test`.`y2`.`pk` = `test`.`x`.`a`)) join `test`.`t1` `z` where (`test`.`z`.`b` = `test`.`x`.`b`)
5572 select straight_join count(*) from t1 as x
5573 left join t1 as y1 on y1.pk = x.a
5574 left join t1 as y2 on y2.pk = x.a
5575 join t1 as z on z.b = x.b;
5576 count(*)
5577 169
5578 explain
5579 select straight_join count(*) from t1 as x
5580 join t1 as y1 on y1.pk = x.a
5581 left join t1 as y2 on y2.pk = x.a
5582 join t1 as z on z.b = x.b;
5583 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
5584 1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 ALL ix1 NULL NULL NULL 13 100.00 Using pushed condition ((`test`.`x`.`a` is not null) and (`test`.`x`.`b` is not null))
5585 1 SIMPLE y1 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.x.a 1 100.00 Using join buffer (Batched Key Access)
5586 1 SIMPLE y2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.x.a 1 100.00 Using join buffer (Batched Key Access)
5587 1 SIMPLE z p0,p1,p2,p3,p4,p5,p6,p7 ref ix1 ix1 5 test.x.b 2 100.00 Using join buffer (Batched Key Access)
5588 Warnings:
5589 Note 1003 Can't push table 'y1' as child, access type 'Batched-key' not implemented
5590 Note 1003 Can't push table 'y2' as child, access type 'Batched-key' not implemented
5591 Note 1003 Can't push table 'z' as child, access type 'Batched-key' not implemented
5592 Note 1003 /* select#1 */ select straight_join count(0) AS `count(*)` from `test`.`t1` `x` join `test`.`t1` `y1` left join `test`.`t1` `y2` on((`test`.`y2`.`pk` = `test`.`x`.`a`)) join `test`.`t1` `z` where ((`test`.`y1`.`pk` = `test`.`x`.`a`) and (`test`.`z`.`b` = `test`.`x`.`b`))
5593 select straight_join count(*) from t1 as x
5594 join t1 as y1 on y1.pk = x.a
5595 left join t1 as y2 on y2.pk = x.a
5596 join t1 as z on z.b = x.b;
5597 count(*)
5598 39
5599 explain
5600 select straight_join count(*) from t1 as x
5601 left join t1 as y1 on y1.pk = x.a
5602 join t1 as y2 on y2.pk = x.a
5603 join t1 as z on z.b = x.b;
5604 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
5605 1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 ALL ix1 NULL NULL NULL 13 100.00 Using pushed condition ((`test`.`x`.`a` is not null) and (`test`.`x`.`b` is not null))
5606 1 SIMPLE y1 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.x.a 1 100.00 Using join buffer (Batched Key Access)
5607 1 SIMPLE y2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.x.a 1 100.00 Using join buffer (Batched Key Access)
5608 1 SIMPLE z p0,p1,p2,p3,p4,p5,p6,p7 ref ix1 ix1 5 test.x.b 2 100.00 Using join buffer (Batched Key Access)
5609 Warnings:
5610 Note 1003 Can't push table 'y1' as child, access type 'Batched-key' not implemented
5611 Note 1003 Can't push table 'y2' as child, access type 'Batched-key' not implemented
5612 Note 1003 Can't push table 'z' as child, access type 'Batched-key' not implemented
5613 Note 1003 /* select#1 */ select straight_join count(0) AS `count(*)` from `test`.`t1` `x` left join `test`.`t1` `y1` on((`test`.`y1`.`pk` = `test`.`x`.`a`)) join `test`.`t1` `y2` join `test`.`t1` `z` where ((`test`.`y2`.`pk` = `test`.`x`.`a`) and (`test`.`z`.`b` = `test`.`x`.`b`))
5614 select straight_join count(*) from t1 as x
5615 left join t1 as y1 on y1.pk = x.a
5616 join t1 as y2 on y2.pk = x.a
5617 join t1 as z on z.b = x.b;
5618 count(*)
5619 39
5620 explain
5621 select straight_join count(*) from t1 as x
5622 left join (t1 as y join t1 as yy on yy.pk=y.u) on y.pk = x.a
5623 join t1 as z on z.b = x.b;
5624 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
5625 1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 ALL ix1 NULL NULL NULL 13 100.00 Parent of 2 pushed join@1; Using pushed condition (`test`.`x`.`b` is not null)
5626 1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY,ix2 PRIMARY 4 test.x.a 1 100.00 Child of 'x' in pushed join@1; Using join buffer (Batched Key Access)
5627 1 SIMPLE yy p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.y.u 1 100.00 Using join buffer (Batched Key Access)
5628 1 SIMPLE z p0,p1,p2,p3,p4,p5,p6,p7 ref ix1 ix1 5 test.x.b 2 100.00 Using join buffer (Batched Key Access)
5629 Warnings:
5630 Note 1003 Can't push table 'yy' as child, access type 'Batched-key' not implemented
5631 Note 1003 Can't push table 'z' as child, access type 'Batched-key' not implemented
5632 Note 1003 /* select#1 */ select straight_join count(0) AS `count(*)` from `test`.`t1` `x` left join (`test`.`t1` `y` join `test`.`t1` `yy`) on(((`test`.`yy`.`pk` = `test`.`y`.`u`) and (`test`.`y`.`pk` = `test`.`x`.`a`))) join `test`.`t1` `z` where (`test`.`z`.`b` = `test`.`x`.`b`)
5633 select straight_join count(*) from t1 as x
5634 left join (t1 as y join t1 as yy on yy.pk=y.u) on y.pk = x.a
5635 join t1 as z on z.b = x.b;
5636 count(*)
5637 169
5638 explain
5639 select straight_join count(*) from t1 as x
5640 join t1 as z on z.b = x.b
5641 left join t1 as y on y.pk = x.a;
5642 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
5643 1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 ALL ix1 NULL NULL NULL 13 100.00 Using pushed condition (`test`.`x`.`b` is not null)
5644 1 SIMPLE z p0,p1,p2,p3,p4,p5,p6,p7 ref ix1 ix1 5 test.x.b 2 100.00 Using join buffer (Batched Key Access)
5645 1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.x.a 1 100.00 Using join buffer (Batched Key Access)
5646 Warnings:
5647 Note 1003 Can't push table 'z' as child, access type 'Batched-key' not implemented
5648 Note 1003 Can't push table 'y' as child, access type 'Batched-key' not implemented
5649 Note 1003 /* select#1 */ select straight_join count(0) AS `count(*)` from `test`.`t1` `x` join `test`.`t1` `z` left join `test`.`t1` `y` on((`test`.`y`.`pk` = `test`.`x`.`a`)) where (`test`.`z`.`b` = `test`.`x`.`b`)
5650 select straight_join count(*) from t1 as x
5651 join t1 as z on z.b = x.b
5652 left join t1 as y on y.pk = x.a;
5653 count(*)
5654 169
5655 explain
5656 select straight_join count(*) from t1 as x
5657 left join t1 as y1 on y1.pk = x.a
5658 left join t1 as y2 on y2.pk = x.a
5659 left join t1 as y3 on y3.pk = x.a;
5660 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
5661 1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 13 100.00 NULL
5662 1 SIMPLE y1 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.x.a 1 100.00 Using join buffer (Batched Key Access)
5663 1 SIMPLE y2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.x.a 1 100.00 Using join buffer (Batched Key Access)
5664 1 SIMPLE y3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.x.a 1 100.00 Using join buffer (Batched Key Access)
5665 Warnings:
5666 Note 1003 Can't push table 'y1' as child, access type 'Batched-key' not implemented
5667 Note 1003 Can't push table 'y2' as child, access type 'Batched-key' not implemented
5668 Note 1003 Can't push table 'y3' as child, access type 'Batched-key' not implemented
5669 Note 1003 /* select#1 */ select straight_join count(0) AS `count(*)` from `test`.`t1` `x` left join `test`.`t1` `y1` on((`test`.`y1`.`pk` = `test`.`x`.`a`)) left join `test`.`t1` `y2` on((`test`.`y2`.`pk` = `test`.`x`.`a`)) left join `test`.`t1` `y3` on((`test`.`y3`.`pk` = `test`.`x`.`a`)) where true
5670 select straight_join count(*) from t1 as x
5671 left join t1 as y1 on y1.pk = x.a
5672 left join t1 as y2 on y2.pk = x.a
5673 left join t1 as y3 on y3.pk = x.a;
5674 count(*)
5675 13
5676 explain
5677 select straight_join count(*) from t1 as x
5678 left join t1 as y on y.pk = x.a
5679 left join t1 as z on z.pk = x.a
5680 left join t1 as y1 on y1.pk = y.b;
5681 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
5682 1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 13 100.00 NULL
5683 1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.x.a 1 100.00 Using join buffer (Batched Key Access)
5684 1 SIMPLE z p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.x.a 1 100.00 Using join buffer (Batched Key Access)
5685 1 SIMPLE y1 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.y.b 1 100.00 Using join buffer (Batched Key Access)
5686 Warnings:
5687 Note 1003 Can't push table 'y' as child, access type 'Batched-key' not implemented
5688 Note 1003 Can't push table 'z' as child, access type 'Batched-key' not implemented
5689 Note 1003 Can't push table 'y1' as child, access type 'Batched-key' not implemented
5690 Note 1003 /* select#1 */ select straight_join count(0) AS `count(*)` from `test`.`t1` `x` left join `test`.`t1` `y` on((`test`.`y`.`pk` = `test`.`x`.`a`)) left join `test`.`t1` `z` on((`test`.`z`.`pk` = `test`.`x`.`a`)) left join `test`.`t1` `y1` on((`test`.`y1`.`pk` = `test`.`y`.`b`)) where true
5691 select straight_join count(*) from t1 as x
5692 left join t1 as y on y.pk = x.a
5693 left join t1 as z on z.pk = x.a
5694 left join t1 as y1 on y1.pk = y.b;
5695 count(*)
5696 13
5697 explain
5698 select straight_join count(*) from t1 as x
5699 join t1 as y on y.pk = x.a
5700 left join t1 as y1 on y1.pk = y.b
5701 left join t1 as z on z.pk = x.b;
5702 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
5703 1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 13 100.00 Using pushed condition (`test`.`x`.`a` is not null)
5704 1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.x.a 1 100.00 Using join buffer (Batched Key Access)
5705 1 SIMPLE y1 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.y.b 1 100.00 Using join buffer (Batched Key Access)
5706 1 SIMPLE z p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.x.b 1 100.00 Using join buffer (Batched Key Access)
5707 Warnings:
5708 Note 1003 Can't push table 'y' as child, access type 'Batched-key' not implemented
5709 Note 1003 Can't push table 'y1' as child, access type 'Batched-key' not implemented
5710 Note 1003 Can't push table 'z' as child, access type 'Batched-key' not implemented
5711 Note 1003 /* select#1 */ select straight_join count(0) AS `count(*)` from `test`.`t1` `x` join `test`.`t1` `y` left join `test`.`t1` `y1` on((`test`.`y1`.`pk` = `test`.`y`.`b`)) left join `test`.`t1` `z` on((`test`.`z`.`pk` = `test`.`x`.`b`)) where (`test`.`y`.`pk` = `test`.`x`.`a`)
5712 select straight_join count(*) from t1 as x
5713 join t1 as y on y.pk = x.a
5714 left join t1 as y1 on y1.pk = y.b
5715 left join t1 as z on z.pk = x.b;
5716 count(*)
5717 3
5718 explain
5719 select straight_join count(*) from t1 as x
5720 left join t1 as y1 on y1.pk = x.a
5721 join t1 as y2 on y2.pk = x.b
5722 join t1 as z on z.b = y2.b;
5723 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
5724 1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 ALL ix1 NULL NULL NULL 13 100.00 Using pushed condition (`test`.`x`.`b` is not null)
5725 1 SIMPLE y1 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.x.a 1 100.00 Using join buffer (Batched Key Access)
5726 1 SIMPLE y2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY,ix1 PRIMARY 4 test.x.b 1 100.00 Using pushed condition (`test`.`y2`.`b` is not null); Using join buffer (Batched Key Access)
5727 1 SIMPLE z p0,p1,p2,p3,p4,p5,p6,p7 ref ix1 ix1 5 test.y2.b 2 100.00 Using join buffer (Batched Key Access)
5728 Warnings:
5729 Note 1003 Can't push table 'y1' as child, access type 'Batched-key' not implemented
5730 Note 1003 Can't push table 'y2' as child, access type 'Batched-key' not implemented
5731 Note 1003 Can't push table 'z' as child, access type 'Batched-key' not implemented
5732 Note 1003 /* select#1 */ select straight_join count(0) AS `count(*)` from `test`.`t1` `x` left join `test`.`t1` `y1` on((`test`.`y1`.`pk` = `test`.`x`.`a`)) join `test`.`t1` `y2` join `test`.`t1` `z` where ((`test`.`y2`.`pk` = `test`.`x`.`b`) and (`test`.`z`.`b` = `test`.`y2`.`b`))
5733 select straight_join count(*) from t1 as x
5734 left join t1 as y1 on y1.pk = x.a
5735 join t1 as y2 on y2.pk = x.b
5736 join t1 as z on z.b = y2.b;
5737 count(*)
5738 169
5739 update t1 set a=a-pk;
5740 drop index ix2 on t1;
5741 create unique index ix2 on t1(a,u);
5742 set ndb_join_pushdown=on;
5743 explain
5744 select straight_join * from
5745 t1 as table1 join
5746 (t1 as table2 join t1 as table3 on table3.a = table2.a)
5747 on table3.u = table1.u
5748 where table2.pk = 3;
5749 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
5750 1 SIMPLE table1 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 13 100.00 NULL
5751 1 SIMPLE table2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY,ix2 PRIMARY 4 const 1 100.00 Using pushed condition (`test`.`table2`.`a` is not null); Using join buffer (Batched Key Access)
5752 1 SIMPLE table3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref ix2 ix2 9 test.table2.a,test.table1.u 1 100.00 Using join buffer (Batched Key Access)
5753 Warnings:
5754 Note 1003 Can't push table 'table2' as child, access type 'Batched-key' not implemented
5755 Note 1003 Can't push table 'table3' as child, access type 'Batched-key' not implemented
5756 Note 1003 /* select#1 */ select straight_join `test`.`table1`.`pk` AS `pk`,`test`.`table1`.`u` AS `u`,`test`.`table1`.`a` AS `a`,`test`.`table1`.`b` AS `b`,`test`.`table2`.`pk` AS `pk`,`test`.`table2`.`u` AS `u`,`test`.`table2`.`a` AS `a`,`test`.`table2`.`b` AS `b`,`test`.`table3`.`pk` AS `pk`,`test`.`table3`.`u` AS `u`,`test`.`table3`.`a` AS `a`,`test`.`table3`.`b` AS `b` from `test`.`t1` `table1` join `test`.`t1` `table2` join `test`.`t1` `table3` where ((`test`.`table3`.`a` = `test`.`table2`.`a`) and (`test`.`table3`.`u` = `test`.`table1`.`u`) and (`test`.`table2`.`pk` = 3))
5757 select straight_join * from
5758 t1 as table1 join
5759 (t1 as table2 join t1 as table3 on table3.a = table2.a)
5760 on table3.u = table1.u
5761 where table2.pk = 3;
5762 pk u a b pk u a b pk u a b
5763 0 0 10 10 3 3 10 10 0 0 10 10
5764 1 1 10 10 3 3 10 10 1 1 10 10
5765 10 10 10 10 3 3 10 10 10 10 10 10
5766 11 11 10 10 3 3 10 10 11 11 10 10
5767 2 2 10 10 3 3 10 10 2 2 10 10
5768 3 3 10 10 3 3 10 10 3 3 10 10
5769 4 4 10 10 3 3 10 10 4 4 10 10
5770 5 5 10 10 3 3 10 10 5 5 10 10
5771 6 6 10 10 3 3 10 10 6 6 10 10
5772 7 7 10 10 3 3 10 10 7 7 10 10
5773 8 8 10 10 3 3 10 10 8 8 10 10
5774 9 9 10 10 3 3 10 10 9 9 10 10
5775 drop table t1;
5776 CREATE TABLE t1 (
5777 a int NOT NULL,
5778 b int NOT NULL,
5779 c int NOT NULL,
5780 d int NOT NULL,
5781 PRIMARY KEY (`a`,`b`)
5782 ) ENGINE=ndbcluster
5783 comment="NDB_TABLE=PARTITION_BALANCE=FOR_RP_BY_LDM";
5784 insert into t1 values (1,1,1,1), (1,2,1,1), (1,3,1,1), (1,4,1,2);
5785 CREATE TABLE t2 (
5786 a int NOT NULL,
5787 PRIMARY KEY (`a`)
5788 ) ENGINE=ndbcluster
5789 comment="NDB_TABLE=PARTITION_BALANCE=FOR_RP_BY_LDM";
5790 CREATE TABLE t3 (
5791 a int NOT NULL,
5792 b int NOT NULL,
5793 PRIMARY KEY (`a`,`b`)
5794 ) ENGINE=ndbcluster
5795 comment="NDB_TABLE=PARTITION_BALANCE=FOR_RP_BY_LDM";
5796 insert into t2 values (0), (1), (2), (3), (4), (5), (6), (7), (8), (9);
5797 insert into t3 select 1, x1.a * 10+x2.a from t2 as x1 cross join t2 as x2;
5798 set global debug='+d,max_64rows_in_spj_batches';
5799 explain select straight_join count(*) from t1 as x0
5800 join t3 as x1 on x1.a=x0.c
5801 join t1 as x2 on x2.a=x0.d
5802 join t3 as x3 on x3.a=x2.c
5803 join t1 as x4 on x4.a=x0.d and x4.b=x3.b;
5804 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
5805 1 SIMPLE x0 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 4 100.00 NULL
5806 1 SIMPLE x1 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.x0.c 1 100.00 Using join buffer (Batched Key Access)
5807 1 SIMPLE x2 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.x0.d 1 100.00 Using join buffer (Batched Key Access)
5808 1 SIMPLE x3 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.x2.c 1 100.00 Using join buffer (Batched Key Access)
5809 1 SIMPLE x4 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.x0.d,test.x3.b 1 100.00 Using join buffer (Batched Key Access)
5810 Warnings:
5811 Note 1003 Can't push table 'x1' as child, access type 'Batched-key' not implemented
5812 Note 1003 Can't push table 'x2' as child, access type 'Batched-key' not implemented
5813 Note 1003 Can't push table 'x3' as child, access type 'Batched-key' not implemented
5814 Note 1003 Can't push table 'x4' as child, access type 'Batched-key' not implemented
5815 Note 1003 /* select#1 */ select straight_join count(0) AS `count(*)` from `test`.`t1` `x0` join `test`.`t3` `x1` join `test`.`t1` `x2` join `test`.`t3` `x3` join `test`.`t1` `x4` where ((`test`.`x1`.`a` = `test`.`x0`.`c`) and (`test`.`x3`.`a` = `test`.`x2`.`c`) and (`test`.`x4`.`b` = `test`.`x3`.`b`) and (`test`.`x2`.`a` = `test`.`x0`.`d`) and (`test`.`x4`.`a` = `test`.`x0`.`d`))
5816 select straight_join count(*) from t1 as x0
5817 join t3 as x1 on x1.a=x0.c
5818 join t1 as x2 on x2.a=x0.d
5819 join t3 as x3 on x3.a=x2.c
5820 join t1 as x4 on x4.a=x0.d and x4.b=x3.b;
5821 count(*)
5822 4800
5823 explain select straight_join count(*) from t1 as x1
5824 join t1 as x2 on x1.c=x2.a and x2.d=2
5825 join t3 as x3 on x1.d=x3.a;
5826 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
5827 1 SIMPLE x1 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL # # NULL
5828 1 SIMPLE x2 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.x1.c # # Using pushed condition (`test`.`x2`.`d` = 2); Using join buffer (Batched Key Access)
5829 1 SIMPLE x3 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.x1.d # # Using join buffer (Batched Key Access)
5830 Warnings:
5831 Note 1003 Can't push table 'x2' as child, access type 'Batched-key' not implemented
5832 Note 1003 Can't push table 'x3' as child, access type 'Batched-key' not implemented
5833 Note 1003 /* select#1 */ select straight_join count(0) AS `count(*)` from `test`.`t1` `x1` join `test`.`t1` `x2` join `test`.`t3` `x3` where ((`test`.`x2`.`d` = 2) and (`test`.`x2`.`a` = `test`.`x1`.`c`) and (`test`.`x3`.`a` = `test`.`x1`.`d`))
5834 select straight_join count(*) from t1 as x1
5835 join t1 as x2 on x1.c=x2.a and x2.d=2
5836 join t3 as x3 on x1.d=x3.a;
5837 count(*)
5838 300
5839 set global debug=@save_debug;
5840 drop table t1;
5841 drop table t2;
5842 drop table t3;
5843 create table t1(
5844 d int not null,
5845 e int null,
5846 f int null,
5847 a int not null,
5848 b int not null,
5849 c int not null,
5850 primary key (a,b,c))
5851 engine = ndb partition by key (b) partitions 8;
5852 insert into t1(a,b,c,d,e,f) values
5853 (1, 2, 3, 1, 2, 3),
5854 (1, 2, 4, 1, 2, 3),
5855 (2, 3, 4, 1, 2, 3),
5856 (3, 4, 5, 1, 2, 3),
5857 (4, 5, 6, 1, 2, 3),
5858 (5, 6, 7, 1, 2, 3),
5859 (6, 7, 8, 1, 2, 3),
5860 (7, 8, 9, 1, 2, 3);
5861 set ndb_join_pushdown=on;
5862 explain
5863 select straight_join * from t1 x, t1 y where y.a=x.d and y.b=x.e;
5864 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
5865 1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL # # Using pushed condition (`test`.`x`.`e` is not null)
5866 1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 8 test.x.d,test.x.e # # Using join buffer (Batched Key Access)
5867 Warnings:
5868 Note 1003 Can't push table 'y' as child, access type 'Batched-key' not implemented
5869 Note 1003 /* select#1 */ select straight_join `test`.`x`.`d` AS `d`,`test`.`x`.`e` AS `e`,`test`.`x`.`f` AS `f`,`test`.`x`.`a` AS `a`,`test`.`x`.`b` AS `b`,`test`.`x`.`c` AS `c`,`test`.`y`.`d` AS `d`,`test`.`y`.`e` AS `e`,`test`.`y`.`f` AS `f`,`test`.`y`.`a` AS `a`,`test`.`y`.`b` AS `b`,`test`.`y`.`c` AS `c` from `test`.`t1` `x` join `test`.`t1` `y` where ((`test`.`y`.`b` = `test`.`x`.`e`) and (`test`.`y`.`a` = `test`.`x`.`d`))
5870 select straight_join * from t1 x, t1 y where y.a=x.d and y.b=x.e;
5871 d e f a b c d e f a b c
5872 1 2 3 1 2 3 1 2 3 1 2 3
5873 1 2 3 1 2 3 1 2 3 1 2 4
5874 1 2 3 1 2 4 1 2 3 1 2 3
5875 1 2 3 1 2 4 1 2 3 1 2 4
5876 1 2 3 2 3 4 1 2 3 1 2 3
5877 1 2 3 2 3 4 1 2 3 1 2 4
5878 1 2 3 3 4 5 1 2 3 1 2 3
5879 1 2 3 3 4 5 1 2 3 1 2 4
5880 1 2 3 4 5 6 1 2 3 1 2 3
5881 1 2 3 4 5 6 1 2 3 1 2 4
5882 1 2 3 5 6 7 1 2 3 1 2 3
5883 1 2 3 5 6 7 1 2 3 1 2 4
5884 1 2 3 6 7 8 1 2 3 1 2 3
5885 1 2 3 6 7 8 1 2 3 1 2 4
5886 1 2 3 7 8 9 1 2 3 1 2 3
5887 1 2 3 7 8 9 1 2 3 1 2 4
5888 alter table t1 partition by key (a) partitions 8;
5889 select straight_join * from t1 x, t1 y where y.a=x.d and y.b=x.e;
5890 d e f a b c d e f a b c
5891 1 2 3 1 2 3 1 2 3 1 2 3
5892 1 2 3 1 2 3 1 2 3 1 2 4
5893 1 2 3 1 2 4 1 2 3 1 2 3
5894 1 2 3 1 2 4 1 2 3 1 2 4
5895 1 2 3 2 3 4 1 2 3 1 2 3
5896 1 2 3 2 3 4 1 2 3 1 2 4
5897 1 2 3 3 4 5 1 2 3 1 2 3
5898 1 2 3 3 4 5 1 2 3 1 2 4
5899 1 2 3 4 5 6 1 2 3 1 2 3
5900 1 2 3 4 5 6 1 2 3 1 2 4
5901 1 2 3 5 6 7 1 2 3 1 2 3
5902 1 2 3 5 6 7 1 2 3 1 2 4
5903 1 2 3 6 7 8 1 2 3 1 2 3
5904 1 2 3 6 7 8 1 2 3 1 2 4
5905 1 2 3 7 8 9 1 2 3 1 2 3
5906 1 2 3 7 8 9 1 2 3 1 2 4
5907 alter table t1 partition by key (a,b) partitions 8;
5908 select straight_join * from t1 x, t1 y where y.a=x.d and y.b=x.e;
5909 d e f a b c d e f a b c
5910 1 2 3 1 2 3 1 2 3 1 2 3
5911 1 2 3 1 2 3 1 2 3 1 2 4
5912 1 2 3 1 2 4 1 2 3 1 2 3
5913 1 2 3 1 2 4 1 2 3 1 2 4
5914 1 2 3 2 3 4 1 2 3 1 2 3
5915 1 2 3 2 3 4 1 2 3 1 2 4
5916 1 2 3 3 4 5 1 2 3 1 2 3
5917 1 2 3 3 4 5 1 2 3 1 2 4
5918 1 2 3 4 5 6 1 2 3 1 2 3
5919 1 2 3 4 5 6 1 2 3 1 2 4
5920 1 2 3 5 6 7 1 2 3 1 2 3
5921 1 2 3 5 6 7 1 2 3 1 2 4
5922 1 2 3 6 7 8 1 2 3 1 2 3
5923 1 2 3 6 7 8 1 2 3 1 2 4
5924 1 2 3 7 8 9 1 2 3 1 2 3
5925 1 2 3 7 8 9 1 2 3 1 2 4
5926 alter table t1 partition by key (b,a) partitions 8;
5927 select straight_join * from t1 x, t1 y where y.a=x.d and y.b=x.e;
5928 d e f a b c d e f a b c
5929 1 2 3 1 2 3 1 2 3 1 2 3
5930 1 2 3 1 2 3 1 2 3 1 2 4
5931 1 2 3 1 2 4 1 2 3 1 2 3
5932 1 2 3 1 2 4 1 2 3 1 2 4
5933 1 2 3 2 3 4 1 2 3 1 2 3
5934 1 2 3 2 3 4 1 2 3 1 2 4
5935 1 2 3 3 4 5 1 2 3 1 2 3
5936 1 2 3 3 4 5 1 2 3 1 2 4
5937 1 2 3 4 5 6 1 2 3 1 2 3
5938 1 2 3 4 5 6 1 2 3 1 2 4
5939 1 2 3 5 6 7 1 2 3 1 2 3
5940 1 2 3 5 6 7 1 2 3 1 2 4
5941 1 2 3 6 7 8 1 2 3 1 2 3
5942 1 2 3 6 7 8 1 2 3 1 2 4
5943 1 2 3 7 8 9 1 2 3 1 2 3
5944 1 2 3 7 8 9 1 2 3 1 2 4
5945 alter table t1 partition by key (b) partitions 8;
5946 select straight_join * from t1 x, t1 y where y.a=x.d and y.b=2;
5947 d e f a b c d e f a b c
5948 1 2 3 1 2 3 1 2 3 1 2 3
5949 1 2 3 1 2 3 1 2 3 1 2 4
5950 1 2 3 1 2 4 1 2 3 1 2 3
5951 1 2 3 1 2 4 1 2 3 1 2 4
5952 1 2 3 2 3 4 1 2 3 1 2 3
5953 1 2 3 2 3 4 1 2 3 1 2 4
5954 1 2 3 3 4 5 1 2 3 1 2 3
5955 1 2 3 3 4 5 1 2 3 1 2 4
5956 1 2 3 4 5 6 1 2 3 1 2 3
5957 1 2 3 4 5 6 1 2 3 1 2 4
5958 1 2 3 5 6 7 1 2 3 1 2 3
5959 1 2 3 5 6 7 1 2 3 1 2 4
5960 1 2 3 6 7 8 1 2 3 1 2 3
5961 1 2 3 6 7 8 1 2 3 1 2 4
5962 1 2 3 7 8 9 1 2 3 1 2 3
5963 1 2 3 7 8 9 1 2 3 1 2 4
5964 alter table t1 partition by key (a) partitions 8;
5965 select straight_join * from t1 x, t1 y where y.a=1 and y.b=x.e;
5966 d e f a b c d e f a b c
5967 1 2 3 1 2 3 1 2 3 1 2 3
5968 1 2 3 1 2 3 1 2 3 1 2 4
5969 1 2 3 1 2 4 1 2 3 1 2 3
5970 1 2 3 1 2 4 1 2 3 1 2 4
5971 1 2 3 2 3 4 1 2 3 1 2 3
5972 1 2 3 2 3 4 1 2 3 1 2 4
5973 1 2 3 3 4 5 1 2 3 1 2 3
5974 1 2 3 3 4 5 1 2 3 1 2 4
5975 1 2 3 4 5 6 1 2 3 1 2 3
5976 1 2 3 4 5 6 1 2 3 1 2 4
5977 1 2 3 5 6 7 1 2 3 1 2 3
5978 1 2 3 5 6 7 1 2 3 1 2 4
5979 1 2 3 6 7 8 1 2 3 1 2 3
5980 1 2 3 6 7 8 1 2 3 1 2 4
5981 1 2 3 7 8 9 1 2 3 1 2 3
5982 1 2 3 7 8 9 1 2 3 1 2 4
5983 select straight_join * from t1 x, t1 y where y.a=0 and y.b=x.e;
5984 d e f a b c d e f a b c
5985 alter table t1 partition by key (a,b) partitions 8;
5986 select straight_join * from t1 x, t1 y where y.a=1 and y.b=x.e;
5987 d e f a b c d e f a b c
5988 1 2 3 1 2 3 1 2 3 1 2 3
5989 1 2 3 1 2 3 1 2 3 1 2 4
5990 1 2 3 1 2 4 1 2 3 1 2 3
5991 1 2 3 1 2 4 1 2 3 1 2 4
5992 1 2 3 2 3 4 1 2 3 1 2 3
5993 1 2 3 2 3 4 1 2 3 1 2 4
5994 1 2 3 3 4 5 1 2 3 1 2 3
5995 1 2 3 3 4 5 1 2 3 1 2 4
5996 1 2 3 4 5 6 1 2 3 1 2 3
5997 1 2 3 4 5 6 1 2 3 1 2 4
5998 1 2 3 5 6 7 1 2 3 1 2 3
5999 1 2 3 5 6 7 1 2 3 1 2 4
6000 1 2 3 6 7 8 1 2 3 1 2 3
6001 1 2 3 6 7 8 1 2 3 1 2 4
6002 1 2 3 7 8 9 1 2 3 1 2 3
6003 1 2 3 7 8 9 1 2 3 1 2 4
6004 select straight_join * from t1 x, t1 y where y.a=x.d and y.b=2;
6005 d e f a b c d e f a b c
6006 1 2 3 1 2 3 1 2 3 1 2 3
6007 1 2 3 1 2 3 1 2 3 1 2 4
6008 1 2 3 1 2 4 1 2 3 1 2 3
6009 1 2 3 1 2 4 1 2 3 1 2 4
6010 1 2 3 2 3 4 1 2 3 1 2 3
6011 1 2 3 2 3 4 1 2 3 1 2 4
6012 1 2 3 3 4 5 1 2 3 1 2 3
6013 1 2 3 3 4 5 1 2 3 1 2 4
6014 1 2 3 4 5 6 1 2 3 1 2 3
6015 1 2 3 4 5 6 1 2 3 1 2 4
6016 1 2 3 5 6 7 1 2 3 1 2 3
6017 1 2 3 5 6 7 1 2 3 1 2 4
6018 1 2 3 6 7 8 1 2 3 1 2 3
6019 1 2 3 6 7 8 1 2 3 1 2 4
6020 1 2 3 7 8 9 1 2 3 1 2 3
6021 1 2 3 7 8 9 1 2 3 1 2 4
6022 alter table t1 drop primary key, add primary key using hash (d,b,a,c);
6023 alter table t1 partition by key (b) partitions 8;
6024 create index ix1 on t1(b,d,a);
6025 explain
6026 select straight_join * from t1 x, t1 y where y.a=x.d and y.b=x.e;
6027 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
6028 1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 ALL PRIMARY NULL NULL NULL # # Using pushed condition (`test`.`x`.`e` is not null)
6029 1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 ref ix1 ix1 4 test.x.e # # Using where; Using join buffer (Batched Key Access)
6030 Warnings:
6031 Note 1003 Can't push table 'y' as child, access type 'Batched-key' not implemented
6032 Note 1003 /* select#1 */ select straight_join `test`.`x`.`d` AS `d`,`test`.`x`.`e` AS `e`,`test`.`x`.`f` AS `f`,`test`.`x`.`a` AS `a`,`test`.`x`.`b` AS `b`,`test`.`x`.`c` AS `c`,`test`.`y`.`d` AS `d`,`test`.`y`.`e` AS `e`,`test`.`y`.`f` AS `f`,`test`.`y`.`a` AS `a`,`test`.`y`.`b` AS `b`,`test`.`y`.`c` AS `c` from `test`.`t1` `x` join `test`.`t1` `y` where ((`test`.`y`.`b` = `test`.`x`.`e`) and (`test`.`y`.`a` = `test`.`x`.`d`))
6033 insert into t1(a,b,c,d,e,f) values
6034 (8, 9, 0, 1, null, 3),
6035 (9, 9, 0, 1, 2, null);
6036 alter table t1 partition by key (b) partitions 8;
6037 select straight_join * from t1 x, t1 y where y.a=x.d and y.b=x.e;
6038 d e f a b c d e f a b c
6039 1 2 3 1 2 3 1 2 3 1 2 3
6040 1 2 3 1 2 3 1 2 3 1 2 4
6041 1 2 3 1 2 4 1 2 3 1 2 3
6042 1 2 3 1 2 4 1 2 3 1 2 4
6043 1 2 3 2 3 4 1 2 3 1 2 3
6044 1 2 3 2 3 4 1 2 3 1 2 4
6045 1 2 3 3 4 5 1 2 3 1 2 3
6046 1 2 3 3 4 5 1 2 3 1 2 4
6047 1 2 3 4 5 6 1 2 3 1 2 3
6048 1 2 3 4 5 6 1 2 3 1 2 4
6049 1 2 3 5 6 7 1 2 3 1 2 3
6050 1 2 3 5 6 7 1 2 3 1 2 4
6051 1 2 3 6 7 8 1 2 3 1 2 3
6052 1 2 3 6 7 8 1 2 3 1 2 4
6053 1 2 3 7 8 9 1 2 3 1 2 3
6054 1 2 3 7 8 9 1 2 3 1 2 4
6055 1 2 NULL 9 9 0 1 2 3 1 2 3
6056 1 2 NULL 9 9 0 1 2 3 1 2 4
6057 pruned
6058 0
6059 const_pruned
6060 0
6061 drop table t1;
6062 create table t1 (pk int primary key, a int, b int) engine=ndb
6063 comment="NDB_TABLE=PARTITION_BALANCE=FOR_RP_BY_LDM";
6064 create index ix1 on t1(b,a);
6065 insert into t1 values (0,10,10);
6066 insert into t1 values (1,10,20);
6067 insert into t1 values (2,20,20);
6068 insert into t1 values (3,10,10);
6069 insert into t1 values (4,10,20);
6070 insert into t1 values (5,10,20);
6071 insert into t1 values (6,10,10);
6072 insert into t1 values (7,10,10);
6073 insert into t1 values (8,10,20);
6074 insert into t1 values (9,10,10);
6075 explain select x1.pk,x1.a,x1.b from t1 as x1
6076 join t1 as x2 on x1.a=x2.b
6077 join t1 as x3 on x2.a=x3.b
6078 order by x1.pk limit 70;
6079 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
6080 1 SIMPLE x1 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 10 100.00 Using pushed condition (`test`.`x1`.`a` is not null); Using temporary; Using filesort
6081 1 SIMPLE x2 p0,p1,p2,p3,p4,p5,p6,p7 ref ix1 ix1 5 test.x1.a 2 100.00 Using pushed condition (`test`.`x2`.`a` is not null); Using join buffer (Batched Key Access)
6082 1 SIMPLE x3 p0,p1,p2,p3,p4,p5,p6,p7 ref ix1 ix1 5 test.x2.a 2 100.00 Using join buffer (Batched Key Access)
6083 Warnings:
6084 Note 1003 Can't push table 'x2' as child, access type 'Batched-key' not implemented
6085 Note 1003 Can't push table 'x3' as child, access type 'Batched-key' not implemented
6086 Note 1003 /* select#1 */ select `test`.`x1`.`pk` AS `pk`,`test`.`x1`.`a` AS `a`,`test`.`x1`.`b` AS `b` from `test`.`t1` `x1` join `test`.`t1` `x2` join `test`.`t1` `x3` where ((`test`.`x2`.`b` = `test`.`x1`.`a`) and (`test`.`x3`.`b` = `test`.`x2`.`a`)) order by `test`.`x1`.`pk` limit 70
6087 select x1.pk,x1.a,x1.b from t1 as x1
6088 join t1 as x2 on x1.a=x2.b
6089 join t1 as x3 on x2.a=x3.b
6090 order by x1.pk limit 70;
6091 pk a b
6092 0 10 10
6093 0 10 10
6094 0 10 10
6095 0 10 10
6096 0 10 10
6097 0 10 10
6098 0 10 10
6099 0 10 10
6100 0 10 10
6101 0 10 10
6102 0 10 10
6103 0 10 10
6104 0 10 10
6105 0 10 10
6106 0 10 10
6107 0 10 10
6108 0 10 10
6109 0 10 10
6110 0 10 10
6111 0 10 10
6112 0 10 10
6113 0 10 10
6114 0 10 10
6115 0 10 10
6116 0 10 10
6117 1 10 20
6118 1 10 20
6119 1 10 20
6120 1 10 20
6121 1 10 20
6122 1 10 20
6123 1 10 20
6124 1 10 20
6125 1 10 20
6126 1 10 20
6127 1 10 20
6128 1 10 20
6129 1 10 20
6130 1 10 20
6131 1 10 20
6132 1 10 20
6133 1 10 20
6134 1 10 20
6135 1 10 20
6136 1 10 20
6137 1 10 20
6138 1 10 20
6139 1 10 20
6140 1 10 20
6141 1 10 20
6142 2 20 20
6143 2 20 20
6144 2 20 20
6145 2 20 20
6146 2 20 20
6147 2 20 20
6148 2 20 20
6149 2 20 20
6150 2 20 20
6151 2 20 20
6152 2 20 20
6153 2 20 20
6154 2 20 20
6155 2 20 20
6156 2 20 20
6157 2 20 20
6158 2 20 20
6159 2 20 20
6160 2 20 20
6161 2 20 20
6162 explain select * from t1 as x1, t1 as x2 where x1.a=x2.b and x1.b = 3;
6163 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
6164 1 SIMPLE x1 p0,p1,p2,p3,p4,p5,p6,p7 ref ix1 ix1 5 const 3 100.00 Using pushed condition (`test`.`x1`.`a` is not null)
6165 1 SIMPLE x2 p0,p1,p2,p3,p4,p5,p6,p7 ref ix1 ix1 5 test.x1.a 2 100.00 Using join buffer (Batched Key Access)
6166 Warnings:
6167 Note 1003 Can't push table 'x2' as child, access type 'Batched-key' not implemented
6168 Note 1003 /* select#1 */ select `test`.`x1`.`pk` AS `pk`,`test`.`x1`.`a` AS `a`,`test`.`x1`.`b` AS `b`,`test`.`x2`.`pk` AS `pk`,`test`.`x2`.`a` AS `a`,`test`.`x2`.`b` AS `b` from `test`.`t1` `x1` join `test`.`t1` `x2` where ((`test`.`x1`.`b` = 3) and (`test`.`x2`.`b` = `test`.`x1`.`a`))
6169 select * from t1 as x1, t1 as x2 where x1.a=x2.b and x1.b = 3;
6170 pk a b pk a b
6171 drop table t1;
6172 create table t (pk int primary key, a int) engine=ndb
6173 comment="NDB_TABLE=PARTITION_BALANCE=FOR_RP_BY_LDM";
6174 insert into t values
6175 (1,1), (2,1),
6176 (4,3), (6,3),
6177 (7,4), (8,4);
6178 explain
6179 select distinct straight_join table1.pk FROM
6180 t as table1 join
6181 (t as table2 join
6182 (t as table3 join t as table4 on table3.pk = table4.a)
6183 on table2.pk = table3.pk )
6184 on table1.a = table4.pk
6185 where table2.pk != 6;
6186 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
6187 1 SIMPLE table1 p0,p1,p2,p3,p4,p5,p6,p7 ALL PRIMARY NULL NULL NULL # # Using pushed condition (`test`.`table1`.`a` is not null); Using temporary
6188 1 SIMPLE table2 p0,p1,p2,p3,p4,p5,p6,p7 range PRIMARY PRIMARY 4 NULL # # Using pushed condition (`test`.`table2`.`pk` <> 6); Using MRR; Distinct; Using join buffer (hash join)
6189 1 SIMPLE table3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.table2.pk # # Distinct; Using join buffer (Batched Key Access)
6190 1 SIMPLE table4 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.table1.a # # Using where; Distinct; Using join buffer (Batched Key Access)
6191 Warnings:
6192 Note 1003 Can't push table 'table2' as child, access type 'Range-scan' not implemented
6193 Note 1003 Can't push table 'table3' as child, access type 'Batched-key' not implemented
6194 Note 1003 Can't push table 'table4' as child, access type 'Batched-key' not implemented
6195 Note 1003 /* select#1 */ select straight_join distinct `test`.`table1`.`pk` AS `pk` from `test`.`t` `table1` join `test`.`t` `table2` join `test`.`t` `table3` join `test`.`t` `table4` where ((`test`.`table3`.`pk` = `test`.`table2`.`pk`) and (`test`.`table4`.`a` = `test`.`table2`.`pk`) and (`test`.`table4`.`pk` = `test`.`table1`.`a`) and (`test`.`table2`.`pk` <> 6))
6196 select distinct straight_join table1.pk FROM
6197 t as table1 join
6198 (t as table2 join
6199 (t as table3 join t as table4 on table3.pk = table4.a)
6200 on table2.pk = table3.pk )
6201 on table1.a = table4.pk
6202 where table2.pk != 6;
6203 pk
6204 1
6205 2
6206 drop table t;
6207 create table t (b int, a int, primary key (a,b)) engine=ndb
6208 comment="NDB_TABLE=PARTITION_BALANCE=FOR_RP_BY_LDM";
6209 insert into t values(0,0);
6210 explain
6211 select * from t as t1 join t as t2 on t2.a=t1.a where t1.a < 8 or t1.a >= 8;
6212 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
6213 1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL PRIMARY NULL NULL NULL # # Using pushed condition ((`test`.`t1`.`a` < 8) or (`test`.`t1`.`a` >= 8))
6214 1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.t1.a # # Using join buffer (Batched Key Access)
6215 Warnings:
6216 Note 1003 Can't push table 't2' as child, access type 'Batched-key' not implemented
6217 Note 1003 /* select#1 */ select `test`.`t1`.`b` AS `b`,`test`.`t1`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`a` AS `a` from `test`.`t` `t1` join `test`.`t` `t2` where ((`test`.`t2`.`a` = `test`.`t1`.`a`) and ((`test`.`t1`.`a` < 8) or (`test`.`t1`.`a` >= 8)))
6218 select * from t as t1 join t as t2 on t2.a=t1.a where t1.a < 8 or t1.a >= 8;
6219 b a b a
6220 0 0 0 0
6221 drop table t;
6222 create table t (pk1 int, pk2 int, primary key(pk1,pk2)) engine = ndb
6223 comment="NDB_TABLE=PARTITION_BALANCE=FOR_RP_BY_LDM";
6224 insert into t values (1,3), (3,6), (6,9), (9,1);
6225 explain
6226 select * from t as t1 join t as t2
6227 on t1.pk2 = t2.pk1
6228 where t1.pk1 != 6
6229 order by t1.pk1 DESC;
6230 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
6231 1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 range PRIMARY PRIMARY 4 NULL # # Using pushed condition (`test`.`t1`.`pk1` <> 6); Using MRR; Using temporary; Using filesort
6232 1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.t1.pk2 # # Using join buffer (Batched Key Access)
6233 Warnings:
6234 Note 1003 Can't push table 't2' as child, access type 'Batched-key' not implemented
6235 Note 1003 /* select#1 */ select `test`.`t1`.`pk1` AS `pk1`,`test`.`t1`.`pk2` AS `pk2`,`test`.`t2`.`pk1` AS `pk1`,`test`.`t2`.`pk2` AS `pk2` from `test`.`t` `t1` join `test`.`t` `t2` where ((`test`.`t2`.`pk1` = `test`.`t1`.`pk2`) and (`test`.`t1`.`pk1` <> 6)) order by `test`.`t1`.`pk1` desc
6236 select * from t as t1 join t as t2
6237 on t1.pk2 = t2.pk1
6238 where t1.pk1 != 6
6239 order by t1.pk1 DESC;
6240 pk1 pk2 pk1 pk2
6241 9 1 1 3
6242 3 6 6 9
6243 1 3 3 6
6244 drop table t;
6245 create table t (k int, uq int, unique key ix1 (uq)) engine = ndb
6246 comment="NDB_TABLE=PARTITION_BALANCE=FOR_RP_BY_LDM";
6247 insert into t values (1,3), (3,NULL), (6,9), (9,1);
6248 explain
6249 select straight_join * from t as a join t as b
6250 on a.uq=b.uq or b.uq is null;
6251 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
6252 1 SIMPLE a p0,p1,p2,p3,p4,p5,p6,p7 ALL ix1 NULL NULL NULL 4 100.00 NULL
6253 1 SIMPLE b p0,p1,p2,p3,p4,p5,p6,p7 ref_or_null ix1 ix1 5 test.a.uq 2 100.00 Using pushed condition ((`test`.`b`.`uq` = `test`.`a`.`uq`) or (`test`.`b`.`uq` is null))
6254 Warnings:
6255 Note 1003 Table 'b' is not pushable: Access type was not chosen at 'prepare' time
6256 Note 1003 /* select#1 */ select straight_join `test`.`a`.`k` AS `k`,`test`.`a`.`uq` AS `uq`,`test`.`b`.`k` AS `k`,`test`.`b`.`uq` AS `uq` from `test`.`t` `a` join `test`.`t` `b` where ((`test`.`b`.`uq` = `test`.`a`.`uq`) or (`test`.`b`.`uq` is null))
6257 select straight_join * from t as a join t as b
6258 on a.uq=b.uq or b.uq is null;
6259 k uq k uq
6260 1 3 1 3
6261 1 3 3 NULL
6262 3 NULL 3 NULL
6263 6 9 3 NULL
6264 6 9 6 9
6265 9 1 3 NULL
6266 9 1 9 1
6267 drop table t;
6268 create table t (k int primary key, uq int) engine = ndb
6269 comment="NDB_TABLE=PARTITION_BALANCE=FOR_RP_BY_LDM";
6270 insert into t values (1,3), (3,NULL), (6,9), (9,1);
6271 #############
6272 # WL#14370: AccessPath will contain a 'zero rows'-AccessPath in place
6273 # of the known 'false' condition.
6274 explain select * from t as a left join t as b
6275 on a.k is null and a.uq=b.uq;
6276 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
6277 1 SIMPLE a p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 4 100.00 NULL
6278 1 SIMPLE b p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 4 100.00 Using where; Using join buffer (hash join)
6279 Warnings:
6280 Note 1003 /* select#1 */ select `test`.`a`.`k` AS `k`,`test`.`a`.`uq` AS `uq`,`test`.`b`.`k` AS `k`,`test`.`b`.`uq` AS `uq` from `test`.`t` `a` left join `test`.`t` `b` on(((`test`.`b`.`uq` = `test`.`a`.`uq`) and (`test`.`a`.`k` is null))) where true
6281 explain format=tree select * from t as a left join t as b
6282 on a.k is null and a.uq=b.uq;
6283 EXPLAIN
6284 -> Left hash join (no condition)
6285 -> Table scan on a
6286 -> Hash
6287 -> Zero rows (Impossible filter)
6288
6289 select * from t as a left join t as b
6290 on a.k is null and a.uq=b.uq;
6291 k uq k uq
6292 1 3 NULL NULL
6293 3 NULL NULL NULL
6294 6 9 NULL NULL
6295 9 1 NULL NULL
6296 drop table t;
6297 create table tc(
6298 a varchar(10) not null,
6299 b varchar(10),
6300 c varchar(10),
6301 primary key (a),
6302 unique key uk1 (b, c)
6303 ) engine=ndbcluster
6304 comment="NDB_TABLE=PARTITION_BALANCE=FOR_RP_BY_LDM";
6305 insert into tc values ('aa','bb', 'x'), ('bb','cc', 'x'), ('cc', 'dd', 'x');
6306 explain select * from tc as x1
6307 right outer join tc as x2 on x1.b=x2.a
6308 left outer join tc as x3 on x2.b = x3.b and x1.c=x3.c;
6309 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
6310 1 SIMPLE x2 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 3 100.00 NULL
6311 1 SIMPLE x1 p0,p1,p2,p3,p4,p5,p6,p7 ref uk1 uk1 43 test.x2.a 1 100.00 Using join buffer (Batched Key Access)
6312 1 SIMPLE x3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref uk1 uk1 86 test.x2.b,test.x1.c 1 100.00 Using join buffer (Batched Key Access)
6313 Warnings:
6314 Note 1003 Can't push table 'x1' as child, access type 'Batched-key' not implemented
6315 Note 1003 Can't push table 'x3' as child, access type 'Batched-key' not implemented
6316 Note 1003 /* select#1 */ select `test`.`x1`.`a` AS `a`,`test`.`x1`.`b` AS `b`,`test`.`x1`.`c` AS `c`,`test`.`x2`.`a` AS `a`,`test`.`x2`.`b` AS `b`,`test`.`x2`.`c` AS `c`,`test`.`x3`.`a` AS `a`,`test`.`x3`.`b` AS `b`,`test`.`x3`.`c` AS `c` from `test`.`tc` `x2` left join `test`.`tc` `x1` on((`test`.`x1`.`b` = `test`.`x2`.`a`)) left join `test`.`tc` `x3` on(((`test`.`x3`.`c` = `test`.`x1`.`c`) and (`test`.`x3`.`b` = `test`.`x2`.`b`))) where true
6317 select * from tc as x1
6318 right outer join tc as x2 on x1.b=x2.a
6319 left outer join tc as x3 on x2.b = x3.b and x1.c=x3.c;
6320 a b c a b c a b c
6321 NULL NULL NULL aa bb x NULL NULL NULL
6322 aa bb x bb cc x bb cc x
6323 bb cc x cc dd x cc dd x
6324 explain select * from tc as x1, tc as x2 where x1.b=x2.a for update;
6325 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
6326 1 SIMPLE x1 p0,p1,p2,p3,p4,p5,p6,p7 ALL uk1 NULL NULL NULL 3 100.00 Using pushed condition (`test`.`x1`.`b` is not null)
6327 1 SIMPLE x2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 42 test.x1.b 1 100.00 Using join buffer (Batched Key Access)
6328 Warnings:
6329 Note 1003 Can't push table 'x2' as child, access type 'Batched-key' not implemented
6330 Note 1003 /* select#1 */ select `test`.`x1`.`a` AS `a`,`test`.`x1`.`b` AS `b`,`test`.`x1`.`c` AS `c`,`test`.`x2`.`a` AS `a`,`test`.`x2`.`b` AS `b`,`test`.`x2`.`c` AS `c` from `test`.`tc` `x1` join `test`.`tc` `x2` where (`test`.`x2`.`a` = `test`.`x1`.`b`)
6331 explain select * from tc as x1, tc as x2 where x1.b=x2.a;
6332 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
6333 1 SIMPLE x1 p0,p1,p2,p3,p4,p5,p6,p7 ALL uk1 NULL NULL NULL 3 100.00 Using pushed condition (`test`.`x1`.`b` is not null)
6334 1 SIMPLE x2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 42 test.x1.b 1 100.00 Using join buffer (Batched Key Access)
6335 Warnings:
6336 Note 1003 Can't push table 'x2' as child, access type 'Batched-key' not implemented
6337 Note 1003 /* select#1 */ select `test`.`x1`.`a` AS `a`,`test`.`x1`.`b` AS `b`,`test`.`x1`.`c` AS `c`,`test`.`x2`.`a` AS `a`,`test`.`x2`.`b` AS `b`,`test`.`x2`.`c` AS `c` from `test`.`tc` `x1` join `test`.`tc` `x2` where (`test`.`x2`.`a` = `test`.`x1`.`b`)
6338 drop table tc;
6339 create table t1 (
6340 a varchar(16) not null,
6341 b int not null,
6342 c varchar(16) not null,
6343 d int not null,
6344 primary key (a,b)
6345 ) engine ndb
6346 comment="NDB_TABLE=PARTITION_BALANCE=FOR_RP_BY_LDM"
6347 partition by key (a);
6348 insert into t1 values ('aaa', 1, 'aaa', 1);
6349 select * from t1 as q1, t1 as q2 where q1.a = 'aaa' and q1.c=q2.a;
6350 a b c d a b c d
6351 aaa 1 aaa 1 aaa 1 aaa 1
6352 drop table t1;
6353 CREATE TABLE t1 (
6354 id int NOT NULL AUTO_INCREMENT,
6355 t2_id int,
6356 PRIMARY KEY (id)
6357 ) ENGINE=ndbcluster DEFAULT CHARSET=latin1
6358 comment="NDB_TABLE=PARTITION_BALANCE=FOR_RP_BY_LDM";
6359 CREATE TABLE t2 (
6360 id int NOT NULL AUTO_INCREMENT,
6361 t3_id varchar(20) DEFAULT NULL,
6362 PRIMARY KEY (id)
6363 ) ENGINE=ndbcluster DEFAULT CHARSET=latin1
6364 comment="NDB_TABLE=PARTITION_BALANCE=FOR_RP_BY_LDM";
6365 CREATE TABLE t3 (
6366 id varchar(20) NOT NULL,
6367 PRIMARY KEY (`id`)
6368 ) ENGINE=ndbcluster DEFAULT CHARSET=latin1
6369 comment="NDB_TABLE=PARTITION_BALANCE=FOR_RP_BY_LDM";
6370 CREATE TABLE t4 (
6371 pk int NOT NULL,
6372 id varchar(20) NOT NULL,
6373 PRIMARY KEY (pk),
6374 UNIQUE KEY (`id`)
6375 ) ENGINE=ndbcluster DEFAULT CHARSET=latin1
6376 comment="NDB_TABLE=PARTITION_BALANCE=FOR_RP_BY_LDM";
6377 INSERT INTO t1 VALUES (20, NULL);
6378 INSERT INTO t1 VALUES (23, 24);
6379 INSERT INTO t2 VALUES (24, NULL);
6380 EXPLAIN
6381 SELECT *
6382 FROM t1
6383 INNER JOIN t2 ON t2.id = t1.t2_id
6384 LEFT OUTER JOIN t3 ON t3.id = t2.t3_id
6385 WHERE t1.id = 20;
6386 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
6387 1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 const 1 100.00 Using where
6388 1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.t1.t2_id 1 100.00 Using join buffer (Batched Key Access)
6389 1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 22 test.t2.t3_id 1 100.00 Using join buffer (Batched Key Access)
6390 Warnings:
6391 Note 1003 Can't push table 't2' as child, access type 'Batched-key' not implemented
6392 Note 1003 Can't push table 't3' as child, access type 'Batched-key' not implemented
6393 Note 1003 /* select#1 */ select `test`.`t1`.`id` AS `id`,`test`.`t1`.`t2_id` AS `t2_id`,`test`.`t2`.`id` AS `id`,`test`.`t2`.`t3_id` AS `t3_id`,`test`.`t3`.`id` AS `id` from `test`.`t1` join `test`.`t2` left join `test`.`t3` on((`test`.`t3`.`id` = `test`.`t2`.`t3_id`)) where ((`test`.`t2`.`id` = `test`.`t1`.`t2_id`) and (`test`.`t1`.`id` = 20))
6394 SELECT *
6395 FROM t1
6396 INNER JOIN t2 ON t2.id = t1.t2_id
6397 LEFT OUTER JOIN t3 ON t3.id = t2.t3_id
6398 WHERE t1.id = 20;
6399 id t2_id id t3_id id
6400 EXPLAIN
6401 SELECT *
6402 FROM t1
6403 INNER JOIN t2 ON t2.id = t1.t2_id
6404 LEFT OUTER JOIN t3 ON t3.id = t2.t3_id
6405 WHERE t1.id = 23;
6406 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
6407 1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 const 1 100.00 Using where
6408 1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.t1.t2_id 1 100.00 Using join buffer (Batched Key Access)
6409 1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 22 test.t2.t3_id 1 100.00 Using join buffer (Batched Key Access)
6410 Warnings:
6411 Note 1003 Can't push table 't2' as child, access type 'Batched-key' not implemented
6412 Note 1003 Can't push table 't3' as child, access type 'Batched-key' not implemented
6413 Note 1003 /* select#1 */ select `test`.`t1`.`id` AS `id`,`test`.`t1`.`t2_id` AS `t2_id`,`test`.`t2`.`id` AS `id`,`test`.`t2`.`t3_id` AS `t3_id`,`test`.`t3`.`id` AS `id` from `test`.`t1` join `test`.`t2` left join `test`.`t3` on((`test`.`t3`.`id` = `test`.`t2`.`t3_id`)) where ((`test`.`t2`.`id` = `test`.`t1`.`t2_id`) and (`test`.`t1`.`id` = 23))
6414 SELECT *
6415 FROM t1
6416 INNER JOIN t2 ON t2.id = t1.t2_id
6417 LEFT OUTER JOIN t3 ON t3.id = t2.t3_id
6418 WHERE t1.id = 23;
6419 id t2_id id t3_id id
6420 23 24 24 NULL NULL
6421 EXPLAIN
6422 SELECT *
6423 FROM t1
6424 INNER JOIN t2 ON t2.id = t1.t2_id
6425 LEFT OUTER JOIN t4 ON t4.id = t2.t3_id
6426 WHERE t1.id = 23;
6427 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
6428 1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 const 1 100.00 Using where
6429 1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.t1.t2_id 1 100.00 Using join buffer (Batched Key Access)
6430 1 SIMPLE t4 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref id id 22 test.t2.t3_id 1 100.00 Using join buffer (Batched Key Access)
6431 Warnings:
6432 Note 1003 Can't push table 't2' as child, access type 'Batched-key' not implemented
6433 Note 1003 Can't push table 't4' as child, access type 'Batched-key' not implemented
6434 Note 1003 /* select#1 */ select `test`.`t1`.`id` AS `id`,`test`.`t1`.`t2_id` AS `t2_id`,`test`.`t2`.`id` AS `id`,`test`.`t2`.`t3_id` AS `t3_id`,`test`.`t4`.`pk` AS `pk`,`test`.`t4`.`id` AS `id` from `test`.`t1` join `test`.`t2` left join `test`.`t4` on((`test`.`t4`.`id` = `test`.`t2`.`t3_id`)) where ((`test`.`t2`.`id` = `test`.`t1`.`t2_id`) and (`test`.`t1`.`id` = 23))
6435 SELECT *
6436 FROM t1
6437 INNER JOIN t2 ON t2.id = t1.t2_id
6438 LEFT OUTER JOIN t4 ON t4.id = t2.t3_id
6439 WHERE t1.id = 23;
6440 id t2_id id t3_id pk id
6441 23 24 24 NULL NULL NULL
6442 EXPLAIN
6443 SELECT *
6444 FROM t1
6445 LEFT OUTER JOIN t2 ON t2.id = t1.t2_id
6446 LEFT OUTER JOIN t2 as t3 ON t3.id = t1.t2_id;
6447 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
6448 1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 2 100.00 NULL
6449 1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.t1.t2_id 1 100.00 Using join buffer (Batched Key Access)
6450 1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.t1.t2_id 1 100.00 Using join buffer (Batched Key Access)
6451 Warnings:
6452 Note 1003 Can't push table 't2' as child, access type 'Batched-key' not implemented
6453 Note 1003 Can't push table 't3' as child, access type 'Batched-key' not implemented
6454 Note 1003 /* select#1 */ select `test`.`t1`.`id` AS `id`,`test`.`t1`.`t2_id` AS `t2_id`,`test`.`t2`.`id` AS `id`,`test`.`t2`.`t3_id` AS `t3_id`,`test`.`t3`.`id` AS `id`,`test`.`t3`.`t3_id` AS `t3_id` from `test`.`t1` left join `test`.`t2` on((`test`.`t2`.`id` = `test`.`t1`.`t2_id`)) left join `test`.`t2` `t3` on((`test`.`t3`.`id` = `test`.`t1`.`t2_id`)) where true
6455 SELECT *
6456 FROM t1
6457 LEFT OUTER JOIN t2 ON t2.id = t1.t2_id
6458 LEFT OUTER JOIN t2 as t3 ON t3.id = t1.t2_id;
6459 id t2_id id t3_id id t3_id
6460 20 NULL NULL NULL NULL NULL
6461 23 24 24 NULL 24 NULL
6462 DROP TABLE t1,t2,t3,t4;
6463 CREATE TABLE t1 (
6464 a int NOT NULL,
6465 b int NOT NULL,
6466 c int NOT NULL,
6467 d int,
6468 PRIMARY KEY (`a`,`b`),
6469 unique key(c)
6470 ) ENGINE=ndbcluster
6471 comment="NDB_TABLE=PARTITION_BALANCE=FOR_RP_BY_LDM";
6472 insert into t1 values
6473 (1,1,1,1),
6474 (1,2,2,1),
6475 (1,3,3,1),
6476 (1,4,4,1),
6477 (1,5,5,2),
6478 (1,6,6,2),
6479 (1,7,7,2),
6480 (1,8,8,2);
6481 explain select count(*) from t1 as x1
6482 join (t1 as x2
6483 left join (t1 as x3
6484 cross join t1 as x4)
6485 on x2.d=x3.a)
6486 on x2.c is null or x1.a=x4.d;
6487 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
6488 1 SIMPLE x2 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 8 100.00 NULL
6489 1 SIMPLE x3 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.x2.d 1 100.00 Using join buffer (Batched Key Access)
6490 1 SIMPLE x4 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 8 100.00 Parent of 2 pushed join@1; Using where; Using join buffer (hash join)
6491 1 SIMPLE x1 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.x4.d 1 100.00 Child of 'x4' in pushed join@1; Using join buffer (Batched Key Access)
6492 Warnings:
6493 Note 1003 Can't push table 'x4' as child, 'type' must be a 'ref' access
6494 Note 1003 Can't push outer joined table 'x3' as child of 'x2', some tables in embedding join-nest(s) are not part of pushed join
6495 Note 1003 Can't push table 'x1' as child of 'x2', column 'x4.d' refers a table which was not pushed
6496 Note 1003 Can't push table 'x1' as child of 'x3', column 'x4.d' refers a table which was not pushed
6497 Note 1003 /* select#1 */ select count(0) AS `count(*)` from `test`.`t1` `x1` join `test`.`t1` `x2` left join (`test`.`t1` `x3` join `test`.`t1` `x4`) on((`test`.`x3`.`a` = `test`.`x2`.`d`)) where (`test`.`x1`.`a` = `test`.`x4`.`d`)
6498 select count(*) from t1 as x1
6499 join (t1 as x2
6500 left join (t1 as x3
6501 cross join t1 as x4)
6502 on x2.d=x3.a)
6503 on x2.c is null or x1.a=x4.d;
6504 count(*)
6505 1024
6506 explain select count(*) from t1 as x1
6507 left join (t1 as x2
6508 cross join t1 as x3)
6509 on x1.d=x2.a;
6510 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
6511 1 SIMPLE x1 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 8 100.00 NULL
6512 1 SIMPLE x2 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.x1.d 1 100.00 Using join buffer (Batched Key Access)
6513 1 SIMPLE x3 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 8 100.00 Using join buffer (hash join)
6514 Warnings:
6515 Note 1003 Can't push table 'x3' as child, 'type' must be a 'ref' access
6516 Note 1003 Can't push outer joined table 'x2' as child of 'x1', some tables in embedding join-nest(s) are not part of pushed join
6517 Note 1003 /* select#1 */ select count(0) AS `count(*)` from `test`.`t1` `x1` left join (`test`.`t1` `x2` join `test`.`t1` `x3`) on((`test`.`x2`.`a` = `test`.`x1`.`d`)) where true
6518 select count(*) from t1 as x1
6519 left join (t1 as x2
6520 cross join t1 as x3)
6521 on x1.d=x2.a;
6522 count(*)
6523 260
6524 #################
6525 # Prior to WL#14370 we did 'pending condition' analysis inside the
6526 # join pushdown handler. That code took a too conservative approach
6527 # in identifying such pending conditions, somethimes resulting in pushdown
6528 # to be rejected due to 'table condition can not be fully evaluated...'
6529 # The AccessPath construction code does a much better job of identifying
6530 # these pending condition, and placing them at the correct branch level.
6531 # As this information is now available to us through the AccessPath
6532 # integration, we eliminated our own (incomplete) code for doing such
6533 # analysis and could avoid such false rejections at the same time.
6534 #
6535 # Note the diff in the traditional and tree format explain below:
6536 # The traditional explain says table x4 is 'using where', which was
6537 # incorrectly identified as a trigger condition on join(x2,x4).
6538 # The tree format explain shows that it has been liftet out of that
6539 # join scope as a 'filter' on the entire x1..x4 join - Thus there is
6540 # noting preventing the left-join(x2,x4)
6541 #################
6542 explain select count(*) from t1 as x0
6543 left join (t1 as x1
6544 join (t1 as x2
6545 left join (t1 as x3
6546 join t1 as x4 on x3.d=x4.a)
6547 on x2.d=x3.a)
6548 on x2.c is null or x1.a=x4.d)
6549 on x0.d=x1.a;
6550 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
6551 1 SIMPLE x0 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 8 100.00 NULL
6552 1 SIMPLE x1 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.x0.d 1 100.00 Using join buffer (Batched Key Access)
6553 1 SIMPLE x2 p0,p1,p2,p3,p4,p5,p6,p7 ALL c NULL NULL NULL 8 100.00 Parent of 3 pushed join@1; Using join buffer (hash join)
6554 1 SIMPLE x3 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.x2.d 1 100.00 Child of 'x2' in pushed join@1; Using join buffer (Batched Key Access)
6555 1 SIMPLE x4 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.x3.d 1 100.00 Child of 'x3' in pushed join@1; Using where; Using join buffer (Batched Key Access)
6556 Warnings:
6557 Note 1003 Can't push outer joined table 'x1' as child of 'x0', join-nest containing the table has FILTER conditions
6558 Note 1003 Can't push table 'x2' as child, 'type' must be a 'ref' access
6559 Note 1003 Can't push table 'x3' as child of 'x0', column 'x2.d' refers a table which was not pushed
6560 Note 1003 Can't push table 'x4' as child of 'x0', column 'x3.d' refers a table which was not pushed
6561 Note 1003 Can't push table 'x3' as child of 'x1', column 'x2.d' refers a table which was not pushed
6562 Note 1003 Can't push table 'x4' as child of 'x1', column 'x3.d' refers a table which was not pushed
6563 Note 1003 /* select#1 */ select count(0) AS `count(*)` from `test`.`t1` `x0` left join (`test`.`t1` `x1` join `test`.`t1` `x2` left join (`test`.`t1` `x3` join `test`.`t1` `x4`) on(((`test`.`x4`.`a` = `test`.`x3`.`d`) and (`test`.`x3`.`a` = `test`.`x2`.`d`)))) on(((`test`.`x1`.`a` = `test`.`x0`.`d`) and ((`test`.`x2`.`c` is null) or (`test`.`x4`.`d` = `test`.`x0`.`d`)))) where true
6564 explain format=tree select count(*) from t1 as x0
6565 left join (t1 as x1
6566 join (t1 as x2
6567 left join (t1 as x3
6568 join t1 as x4 on x3.d=x4.a)
6569 on x2.d=x3.a)
6570 on x2.c is null or x1.a=x4.d)
6571 on x0.d=x1.a;
6572 EXPLAIN
6573 -> Aggregate: count(0)
6574 -> Nested loop left join
6575 -> Table scan on x0
6576 -> Filter: ((x2.c is null) or (x4.d = x0.d))
6577 -> Nested loop left join
6578 -> Nested loop inner join
6579 -> Index lookup on x1 using PRIMARY (a=x0.d)
6580 -> Table scan on x2, activating pushed join of 3 tables
6581 -> Nested loop inner join
6582 -> Index lookup on x3 using PRIMARY (a=x2.d), child of x2 in pushed join
6583 -> Index lookup on x4 using PRIMARY (a=x3.d), child of x3 in pushed join
6584
6585 Warnings:
6586 Note 1003 Can't push outer joined table 'x1' as child of 'x0', join-nest containing the table has FILTER conditions
6587 Note 1003 Can't push table 'x2' as child, 'type' must be a 'ref' access
6588 Note 1003 Can't push table 'x3' as child of 'x0', column 'x2.d' refers a table which was not pushed
6589 Note 1003 Can't push table 'x4' as child of 'x0', column 'x3.d' refers a table which was not pushed
6590 Note 1003 Can't push table 'x3' as child of 'x1', column 'x2.d' refers a table which was not pushed
6591 Note 1003 Can't push table 'x4' as child of 'x1', column 'x3.d' refers a table which was not pushed
6592 select count(*) from t1 as x0
6593 left join (t1 as x1
6594 join (t1 as x2
6595 left join (t1 as x3
6596 join t1 as x4 on x3.d=x4.a)
6597 on x2.d=x3.a)
6598 on x2.c is null or x1.a=x4.d)
6599 on x0.d=x1.a;
6600 count(*)
6601 2052
6602 drop table t1;
6603 create table t1 (pk char(10) primary key, u int not null) engine=ndb
6604 comment="NDB_TABLE=PARTITION_BALANCE=FOR_RP_BY_LDM";
6605 create table t2 (pk int primary key, u int not null) engine=ndb
6606 comment="NDB_TABLE=PARTITION_BALANCE=FOR_RP_BY_LDM";
6607 insert into t1 values ('wh',1);
6608 insert into t1 values ('ik',2);
6609 insert into t1 values ('cu',3);
6610 insert into t1 values ('pw',4);
6611 insert into t1 values ('cq',4);
6612 insert into t2 values (1,2), (2,3), (3,4), (4,5);
6613 explain select * from t1 join t2 on t1.u = t2.pk order by t1.pk;
6614 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
6615 1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 5 100.00 Using temporary; Using filesort
6616 1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.t1.u 1 100.00 Using join buffer (Batched Key Access)
6617 Warnings:
6618 Note 1003 Can't push table 't2' as child, access type 'Batched-key' not implemented
6619 Note 1003 /* select#1 */ select `test`.`t1`.`pk` AS `pk`,`test`.`t1`.`u` AS `u`,`test`.`t2`.`pk` AS `pk`,`test`.`t2`.`u` AS `u` from `test`.`t1` join `test`.`t2` where (`test`.`t2`.`pk` = `test`.`t1`.`u`) order by `test`.`t1`.`pk`
6620 select * from t1 join t2 on t1.u = t2.pk order by t1.pk;
6621 pk u pk u
6622 cq 4 4 5
6623 cu 3 3 4
6624 ik 2 2 3
6625 pw 4 4 5
6626 wh 1 1 2
6627 drop table t1;
6628 drop table t2;
6629 create table t1 (
6630 a char(10) primary key,
6631 b char(10) not null,
6632 c char(10) not null,
6633 l00 char(255) not null,
6634 l01 char(255) not null,
6635 l02 char(255) not null,
6636 l03 char(255) not null,
6637 l04 char(255) not null,
6638 l05 char(255) not null,
6639 l06 char(255) not null,
6640 l07 char(255) not null,
6641 l08 char(255) not null,
6642 l09 char(255) not null,
6643 l10 char(255) not null,
6644 l11 char(255) not null,
6645 l12 char(255) not null,
6646 l13 char(255) not null,
6647 l14 char(255) not null,
6648 l15 char(255) not null,
6649 l16 char(255) not null,
6650 l17 char(255) not null,
6651 l18 char(255) not null,
6652 l19 char(255) not null,
6653 l20 char(255) not null,
6654 l21 char(255) not null,
6655 l22 char(255) not null,
6656 l23 char(255) not null,
6657 l24 char(255) not null,
6658 l25 char(255) not null,
6659 l26 char(255) not null,
6660 l27 char(255) not null,
6661 l28 char(255) not null,
6662 l29 char(255) not null,
6663 l30 char(255) not null,
6664 l31 char(255) not null,
6665 index(c, b)
6666 ) engine=ndb character set latin1 partition by key(a) partitions 8;
6667 insert into t1 values ('a','a','a','x','x','x','x','x','x','x','x','x','x','x','x','x','x','x','x','x','x','x','x','x','x','x','x','x','x','x','x','x','x','x','x');
6668 insert into t1 values ('b','b','b','x','x','x','x','x','x','x','x','x','x','x','x','x','x','x','x','x','x','x','x','x','x','x','x','x','x','x','x','x','x','x','x');
6669 insert into t1 values ('c','c','c','x','x','x','x','x','x','x','x','x','x','x','x','x','x','x','x','x','x','x','x','x','x','x','x','x','x','x','x','x','x','x','x');
6670 explain select count(*) from t1 as x1 join t1 as x2 on x1.b = x2.c;
6671 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
6672 1 SIMPLE x1 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL # # NULL
6673 1 SIMPLE x2 p0,p1,p2,p3,p4,p5,p6,p7 ref c c 10 test.x1.b # # Using join buffer (Batched Key Access)
6674 Warnings:
6675 Note 1003 Can't push table 'x2' as child, access type 'Batched-key' not implemented
6676 Note 1003 /* select#1 */ select count(0) AS `count(*)` from `test`.`t1` `x1` join `test`.`t1` `x2` where (`test`.`x2`.`c` = `test`.`x1`.`b`)
6677 select count(*) from t1 as x1 join t1 as x2 on x1.b = x2.c;
6678 count(*)
6679 3
6680 drop table t1;
6681 create table t1
6682 (a int not null,
6683 b int not null,
6684 c int not null,
6685 d int not null,
6686 primary key(a,b,c,d)) engine=ndb
6687 comment="NDB_TABLE=PARTITION_BALANCE=FOR_RP_BY_LDM"
6688 partition by key (b,c);
6689 insert into t1 values (0x4f, 0x4f, 0x4f, 0x4f);
6690 explain select * from t1 as x1
6691 join t1 as x2 on x1.c=0x4f and x2.a=0+x1.b and x2.b=x1.b
6692 join t1 as x3 on x3.a=x2.d and x3.b=x1.d and x3.c=x2.c;
6693 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
6694 1 SIMPLE x1 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL # # Using pushed condition (`test`.`x1`.`c` = 0x4f)
6695 1 SIMPLE x2 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 8 func,test.x1.b # # Using where; Using join buffer (Batched Key Access)
6696 1 SIMPLE x3 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 12 test.x2.d,test.x1.d,test.x2.c # # Using join buffer (Batched Key Access)
6697 Warnings:
6698 Note 1003 Can't push table 'x2' as child, access type 'Batched-key' not implemented
6699 Note 1003 Can't push table 'x3' as child, access type 'Batched-key' not implemented
6700 Note 1003 /* select#1 */ select `test`.`x1`.`a` AS `a`,`test`.`x1`.`b` AS `b`,`test`.`x1`.`c` AS `c`,`test`.`x1`.`d` AS `d`,`test`.`x2`.`a` AS `a`,`test`.`x2`.`b` AS `b`,`test`.`x2`.`c` AS `c`,`test`.`x2`.`d` AS `d`,`test`.`x3`.`a` AS `a`,`test`.`x3`.`b` AS `b`,`test`.`x3`.`c` AS `c`,`test`.`x3`.`d` AS `d` from `test`.`t1` `x1` join `test`.`t1` `x2` join `test`.`t1` `x3` where ((`test`.`x2`.`b` = `test`.`x1`.`b`) and (`test`.`x3`.`c` = `test`.`x2`.`c`) and (`test`.`x3`.`b` = `test`.`x1`.`d`) and (`test`.`x3`.`a` = `test`.`x2`.`d`) and (`test`.`x1`.`c` = 0x4f) and (`test`.`x2`.`a` = (0 + `test`.`x1`.`b`)))
6701 select * from t1 as x1
6702 join t1 as x2 on x1.c=0x4f and x2.a=0+x1.b and x2.b=x1.b
6703 join t1 as x3 on x3.a=x2.c and x3.b=x1.d and x3.c=x2.c;
6704 a b c d a b c d a b c d
6705 79 79 79 79 79 79 79 79 79 79 79 79
6706 explain select * from t1 as x1
6707 join t1 as x2 on x1.c=0x4f and x2.a=0+x1.b and x2.b=x1.b
6708 join t1 as x3 on x3.a=x2.d and x3.b=x1.d and x3.c=0x4f;
6709 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
6710 1 SIMPLE x1 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL # # Using pushed condition (`test`.`x1`.`c` = 0x4f)
6711 1 SIMPLE x2 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 8 func,test.x1.b # # Using where; Using join buffer (Batched Key Access)
6712 1 SIMPLE x3 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 12 test.x2.d,test.x1.d,const # # Using join buffer (Batched Key Access)
6713 Warnings:
6714 Note 1003 Can't push table 'x2' as child, access type 'Batched-key' not implemented
6715 Note 1003 Can't push table 'x3' as child, access type 'Batched-key' not implemented
6716 Note 1003 /* select#1 */ select `test`.`x1`.`a` AS `a`,`test`.`x1`.`b` AS `b`,`test`.`x1`.`c` AS `c`,`test`.`x1`.`d` AS `d`,`test`.`x2`.`a` AS `a`,`test`.`x2`.`b` AS `b`,`test`.`x2`.`c` AS `c`,`test`.`x2`.`d` AS `d`,`test`.`x3`.`a` AS `a`,`test`.`x3`.`b` AS `b`,`test`.`x3`.`c` AS `c`,`test`.`x3`.`d` AS `d` from `test`.`t1` `x1` join `test`.`t1` `x2` join `test`.`t1` `x3` where ((`test`.`x2`.`b` = `test`.`x1`.`b`) and (`test`.`x3`.`b` = `test`.`x1`.`d`) and (`test`.`x3`.`a` = `test`.`x2`.`d`) and (`test`.`x3`.`c` = 0x4f) and (`test`.`x1`.`c` = 0x4f) and (`test`.`x2`.`a` = (0 + `test`.`x1`.`b`)))
6717 select * from t1 as x1
6718 join t1 as x2 on x1.c=0x4f and x2.a=0+x1.b and x2.b=x1.b
6719 join t1 as x3 on x3.a=x2.c and x3.b=x1.d and x3.c=0x4f;
6720 a b c d a b c d a b c d
6721 79 79 79 79 79 79 79 79 79 79 79 79
6722 drop table t1;
6723 create table t1 (
6724 k1 int primary key,
6725 i int,
6726 name varchar(32),
6727 key (name)
6728 )
6729 default charset = utf8
6730 engine = ndb
6731 comment="NDB_TABLE=PARTITION_BALANCE=FOR_RP_BY_LDM";
6732 Warnings:
6733 Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous.
6734 insert into t1 values (1, 1, 'Ole');
6735 insert into t1 values (2, 2, 'Dole');
6736 insert into t1 values (3, 3, 'Doffen');
6737 insert into t1 values (4, 4, 'row# 999');
6738 set @save_range_opt_max = @@session.range_optimizer_max_mem_size;
6739 set range_optimizer_max_mem_size = 64*1024;
6740 ------------------------------------------------------------------
6741
6742 explain select * from t1 x, t1 y where y.k1=x.i and x.name in ('foo', .... 'row# 1999' );
6743 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
6744 1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 ALL name NULL NULL NULL 4 50.00 Using pushed condition ((`test`.`x`.`name` in ('foo', .... 'row# 1999')) and (`test`.`x`.`i` is not null))
6745 1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.x.i 1 100.00 Using join buffer (Batched Key Access)
6746 Warnings:
6747 Warning 3170 Memory capacity of 65536 bytes for 'range_optimizer_max_mem_size' exceeded. Range optimization was not done for this query.
6748 Note 1003 Can't push table 'y' as child, access type 'Batched-key' not implemented
6749 Note 1003 /* select#1 */ select `test`.`x`.`k1` AS `k1`,`test`.`x`.`i` AS `i`,`test`.`x`.`name` AS `name`,`test`.`y`.`k1` AS `k1`,`test`.`y`.`i` AS `i`,`test`.`y`.`name` AS `name` from `test`.`t1` `x` join `test`.`t1` `y` where ((`test`.`y`.`k1` = `test`.`x`.`i`) and (`test`.`x`.`name` in ('foo', .... 'row# 1999')))
6750 select * from t1 x, t1 y where y.k1=x.i and x.name in ('foo', .... 'row# 1999' );
6751 k1 i name k1 i name
6752 4 4 row# 999 4 4 row# 999
6753 Warnings:
6754 Warning 3170 Memory capacity of 65536 bytes for 'range_optimizer_max_mem_size' exceeded. Range optimization was not done for this query.
6755 ------------------------------------------------------------------
6756
6757 explain select * from t1 x, t1 y where y.k1=x.i and x.name in ('foo', .... 'row# 3999' );
6758 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
6759 1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 ALL name NULL NULL NULL 4 50.00 Using where
6760 1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.x.i 1 100.00 Using join buffer (Batched Key Access)
6761 Warnings:
6762 Warning 3170 Memory capacity of 65536 bytes for 'range_optimizer_max_mem_size' exceeded. Range optimization was not done for this query.
6763 Note 1003 Can't push table 'y' as child, access type 'Batched-key' not implemented
6764 Warning 4294 Scan filter is too large, discarded
6765 Note 1003 /* select#1 */ select `test`.`x`.`k1` AS `k1`,`test`.`x`.`i` AS `i`,`test`.`x`.`name` AS `name`,`test`.`y`.`k1` AS `k1`,`test`.`y`.`i` AS `i`,`test`.`y`.`name` AS `name` from `test`.`t1` `x` join `test`.`t1` `y` where ((`test`.`y`.`k1` = `test`.`x`.`i`) and (`test`.`x`.`name` in ('foo', .... 'row# 3999')))
6766 select * from t1 x, t1 y where y.k1=x.i and x.name in ('foo', .... 'row# 3999' );
6767 k1 i name k1 i name
6768 4 4 row# 999 4 4 row# 999
6769 Warnings:
6770 Warning 3170 Memory capacity of 65536 bytes for 'range_optimizer_max_mem_size' exceeded. Range optimization was not done for this query.
6771 Warning 4294 Scan filter is too large, discarded
6772 ------------------------------------------------------------------
6773
6774 explain select * from t1 x where x.name in ('foo', .... 'row# 3999' );
6775 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
6776 1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 ALL name NULL NULL NULL 4 50.00 Using where
6777 Warnings:
6778 Warning 3170 Memory capacity of 65536 bytes for 'range_optimizer_max_mem_size' exceeded. Range optimization was not done for this query.
6779 Warning 4294 Scan filter is too large, discarded
6780 Note 1003 /* select#1 */ select `test`.`x`.`k1` AS `k1`,`test`.`x`.`i` AS `i`,`test`.`x`.`name` AS `name` from `test`.`t1` `x` where (`test`.`x`.`name` in ('foo', .... 'row# 3999'))
6781 select * from t1 x where x.name in ('foo', .... 'row# 3999' );
6782 k1 i name
6783 4 4 row# 999
6784 Warnings:
6785 Warning 3170 Memory capacity of 65536 bytes for 'range_optimizer_max_mem_size' exceeded. Range optimization was not done for this query.
6786 Warning 4294 Scan filter is too large, discarded
6787 insert into t1 values (5, 4, 'row# 1');
6788 insert into t1 values (6, 4, 'row# 2');
6789 insert into t1 values (7, 4, 'row# 3');
6790 insert into t1 values (8, 4, 'row# 4');
6791 ------------------------------------------------------------------
6792
6793 explain select straight_join * from t1 x, t1 y where y.k1=x.i and y.name in ('foo', .... 'row# 999' ) order by x.k1;
6794 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
6795 1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 8 100.00 Using pushed condition (`test`.`x`.`i` is not null); Using temporary; Using filesort
6796 1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY,name PRIMARY 4 test.x.i 1 50.00 Using pushed condition (`test`.`y`.`name` in ('foo', .... 'row# 999')); Using join buffer (Batched Key Access)
6797 Warnings:
6798 Warning 3170 Memory capacity of 65536 bytes for 'range_optimizer_max_mem_size' exceeded. Range optimization was not done for this query.
6799 Note 1003 Can't push table 'y' as child, access type 'Batched-key' not implemented
6800 Note 1003 /* select#1 */ select straight_join `test`.`x`.`k1` AS `k1`,`test`.`x`.`i` AS `i`,`test`.`x`.`name` AS `name`,`test`.`y`.`k1` AS `k1`,`test`.`y`.`i` AS `i`,`test`.`y`.`name` AS `name` from `test`.`t1` `x` join `test`.`t1` `y` where ((`test`.`y`.`k1` = `test`.`x`.`i`) and (`test`.`y`.`name` in ('foo', .... 'row# 999'))) order by `test`.`x`.`k1`
6801 select straight_join * from t1 x, t1 y where y.k1=x.i and y.name in ('foo', .... 'row# 999' ) order by x.k1;
6802 k1 i name k1 i name
6803 4 4 row# 999 4 4 row# 999
6804 5 4 row# 1 4 4 row# 999
6805 6 4 row# 2 4 4 row# 999
6806 7 4 row# 3 4 4 row# 999
6807 8 4 row# 4 4 4 row# 999
6808 Warnings:
6809 Warning 3170 Memory capacity of 65536 bytes for 'range_optimizer_max_mem_size' exceeded. Range optimization was not done for this query.
6810 ------------------------------------------------------------------
6811
6812 explain select straight_join * from t1 x, t1 y where y.k1=x.i and y.name in ('foo', .... 'row# 3999' ) order by x.k1;
6813 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
6814 1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 8 100.00 Using pushed condition (`test`.`x`.`i` is not null); Using temporary; Using filesort
6815 1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY,name PRIMARY 4 test.x.i 1 50.00 Using where; Using join buffer (Batched Key Access)
6816 Warnings:
6817 Warning 3170 Memory capacity of 65536 bytes for 'range_optimizer_max_mem_size' exceeded. Range optimization was not done for this query.
6818 Note 1003 Can't push table 'y' as child, access type 'Batched-key' not implemented
6819 Warning 4294 Scan filter is too large, discarded
6820 Note 1003 /* select#1 */ select straight_join `test`.`x`.`k1` AS `k1`,`test`.`x`.`i` AS `i`,`test`.`x`.`name` AS `name`,`test`.`y`.`k1` AS `k1`,`test`.`y`.`i` AS `i`,`test`.`y`.`name` AS `name` from `test`.`t1` `x` join `test`.`t1` `y` where ((`test`.`y`.`k1` = `test`.`x`.`i`) and (`test`.`y`.`name` in ('foo', .... 'row# 3999'))) order by `test`.`x`.`k1`
6821 select straight_join * from t1 x, t1 y where y.k1=x.i and y.name in ('foo', .... 'row# 3999' ) order by x.k1;
6822 k1 i name k1 i name
6823 4 4 row# 999 4 4 row# 999
6824 5 4 row# 1 4 4 row# 999
6825 6 4 row# 2 4 4 row# 999
6826 7 4 row# 3 4 4 row# 999
6827 8 4 row# 4 4 4 row# 999
6828 Warnings:
6829 Warning 3170 Memory capacity of 65536 bytes for 'range_optimizer_max_mem_size' exceeded. Range optimization was not done for this query.
6830 Warning 4294 Scan filter is too large, discarded
6831 ------------------------------------------------------------------
6832
6833 explain select straight_join * from t1 x, t1 y where y.k1=x.i and y.name in ('foo', .... 'row# 1999' ) order by x.k1;
6834 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
6835 1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 8 100.00 Using pushed condition (`test`.`x`.`i` is not null); Using temporary; Using filesort
6836 1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY,name PRIMARY 4 test.x.i 1 50.00 Using pushed condition (`test`.`y`.`name` in ('foo', .... 'row# 1999')); Using join buffer (Batched Key Access)
6837 Warnings:
6838 Warning 3170 Memory capacity of 65536 bytes for 'range_optimizer_max_mem_size' exceeded. Range optimization was not done for this query.
6839 Note 1003 Can't push table 'y' as child, access type 'Batched-key' not implemented
6840 Note 1003 /* select#1 */ select straight_join `test`.`x`.`k1` AS `k1`,`test`.`x`.`i` AS `i`,`test`.`x`.`name` AS `name`,`test`.`y`.`k1` AS `k1`,`test`.`y`.`i` AS `i`,`test`.`y`.`name` AS `name` from `test`.`t1` `x` join `test`.`t1` `y` where ((`test`.`y`.`k1` = `test`.`x`.`i`) and (`test`.`y`.`name` in ('foo', .... 'row# 1999'))) order by `test`.`x`.`k1`
6841 select straight_join * from t1 x, t1 y where y.k1=x.i and y.name in ('foo', .... 'row# 1999' ) order by x.k1;
6842 k1 i name k1 i name
6843 4 4 row# 999 4 4 row# 999
6844 5 4 row# 1 4 4 row# 999
6845 6 4 row# 2 4 4 row# 999
6846 7 4 row# 3 4 4 row# 999
6847 8 4 row# 4 4 4 row# 999
6848 Warnings:
6849 Warning 3170 Memory capacity of 65536 bytes for 'range_optimizer_max_mem_size' exceeded. Range optimization was not done for this query.
6850 set range_optimizer_max_mem_size = @save_range_opt_max;
6851 drop table t1;
6852 ------------------------------------------------------------------
6853 Bug#35185670 'mysqld crashes on expensive query'
6854 or we may assert, or just hang until timeout...
6855
6856 create table t1 (
6857 k1 varchar(32) not null,
6858 k2 int not null default 0,
6859 primary key(k1,k2),
6860 i int default 0
6861 ) engine = ndbcluster
6862 partition by key() partitions 32;
6863 create table t2 (
6864 k1 int not null primary key
6865 ) engine = ndbcluster
6866 partition by key() partitions 32;
6867
6868 Inserting 2000 rows in table t1
6869 Table Op Msg_type Msg_text
6870 test.t1 analyze status OK
6871 Table Op Msg_type Msg_text
6872 test.t2 analyze status OK
6873
6874 Expect query and IN-condition to be pushed
6875 (If join_pushdown is enabled)
6876 explain select * from t1 left join t2 on t2.k1=t1.i where t1.k1 in ('foo', .... 'row# 1999' ) order by t1.k1, t1.k2;
6877 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
6878 1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12,p13,p14,p15,p16,p17,p18,p19,p20,p21,p22,p23,p24,p25,p26,p27,p28,p29,p30,p31 range PRIMARY PRIMARY 130 NULL 2001 100.00 Using pushed condition (`test`.`t1`.`k1` in ('foo', .... 'row# 1999')); Using MRR; Using temporary; Using filesort
6879 1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12,p13,p14,p15,p16,p17,p18,p19,p20,p21,p22,p23,p24,p25,p26,p27,p28,p29,p30,p31 eq_ref PRIMARY PRIMARY 4 test.t1.i 1 100.00 Using join buffer (Batched Key Access)
6880 Warnings:
6881 Note 1003 Can't push table 't2' as child, access type 'Batched-key' not implemented
6882 Note 1003 /* select#1 */ select `test`.`t1`.`k1` AS `k1`,`test`.`t1`.`k2` AS `k2`,`test`.`t1`.`i` AS `i`,`test`.`t2`.`k1` AS `k1` from `test`.`t1` left join `test`.`t2` on((`test`.`t2`.`k1` = `test`.`t1`.`i`)) where (`test`.`t1`.`k1` in ('foo', .... 'row# 1999')) order by `test`.`t1`.`k1`,`test`.`t1`.`k2`
6883 select * from t1 left join t2 on t2.k1=t1.i where t1.k1 in ('foo', .... 'row# 1999' ) order by t1.k1, t1.k2;
6884 drop table t1;
6885 drop table t2;
6886 create table t(
6887 pk int primary key auto_increment,
6888 i int,
6889 j int,
6890 k int,
6891 index(i,j),
6892 index(i),
6893 index(j),
6894 index(k)
6895 ) engine = ndb
6896 comment="NDB_TABLE=PARTITION_BALANCE=FOR_RP_BY_LDM";
6897 insert into t(i,j,k) values
6898 (1,1,1), (1,1,1), (1,1,1),
6899 (2,2,2), (2,2,2), (2,2,2);
6900 set global debug='+d,max_4rows_in_spj_batches';
6901 explain
6902 select straight_join count(*) from
6903 t as t1
6904 join t as t2 on t2.i = t1.i
6905 join (t as t3 join t as t4 on t4.k=t3.k join t as t5 on t5.i=t4.i and t5.j=t3.j) on t3.pk=t1.j
6906 join t as t6 on t6.k = t1.k
6907 where t1.i < 2;
6908 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
6909 1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 range i,i_2,j,k i 5 NULL # # Using pushed condition ((`test`.`t1`.`i` < 2) and (`test`.`t1`.`i` is not null) and (`test`.`t1`.`j` is not null) and (`test`.`t1`.`k` is not null)); Using MRR
6910 1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 ref i,i_2 i 5 test.t1.i # # Using join buffer (Batched Key Access)
6911 1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY,j,k PRIMARY 4 test.t1.j # # Using pushed condition ((`test`.`t3`.`k` is not null) and (`test`.`t3`.`j` is not null)); Using join buffer (Batched Key Access)
6912 1 SIMPLE t4 p0,p1,p2,p3,p4,p5,p6,p7 ref i,i_2,k k 5 test.t3.k # # Using pushed condition (`test`.`t4`.`i` is not null); Using join buffer (Batched Key Access)
6913 1 SIMPLE t5 p0,p1,p2,p3,p4,p5,p6,p7 ref i,i_2,j i 10 test.t4.i,test.t3.j # # Using join buffer (Batched Key Access)
6914 1 SIMPLE t6 p0,p1,p2,p3,p4,p5,p6,p7 ref k k 5 test.t1.k # # Using join buffer (Batched Key Access)
6915 Warnings:
6916 Note 1003 Can't push table 't2' as child, access type 'Batched-key' not implemented
6917 Note 1003 Can't push table 't3' as child, access type 'Batched-key' not implemented
6918 Note 1003 Can't push table 't4' as child, access type 'Batched-key' not implemented
6919 Note 1003 Can't push table 't5' as child, access type 'Batched-key' not implemented
6920 Note 1003 Can't push table 't6' as child, access type 'Batched-key' not implemented
6921 Note 1003 /* select#1 */ select straight_join count(0) AS `count(*)` from `test`.`t` `t1` join `test`.`t` `t2` join `test`.`t` `t3` join `test`.`t` `t4` join `test`.`t` `t5` join `test`.`t` `t6` where ((`test`.`t2`.`i` = `test`.`t1`.`i`) and (`test`.`t4`.`k` = `test`.`t3`.`k`) and (`test`.`t5`.`j` = `test`.`t3`.`j`) and (`test`.`t5`.`i` = `test`.`t4`.`i`) and (`test`.`t3`.`pk` = `test`.`t1`.`j`) and (`test`.`t6`.`k` = `test`.`t1`.`k`) and (`test`.`t1`.`i` < 2))
6922 select straight_join count(*) from
6923 t as t1
6924 join t as t2 on t2.i = t1.i
6925 join (t as t3 join t as t4 on t4.k=t3.k join t as t5 on t5.i=t4.i and t5.j=t3.j) on t3.pk=t1.j
6926 join t as t6 on t6.k = t1.k
6927 where t1.i < 2;
6928 count(*)
6929 243
6930 set global debug=@save_debug;
6931 drop table t;
6932 create table t1 (a int primary key, b int, c int, index(b,c)) engine = ndb
6933 comment="NDB_TABLE=PARTITION_BALANCE=FOR_RP_BY_LDM";
6934 insert into t1 values (4,null, 2);
6935 explain
6936 select x.a from t1 as x join t1 as y on y.a = x.b where x.a=4;
6937 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
6938 1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY,b PRIMARY 4 const 1 100.00 Using where
6939 1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.x.b 1 100.00 Using join buffer (Batched Key Access)
6940 Warnings:
6941 Note 1003 Can't push table 'y' as child, access type 'Batched-key' not implemented
6942 Note 1003 /* select#1 */ select `test`.`x`.`a` AS `a` from `test`.`t1` `x` join `test`.`t1` `y` where ((`test`.`y`.`a` = `test`.`x`.`b`) and (`test`.`x`.`a` = 4))
6943 select x.a from t1 as x join t1 as y on y.a = x.b where x.a=4;
6944 a
6945 drop table t1;
6946 CREATE TABLE t1 (
6947 a int NOT NULL,
6948 b int DEFAULT NULL,
6949 c int NOT NULL,
6950 d int NOT NULL,
6951 PRIMARY KEY (`a`)
6952 ) ENGINE=ndbcluster
6953 comment="NDB_TABLE=PARTITION_BALANCE=FOR_RP_BY_LDM";
6954 create unique index ix1 on t1(b,c) using hash;
6955 Warnings:
6956 Warning 1121 Ndb does not support unique index on NULL valued attributes, index access with NULL value will become full table scan
6957 insert into t1 values (1,NULL,1,1);
6958 explain select * from t1 as x1 left join (t1 as x2 join t1 as x3 on x2.d=x3.c) on x1.b=x3.b;
6959 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
6960 1 SIMPLE x1 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 2 100.00 NULL
6961 1 SIMPLE x2 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 2 100.00 Using join buffer (hash join)
6962 1 SIMPLE x3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref ix1 ix1 9 test.x1.b,test.x2.d 1 100.00 Using join buffer (Batched Key Access)
6963 Warnings:
6964 Note 1003 Can't push table 'x2' as child, 'type' must be a 'ref' access
6965 Note 1003 Can't push table 'x3' as child, access type 'Batched-key' not implemented
6966 Note 1003 /* select#1 */ select `test`.`x1`.`a` AS `a`,`test`.`x1`.`b` AS `b`,`test`.`x1`.`c` AS `c`,`test`.`x1`.`d` AS `d`,`test`.`x2`.`a` AS `a`,`test`.`x2`.`b` AS `b`,`test`.`x2`.`c` AS `c`,`test`.`x2`.`d` AS `d`,`test`.`x3`.`a` AS `a`,`test`.`x3`.`b` AS `b`,`test`.`x3`.`c` AS `c`,`test`.`x3`.`d` AS `d` from `test`.`t1` `x1` left join (`test`.`t1` `x2` join `test`.`t1` `x3`) on(((`test`.`x3`.`c` = `test`.`x2`.`d`) and (`test`.`x3`.`b` = `test`.`x1`.`b`))) where true
6967 create temporary table scan_count
6968 select * from performance_schema.global_status
6969 where variable_name = 'Ndb_scan_count';
6970 select * from t1 as x1 left join (t1 as x2 join t1 as x3 on x2.d=x3.c) on x1.b=x3.b;
6971 a b c d a b c d a b c d
6972 1 NULL 1 1 NULL NULL NULL NULL NULL NULL NULL NULL
6973 select scan_count.VARIABLE_NAME,
6974 old.VARIABLE_VALUE - scan_count.VARIABLE_VALUE
6975 from scan_count, performance_schema.global_status as old
6976 where old.variable_name = 'Ndb_scan_count';
6977 VARIABLE_NAME old.VARIABLE_VALUE - scan_count.VARIABLE_VALUE
6978 Ndb_scan_count 2
6979 drop table scan_count;
6980 drop table t1;
6981 CREATE TABLE table1 (
6982 col_int_unique int(11),
6983 PRIMARY KEY (col_int_unique)
6984 ) ENGINE=ndbcluster
6985 comment="NDB_TABLE=PARTITION_BALANCE=FOR_RP_BY_LDM";
6986 Warnings:
6987 Warning 1681 Integer display width is deprecated and will be removed in a future release.
6988 CREATE TABLE table3 (
6989 col_int int(11) NOT NULL DEFAULT '0',
6990 KEY (col_int)
6991 ) ENGINE=ndbcluster
6992 comment="NDB_TABLE=PARTITION_BALANCE=FOR_RP_BY_LDM";
6993 Warnings:
6994 Warning 1681 Integer display width is deprecated and will be removed in a future release.
6995 CREATE TABLE table4 (
6996 col_int int(11) DEFAULT NULL,
6997 pk int(11) NOT NULL,
6998 PRIMARY KEY (pk)
6999 ) ENGINE=ndbcluster
7000 comment="NDB_TABLE=PARTITION_BALANCE=FOR_RP_BY_LDM";
7001 Warnings:
7002 Warning 1681 Integer display width is deprecated and will be removed in a future release.
7003 Warning 1681 Integer display width is deprecated and will be removed in a future release.
7004 CREATE TABLE table6 (
7005 col_int int(11) DEFAULT NULL,
7006 col_int_unique int(11) DEFAULT NULL
7007 ) ENGINE=ndbcluster
7008 comment="NDB_TABLE=PARTITION_BALANCE=FOR_RP_BY_LDM";
7009 Warnings:
7010 Warning 1681 Integer display width is deprecated and will be removed in a future release.
7011 Warning 1681 Integer display width is deprecated and will be removed in a future release.
7012 insert into table6 values
7013 (2,NULL),
7014 (2,NULL),
7015 (2,NULL),
7016 (2,NULL),
7017 (2,NULL),
7018 (2,NULL),
7019 (2,NULL),
7020 (2,NULL);
7021 set global debug='+d,max_4rows_in_spj_batches';
7022 EXPLAIN
7023 SELECT * FROM
7024 table1 RIGHT JOIN
7025 table3 LEFT JOIN table4 ON table3.col_int = table4.col_int
7026 JOIN
7027 table6 ON table4.pk = table6.col_int_unique
7028 ON table1.col_int_unique = table6.col_int;
7029 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
7030 1 SIMPLE table6 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 8 100.00 NULL
7031 1 SIMPLE table4 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.table6.col_int_unique 1 100.00 Using pushed condition (`test`.`table4`.`col_int` is not null); Using join buffer (Batched Key Access)
7032 1 SIMPLE table1 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.table6.col_int 1 100.00 Using join buffer (Batched Key Access)
7033 1 SIMPLE table3 p0,p1,p2,p3,p4,p5,p6,p7 ref col_int col_int 4 test.table4.col_int 2 100.00 Using join buffer (Batched Key Access)
7034 Warnings:
7035 Note 1003 Can't push table 'table4' as child, access type 'Batched-key' not implemented
7036 Note 1003 Can't push table 'table1' as child, access type 'Batched-key' not implemented
7037 Note 1003 Can't push table 'table3' as child, access type 'Batched-key' not implemented
7038 Note 1003 /* select#1 */ select `test`.`table1`.`col_int_unique` AS `col_int_unique`,`test`.`table3`.`col_int` AS `col_int`,`test`.`table4`.`col_int` AS `col_int`,`test`.`table4`.`pk` AS `pk`,`test`.`table6`.`col_int` AS `col_int`,`test`.`table6`.`col_int_unique` AS `col_int_unique` from `test`.`table3` join `test`.`table4` join `test`.`table6` left join `test`.`table1` on((`test`.`table1`.`col_int_unique` = `test`.`table6`.`col_int`)) where ((`test`.`table3`.`col_int` = `test`.`table4`.`col_int`) and (`test`.`table4`.`pk` = `test`.`table6`.`col_int_unique`))
7039 SELECT * FROM
7040 table1 RIGHT JOIN
7041 table3 LEFT JOIN table4 ON table3.col_int = table4.col_int
7042 JOIN
7043 table6 ON table4.pk = table6.col_int_unique
7044 ON table1.col_int_unique = table6.col_int;
7045 col_int_unique col_int col_int pk col_int col_int_unique
7046 set global debug=@save_debug;
7047 drop table table6;
7048 drop table table4;
7049 drop table table3;
7050 drop table table1;
7051 5.6 tests
7052 create table t1 (
7053 a int not null,
7054 b int not null,
7055 c int not null,
7056 d int not null,
7057 primary key (`a`,`b`),
7058 key(c), key(d)
7059 ) engine=ndbcluster
7060 comment="NDB_TABLE=PARTITION_BALANCE=FOR_RP_BY_LDM";
7061 insert into t1 values
7062 (1,1,1,1), (2,2,2,2), (3,3,3,3), (4,4,4,4),
7063 (1,2,5,1), (1,3,1,2), (1,4,2,3),
7064 (2,1,3,4), (2,3,4,5), (2,4,5,1),
7065 (3,1,1,2), (3,2,2,3), (3,4,3,4),
7066 (4,1,4,5), (4,2,5,1), (4,3,1,2);
7067 set global debug='+d,max_4rows_in_spj_batches';
7068 set @save_optimizer_switch = @@optimizer_switch;
7069 set optimizer_switch='materialization=off';
7070 explain
7071 select count(*) from t1 where
7072 t1.c in (select c from t1 as subq);
7073 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
7074 1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL c NULL NULL NULL 16 100.00 NULL
7075 1 SIMPLE subq p0,p1,p2,p3,p4,p5,p6,p7 ref c c 4 test.t1.c 2 100.00 FirstMatch(t1); Using join buffer (Batched Key Access)
7076 Warnings:
7077 Note 1003 Can't push table 'subq' as child, access type 'Batched-key' not implemented
7078 Note 1003 /* select#1 */ select count(0) AS `count(*)` from `test`.`t1` semi join (`test`.`t1` `subq`) where (`test`.`subq`.`c` = `test`.`t1`.`c`)
7079 select count(*) from t1 where
7080 t1.c in (select c from t1 as subq);
7081 count(*)
7082 16
7083 explain
7084 select count(*) from t1 where
7085 t1.c in (select c from t1 as subq1) and
7086 t1.d in (select d from t1 as subq2);
7087 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
7088 1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL c,d NULL NULL NULL 16 100.00 NULL
7089 1 SIMPLE subq1 p0,p1,p2,p3,p4,p5,p6,p7 ref c c 4 test.t1.c 2 100.00 FirstMatch(t1); Using join buffer (Batched Key Access)
7090 1 SIMPLE subq2 p0,p1,p2,p3,p4,p5,p6,p7 ref d d 4 test.t1.d 2 100.00 FirstMatch(subq1); Using join buffer (Batched Key Access)
7091 Warnings:
7092 Note 1003 Can't push table 'subq1' as child, access type 'Batched-key' not implemented
7093 Note 1003 Can't push table 'subq2' as child, access type 'Batched-key' not implemented
7094 Note 1003 /* select#1 */ select count(0) AS `count(*)` from `test`.`t1` semi join (`test`.`t1` `subq1`) semi join (`test`.`t1` `subq2`) where ((`test`.`subq2`.`d` = `test`.`t1`.`d`) and (`test`.`subq1`.`c` = `test`.`t1`.`c`))
7095 select count(*) from t1 where
7096 t1.c in (select c from t1 as subq1) and
7097 t1.d in (select d from t1 as subq2);
7098 count(*)
7099 16
7100 explain
7101 select count(*) from t1 where
7102 t1.c in (select c from t1 as subq1 where
7103 subq1.c in (select c from t1 as subq2));
7104 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
7105 1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL c NULL NULL NULL 16 100.00 Parent of 3 pushed join@1
7106 1 SIMPLE subq1 p0,p1,p2,p3,p4,p5,p6,p7 ref c c 4 test.t1.c 2 100.00 Child of 't1' in pushed join@1
7107 1 SIMPLE subq2 p0,p1,p2,p3,p4,p5,p6,p7 ref c c 4 test.t1.c 2 100.00 Child of 't1' in pushed join@1; FirstMatch(t1)
7108 Warnings:
7109 Note 1003 /* select#1 */ select count(0) AS `count(*)` from `test`.`t1` semi join (`test`.`t1` `subq1` join `test`.`t1` `subq2`) where ((`test`.`subq1`.`c` = `test`.`t1`.`c`) and (`test`.`subq2`.`c` = `test`.`t1`.`c`))
7110 select count(*) from t1 where
7111 t1.c in (select c from t1 as subq1 where
7112 subq1.c in (select c from t1 as subq2));
7113 count(*)
7114 16
7115 explain
7116 select count(*) from t1 where
7117 t1.c in (select subq1.c from t1 as subq1 straight_join t1 as subq2 on subq1.a = subq2.c);
7118 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
7119 1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL c NULL NULL NULL 16 100.00 Parent of 3 pushed join@1
7120 1 SIMPLE subq1 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY,c c 4 test.t1.c 2 100.00 Child of 't1' in pushed join@1
7121 1 SIMPLE subq2 p0,p1,p2,p3,p4,p5,p6,p7 ref c c 4 test.subq1.a 2 100.00 Child of 'subq1' in pushed join@1; FirstMatch(t1)
7122 Warnings:
7123 Note 1003 /* select#1 */ select count(0) AS `count(*)` from `test`.`t1` semi join (`test`.`t1` `subq1` straight_join `test`.`t1` `subq2`) where ((`test`.`subq2`.`c` = `test`.`subq1`.`a`) and (`test`.`subq1`.`c` = `test`.`t1`.`c`))
7124 select count(*) from t1 where
7125 t1.c in (select subq1.c from t1 as subq1 straight_join t1 as subq2 on subq1.a = subq2.c);
7126 count(*)
7127 16
7128 set optimizer_switch=@save_optimizer_switch;
7129 set global debug=@save_debug;
7130 #
7131 # Bug#29860378
7132 # RESULTS NOT SORTED AS SPECIFIED WHEN QUERY IS A 'PUSHED JOIN'
7133 #
7134 set global debug='+d,max_4rows_in_spj_batches';
7135 explain
7136 select straight_join t1.* from
7137 t1 join t1 as t2 on t2.d = t1.a
7138 where t1.a > 0
7139 order by t1.a,t1.b;
7140 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
7141 1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 range PRIMARY PRIMARY 4 NULL 3 100.00 Using pushed condition (`test`.`t1`.`a` > 0); Using MRR; Using temporary; Using filesort
7142 1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 ref d d 4 test.t1.a 2 100.00 Using join buffer (Batched Key Access)
7143 Warnings:
7144 Note 1003 Can't push table 't2' as child, access type 'Batched-key' not implemented
7145 Note 1003 /* select#1 */ select straight_join `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t1`.`d` AS `d` from `test`.`t1` join `test`.`t1` `t2` where ((`test`.`t2`.`d` = `test`.`t1`.`a`) and (`test`.`t1`.`a` > 0)) order by `test`.`t1`.`a`,`test`.`t1`.`b`
7146 select straight_join t1.* from
7147 t1 join t1 as t2 on t2.d = t1.a
7148 where t1.a > 0
7149 order by t1.a,t1.b;
7150 a b c d
7151 1 1 1 1
7152 1 1 1 1
7153 1 1 1 1
7154 1 1 1 1
7155 1 2 5 1
7156 1 2 5 1
7157 1 2 5 1
7158 1 2 5 1
7159 1 3 1 2
7160 1 3 1 2
7161 1 3 1 2
7162 1 3 1 2
7163 1 4 2 3
7164 1 4 2 3
7165 1 4 2 3
7166 1 4 2 3
7167 2 1 3 4
7168 2 1 3 4
7169 2 1 3 4
7170 2 1 3 4
7171 2 2 2 2
7172 2 2 2 2
7173 2 2 2 2
7174 2 2 2 2
7175 2 3 4 5
7176 2 3 4 5
7177 2 3 4 5
7178 2 3 4 5
7179 2 4 5 1
7180 2 4 5 1
7181 2 4 5 1
7182 2 4 5 1
7183 3 1 1 2
7184 3 1 1 2
7185 3 1 1 2
7186 3 2 2 3
7187 3 2 2 3
7188 3 2 2 3
7189 3 3 3 3
7190 3 3 3 3
7191 3 3 3 3
7192 3 4 3 4
7193 3 4 3 4
7194 3 4 3 4
7195 4 1 4 5
7196 4 1 4 5
7197 4 1 4 5
7198 4 2 5 1
7199 4 2 5 1
7200 4 2 5 1
7201 4 3 1 2
7202 4 3 1 2
7203 4 3 1 2
7204 4 4 4 4
7205 4 4 4 4
7206 4 4 4 4
7207 explain
7208 select straight_join t1.a,t1.b,count(*) from
7209 t1 join t1 as t2 on t2.d = t1.a
7210 where t1.a > 0
7211 group by t1.a,t1.b;
7212 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
7213 1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 range PRIMARY PRIMARY 4 NULL 3 100.00 Using pushed condition (`test`.`t1`.`a` > 0); Using MRR; Using temporary
7214 1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 ref d d 4 test.t1.a 2 100.00 Using join buffer (Batched Key Access)
7215 Warnings:
7216 Note 1003 Can't push table 't2' as child, access type 'Batched-key' not implemented
7217 Note 1003 /* select#1 */ select straight_join `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,count(0) AS `count(*)` from `test`.`t1` join `test`.`t1` `t2` where ((`test`.`t2`.`d` = `test`.`t1`.`a`) and (`test`.`t1`.`a` > 0)) group by `test`.`t1`.`a`,`test`.`t1`.`b`
7218 select straight_join t1.a,t1.b,count(*) from
7219 t1 join t1 as t2 on t2.d = t1.a
7220 where t1.a > 0
7221 group by t1.a,t1.b;
7222 a b count(*)
7223 1 1 4
7224 1 2 4
7225 1 3 4
7226 1 4 4
7227 2 1 4
7228 2 2 4
7229 2 3 4
7230 2 4 4
7231 3 1 3
7232 3 2 3
7233 3 3 3
7234 3 4 3
7235 4 1 3
7236 4 2 3
7237 4 3 3
7238 4 4 3
7239 set global debug=@save_debug;
7240 set @save_optimizer_switch = @@optimizer_switch;
7241 set @@optimizer_switch='semijoin=on';
7242 set @@optimizer_switch='loosescan=on';
7243 explain SELECT count(*)
7244 FROM (t1 AS table1 JOIN t1 AS table2 USING(a,b))
7245 WHERE table1.b IN
7246 (SELECT /*+ SEMIJOIN(LOOSESCAN)*/ table1s.c FROM t1 as table1s);
7247 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
7248 1 SIMPLE table2 p0,p1,p2,p3,p4,p5,p6,p7 ALL PRIMARY NULL NULL NULL 16 100.00 Parent of 2 pushed join@1
7249 1 SIMPLE table1s p0,p1,p2,p3,p4,p5,p6,p7 ref c c 4 test.table2.b 2 100.00 Child of 'table2' in pushed join@1; LooseScan
7250 1 SIMPLE table1 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.table2.a,test.table2.b 1 100.00 Using join buffer (Batched Key Access)
7251 Warnings:
7252 Note 1003 Can't push table 'table1' as child, access type 'Batched-key' not implemented
7253 Note 1003 /* select#1 */ select /*+ SEMIJOIN(@`select#2` LOOSESCAN) */ count(0) AS `count(*)` from `test`.`t1` `table1` join `test`.`t1` `table2` semi join (`test`.`t1` `table1s`) where ((`test`.`table1`.`a` = `test`.`table2`.`a`) and (`test`.`table1s`.`c` = `test`.`table2`.`b`) and (`test`.`table1`.`b` = `test`.`table2`.`b`))
7254 SELECT count(*)
7255 FROM (t1 AS table1 JOIN t1 AS table2 USING(a,b))
7256 WHERE table1.b IN
7257 (SELECT /*+ SEMIJOIN(LOOSESCAN)*/ table1s.c FROM t1 as table1s);
7258 count(*)
7259 16
7260 set @@optimizer_switch='firstmatch=on';
7261 explain SELECT count(*)
7262 FROM (t1 AS table1 JOIN t1 AS table2 USING(a,b))
7263 WHERE table1.b IN
7264 (SELECT /*+ SEMIJOIN(FIRSTMATCH)*/ table1s.c FROM t1 as table1s);
7265 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
7266 1 SIMPLE table1 p0,p1,p2,p3,p4,p5,p6,p7 ALL PRIMARY NULL NULL NULL 16 100.00 NULL
7267 1 SIMPLE table2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.table1.a,test.table1.b 1 100.00 Using join buffer (Batched Key Access)
7268 1 SIMPLE table1s p0,p1,p2,p3,p4,p5,p6,p7 ref c c 4 test.table1.b 2 100.00 FirstMatch(table2); Using join buffer (Batched Key Access)
7269 Warnings:
7270 Note 1003 Can't push table 'table2' as child, access type 'Batched-key' not implemented
7271 Note 1003 Can't push table 'table1s' as child, access type 'Batched-key' not implemented
7272 Note 1003 /* select#1 */ select /*+ SEMIJOIN(@`select#2` FIRSTMATCH) */ count(0) AS `count(*)` from `test`.`t1` `table1` join `test`.`t1` `table2` semi join (`test`.`t1` `table1s`) where ((`test`.`table2`.`a` = `test`.`table1`.`a`) and (`test`.`table2`.`b` = `test`.`table1`.`b`) and (`test`.`table1s`.`c` = `test`.`table1`.`b`))
7273 SELECT count(*)
7274 FROM (t1 AS table1 JOIN t1 AS table2 USING(a,b))
7275 WHERE table1.b IN
7276 (SELECT /*+ SEMIJOIN(FIRSTMATCH)*/ table1s.c FROM t1 as table1s);
7277 count(*)
7278 16
7279 set optimizer_switch=@save_optimizer_switch;
7280 ####################################################################
7281 # WL#14370: Change EXPLAIN to use 'format=tree'. Traditional explain
7282 # didn't correctly represent the order of tables in MATERIALIZED
7283 # sub queries. That resulted in some confusing 'EXPLAIN_NO_PUSH' diffs
7284 # where the reported root/child order didn't make sense.
7285 # As the tree-format explain will show, the changed output
7286 # make more sense related to the query plan represented by the
7287 # AccessPath tree.
7288 # WL#14370: Materialized semijoin's is not the only SJ-strategi
7289 # where we do no pushdown across main-query -> sub-query border.
7290 # (The sub-query itself may be pushed though)
7291 ###################################################################
7292 set @save_optimizer_switch = @@optimizer_switch;
7293 set @@optimizer_switch='semijoin=on';
7294 set @@optimizer_switch='materialization=on';
7295 explain format=tree select count(*)
7296 from t1
7297 join t1 as t2 on t2.a = t1.b
7298 where t1.c IN (select /*+ SEMIJOIN(MATERIALIZATION)*/ c from t1 as t3);
7299 EXPLAIN
7300 -> Aggregate: count(0)
7301 -> Batched key access inner join
7302 -> Batch input rows
7303 -> Batched key access inner join
7304 -> Batch input rows
7305 -> Table scan on <subquery2>
7306 -> Materialize with deduplication
7307 -> Table scan on t3
7308 -> Multi-range index lookup on t1 using c (c=`<subquery2>`.c)
7309 -> Multi-range index lookup on t2 using PRIMARY (a=t1.b)
7310
7311 Warnings:
7312 Note 1003 Can't push table 't1' as child, access type 'Multi-range' not implemented
7313 Note 1003 Can't push table 't2' as child, access type 'Multi-range' not implemented
7314 select count(*)
7315 from t1
7316 join t1 as t2 on t2.a = t1.b
7317 where t1.c IN (select /*+ SEMIJOIN(MATERIALIZATION)*/ c from t1 as t3);
7318 count(*)
7319 64
7320 explain format=tree select count(*)
7321 from t1
7322 join t1 as t2 on t2.a = t1.b and t2.b = t1.c
7323 where t1.c IN (select /*+ SEMIJOIN(MATERIALIZATION)*/ c from t1 as t3);
7324 EXPLAIN
7325 -> Aggregate: count(0)
7326 -> Batched key access inner join
7327 -> Batch input rows
7328 -> Batched key access inner join
7329 -> Batch input rows
7330 -> Table scan on <subquery2>
7331 -> Materialize with deduplication
7332 -> Table scan on t3
7333 -> Multi-range index lookup on t1 using c (c=`<subquery2>`.c)
7334 -> Multi-range index lookup on t2 using PRIMARY (a=t1.b, b=`<subquery2>`.c)
7335
7336 Warnings:
7337 Note 1003 Can't push table 't1' as child, access type 'Multi-range' not implemented
7338 Note 1003 Can't push table 't2' as child, access type 'Multi-range' not implemented
7339 select count(*)
7340 from t1
7341 join t1 as t2 on t2.a = t1.b and t2.b = t1.c
7342 where t1.c IN (select /*+ SEMIJOIN(MATERIALIZATION)*/ c from t1 as t3);
7343 count(*)
7344 13
7345 explain format=tree select count(*)
7346 from (select * from t1 where t1.c IN (select /*+ SEMIJOIN(MATERIALIZATION)*/ c from t1 as t3)) as t1
7347 join t1 as t2 on t2.a = t1.b and t2.b = t1.c;
7348 EXPLAIN
7349 -> Aggregate: count(0)
7350 -> Batched key access inner join
7351 -> Batch input rows
7352 -> Batched key access inner join
7353 -> Batch input rows
7354 -> Table scan on <subquery3>
7355 -> Materialize with deduplication
7356 -> Table scan on t3
7357 -> Multi-range index lookup on t1 using c (c=`<subquery3>`.c)
7358 -> Multi-range index lookup on t2 using PRIMARY (a=t1.b, b=`<subquery3>`.c)
7359
7360 Warnings:
7361 Note 1003 Can't push table 't1' as child, access type 'Multi-range' not implemented
7362 Note 1003 Can't push table 't2' as child, access type 'Multi-range' not implemented
7363 select count(*)
7364 from (select * from t1 where t1.c IN (select /*+ SEMIJOIN(MATERIALIZATION)*/ c from t1 as t3)) as t1
7365 join t1 as t2 on t2.a = t1.b and t2.b = t1.c;
7366 count(*)
7367 13
7368 explain format=tree select count(*)
7369 from (select * from t1 where t1.c IN (select /*+ SEMIJOIN(MATERIALIZATION)*/ c from t1 as t3)) as t1
7370 join t1 as t2 on t2.a = t1.b and t2.b = t1.c
7371 where t1.c IN (select /*+ SEMIJOIN(MATERIALIZATION)*/ c from t1 as t4);
7372 EXPLAIN
7373 -> Aggregate: count(0)
7374 -> Nested loop inner join
7375 -> Batched key access inner join
7376 -> Batch input rows
7377 -> Batched key access inner join
7378 -> Batch input rows
7379 -> Table scan on <subquery3>
7380 -> Materialize with deduplication
7381 -> Table scan on t3
7382 -> Multi-range index lookup on t1 using c (c=`<subquery3>`.c)
7383 -> Multi-range index lookup on t2 using PRIMARY (a=t1.b, b=`<subquery3>`.c)
7384 -> Filter: (`<subquery4>`.c = `<subquery3>`.c)
7385 -> Single-row index lookup on <subquery4> using <auto_distinct_key> (c=t1.c)
7386 -> Materialize with deduplication
7387 -> Table scan on t4
7388
7389 Warnings:
7390 Note 1003 Can't push table 't1' as child, access type 'Multi-range' not implemented
7391 Note 1003 Can't push table 't2' as child, access type 'Multi-range' not implemented
7392 Note 1003 Can't push table 't4' as child, 'type' must be a 'ref' access
7393 select count(*)
7394 from (select * from t1 where t1.c IN (select /*+ SEMIJOIN(MATERIALIZATION)*/ c from t1 as t3)) as t1
7395 join t1 as t2 on t2.a = t1.b and t2.b = t1.c
7396 where t1.c IN (select /*+ SEMIJOIN(MATERIALIZATION)*/ c from t1 as t4);
7397 count(*)
7398 13
7399 set optimizer_switch='block_nested_loop=off';
7400 explain format=tree select count(*)
7401 from t1 cross join t1 as t2
7402 where t2.c IN (select /*+ SEMIJOIN(MATERIALIZATION)*/ t4s.c
7403 from t1 as t3s join t1 as t4s on t4s.a = t3s.b);
7404 EXPLAIN
7405 -> Aggregate: count(0)
7406 -> Batched key access inner join
7407 -> Batch input rows
7408 -> Nested loop inner join
7409 -> Table scan on t1
7410 -> Table scan on <subquery2>
7411 -> Materialize with deduplication
7412 -> Batched key access inner join
7413 -> Batch input rows
7414 -> Table scan on t3s
7415 -> Multi-range index lookup on t4s using PRIMARY (a=t3s.b)
7416 -> Multi-range index lookup on t2 using c (c=`<subquery2>`.c)
7417
7418 Warnings:
7419 Note 1003 Can't push table 't3s' as child, 'type' must be a 'ref' access
7420 Note 1003 Can't push table 't4s' as child, access type 'Multi-range' not implemented
7421 Note 1003 Can't push table 't2' as child, access type 'Multi-range' not implemented
7422 select count(*)
7423 from t1 cross join t1 as t2
7424 where t2.c IN (select /*+ SEMIJOIN(MATERIALIZATION)*/ t4s.c
7425 from t1 as t3s join t1 as t4s on t4s.a = t3s.b);
7426 count(*)
7427 256
7428 set optimizer_switch=@save_optimizer_switch;
7429 set global debug='+d,max_4rows_in_spj_batches';
7430 set @save_optimizer_switch = @@optimizer_switch;
7431 set @@optimizer_switch='semijoin=on';
7432 explain
7433 select count(*)
7434 from t1
7435 join t1 as t2 on t2.a = t1.b
7436 where t1.c IN (
7437 select /*+ SEMIJOIN(DUPSWEEDOUT)*/ t3s.c from t1 as t3s
7438 join t1 as t4s on t4s.a = t3s.b);
7439 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
7440 1 SIMPLE t3s p0,p1,p2,p3,p4,p5,p6,p7 ALL c NULL NULL NULL 16 100.00 Start temporary
7441 1 SIMPLE t4s p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.t3s.b 1 100.00 Using join buffer (Batched Key Access)
7442 1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ref c c 4 test.t3s.c 2 100.00 End temporary; Using join buffer (Batched Key Access)
7443 1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.t1.b 1 100.00 Using join buffer (Batched Key Access)
7444 Warnings:
7445 Note 1003 Can't push table 't4s' as child, access type 'Batched-key' not implemented
7446 Note 1003 Can't push table 't1' as child, access type 'Batched-key' not implemented
7447 Note 1003 Can't push table 't2' as child, access type 'Batched-key' not implemented
7448 Note 1003 /* select#1 */ select /*+ SEMIJOIN(@`select#2` DUPSWEEDOUT) */ count(0) AS `count(*)` from `test`.`t1` join `test`.`t1` `t2` semi join (`test`.`t1` `t3s` join `test`.`t1` `t4s`) where ((`test`.`t2`.`a` = `test`.`t1`.`b`) and (`test`.`t4s`.`a` = `test`.`t3s`.`b`) and (`test`.`t1`.`c` = `test`.`t3s`.`c`))
7449 select count(*)
7450 from t1
7451 join t1 as t2 on t2.a = t1.b
7452 where t1.c IN (
7453 select /*+ SEMIJOIN(DUPSWEEDOUT)*/ t3s.c from t1 as t3s
7454 join t1 as t4s on t4s.a = t3s.b);
7455 count(*)
7456 64
7457 explain
7458 select count(*)
7459 from t1
7460 join t1 as t2 on t2.a = t1.b
7461 where t2.c IN (
7462 select /*+ SEMIJOIN(DUPSWEEDOUT)*/ t3s.c from t1 as t3s
7463 join t1 as t4s on t4s.a = t3s.b);
7464 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
7465 1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 16 100.00 Start temporary
7466 1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY,c PRIMARY 4 test.t1.b 1 100.00 Using join buffer (Batched Key Access)
7467 1 SIMPLE t3s p0,p1,p2,p3,p4,p5,p6,p7 ref c c 4 test.t2.c 2 100.00 Using join buffer (Batched Key Access)
7468 1 SIMPLE t4s p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.t3s.b 1 100.00 End temporary; Using join buffer (Batched Key Access)
7469 Warnings:
7470 Note 1003 Can't push table 't2' as child, access type 'Batched-key' not implemented
7471 Note 1003 Can't push table 't3s' as child, access type 'Batched-key' not implemented
7472 Note 1003 Can't push table 't4s' as child, access type 'Batched-key' not implemented
7473 Note 1003 /* select#1 */ select /*+ SEMIJOIN(@`select#2` DUPSWEEDOUT) */ count(0) AS `count(*)` from `test`.`t1` join `test`.`t1` `t2` semi join (`test`.`t1` `t3s` join `test`.`t1` `t4s`) where ((`test`.`t2`.`a` = `test`.`t1`.`b`) and (`test`.`t4s`.`a` = `test`.`t3s`.`b`) and (`test`.`t3s`.`c` = `test`.`t2`.`c`))
7474 select count(*)
7475 from t1
7476 join t1 as t2 on t2.a = t1.b
7477 where t2.c IN (
7478 select /*+ SEMIJOIN(DUPSWEEDOUT)*/ t3s.c from t1 as t3s
7479 join t1 as t4s on t4s.a = t3s.b);
7480 count(*)
7481 64
7482 explain
7483 select count(*)
7484 from t1
7485 join t1 as t2 on t2.a = t1.b
7486 join t1 as t3 on t3.a = t2.b
7487 where t1.c IN (
7488 select /*+ SEMIJOIN(DUPSWEEDOUT)*/ t4s.c from t1 as t4s
7489 join t1 as t5s on t5s.a = t4s.b
7490 join t1 as t6s on t6s.a = t5s.b
7491 );
7492 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
7493 1 SIMPLE t4s p0,p1,p2,p3,p4,p5,p6,p7 ALL c NULL NULL NULL 16 100.00 Start temporary
7494 1 SIMPLE t5s p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.t4s.b 1 100.00 Using join buffer (Batched Key Access)
7495 1 SIMPLE t6s p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.t5s.b 1 100.00 Using join buffer (Batched Key Access)
7496 1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ref c c 4 test.t4s.c 2 100.00 End temporary; Using join buffer (Batched Key Access)
7497 1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.t1.b 1 100.00 Using join buffer (Batched Key Access)
7498 1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.t2.b 1 100.00 Using join buffer (Batched Key Access)
7499 Warnings:
7500 Note 1003 Can't push table 't5s' as child, access type 'Batched-key' not implemented
7501 Note 1003 Can't push table 't6s' as child, access type 'Batched-key' not implemented
7502 Note 1003 Can't push table 't1' as child, access type 'Batched-key' not implemented
7503 Note 1003 Can't push table 't2' as child, access type 'Batched-key' not implemented
7504 Note 1003 Can't push table 't3' as child, access type 'Batched-key' not implemented
7505 Note 1003 /* select#1 */ select /*+ SEMIJOIN(@`select#2` DUPSWEEDOUT) */ count(0) AS `count(*)` from `test`.`t1` join `test`.`t1` `t2` join `test`.`t1` `t3` semi join (`test`.`t1` `t4s` join `test`.`t1` `t5s` join `test`.`t1` `t6s`) where ((`test`.`t2`.`a` = `test`.`t1`.`b`) and (`test`.`t3`.`a` = `test`.`t2`.`b`) and (`test`.`t5s`.`a` = `test`.`t4s`.`b`) and (`test`.`t6s`.`a` = `test`.`t5s`.`b`) and (`test`.`t1`.`c` = `test`.`t4s`.`c`))
7506 select count(*)
7507 from t1
7508 join t1 as t2 on t2.a = t1.b
7509 join t1 as t3 on t3.a = t2.b
7510 where t1.c IN (
7511 select /*+ SEMIJOIN(DUPSWEEDOUT)*/ t4s.c from t1 as t4s
7512 join t1 as t5s on t5s.a = t4s.b
7513 join t1 as t6s on t6s.a = t5s.b
7514 );
7515 count(*)
7516 256
7517 explain
7518 select count(*)
7519 from t1
7520 join t1 as t2 on t2.a = t1.b
7521 join t1 as t3 on t3.a = t2.b
7522 where t2.c IN (
7523 select /*+ SEMIJOIN(DUPSWEEDOUT)*/ t4s.c from t1 as t4s
7524 join t1 as t5s on t5s.a = t4s.b
7525 join t1 as t6s on t6s.a = t5s.b
7526 );
7527 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
7528 1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 16 100.00 Start temporary
7529 1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY,c PRIMARY 4 test.t1.b 1 100.00 Using join buffer (Batched Key Access)
7530 1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.t2.b 1 100.00 Using join buffer (Batched Key Access)
7531 1 SIMPLE t4s p0,p1,p2,p3,p4,p5,p6,p7 ref c c 4 test.t2.c 2 100.00 Using join buffer (Batched Key Access)
7532 1 SIMPLE t5s p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.t4s.b 1 100.00 Using join buffer (Batched Key Access)
7533 1 SIMPLE t6s p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.t5s.b 1 100.00 End temporary; Using join buffer (Batched Key Access)
7534 Warnings:
7535 Note 1003 Can't push table 't2' as child, access type 'Batched-key' not implemented
7536 Note 1003 Can't push table 't3' as child, access type 'Batched-key' not implemented
7537 Note 1003 Can't push table 't4s' as child, access type 'Batched-key' not implemented
7538 Note 1003 Can't push table 't5s' as child, access type 'Batched-key' not implemented
7539 Note 1003 Can't push table 't6s' as child, access type 'Batched-key' not implemented
7540 Note 1003 /* select#1 */ select /*+ SEMIJOIN(@`select#2` DUPSWEEDOUT) */ count(0) AS `count(*)` from `test`.`t1` join `test`.`t1` `t2` join `test`.`t1` `t3` semi join (`test`.`t1` `t4s` join `test`.`t1` `t5s` join `test`.`t1` `t6s`) where ((`test`.`t2`.`a` = `test`.`t1`.`b`) and (`test`.`t3`.`a` = `test`.`t2`.`b`) and (`test`.`t5s`.`a` = `test`.`t4s`.`b`) and (`test`.`t6s`.`a` = `test`.`t5s`.`b`) and (`test`.`t4s`.`c` = `test`.`t2`.`c`))
7541 select count(*)
7542 from t1
7543 join t1 as t2 on t2.a = t1.b
7544 join t1 as t3 on t3.a = t2.b
7545 where t2.c IN (
7546 select /*+ SEMIJOIN(DUPSWEEDOUT)*/ t4s.c from t1 as t4s
7547 join t1 as t5s on t5s.a = t4s.b
7548 join t1 as t6s on t6s.a = t5s.b
7549 );
7550 count(*)
7551 256
7552 explain
7553 select count(*)
7554 from t1
7555 join t1 as t2 on t2.a = t1.b
7556 join t1 as t3 on t3.a = t2.b
7557 where t3.c IN (
7558 select /*+ SEMIJOIN(DUPSWEEDOUT)*/ t4s.c from t1 as t4s
7559 join t1 as t5s on t5s.a = t4s.b
7560 join t1 as t6s on t6s.a = t5s.b
7561 );
7562 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
7563 1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 16 100.00 Start temporary
7564 1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.t1.b 1 100.00 Using join buffer (Batched Key Access)
7565 1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY,c PRIMARY 4 test.t2.b 1 100.00 Using join buffer (Batched Key Access)
7566 1 SIMPLE t4s p0,p1,p2,p3,p4,p5,p6,p7 ref c c 4 test.t3.c 2 100.00 Using join buffer (Batched Key Access)
7567 1 SIMPLE t5s p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.t4s.b 1 100.00 Using join buffer (Batched Key Access)
7568 1 SIMPLE t6s p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.t5s.b 1 100.00 End temporary; Using join buffer (Batched Key Access)
7569 Warnings:
7570 Note 1003 Can't push table 't2' as child, access type 'Batched-key' not implemented
7571 Note 1003 Can't push table 't3' as child, access type 'Batched-key' not implemented
7572 Note 1003 Can't push table 't4s' as child, access type 'Batched-key' not implemented
7573 Note 1003 Can't push table 't5s' as child, access type 'Batched-key' not implemented
7574 Note 1003 Can't push table 't6s' as child, access type 'Batched-key' not implemented
7575 Note 1003 /* select#1 */ select /*+ SEMIJOIN(@`select#2` DUPSWEEDOUT) */ count(0) AS `count(*)` from `test`.`t1` join `test`.`t1` `t2` join `test`.`t1` `t3` semi join (`test`.`t1` `t4s` join `test`.`t1` `t5s` join `test`.`t1` `t6s`) where ((`test`.`t2`.`a` = `test`.`t1`.`b`) and (`test`.`t3`.`a` = `test`.`t2`.`b`) and (`test`.`t5s`.`a` = `test`.`t4s`.`b`) and (`test`.`t6s`.`a` = `test`.`t5s`.`b`) and (`test`.`t4s`.`c` = `test`.`t3`.`c`))
7576 select count(*)
7577 from t1
7578 join t1 as t2 on t2.a = t1.b
7579 join t1 as t3 on t3.a = t2.b
7580 where t3.c IN (
7581 select /*+ SEMIJOIN(DUPSWEEDOUT)*/ t4s.c from t1 as t4s
7582 join t1 as t5s on t5s.a = t4s.b
7583 join t1 as t6s on t6s.a = t5s.b
7584 );
7585 count(*)
7586 256
7587 set global debug=@save_debug;
7588 set optimizer_switch=@save_optimizer_switch;
7589 ###########
7590 # WL#14370: EXPLAIN need to use 'format=tree as table access order
7591 # in MATERIALIZED execution is not currectly represented by
7592 # the traditional explain.
7593 ###########
7594 explain format=tree select count(*)
7595 from t1
7596 join t1 as t2 on t2.a = t1.b
7597 where t1.c IN (
7598 select /*+ SEMIJOIN(MATERIALIZATION)*/ t3s.c from t1 as t3s
7599 join t1 as t4s on t4s.a = t3s.b);
7600 EXPLAIN
7601 -> Aggregate: count(0)
7602 -> Batched key access inner join
7603 -> Batch input rows
7604 -> Batched key access inner join
7605 -> Batch input rows
7606 -> Table scan on <subquery2>
7607 -> Materialize with deduplication
7608 -> Batched key access inner join
7609 -> Batch input rows
7610 -> Table scan on t3s
7611 -> Multi-range index lookup on t4s using PRIMARY (a=t3s.b)
7612 -> Multi-range index lookup on t1 using c (c=`<subquery2>`.c)
7613 -> Multi-range index lookup on t2 using PRIMARY (a=t1.b)
7614
7615 Warnings:
7616 Note 1003 Can't push table 't4s' as child, access type 'Multi-range' not implemented
7617 Note 1003 Can't push table 't1' as child, access type 'Multi-range' not implemented
7618 Note 1003 Can't push table 't2' as child, access type 'Multi-range' not implemented
7619 select count(*)
7620 from t1
7621 join t1 as t2 on t2.a = t1.b
7622 where t1.c IN (
7623 select /*+ SEMIJOIN(MATERIALIZATION)*/ t3s.c from t1 as t3s
7624 join t1 as t4s on t4s.a = t3s.b);
7625 count(*)
7626 64
7627 explain format=tree select count(*)
7628 from t1
7629 join t1 as t2 on t2.a = t1.b
7630 where t1.c IN(
7631 select /*+ SEMIJOIN(MATERIALIZATION)*/ t3s1.c from t1 as t3s1
7632 join t1 as t4s1 on t4s1.a = t3s1.b
7633 )
7634 and t1.d IN (
7635 select /*+ SEMIJOIN(MATERIALIZATION)*/ t3s2.c from t1 as t3s2
7636 join t1 as t4s2 on t4s2.a = t3s2.b
7637 );
7638 EXPLAIN
7639 -> Aggregate: count(0)
7640 -> Nested loop inner join
7641 -> Batched key access inner join
7642 -> Batch input rows
7643 -> Batched key access inner join
7644 -> Batch input rows
7645 -> Table scan on <subquery2>
7646 -> Materialize with deduplication
7647 -> Batched key access inner join
7648 -> Batch input rows
7649 -> Table scan on t3s1
7650 -> Multi-range index lookup on t4s1 using PRIMARY (a=t3s1.b)
7651 -> Multi-range index lookup on t1 using c (c=`<subquery2>`.c)
7652 -> Multi-range index lookup on t2 using PRIMARY (a=t1.b)
7653 -> Single-row index lookup on <subquery3> using <auto_distinct_key> (c=t1.d)
7654 -> Materialize with deduplication
7655 -> Batched key access inner join
7656 -> Batch input rows
7657 -> Table scan on t3s2
7658 -> Multi-range index lookup on t4s2 using PRIMARY (a=t3s2.b)
7659
7660 Warnings:
7661 Note 1003 Can't push table 't4s1' as child, access type 'Multi-range' not implemented
7662 Note 1003 Can't push table 't1' as child, access type 'Multi-range' not implemented
7663 Note 1003 Can't push table 't2' as child, access type 'Multi-range' not implemented
7664 Note 1003 Can't push table 't3s2' as child, 'type' must be a 'ref' access
7665 Note 1003 Can't push table 't4s2' as child, access type 'Multi-range' not implemented
7666 select count(*)
7667 from t1
7668 join t1 as t2 on t2.a = t1.b
7669 where t1.c IN(
7670 select /*+ SEMIJOIN(MATERIALIZATION)*/ t3s1.c from t1 as t3s1
7671 join t1 as t4s1 on t4s1.a = t3s1.b
7672 )
7673 and t1.d IN (
7674 select /*+ SEMIJOIN(MATERIALIZATION)*/ t3s2.c from t1 as t3s2
7675 join t1 as t4s2 on t4s2.a = t3s2.b
7676 );
7677 count(*)
7678 64
7679 explain
7680 select /*+ BKA(t2) NO_BKA(t3) */ t1.a, t2.a, t3.a
7681 from t1
7682 straight_join t1 as t2 on t2.a = t1.c
7683 straight_join t1 as t3 on t3.a = t2.c and t3.b=t2.d;
7684 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
7685 1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL c NULL NULL NULL 16 100.00 NULL
7686 1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY,c,d PRIMARY 4 test.t1.c 1 100.00 Parent of 2 pushed join@1; Using join buffer (Batched Key Access)
7687 1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t2.c,test.t2.d 1 100.00 Child of 't2' in pushed join@1
7688 Warnings:
7689 Note 1003 Can't push table 't2' as child, access type 'Batched-key' not implemented
7690 Note 1003 Can't push table 't3' as child of 't1', it is in a batched-keys-branch which can't be referred.
7691 Note 1003 /* select#1 */ select /*+ BKA(`t2`@`select#1`) NO_BKA(`t3`@`select#1`) */ `test`.`t1`.`a` AS `a`,`test`.`t2`.`a` AS `a`,`test`.`t3`.`a` AS `a` from `test`.`t1` straight_join `test`.`t1` `t2` straight_join `test`.`t1` `t3` where ((`test`.`t2`.`a` = `test`.`t1`.`c`) and (`test`.`t3`.`b` = `test`.`t2`.`d`) and (`test`.`t3`.`a` = `test`.`t2`.`c`))
7692 select /*+ BKA(t2) NO_BKA(t3) */ t1.a, t2.a, t3.a
7693 from t1
7694 straight_join t1 as t2 on t2.a = t1.c
7695 straight_join t1 as t3 on t3.a = t2.c and t3.b=t2.d;
7696 a a a
7697 1 1 1
7698 1 1 1
7699 1 1 1
7700 1 1 1
7701 1 1 2
7702 1 1 2
7703 1 2 2
7704 1 2 3
7705 2 2 2
7706 2 2 3
7707 2 3 1
7708 2 3 2
7709 2 3 3
7710 2 3 3
7711 2 4 1
7712 2 4 4
7713 3 1 1
7714 3 1 1
7715 3 1 2
7716 3 2 2
7717 3 2 3
7718 3 3 1
7719 3 3 1
7720 3 3 2
7721 3 3 2
7722 3 3 3
7723 3 3 3
7724 3 3 3
7725 3 3 3
7726 4 1 1
7727 4 1 1
7728 4 1 2
7729 4 4 1
7730 4 4 1
7731 4 4 4
7732 4 4 4
7733 explain
7734 select /*+ BKA(t2) NO_BKA(t3) */ t1.a, t2.a, t3.a
7735 from t1
7736 straight_join t1 as t2 on t2.a = t1.c
7737 straight_join t1 as t3 on t3.a = t1.c and t3.b=t2.d;
7738 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
7739 1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL c NULL NULL NULL 16 100.00 NULL
7740 1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY,d PRIMARY 4 test.t1.c 1 100.00 Parent of 2 pushed join@1; Using join buffer (Batched Key Access)
7741 1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.c,test.t2.d 1 100.00 Child of 't2' in pushed join@1
7742 Warnings:
7743 Note 1003 Can't push table 't2' as child, access type 'Batched-key' not implemented
7744 Note 1003 Can't push table 't3' as child of 't1', it is in a batched-keys-branch which can't be referred.
7745 Note 1003 /* select#1 */ select /*+ BKA(`t2`@`select#1`) NO_BKA(`t3`@`select#1`) */ `test`.`t1`.`a` AS `a`,`test`.`t2`.`a` AS `a`,`test`.`t3`.`a` AS `a` from `test`.`t1` straight_join `test`.`t1` `t2` straight_join `test`.`t1` `t3` where ((`test`.`t3`.`b` = `test`.`t2`.`d`) and (`test`.`t2`.`a` = `test`.`t1`.`c`) and (`test`.`t3`.`a` = `test`.`t1`.`c`))
7746 select /*+ BKA(t2) NO_BKA(t3) */ t1.a, t2.a, t3.a
7747 from t1
7748 straight_join t1 as t2 on t2.a = t1.c
7749 straight_join t1 as t3 on t3.a = t1.c and t3.b=t2.d;
7750 a a a
7751 1 1 1
7752 1 1 1
7753 1 1 1
7754 1 1 1
7755 1 1 1
7756 1 1 1
7757 1 1 1
7758 1 1 1
7759 1 2 2
7760 1 2 2
7761 1 2 2
7762 2 2 2
7763 2 2 2
7764 2 2 2
7765 2 3 3
7766 2 3 3
7767 2 3 3
7768 2 3 3
7769 2 4 4
7770 2 4 4
7771 2 4 4
7772 3 1 1
7773 3 1 1
7774 3 1 1
7775 3 1 1
7776 3 2 2
7777 3 2 2
7778 3 2 2
7779 3 3 3
7780 3 3 3
7781 3 3 3
7782 3 3 3
7783 3 3 3
7784 3 3 3
7785 3 3 3
7786 3 3 3
7787 4 1 1
7788 4 1 1
7789 4 1 1
7790 4 1 1
7791 4 4 4
7792 4 4 4
7793 4 4 4
7794 4 4 4
7795 4 4 4
7796 4 4 4
7797 drop table t1;
7798 CREATE TABLE ndb_order_test (
7799 node_id int(10) unsigned NOT NULL,
7800 user_id int(10) unsigned NOT NULL,
7801 sort_number int(10) unsigned NOT NULL,
7802 KEY node_id (node_id,sort_number)
7803 ) ENGINE=ndbcluster DEFAULT CHARSET=utf8
7804 comment="NDB_TABLE=PARTITION_BALANCE=FOR_RP_BY_LDM";
7805 Warnings:
7806 Warning 1681 Integer display width is deprecated and will be removed in a future release.
7807 Warning 1681 Integer display width is deprecated and will be removed in a future release.
7808 Warning 1681 Integer display width is deprecated and will be removed in a future release.
7809 Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous.
7810 CREATE TABLE ndb_user_test (
7811 user_id int(10) unsigned NOT NULL AUTO_INCREMENT,
7812 name varchar(20) NOT NULL,
7813 PRIMARY KEY (user_id)
7814 ) ENGINE=ndbcluster DEFAULT CHARSET=utf8 AUTO_INCREMENT=2
7815 comment="NDB_TABLE=PARTITION_BALANCE=FOR_RP_BY_LDM";
7816 Warnings:
7817 Warning 1681 Integer display width is deprecated and will be removed in a future release.
7818 Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous.
7819 INSERT INTO ndb_order_test (node_id, user_id, sort_number) VALUES
7820 (68, 1, 1398029),
7821 (68, 1, 549053);
7822 INSERT INTO ndb_user_test (user_id, name) VALUES
7823 (1, 'Shawn');
7824 EXPLAIN
7825 SELECT *
7826 FROM ndb_order_test JOIN ndb_user_test USING (user_id)
7827 WHERE node_id = 68
7828 ORDER BY sort_number DESC;
7829 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
7830 1 SIMPLE ndb_order_test p0,p1,p2,p3,p4,p5,p6,p7 ref node_id node_id 4 const 2 100.00 Using temporary; Using filesort
7831 1 SIMPLE ndb_user_test p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.ndb_order_test.user_id 1 100.00 Using join buffer (Batched Key Access)
7832 Warnings:
7833 Note 1003 Can't push table 'ndb_user_test' as child, access type 'Batched-key' not implemented
7834 Note 1003 /* select#1 */ select `test`.`ndb_order_test`.`user_id` AS `user_id`,`test`.`ndb_order_test`.`node_id` AS `node_id`,`test`.`ndb_order_test`.`sort_number` AS `sort_number`,`test`.`ndb_user_test`.`name` AS `name` from `test`.`ndb_order_test` join `test`.`ndb_user_test` where ((`test`.`ndb_user_test`.`user_id` = `test`.`ndb_order_test`.`user_id`) and (`test`.`ndb_order_test`.`node_id` = 68)) order by `test`.`ndb_order_test`.`sort_number` desc
7835 SELECT *
7836 FROM ndb_order_test JOIN ndb_user_test USING (user_id)
7837 WHERE node_id = 68
7838 ORDER BY sort_number DESC;
7839 user_id node_id sort_number name
7840 1 68 1398029 Shawn
7841 1 68 549053 Shawn
7842 EXPLAIN
7843 SELECT *
7844 FROM ndb_order_test JOIN ndb_user_test USING (user_id)
7845 WHERE node_id = 68
7846 ORDER BY sort_number ASC;
7847 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
7848 1 SIMPLE ndb_order_test p0,p1,p2,p3,p4,p5,p6,p7 ref node_id node_id 4 const 2 100.00 Using temporary; Using filesort
7849 1 SIMPLE ndb_user_test p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.ndb_order_test.user_id 1 100.00 Using join buffer (Batched Key Access)
7850 Warnings:
7851 Note 1003 Can't push table 'ndb_user_test' as child, access type 'Batched-key' not implemented
7852 Note 1003 /* select#1 */ select `test`.`ndb_order_test`.`user_id` AS `user_id`,`test`.`ndb_order_test`.`node_id` AS `node_id`,`test`.`ndb_order_test`.`sort_number` AS `sort_number`,`test`.`ndb_user_test`.`name` AS `name` from `test`.`ndb_order_test` join `test`.`ndb_user_test` where ((`test`.`ndb_user_test`.`user_id` = `test`.`ndb_order_test`.`user_id`) and (`test`.`ndb_order_test`.`node_id` = 68)) order by `test`.`ndb_order_test`.`sort_number`
7853 SELECT *
7854 FROM ndb_order_test JOIN ndb_user_test USING (user_id)
7855 WHERE node_id = 68
7856 ORDER BY sort_number ASC;
7857 user_id node_id sort_number name
7858 1 68 549053 Shawn
7859 1 68 1398029 Shawn
7860 DROP TABLE ndb_order_test, ndb_user_test;
7861 ##################
7862 #
7863 # Bug #29501263 CRASH IN SPJ BLOCK, ILLEGAL ACCESS
7864 # TO ARRAYPOOL<T>::GETPTR
7865 #
7866 ##################
7867 create table t1 (
7868 pk int primary key,
7869 i1 int
7870 ) engine = ndb;
7871 insert into t1 values (1,1),(2,2),(3,3);
7872 alter table t1 add column (i2 int, i3 int, i4 int, i5 int);
7873 Warnings:
7874 Warning 1478 Converted FIXED field 'i2' to DYNAMIC to enable online ADD COLUMN
7875 Warning 1478 Converted FIXED field 'i3' to DYNAMIC to enable online ADD COLUMN
7876 Warning 1478 Converted FIXED field 'i4' to DYNAMIC to enable online ADD COLUMN
7877 Warning 1478 Converted FIXED field 'i5' to DYNAMIC to enable online ADD COLUMN
7878 update t1 set i2=i1, i3=i1, i4=i1, i5=i1;
7879 alter table t1 add index ix1(i1);
7880 alter table t1 add index ix2(i2);
7881 alter table t1 add index ix3(i3);
7882 alter table t1 add index ix4(i4);
7883 alter table t1 add index ix5(i5);
7884 alter table t1 add unique index uix(i4,i5);
7885 select straight_join * from
7886 t1
7887 join t1 as t2 on t2.i1 = t1.i1
7888 join t1 as t3 on t3.pk = t2.i2
7889 left join t1 as t4 on t4.pk = t3.i3
7890 left join t1 as t5 on t5.i4 = t2.i4 and t5.i5 = t1.i5;
7891 pk i1 i2 i3 i4 i5 pk i1 i2 i3 i4 i5 pk i1 i2 i3 i4 i5 pk i1 i2 i3 i4 i5 pk i1 i2 i3 i4 i5
7892 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
7893 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
7894 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3
7895 drop table t1;
7896 ##################
7897 #
7898 # Bug#32203548 REQUIRE_FAILED WHEN COMPARE_NDBRECORD()
7899 # SORT-MERGE SPJ RESULTS FROM INDEX
7900 #
7901 ##################
7902 create table t1 (
7903 a int not null,
7904 b int not null,
7905 c varchar(1) not null,
7906 d varchar(1) not null,
7907 primary key (a,b),
7908 index ix2 (d,c)
7909 ) engine=ndbcluster;
7910 insert into t1 values
7911 (1,1,"1","1"), (2,2,"2","1"), (3,3,"3","1"), (4,4,"4","1"),
7912 (1,2,"5","1"), (1,3,"1","1"), (1,4,"2","1"),
7913 (2,1,"3","1"), (2,3,"4","1"), (2,4,"5","1");
7914 explain
7915 select t1.d from t1 FORCE INDEX FOR ORDER BY (ix2)
7916 straight_join t1 as t2 on t2.a = t1.a
7917 order by t1.d;
7918 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
7919 1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 index PRIMARY ix2 12 NULL 10 100.00 Parent of 2 pushed join@1
7920 1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.t1.a 1 100.00 Child of 't1' in pushed join@1
7921 Warnings:
7922 Note 1003 /* select#1 */ select `test`.`t1`.`d` AS `d` from `test`.`t1` FORCE INDEX FOR ORDER BY (`ix2`) straight_join `test`.`t1` `t2` where (`test`.`t2`.`a` = `test`.`t1`.`a`) order by `test`.`t1`.`d`
7923 select t1.d from t1 FORCE INDEX FOR ORDER BY (ix2)
7924 straight_join t1 as t2 on t2.a = t1.a
7925 order by t1.d;
7926 d
7927 1
7928 1
7929 1
7930 1
7931 1
7932 1
7933 1
7934 1
7935 1
7936 1
7937 1
7938 1
7939 1
7940 1
7941 1
7942 1
7943 1
7944 1
7945 1
7946 1
7947 1
7948 1
7949 1
7950 1
7951 1
7952 1
7953 1
7954 1
7955 1
7956 1
7957 1
7958 1
7959 1
7960 1
7961 drop table t1;
7962 ##################
7963 #
7964 # Specific WL-14370, 'AccessPath' tests
7965 # (Unknown if/how this worked pre-wl-14370)
7966 #
7967 ##################
7968 Testcase for AccessPath::NESTED_LOOP_SEMIJOIN_WITH_DUPLICATE_REMOVAL
7969 Expect explain: 'Nested loop semijoin with duplicate removal on...'
7970 (Hardly ever used unless forced to...)
7971 Testcase for AccessPath::WINDOWING
7972 create table t2(a int) engine=ndbcluster;
7973 insert into t2 values(1), (2);
7974 create table t3(a int, b int) engine=ndbcluster;
7975 insert into t3 values(1, 3), (2, 3);
7976 explain format=tree select a,
7977 (select sum(a) over w from t2 window w as(order by t3.a) limit 1)
7978 from t3;
7979 EXPLAIN
7980 -> Table scan on t3
7981 -> Select #2 (subquery in projection; dependent)
7982 -> Limit: 1 row(s)
7983 -> Window aggregate with buffering: sum(t2.a) OVER w
7984 -> Sort: t3.a
7985 -> Table scan on t2
7986
7987 Warnings:
7988 Note 1276 Field or reference 'test.t3.a' of SELECT #2 was resolved in SELECT #1
7989 select a,
7990 (select sum(a) over w from t2 window w as(order by t3.a) limit 1)
7991 from t3;
7992 a (select sum(a) over w from t2 window w as(order by t3.a) limit 1)
7993 1 3
7994 2 3
7995 drop table t2,t3;
7996 create table t1 (
7997 a int not null,
7998 b int not null,
7999 c int not null,
8000 d int not null,
8001 primary key (`a`,`b`)
8002 ) engine=ndbcluster
8003 partition by key() partitions 8;
8004 insert into t1 values
8005 (1,1,1,1), (2,2,2,2), (3,3,3,3), (4,4,4,4),
8006 (1,2,5,1), (1,3,1,2), (1,4,2,3),
8007 (2,1,3,4), (2,3,4,5), (2,4,5,1),
8008 (3,1,1,2), (3,2,2,3), (3,4,3,4),
8009 (4,1,4,5), (4,2,5,1), (4,3,1,2);
8010 explain format=tree select *
8011 from t1
8012 straight_join t1 as t2 on t2.a = t1.b+0 and t2.b = t1.c
8013 straight_join t1 as t3 on t3.a = t1.b and t3.b = t2.b
8014 where t1.a=1 and t1.d=1 union all select *
8015 from t1
8016 straight_join t1 as t2 on t2.a = t1.b+0 and t2.b = t1.c
8017 straight_join t1 as t3 on t3.a = t1.b and t3.b = t2.b
8018 where t1.a=1 and t1.d=1;
8019 EXPLAIN
8020 -> Append
8021 -> Stream results
8022 -> Batched key access inner join
8023 -> Batch input rows
8024 -> Batched key access inner join
8025 -> Batch input rows
8026 -> Index lookup on t1 using PRIMARY (a=1), with pushed condition: (t1.d = 1)
8027 -> Filter: (t2.a = (t1.b + 0))
8028 -> Multi-range index lookup on t2 using PRIMARY (a=(t1.b + 0), b=t1.c)
8029 -> Multi-range index lookup on t3 using PRIMARY (a=t1.b, b=t1.c)
8030 -> Stream results
8031 -> Batched key access inner join
8032 -> Batch input rows
8033 -> Batched key access inner join
8034 -> Batch input rows
8035 -> Index lookup on t1 using PRIMARY (a=1), with pushed condition: (t1.d = 1)
8036 -> Filter: (t2.a = (t1.b + 0))
8037 -> Multi-range index lookup on t2 using PRIMARY (a=(t1.b + 0), b=t1.c)
8038 -> Multi-range index lookup on t3 using PRIMARY (a=t1.b, b=t1.c)
8039
8040 Warnings:
8041 Note 1003 Can't push table 't2' as child, access type 'Multi-range' not implemented
8042 Note 1003 Can't push table 't3' as child, access type 'Multi-range' not implemented
8043 Note 1003 Can't push table 't2' as child, access type 'Multi-range' not implemented
8044 Note 1003 Can't push table 't3' as child, access type 'Multi-range' not implemented
8045 select *
8046 from t1
8047 straight_join t1 as t2 on t2.a = t1.b+0 and t2.b = t1.c
8048 straight_join t1 as t3 on t3.a = t1.b and t3.b = t2.b
8049 where t1.a=1 and t1.d=1 union all select *
8050 from t1
8051 straight_join t1 as t2 on t2.a = t1.b+0 and t2.b = t1.c
8052 straight_join t1 as t3 on t3.a = t1.b and t3.b = t2.b
8053 where t1.a=1 and t1.d=1;
8054 a b c d a b c d a b c d
8055 1 1 1 1 1 1 1 1 1 1 1 1
8056 1 1 1 1 1 1 1 1 1 1 1 1
8057 explain format=tree select *
8058 from t1
8059 straight_join t1 as t2 on t2.a = t1.b+0 and t2.b = t1.c
8060 straight_join t1 as t3 on t3.a = t1.b and t3.b = t2.b
8061 where t1.a=1 and t1.d=1 union select *
8062 from t1
8063 straight_join t1 as t2 on t2.a = t1.b+0 and t2.b = t1.c
8064 straight_join t1 as t3 on t3.a = t1.b and t3.b = t2.b
8065 where t1.a=1 and t1.d=1;
8066 EXPLAIN
8067 -> Table scan on <union temporary>
8068 -> Union materialize with deduplication
8069 -> Batched key access inner join
8070 -> Batch input rows
8071 -> Batched key access inner join
8072 -> Batch input rows
8073 -> Index lookup on t1 using PRIMARY (a=1), with pushed condition: (t1.d = 1)
8074 -> Filter: (t2.a = (t1.b + 0))
8075 -> Multi-range index lookup on t2 using PRIMARY (a=(t1.b + 0), b=t1.c)
8076 -> Multi-range index lookup on t3 using PRIMARY (a=t1.b, b=t1.c)
8077 -> Batched key access inner join
8078 -> Batch input rows
8079 -> Batched key access inner join
8080 -> Batch input rows
8081 -> Index lookup on t1 using PRIMARY (a=1), with pushed condition: (t1.d = 1)
8082 -> Filter: (t2.a = (t1.b + 0))
8083 -> Multi-range index lookup on t2 using PRIMARY (a=(t1.b + 0), b=t1.c)
8084 -> Multi-range index lookup on t3 using PRIMARY (a=t1.b, b=t1.c)
8085
8086 Warnings:
8087 Note 1003 Can't push table 't2' as child, access type 'Multi-range' not implemented
8088 Note 1003 Can't push table 't3' as child, access type 'Multi-range' not implemented
8089 Note 1003 Can't push table 't2' as child, access type 'Multi-range' not implemented
8090 Note 1003 Can't push table 't3' as child, access type 'Multi-range' not implemented
8091 select *
8092 from t1
8093 straight_join t1 as t2 on t2.a = t1.b+0 and t2.b = t1.c
8094 straight_join t1 as t3 on t3.a = t1.b and t3.b = t2.b
8095 where t1.a=1 and t1.d=1 union select *
8096 from t1
8097 straight_join t1 as t2 on t2.a = t1.b+0 and t2.b = t1.c
8098 straight_join t1 as t3 on t3.a = t1.b and t3.b = t2.b
8099 where t1.a=1 and t1.d=1;
8100 a b c d a b c d a b c d
8101 1 1 1 1 1 1 1 1 1 1 1 1
8102 drop table t1;
8103 ##################
8104 #
8105 # Bug#33669039 Stale rows returned from SPJ API,
8106 # hit assert(key_cmp_if_same(...)) in debug build
8107 #
8108 ##################
8109 create table t (
8110 pk int primary key,
8111 a int,
8112 b int,
8113 c int,
8114 d int
8115 ) engine = ndbcluster;
8116 insert into t values (0,0,0,0,0);
8117 insert into t values (1,1,1,1,1);
8118 insert into t values (2,2,2,2,2);
8119 insert into t values (3,3,3,3,3);
8120 insert into t values (4,4,4,4,4);
8121 insert into t values (5,5,5,5,5);
8122 insert into t values (6,6,6,6,6);
8123 insert into t values (7,-1,7,7,7);
8124 insert into t values (8,8,8,8,8);
8125 insert into t values (9,9,9,9,9);
8126 insert into t values (10,10,10,10,10);
8127 insert into t values (11,11,11,11,11);
8128 insert into t values (12,12,12,12,12);
8129 insert into t values (13,13,13,13,13);
8130 insert into t values (14,14,14,14,14);
8131 insert into t values (15,15,15,15,15);
8132 explain format=tree select t1.pk, t2.pk, t3.pk, t4.pk, t5.pk
8133 from t as t1
8134 left join (
8135 t as t2
8136 straight_join t as t3 on t3.pk = t2.b
8137 ) on t2.pk = t1.a
8138 left join (
8139 t as t4
8140 straight_join t as t5
8141 ) on t4.pk = t1.c and t5.pk = t3.d;
8142 EXPLAIN
8143 -> Nested loop left join
8144 -> Nested loop left join
8145 -> Table scan on t1, activating pushed join of 3 tables
8146 -> Batched key access inner join
8147 -> Batch input rows
8148 -> Single-row index lookup on t2 using PRIMARY (pk=t1.a), child of t1 in pushed join
8149 -> Multi-range index lookup on t3 using PRIMARY (pk=t2.b)
8150 -> Batched key access inner join
8151 -> Batch input rows
8152 -> Single-row index lookup on t4 using PRIMARY (pk=t1.c), child of t1 in pushed join
8153 -> Multi-range index lookup on t5 using PRIMARY (pk=t3.d)
8154
8155 Warnings:
8156 Note 1003 Can't push table 't3' as child, access type 'Multi-range' not implemented
8157 Note 1003 Can't push table 't5' as child, access type 'Multi-range' not implemented
8158 select t1.pk, t2.pk, t3.pk, t4.pk, t5.pk
8159 from t as t1
8160 left join (
8161 t as t2
8162 straight_join t as t3 on t3.pk = t2.b
8163 ) on t2.pk = t1.a
8164 left join (
8165 t as t4
8166 straight_join t as t5
8167 ) on t4.pk = t1.c and t5.pk = t3.d;
8168 pk pk pk pk pk
8169 0 0 0 0 0
8170 1 1 1 1 1
8171 10 10 10 10 10
8172 11 11 11 11 11
8173 12 12 12 12 12
8174 13 13 13 13 13
8175 14 14 14 14 14
8176 15 15 15 15 15
8177 2 2 2 2 2
8178 3 3 3 3 3
8179 4 4 4 4 4
8180 5 5 5 5 5
8181 6 6 6 6 6
8182 7 NULL NULL NULL NULL
8183 8 8 8 8 8
8184 9 9 9 9 9
8185 drop table t;
8186 ##################
8187 #
8188 # Bug#34482783 NDB: mysqld crash in ::is_pushable_within_nest()
8189 #
8190 ##################
8191 create table t (
8192 pk int primary key,
8193 col_int_key int not null,
8194 col_int int not null,
8195 key(col_int_key)
8196 ) engine = ndbcluster;
8197 explain format=tree SELECT *
8198 FROM t AS table1
8199 LEFT JOIN t AS table2
8200 JOIN t AS table3 ON table2.col_int IS NULL # <- 'zero rows'
8201 ON table1.col_int = table2.col_int AND
8202 table1.col_int_key = table2.col_int_key AND
8203 table1.pk = table3.pk;
8204 EXPLAIN
8205 -> Nested loop left join
8206 -> Table scan on table1
8207 -> Batched key access inner join
8208 -> Batch input rows
8209 -> Zero rows (Impossible filter)
8210 -> Multi-range index lookup on table2 using col_int_key (col_int_key=table1.col_int_key), with pushed condition: (table2.col_int = table1.col_int)
8211
8212 Warnings:
8213 Note 1003 Can't push table 'table2' as child, access type 'Multi-range' not implemented
8214 SELECT *
8215 FROM t AS table1
8216 LEFT JOIN t AS table2
8217 JOIN t AS table3 ON table2.col_int IS NULL # <- 'zero rows'
8218 ON table1.col_int = table2.col_int AND
8219 table1.col_int_key = table2.col_int_key AND
8220 table1.pk = table3.pk;
8221 pk col_int_key col_int pk col_int_key col_int pk col_int_key col_int
8222 drop table t;
8223 ##################
8224 #
8225 # Bug#34723413 A 'pushed join' should not start with a scan-table
8226 # returning very few rows .
8227 #
8228 ##################
8229 create table t10 (
8230 k int not null auto_increment,
8231 i int,
8232 primary key(k),
8233 key(i)
8234 ) engine = ndbcluster;
8235 insert into t10(i) values (1),(2),(3),(4),(5),(6),(7),(8),(9),(0);
8236 create table t100 like t10;
8237 insert into t100(i)
8238 select x.i from t10 as x, t10 as y;
8239 create table t1000 like t10;
8240 insert into t1000(i)
8241 select x.i from t10 as x, t10 as y, t10 as z;
8242 delete from t10 where i > 2;
8243 update t100 set i = i/3;
8244 update t1000 set i = i/3;
8245 analyze table t10,t100,t1000;
8246 Table Op Msg_type Msg_text
8247 test.t10 analyze status OK
8248 test.t100 analyze status OK
8249 test.t1000 analyze status OK
8250 explain format=tree
8251 select *
8252 from t10
8253 straight_join t1000 on t1000.i = t10.i
8254 straight_join t100 on t100.k = t1000.k;
8255 EXPLAIN
8256 -> Batched key access inner join
8257 -> Batch input rows
8258 -> Batched key access inner join
8259 -> Batch input rows
8260 -> Table scan on t10, with pushed condition: (t10.i is not null)
8261 -> Multi-range index lookup on t1000 using i (i=t10.i)
8262 -> Multi-range index lookup on t100 using PRIMARY (k=t1000.k)
8263
8264 Warnings:
8265 Note 1003 Can't push table 't1000' as child, access type 'Multi-range' not implemented
8266 Note 1003 Can't push table 't100' as child, access type 'Multi-range' not implemented
8267 explain format=tree select *
8268 from t10
8269 straight_join t1000 on t1000.i = t10.i
8270 straight_join t100 on t100.k = t10.k;
8271 EXPLAIN
8272 -> Batched key access inner join
8273 -> Batch input rows
8274 -> Batched key access inner join
8275 -> Batch input rows
8276 -> Table scan on t10, with pushed condition: (t10.i is not null)
8277 -> Multi-range index lookup on t1000 using i (i=t10.i)
8278 -> Multi-range index lookup on t100 using PRIMARY (k=t10.k)
8279
8280 Warnings:
8281 Note 1003 Can't push table 't1000' as child, access type 'Multi-range' not implemented
8282 Note 1003 Can't push table 't100' as child, access type 'Multi-range' not implemented
8283 drop table t10,t100,t1000;
8284 ##################
8285 #
8286 # Bug#34782276:
8287 # Improve SPJ-internal execution plan, evaluate inner-joins first
8288 #
8289 ##################
8290 create table t (
8291 k int,
8292 a int,
8293 key ix1(k),
8294 key ix2(a)
8295 ) engine = ndb;
8296 insert into t values
8297 (0,0), (1,1), (2,2),
8298 (3,0), (4,1), (5,2),
8299 (6,0), (7,1), (8,2);
8300 explain format=tree select straight_join *
8301 from t as t1
8302 inner join t as t2 on t2.a = t1.k
8303 inner join t as t3 on t3.k = t1.k;
8304 EXPLAIN
8305 -> Batched key access inner join
8306 -> Batch input rows
8307 -> Batched key access inner join
8308 -> Batch input rows
8309 -> Table scan on t1, with pushed condition: (t1.k is not null)
8310 -> Multi-range index lookup on t2 using ix2 (a=t1.k)
8311 -> Multi-range index lookup on t3 using ix1 (k=t1.k)
8312
8313 Warnings:
8314 Note 1003 Can't push table 't2' as child, access type 'Multi-range' not implemented
8315 Note 1003 Can't push table 't3' as child, access type 'Multi-range' not implemented
8316 select straight_join *
8317 from t as t1
8318 inner join t as t2 on t2.a = t1.k
8319 inner join t as t3 on t3.k = t1.k;
8320 ############
8321 # Verify the expect 21 rows were returned from SPJ:
8322 # - 2 x 9 rows from t1 inner join t2
8323 # - 3 rows from t1 join t3
8324 # -> 21 rows (0 *SPJ* rows when not join-pushed (BKA))
8325 #
8326 SPJ_rows_returned
8327 0
8328 explain format=tree select straight_join *
8329 from t as t1
8330 inner join t as t2 on t2.a = t1.k
8331 left join t as t3 on t3.k = t1.k;
8332 EXPLAIN
8333 -> Batched key access left join
8334 -> Batch input rows
8335 -> Batched key access inner join
8336 -> Batch input rows
8337 -> Table scan on t1, with pushed condition: (t1.k is not null)
8338 -> Multi-range index lookup on t2 using ix2 (a=t1.k)
8339 -> Multi-range index lookup on t3 using ix1 (k=t1.k)
8340
8341 Warnings:
8342 Note 1003 Can't push table 't2' as child, access type 'Multi-range' not implemented
8343 Note 1003 Can't push table 't3' as child, access type 'Multi-range' not implemented
8344 select straight_join *
8345 from t as t1
8346 inner join t as t2 on t2.a = t1.k
8347 left join t as t3 on t3.k = t1.k;
8348 ############
8349 # As above, t1 inner join t2 is evaluated first
8350 # - 2 x 9 rows from join(t1,t2)
8351 # - Only the 3 matching t1 rows are requested from t3!
8352 # -> still 21 rows (and still 0 *SPJ* rows when not join-pushed (BKA))
8353 #
8354 SPJ_rows_returned
8355 0
8356 explain format=tree select straight_join *
8357 from t as t1
8358 left join t as t2 on t2.a = t1.k
8359 inner join t as t3 on t3.k = t1.k;
8360 EXPLAIN
8361 -> Batched key access inner join
8362 -> Batch input rows
8363 -> Batched key access left join
8364 -> Batch input rows
8365 -> Table scan on t1, with pushed condition: (t1.k is not null)
8366 -> Multi-range index lookup on t2 using ix2 (a=t1.k)
8367 -> Multi-range index lookup on t3 using ix1 (k=t1.k)
8368
8369 Warnings:
8370 Note 1003 Can't push table 't2' as child, access type 'Multi-range' not implemented
8371 Note 1003 Can't push table 't3' as child, access type 'Multi-range' not implemented
8372 select straight_join *
8373 from t as t1
8374 left join t as t2 on t2.a = t1.k
8375 inner join t as t3 on t3.k = t1.k;
8376 ############
8377 # Verify that all 3 x 9 rows were returned from SPJ:
8378 # - 2 x 9 rows from t1 outer join t2
8379 # (No t1-match elimination in an outer-join)
8380 # - 9 rows from t1 inner join t3
8381 # -> 27 rows
8382 #
8383 SPJ_rows_returned
8384 0
8385 drop table t;
8386 select new.variable_name, new.variable_value - old.variable_value
8387 from server_counts_at_startup as old,
8388 performance_schema.global_status as new
8389 where new.variable_name = old.variable_name
8390 order by new.variable_name;
8391 variable_name new.variable_value - old.variable_value
8392 Ndb_pruned_scan_count 24
8393 Ndb_pushed_queries_defined 20
8394 Ndb_pushed_queries_dropped 0
8395 Ndb_sorted_scan_count 0
8396 drop table server_counts_at_startup;
8397 set ndb_join_pushdown = @save_ndb_join_pushdown;
8398 CREATE TABLE f (
8399 col_int_key int DEFAULT NULL
8400 ) ENGINE=ndbcluster;
8401 CREATE TABLE p (
8402 col_int int DEFAULT NULL,
8403 col_int_unique int DEFAULT NULL,
8404 UNIQUE KEY ix1 (col_int,col_int_unique) USING HASH
8405 ) ENGINE=ndbcluster;
8406 Warnings:
8407 Warning 1121 Ndb does not support unique index on NULL valued attributes, index access with NULL value will become full table scan
8408 insert into f values (1),(NULL);
8409 insert into p values (NULL,1);
8410 explain format=tree SELECT * FROM f AS table2
8411 STRAIGHT_JOIN p AS table4 ON table4.col_int IS NULL
8412 AND table4.col_int_unique = table2.col_int_key;
8413 EXPLAIN
8414 -> Inner hash join (table4.col_int_unique = table2.col_int_key) (...)
8415 -> Table scan on table4, with pushed condition: (table4.col_int is null) (...)
8416 -> Hash
8417 -> Table scan on table2 (...)
8418
8419 Warnings:
8420 Note 1003 Can't push table 'table4' as child, 'type' must be a 'ref' access
8421 SELECT * FROM f AS table2
8422 STRAIGHT_JOIN p AS table4 ON table4.col_int IS NULL
8423 AND table4.col_int_unique = table2.col_int_key;
8424 col_int_key col_int col_int_unique
8425 1 NULL 1
8426 explain format=tree SELECT * FROM f AS table2
8427 STRAIGHT_JOIN p AS table4 ON table4.col_int = 1
8428 AND table4.col_int_unique = table2.col_int_key;
8429 EXPLAIN
8430 -> Batched key access inner join
8431 -> Batch input rows
8432 -> Table scan on table2, with pushed condition: (table2.col_int_key is not null) (...)
8433 -> Multi-range index lookup on table4 using ix1 (col_int=1, col_int_unique=table2.col_int_key) (...)
8434
8435 Warnings:
8436 Note 1003 Can't push table 'table4' as child, access type 'Multi-range' not implemented
8437 SELECT * FROM f AS table2
8438 STRAIGHT_JOIN p AS table4 ON table4.col_int = 1
8439 AND table4.col_int_unique = table2.col_int_key;
8440 col_int_key col_int col_int_unique
8441 explain format=tree SELECT * FROM f AS table2
8442 STRAIGHT_JOIN p AS table4 ON table4.col_int <=> table2.col_int_key
8443 AND table4.col_int_unique = table2.col_int_key;
8444 EXPLAIN
8445 -> Nested loop inner join (...)
8446 -> Table scan on table2, activating pushed join of 2 tables, with pushed condition: (table2.col_int_key is not null) (...)
8447 -> Filter: (table4.col_int <=> table2.col_int_key) (...)
8448 -> Index lookup on table4 using ix1 (col_int=table2.col_int_key, col_int_unique=table2.col_int_key), child of table2 in pushed join (...)
8449
8450 SELECT * FROM f AS table2
8451 STRAIGHT_JOIN p AS table4 ON table4.col_int <=> table2.col_int_key
8452 AND table4.col_int_unique = table2.col_int_key;
8453 col_int_key col_int col_int_unique
8454 explain format=tree SELECT * FROM f AS table2
8455 STRAIGHT_JOIN p AS table4 ON table4.col_int = table2.col_int_key
8456 AND table4.col_int_unique <=> table2.col_int_key;
8457 EXPLAIN
8458 -> Nested loop inner join (...)
8459 -> Table scan on table2, activating pushed join of 2 tables, with pushed condition: (table2.col_int_key is not null) (...)
8460 -> Filter: (table4.col_int_unique <=> table2.col_int_key) (...)
8461 -> Index lookup on table4 using ix1 (col_int=table2.col_int_key, col_int_unique=table2.col_int_key), child of table2 in pushed join (...)
8462
8463 SELECT * FROM f AS table2
8464 STRAIGHT_JOIN p AS table4 ON table4.col_int = table2.col_int_key
8465 AND table4.col_int_unique <=> table2.col_int_key;
8466 col_int_key col_int col_int_unique
8467 explain format=tree SELECT * FROM f AS table2
8468 STRAIGHT_JOIN p AS table4 ON table4.col_int = table2.col_int_key
8469 AND table4.col_int_unique = table2.col_int_key;
8470 EXPLAIN
8471 -> Batched key access inner join
8472 -> Batch input rows
8473 -> Table scan on table2, with pushed condition: (table2.col_int_key is not null) (...)
8474 -> Multi-range index lookup on table4 using ix1 (col_int=table2.col_int_key, col_int_unique=table2.col_int_key) (...)
8475
8476 Warnings:
8477 Note 1003 Can't push table 'table4' as child, access type 'Multi-range' not implemented
8478 SELECT * FROM f AS table2
8479 STRAIGHT_JOIN p AS table4 ON table4.col_int = table2.col_int_key
8480 AND table4.col_int_unique = table2.col_int_key;
8481 col_int_key col_int col_int_unique
8482 DROP TABLE f,p;
8483 set @@global.optimizer_switch=default;