Debian Codegraph @

mysql-test/suite/ndb/r/ndb_read_local.result

raw
1 use test;
2 Test read-locality of READ-BACKUP
3 create table test.t1 (a int primary key,
4 b int,
5 c int,
6 d int,
7 unique(b) using hash,
8 key(c),
9 key(a,c))
10 comment="NDB_TABLE=READ_BACKUP=1"
11 engine=ndb;
12 Warnings:
13 Warning 1121 Ndb does not support unique index on NULL valued attributes, index access with NULL value will become full table scan
14 create table test.t2 (a int primary key,
15 b int,
16 c int,
17 d text,
18 unique(b) using hash,
19 key(c))
20 comment="NDB_TABLE=READ_BACKUP=1"
21 engine=ndb;
22 Warnings:
23 Warning 1121 Ndb does not support unique index on NULL valued attributes, index access with NULL value will become full table scan
24 select id into @t1_id from ndbinfo.ndb$dict_obj_info where fq_name = 'test/def/t1';
25 select id into @t1ui_id from ndbinfo.ndb$dict_obj_info where parent_obj_id = @t1_id and type = 3;
26 select id into @t2_id from ndbinfo.ndb$dict_obj_info where fq_name = 'test/def/t2';
27 select id into @t2ui_id from ndbinfo.ndb$dict_obj_info where parent_obj_id = @t2_id and type = 3;
28 select id into @t2bt_id from ndbinfo.ndb$dict_obj_info where parent_obj_id = @t2_id and fq_name like 'test/def/NDB$BLOB%';
29 Put some data in.
30 Make it more interesting for joining
31 update test.t1 set c=c+1, d=d+1;
32 select count(distinct node_id) into @nodes
33 from ndbinfo.ndb$membership where group_id < 0xFFFFFF00;
34 Check replicas
35 select count(distinct node_id)
36 from ndbinfo.operations_per_fragment
37 where fq_name='test/def/t1'
38 and fragment_num=0;
39 count(distinct node_id)
40 2
41 Check nodes with table data
42 select count(distinct node_id)
43 from ndbinfo.operations_per_fragment
44 where fq_name='test/def/t1';
45 count(distinct node_id)
46 2
47 Check UI replicas
48 select count(distinct node_id)
49 from ndbinfo.operations_per_fragment
50 where table_id = @t1ui_id
51 and fragment_num=0;
52 count(distinct node_id)
53 2
54 Check nodes with UI data
55 select count(distinct node_id)
56 from ndbinfo.operations_per_fragment
57 where table_id = @t1ui_id;
58 count(distinct node_id)
59 2
60 Put some data in.
61 insert into test.t2 select a,b,c,repeat('BJC',300) from test.t1;
62 Check blob table replicas
63 select count(distinct node_id)
64 from ndbinfo.operations_per_fragment
65 where table_id = @t2bt_id
66 and fragment_num=0;
67 count(distinct node_id)
68 2
69 Check nodes with blob data
70 select count(distinct node_id)
71 from ndbinfo.operations_per_fragment
72 where table_id = @t2bt_id;
73 count(distinct node_id)
74 2
75 set @partitions = 'PARTITION p2 VALUES IN (2)';
76 set @partitions = concat(@partitions,',PARTITION p1 VALUES IN (1)');
77 set @@new = 1;
78 Warnings:
79 Warning 1287 '@@new' is deprecated and will be removed in a future release.
80 create table hints (i int primary key) engine=ndb partition by list(i) (PARTITION p2 VALUES IN (2),PARTITION p1 VALUES IN (1));
81 insert into hints values (2);
82 Hint node by 2 of 2
83 Tests on T1 (!Blobs)
84 Test some basic NdbApi
85 PK lookups
86 explain select * from test.t1 where t1.a=6;
87 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
88 1 SIMPLE t1 # eq_ref PRIMARY,a PRIMARY 4 const # # NULL
89 Warnings:
90 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` from `test`.`t1` where (`test`.`t1`.`a` = 6)
91 Error insert to ensure that TC requests are purely local
92
93
94 UI lookups
95 explain select * from test.t1 where t1.b=6;
96 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
97 1 SIMPLE t1 # eq_ref b b 5 const # # NULL
98 Warnings:
99 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` from `test`.`t1` where (`test`.`t1`.`b` = 6)
100 Error insert to ensure that TC requests are purely local
101
102
103 OI scan
104 explain select * from test.t1 where c > 6;
105 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
106 1 SIMPLE t1 # range c c 5 NULL # # Using pushed condition (`test`.`t1`.`c` > 6); Using MRR
107 Warnings:
108 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` from `test`.`t1` where (`test`.`t1`.`c` > 6)
109 Error insert to ensure that TC requests are purely local
110
111
112 Table scan
113 explain select * from test.t1;
114 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
115 1 SIMPLE t1 # ALL NULL NULL NULL NULL # # NULL
116 Warnings:
117 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` from `test`.`t1`
118 Error insert to ensure that TC requests are purely local
119
120
121 Test pushed queries (SPJ)
122 Pushed pk->pk
123 Lookup to get a.d, feeding pk lookup of b.a
124 explain select a.a, a.d, b.d
125 from
126 test.t1 a
127 join
128 test.t1 b
129 on
130 a.d = b.a
131 where a.a = 6;
132 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
133 1 SIMPLE a # eq_ref PRIMARY,a PRIMARY 4 const # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
134 1 SIMPLE b # eq_ref PRIMARY,a PRIMARY 4 test.a.d # # Child of 'a' in pushed join@1
135 Warnings:
136 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`a` = `test`.`a`.`d`) and (`test`.`a`.`a` = 6))
137 Error insert to ensure that SPJ requests are purely local
138
139
140 Pushed uk->uk
141 Lookup to get a.d, feeding uk lookup of b.b
142 explain select a.a, a.d, b.d
143 from
144 test.t1 a
145 join
146 test.t1 b
147 on
148 a.d = b.b
149 where a.b = 6;
150 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
151 1 SIMPLE a # eq_ref b b 5 const # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
152 1 SIMPLE b # eq_ref b b 5 test.a.d # # Child of 'a' in pushed join@1
153 Warnings:
154 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`b` = `test`.`a`.`d`) and (`test`.`a`.`b` = 6))
155 Error insert to ensure that SPJ requests are purely local
156
157
158 Pushed uk->pk
159 Lookup to get a.d, feeding pk lookup of b.a
160 explain select a.a, a.d, b.d
161 from
162 test.t1 a
163 join
164 test.t1 b
165 on
166 a.d = b.a
167 where a.b = 6;
168 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
169 1 SIMPLE a # eq_ref b b 5 const # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
170 1 SIMPLE b # eq_ref PRIMARY,a PRIMARY 4 test.a.d # # Child of 'a' in pushed join@1
171 Warnings:
172 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`a` = `test`.`a`.`d`) and (`test`.`a`.`b` = 6))
173 Error insert to ensure that SPJ requests are purely local
174
175
176 Pushed pk->uk
177 Lookup to get a.d, feeding uk lookup of b.b
178 explain select a.a, a.d, b.d
179 from
180 test.t1 a
181 join
182 test.t1 b
183 on
184 a.d = b.b
185 where a.a = 6;
186 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
187 1 SIMPLE a # eq_ref PRIMARY,a PRIMARY 4 const # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
188 1 SIMPLE b # eq_ref b b 5 test.a.d # # Child of 'a' in pushed join@1
189 Warnings:
190 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`b` = `test`.`a`.`d`) and (`test`.`a`.`a` = 6))
191 Error insert to ensure that SPJ requests are purely local
192
193
194 Pushed scan originating sub-lookups
195 Table scan to get a.d, feeding pk lookups of b.a
196 explain select a.a, a.d, b.d
197 from
198 test.t1 a
199 join
200 test.t1 b
201 on
202 a.d = b.a;
203 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
204 1 SIMPLE a # ALL NULL NULL NULL NULL # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
205 1 SIMPLE b # eq_ref PRIMARY,a PRIMARY 4 test.a.d # # Child of 'a' in pushed join@1
206 Warnings:
207 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where (`test`.`b`.`a` = `test`.`a`.`d`)
208 Error insert to ensure that SPJ requests are purely local
209
210 begin;
211 select * from hints where i = 2;
212 select a.a, a.d, b.d
213 from
214 test.t1 a
215 join
216 test.t1 b
217 on
218 a.d = b.a;
219 commit;
220
221 Pushed scan originating sub-lookups
222 Table scan to get a.d, feeding uk lookups of b.b
223 explain select a.a, a.d, b.d
224 from
225 test.t1 a
226 join
227 test.t1 b
228 on
229 a.d = b.b;
230 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
231 1 SIMPLE a # ALL NULL NULL NULL NULL # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
232 1 SIMPLE b # eq_ref b b 5 test.a.d # # Child of 'a' in pushed join@1
233 Warnings:
234 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where (`test`.`b`.`b` = `test`.`a`.`d`)
235 Error insert to ensure that SPJ requests are purely local
236
237 begin;
238 select * from hints where i = 2;
239 select a.a, a.d, b.d
240 from
241 test.t1 a
242 join
243 test.t1 b
244 on
245 a.d = b.b;
246 commit;
247
248 Pushed scan originating sub-scans
249 Range scan on a.a > 10 getting a.d, feeding range scans on b.c = a.d
250 explain select a.a, a.d, b.d
251 from
252 test.t1 a
253 join
254 test.t1 b
255 on
256 b.c=a.d
257 where
258 a.a>10;
259 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
260 1 SIMPLE a # range PRIMARY,a PRIMARY 4 NULL # # Parent of 2 pushed join@1; Using pushed condition ((`test`.`a`.`a` > 10) and (`test`.`a`.`d` is not null)); Using MRR
261 1 SIMPLE b # ref c c 5 test.a.d # # Child of 'a' in pushed join@1
262 Warnings:
263 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`c` = `test`.`a`.`d`) and (`test`.`a`.`a` > 10))
264 Error insert to ensure that SPJ requests are purely local
265
266 begin;
267 select * from hints where i = 2;
268 select a.a, a.d, b.d
269 from
270 test.t1 a
271 join
272 test.t1 b
273 on
274 b.c=a.d
275 where
276 a.a>10;
277 commit;
278
279 Tests on T2 (Blobs)
280 Test some basic NdbApi
281 explain select * from test.t2 where t2.a=6;
282 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
283 1 SIMPLE t2 # eq_ref PRIMARY PRIMARY 4 const # # NULL
284 Warnings:
285 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` from `test`.`t2` where (`test`.`t2`.`a` = 6)
286 Error insert to ensure that TC requests are purely local
287
288
289 UI lookups
290 explain select * from test.t2 where t2.b=6;
291 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
292 1 SIMPLE t2 # eq_ref b b 5 const # # NULL
293 Warnings:
294 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` from `test`.`t2` where (`test`.`t2`.`b` = 6)
295 Error insert to ensure that TC requests are purely local
296
297
298 OI scan
299 explain select * from test.t2 where c > 6;
300 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
301 1 SIMPLE t2 # range c c 5 NULL # # Using pushed condition (`test`.`t2`.`c` > 6)
302 Warnings:
303 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` from `test`.`t2` where (`test`.`t2`.`c` > 6)
304 Error insert to ensure that TC requests are purely local
305
306
307 Table scan
308 explain select * from test.t2;
309 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
310 1 SIMPLE t2 # ALL NULL NULL NULL NULL # # NULL
311 Warnings:
312 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` from `test`.`t2`
313 Error insert to ensure that TC requests are purely local
314
315
316 insert into hints values (1);
317 Hint node by 1 of 2
318 Tests on T1 (!Blobs)
319 Test some basic NdbApi
320 PK lookups
321 explain select * from test.t1 where t1.a=6;
322 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
323 1 SIMPLE t1 # eq_ref PRIMARY,a PRIMARY 4 const # # NULL
324 Warnings:
325 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` from `test`.`t1` where (`test`.`t1`.`a` = 6)
326 Error insert to ensure that TC requests are purely local
327
328
329 UI lookups
330 explain select * from test.t1 where t1.b=6;
331 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
332 1 SIMPLE t1 # eq_ref b b 5 const # # NULL
333 Warnings:
334 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` from `test`.`t1` where (`test`.`t1`.`b` = 6)
335 Error insert to ensure that TC requests are purely local
336
337
338 OI scan
339 explain select * from test.t1 where c > 6;
340 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
341 1 SIMPLE t1 # range c c 5 NULL # # Using pushed condition (`test`.`t1`.`c` > 6); Using MRR
342 Warnings:
343 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` from `test`.`t1` where (`test`.`t1`.`c` > 6)
344 Error insert to ensure that TC requests are purely local
345
346
347 Table scan
348 explain select * from test.t1;
349 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
350 1 SIMPLE t1 # ALL NULL NULL NULL NULL # # NULL
351 Warnings:
352 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` from `test`.`t1`
353 Error insert to ensure that TC requests are purely local
354
355
356 Test pushed queries (SPJ)
357 Pushed pk->pk
358 Lookup to get a.d, feeding pk lookup of b.a
359 explain select a.a, a.d, b.d
360 from
361 test.t1 a
362 join
363 test.t1 b
364 on
365 a.d = b.a
366 where a.a = 6;
367 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
368 1 SIMPLE a # eq_ref PRIMARY,a PRIMARY 4 const # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
369 1 SIMPLE b # eq_ref PRIMARY,a PRIMARY 4 test.a.d # # Child of 'a' in pushed join@1
370 Warnings:
371 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`a` = `test`.`a`.`d`) and (`test`.`a`.`a` = 6))
372 Error insert to ensure that SPJ requests are purely local
373
374
375 Pushed uk->uk
376 Lookup to get a.d, feeding uk lookup of b.b
377 explain select a.a, a.d, b.d
378 from
379 test.t1 a
380 join
381 test.t1 b
382 on
383 a.d = b.b
384 where a.b = 6;
385 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
386 1 SIMPLE a # eq_ref b b 5 const # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
387 1 SIMPLE b # eq_ref b b 5 test.a.d # # Child of 'a' in pushed join@1
388 Warnings:
389 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`b` = `test`.`a`.`d`) and (`test`.`a`.`b` = 6))
390 Error insert to ensure that SPJ requests are purely local
391
392
393 Pushed uk->pk
394 Lookup to get a.d, feeding pk lookup of b.a
395 explain select a.a, a.d, b.d
396 from
397 test.t1 a
398 join
399 test.t1 b
400 on
401 a.d = b.a
402 where a.b = 6;
403 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
404 1 SIMPLE a # eq_ref b b 5 const # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
405 1 SIMPLE b # eq_ref PRIMARY,a PRIMARY 4 test.a.d # # Child of 'a' in pushed join@1
406 Warnings:
407 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`a` = `test`.`a`.`d`) and (`test`.`a`.`b` = 6))
408 Error insert to ensure that SPJ requests are purely local
409
410
411 Pushed pk->uk
412 Lookup to get a.d, feeding uk lookup of b.b
413 explain select a.a, a.d, b.d
414 from
415 test.t1 a
416 join
417 test.t1 b
418 on
419 a.d = b.b
420 where a.a = 6;
421 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
422 1 SIMPLE a # eq_ref PRIMARY,a PRIMARY 4 const # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
423 1 SIMPLE b # eq_ref b b 5 test.a.d # # Child of 'a' in pushed join@1
424 Warnings:
425 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`b` = `test`.`a`.`d`) and (`test`.`a`.`a` = 6))
426 Error insert to ensure that SPJ requests are purely local
427
428
429 Pushed scan originating sub-lookups
430 Table scan to get a.d, feeding pk lookups of b.a
431 explain select a.a, a.d, b.d
432 from
433 test.t1 a
434 join
435 test.t1 b
436 on
437 a.d = b.a;
438 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
439 1 SIMPLE a # ALL NULL NULL NULL NULL # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
440 1 SIMPLE b # eq_ref PRIMARY,a PRIMARY 4 test.a.d # # Child of 'a' in pushed join@1
441 Warnings:
442 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where (`test`.`b`.`a` = `test`.`a`.`d`)
443 Error insert to ensure that SPJ requests are purely local
444
445 begin;
446 select * from hints where i = 1;
447 select a.a, a.d, b.d
448 from
449 test.t1 a
450 join
451 test.t1 b
452 on
453 a.d = b.a;
454 commit;
455
456 Pushed scan originating sub-lookups
457 Table scan to get a.d, feeding uk lookups of b.b
458 explain select a.a, a.d, b.d
459 from
460 test.t1 a
461 join
462 test.t1 b
463 on
464 a.d = b.b;
465 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
466 1 SIMPLE a # ALL NULL NULL NULL NULL # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
467 1 SIMPLE b # eq_ref b b 5 test.a.d # # Child of 'a' in pushed join@1
468 Warnings:
469 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where (`test`.`b`.`b` = `test`.`a`.`d`)
470 Error insert to ensure that SPJ requests are purely local
471
472 begin;
473 select * from hints where i = 1;
474 select a.a, a.d, b.d
475 from
476 test.t1 a
477 join
478 test.t1 b
479 on
480 a.d = b.b;
481 commit;
482
483 Pushed scan originating sub-scans
484 Range scan on a.a > 10 getting a.d, feeding range scans on b.c = a.d
485 explain select a.a, a.d, b.d
486 from
487 test.t1 a
488 join
489 test.t1 b
490 on
491 b.c=a.d
492 where
493 a.a>10;
494 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
495 1 SIMPLE a # range PRIMARY,a PRIMARY 4 NULL # # Parent of 2 pushed join@1; Using pushed condition ((`test`.`a`.`a` > 10) and (`test`.`a`.`d` is not null)); Using MRR
496 1 SIMPLE b # ref c c 5 test.a.d # # Child of 'a' in pushed join@1
497 Warnings:
498 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`c` = `test`.`a`.`d`) and (`test`.`a`.`a` > 10))
499 Error insert to ensure that SPJ requests are purely local
500
501 begin;
502 select * from hints where i = 1;
503 select a.a, a.d, b.d
504 from
505 test.t1 a
506 join
507 test.t1 b
508 on
509 b.c=a.d
510 where
511 a.a>10;
512 commit;
513
514 Tests on T2 (Blobs)
515 Test some basic NdbApi
516 explain select * from test.t2 where t2.a=6;
517 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
518 1 SIMPLE t2 # eq_ref PRIMARY PRIMARY 4 const # # NULL
519 Warnings:
520 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` from `test`.`t2` where (`test`.`t2`.`a` = 6)
521 Error insert to ensure that TC requests are purely local
522
523
524 UI lookups
525 explain select * from test.t2 where t2.b=6;
526 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
527 1 SIMPLE t2 # eq_ref b b 5 const # # NULL
528 Warnings:
529 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` from `test`.`t2` where (`test`.`t2`.`b` = 6)
530 Error insert to ensure that TC requests are purely local
531
532
533 OI scan
534 explain select * from test.t2 where c > 6;
535 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
536 1 SIMPLE t2 # range c c 5 NULL # # Using pushed condition (`test`.`t2`.`c` > 6)
537 Warnings:
538 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` from `test`.`t2` where (`test`.`t2`.`c` > 6)
539 Error insert to ensure that TC requests are purely local
540
541
542 Table scan
543 explain select * from test.t2;
544 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
545 1 SIMPLE t2 # ALL NULL NULL NULL NULL # # NULL
546 Warnings:
547 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` from `test`.`t2`
548 Error insert to ensure that TC requests are purely local
549
550
551 drop table hints;
552 delete from t1;
553 delete from t2;
554 drop table test.t1;
555 drop table test.t2;
556 Test read-locality after ALTER TABLE into READ-BACKUP
557 create table test.t1 (a int primary key,
558 b int,
559 c int,
560 d int,
561 unique(b) using hash,
562 key(c),
563 key(a,c))
564 engine=ndb;
565 Warnings:
566 Warning 1121 Ndb does not support unique index on NULL valued attributes, index access with NULL value will become full table scan
567 create table test.t2 (a int primary key,
568 b int,
569 c int,
570 d text,
571 unique(b) using hash,
572 key(c))
573 engine=ndb;
574 Warnings:
575 Warning 1121 Ndb does not support unique index on NULL valued attributes, index access with NULL value will become full table scan
576 alter table t1 algorithm=inplace, comment="NDB_TABLE=READ_BACKUP=1";
577 alter table t2 algorithm=inplace, comment="NDB_TABLE=READ_BACKUP=1";
578 -- t2 --
579 Version: Any
580 Fragment type: HashMapPartition
581 K Value: 6
582 Min load factor: 78
583 Max load factor: 80
584 Temporary table: no
585 Number of attributes: 4
586 Number of primary keys: 1
587 Length of frm data: XXX
588 Max Rows: 0
589 Row Checksum: 1
590 Row GCI: 1
591 SingleUserMode: 0
592 ForceVarPart: 1
593 PartitionCount: 8
594 FragmentCount: 8
595 PartitionBalance: FOR_RP_BY_LDM
596 ExtraRowGciBits: 0
597 ExtraRowAuthorBits: 0
598 TableStatus: Retrieved
599 Table options: readbackup
600 HashMap: DEFAULT-HASHMAP-3840-8
601 -- Attributes --
602 a Int PRIMARY KEY DISTRIBUTION KEY AT=FIXED ST=MEMORY
603 b Int NULL AT=FIXED ST=MEMORY
604 c Int NULL AT=FIXED ST=MEMORY
605 d Text(256,2000,0;utf8mb4_0900_ai_ci) NULL AT=MEDIUM_VAR ST=MEMORY BV=2 BT=NDB$BLOB_XX_3
606 -- Indexes --
607 PRIMARY KEY(a) - UniqueHashIndex
608 PRIMARY(a) - OrderedIndex
609 b$unique(b) - UniqueHashIndex
610 c(c) - OrderedIndex
611 -- t2/PRIMARY --
612 Version: Any
613 Base table: t2
614 Number of attributes: 1
615 Logging: 0
616 Index type: OrderedIndex
617 Index status: Retrieved
618 -- Attributes --
619 a Int NOT NULL AT=FIXED ST=MEMORY
620 -- IndexTable XX/PRIMARY --
621 Version: Any
622 Fragment type: FragUndefined
623 K Value: 6
624 Min load factor: 78
625 Max load factor: 80
626 Temporary table: yes
627 Number of attributes: 2
628 Number of primary keys: 1
629 Length of frm data: XXX
630 Max Rows: 0
631 Row Checksum: 1
632 Row GCI: 1
633 SingleUserMode: 2
634 ForceVarPart: 0
635 PartitionCount: 8
636 FragmentCount: 8
637 PartitionBalance: FOR_RP_BY_LDM
638 ExtraRowGciBits: 0
639 ExtraRowAuthorBits: 0
640 TableStatus: Retrieved
641 Table options: readbackup
642 -- Attributes --
643 a Int NOT NULL DISTRIBUTION KEY AT=FIXED ST=MEMORY
644 NDB$TNODE Unsigned [64] PRIMARY KEY DISTRIBUTION KEY AT=FIXED ST=MEMORY
645 -- Indexes --
646 PRIMARY KEY(NDB$TNODE) - UniqueHashIndex
647
648 -- t2/b$unique --
649 Version: Any
650 Base table: t2
651 Number of attributes: 1
652 Logging: 1
653 Index type: UniqueHashIndex
654 Index status: Retrieved
655 -- Attributes --
656 b Int PRIMARY KEY DISTRIBUTION KEY AT=FIXED ST=MEMORY
657 -- IndexTable XX/b$unique --
658 Version: Any
659 Fragment type: HashMapPartition
660 K Value: 6
661 Min load factor: 78
662 Max load factor: 80
663 Temporary table: no
664 Number of attributes: 2
665 Number of primary keys: 1
666 Length of frm data: XXX
667 Max Rows: 0
668 Row Checksum: 1
669 Row GCI: 1
670 SingleUserMode: 2
671 ForceVarPart: 0
672 PartitionCount: 8
673 FragmentCount: 8
674 PartitionBalance: FOR_RP_BY_LDM
675 ExtraRowGciBits: 0
676 ExtraRowAuthorBits: 0
677 TableStatus: Retrieved
678 Table options: readbackup
679 HashMap: DEFAULT-HASHMAP-3840-8
680 -- Attributes --
681 b Int PRIMARY KEY DISTRIBUTION KEY AT=FIXED ST=MEMORY
682 NDB$PK Unsigned [2] NOT NULL AT=FIXED ST=MEMORY
683 -- Indexes --
684 PRIMARY KEY(b) - UniqueHashIndex
685
686 -- t2/c --
687 Version: Any
688 Base table: t2
689 Number of attributes: 1
690 Logging: 0
691 Index type: OrderedIndex
692 Index status: Retrieved
693 -- Attributes --
694 c Int NULL AT=FIXED ST=MEMORY
695 -- IndexTable XX/c --
696 Version: Any
697 Fragment type: FragUndefined
698 K Value: 6
699 Min load factor: 78
700 Max load factor: 80
701 Temporary table: yes
702 Number of attributes: 2
703 Number of primary keys: 1
704 Length of frm data: XXX
705 Max Rows: 0
706 Row Checksum: 1
707 Row GCI: 1
708 SingleUserMode: 2
709 ForceVarPart: 0
710 PartitionCount: 8
711 FragmentCount: 8
712 PartitionBalance: FOR_RP_BY_LDM
713 ExtraRowGciBits: 0
714 ExtraRowAuthorBits: 0
715 TableStatus: Retrieved
716 Table options: readbackup
717 -- Attributes --
718 c Int NULL AT=FIXED ST=MEMORY
719 NDB$TNODE Unsigned [64] PRIMARY KEY DISTRIBUTION KEY AT=FIXED ST=MEMORY
720 -- Indexes --
721 PRIMARY KEY(NDB$TNODE) - UniqueHashIndex
722
723 -- NDB$BLOB_XX_3 --
724 Version: Any
725 Fragment type: HashMapPartition
726 K Value: 6
727 Min load factor: 78
728 Max load factor: 80
729 Temporary table: no
730 Number of attributes: 4
731 Number of primary keys: 2
732 Length of frm data: XXX
733 Max Rows: 0
734 Row Checksum: 1
735 Row GCI: 1
736 SingleUserMode: 0
737 ForceVarPart: 0
738 PartitionCount: 8
739 FragmentCount: 8
740 PartitionBalance: FOR_RP_BY_LDM
741 ExtraRowGciBits: 0
742 ExtraRowAuthorBits: 0
743 TableStatus: Retrieved
744 Table options: readbackup
745 HashMap: DEFAULT-HASHMAP-3840-8
746 -- Attributes --
747 a Int PRIMARY KEY DISTRIBUTION KEY AT=FIXED ST=MEMORY
748 NDB$PART Unsigned PRIMARY KEY AT=FIXED ST=MEMORY
749 NDB$PKID Unsigned NOT NULL AT=FIXED ST=MEMORY
750 NDB$DATA Longvarchar(2000;binary) NOT NULL AT=MEDIUM_VAR ST=MEMORY
751 -- Indexes --
752 PRIMARY KEY(a, NDB$PART) - UniqueHashIndex
753
754 select id into @t1_id from ndbinfo.ndb$dict_obj_info where fq_name = 'test/def/t1';
755 select id into @t1ui_id from ndbinfo.ndb$dict_obj_info where parent_obj_id = @t1_id and type = 3;
756 select id into @t2_id from ndbinfo.ndb$dict_obj_info where fq_name = 'test/def/t2';
757 select id into @t2ui_id from ndbinfo.ndb$dict_obj_info where parent_obj_id = @t2_id and type = 3;
758 select id into @t2bt_id from ndbinfo.ndb$dict_obj_info where parent_obj_id = @t2_id and fq_name like 'test/def/NDB$BLOB%';
759 Put some data in.
760 Make it more interesting for joining
761 update test.t1 set c=c+1, d=d+1;
762 select count(distinct node_id) into @nodes
763 from ndbinfo.ndb$membership where group_id < 0xFFFFFF00;
764 Check replicas
765 select count(distinct node_id)
766 from ndbinfo.operations_per_fragment
767 where fq_name='test/def/t1'
768 and fragment_num=0;
769 count(distinct node_id)
770 2
771 Check nodes with table data
772 select count(distinct node_id)
773 from ndbinfo.operations_per_fragment
774 where fq_name='test/def/t1';
775 count(distinct node_id)
776 2
777 Check UI replicas
778 select count(distinct node_id)
779 from ndbinfo.operations_per_fragment
780 where table_id = @t1ui_id
781 and fragment_num=0;
782 count(distinct node_id)
783 2
784 Check nodes with UI data
785 select count(distinct node_id)
786 from ndbinfo.operations_per_fragment
787 where table_id = @t1ui_id;
788 count(distinct node_id)
789 2
790 Put some data in.
791 insert into test.t2 select a,b,c,repeat('BJC',300) from test.t1;
792 Check blob table replicas
793 select count(distinct node_id)
794 from ndbinfo.operations_per_fragment
795 where table_id = @t2bt_id
796 and fragment_num=0;
797 count(distinct node_id)
798 2
799 Check nodes with blob data
800 select count(distinct node_id)
801 from ndbinfo.operations_per_fragment
802 where table_id = @t2bt_id;
803 count(distinct node_id)
804 2
805 set @partitions = 'PARTITION p2 VALUES IN (2)';
806 set @partitions = concat(@partitions,',PARTITION p1 VALUES IN (1)');
807 set @@new = 1;
808 Warnings:
809 Warning 1287 '@@new' is deprecated and will be removed in a future release.
810 create table hints (i int primary key) engine=ndb partition by list(i) (PARTITION p2 VALUES IN (2),PARTITION p1 VALUES IN (1));
811 insert into hints values (2);
812 Hint node by 2 of 2
813 Tests on T1 (!Blobs)
814 Test some basic NdbApi
815 PK lookups
816 explain select * from test.t1 where t1.a=6;
817 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
818 1 SIMPLE t1 # eq_ref PRIMARY,a PRIMARY 4 const # # NULL
819 Warnings:
820 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` from `test`.`t1` where (`test`.`t1`.`a` = 6)
821 Error insert to ensure that TC requests are purely local
822
823
824 UI lookups
825 explain select * from test.t1 where t1.b=6;
826 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
827 1 SIMPLE t1 # eq_ref b b 5 const # # NULL
828 Warnings:
829 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` from `test`.`t1` where (`test`.`t1`.`b` = 6)
830 Error insert to ensure that TC requests are purely local
831
832
833 OI scan
834 explain select * from test.t1 where c > 6;
835 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
836 1 SIMPLE t1 # range c c 5 NULL # # Using pushed condition (`test`.`t1`.`c` > 6); Using MRR
837 Warnings:
838 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` from `test`.`t1` where (`test`.`t1`.`c` > 6)
839 Error insert to ensure that TC requests are purely local
840
841
842 Table scan
843 explain select * from test.t1;
844 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
845 1 SIMPLE t1 # ALL NULL NULL NULL NULL # # NULL
846 Warnings:
847 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` from `test`.`t1`
848 Error insert to ensure that TC requests are purely local
849
850
851 Test pushed queries (SPJ)
852 Pushed pk->pk
853 Lookup to get a.d, feeding pk lookup of b.a
854 explain select a.a, a.d, b.d
855 from
856 test.t1 a
857 join
858 test.t1 b
859 on
860 a.d = b.a
861 where a.a = 6;
862 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
863 1 SIMPLE a # eq_ref PRIMARY,a PRIMARY 4 const # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
864 1 SIMPLE b # eq_ref PRIMARY,a PRIMARY 4 test.a.d # # Child of 'a' in pushed join@1
865 Warnings:
866 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`a` = `test`.`a`.`d`) and (`test`.`a`.`a` = 6))
867 Error insert to ensure that SPJ requests are purely local
868
869
870 Pushed uk->uk
871 Lookup to get a.d, feeding uk lookup of b.b
872 explain select a.a, a.d, b.d
873 from
874 test.t1 a
875 join
876 test.t1 b
877 on
878 a.d = b.b
879 where a.b = 6;
880 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
881 1 SIMPLE a # eq_ref b b 5 const # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
882 1 SIMPLE b # eq_ref b b 5 test.a.d # # Child of 'a' in pushed join@1
883 Warnings:
884 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`b` = `test`.`a`.`d`) and (`test`.`a`.`b` = 6))
885 Error insert to ensure that SPJ requests are purely local
886
887
888 Pushed uk->pk
889 Lookup to get a.d, feeding pk lookup of b.a
890 explain select a.a, a.d, b.d
891 from
892 test.t1 a
893 join
894 test.t1 b
895 on
896 a.d = b.a
897 where a.b = 6;
898 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
899 1 SIMPLE a # eq_ref b b 5 const # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
900 1 SIMPLE b # eq_ref PRIMARY,a PRIMARY 4 test.a.d # # Child of 'a' in pushed join@1
901 Warnings:
902 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`a` = `test`.`a`.`d`) and (`test`.`a`.`b` = 6))
903 Error insert to ensure that SPJ requests are purely local
904
905
906 Pushed pk->uk
907 Lookup to get a.d, feeding uk lookup of b.b
908 explain select a.a, a.d, b.d
909 from
910 test.t1 a
911 join
912 test.t1 b
913 on
914 a.d = b.b
915 where a.a = 6;
916 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
917 1 SIMPLE a # eq_ref PRIMARY,a PRIMARY 4 const # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
918 1 SIMPLE b # eq_ref b b 5 test.a.d # # Child of 'a' in pushed join@1
919 Warnings:
920 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`b` = `test`.`a`.`d`) and (`test`.`a`.`a` = 6))
921 Error insert to ensure that SPJ requests are purely local
922
923
924 Pushed scan originating sub-lookups
925 Table scan to get a.d, feeding pk lookups of b.a
926 explain select a.a, a.d, b.d
927 from
928 test.t1 a
929 join
930 test.t1 b
931 on
932 a.d = b.a;
933 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
934 1 SIMPLE a # ALL NULL NULL NULL NULL # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
935 1 SIMPLE b # eq_ref PRIMARY,a PRIMARY 4 test.a.d # # Child of 'a' in pushed join@1
936 Warnings:
937 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where (`test`.`b`.`a` = `test`.`a`.`d`)
938 Error insert to ensure that SPJ requests are purely local
939
940 begin;
941 select * from hints where i = 2;
942 select a.a, a.d, b.d
943 from
944 test.t1 a
945 join
946 test.t1 b
947 on
948 a.d = b.a;
949 commit;
950
951 Pushed scan originating sub-lookups
952 Table scan to get a.d, feeding uk lookups of b.b
953 explain select a.a, a.d, b.d
954 from
955 test.t1 a
956 join
957 test.t1 b
958 on
959 a.d = b.b;
960 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
961 1 SIMPLE a # ALL NULL NULL NULL NULL # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
962 1 SIMPLE b # eq_ref b b 5 test.a.d # # Child of 'a' in pushed join@1
963 Warnings:
964 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where (`test`.`b`.`b` = `test`.`a`.`d`)
965 Error insert to ensure that SPJ requests are purely local
966
967 begin;
968 select * from hints where i = 2;
969 select a.a, a.d, b.d
970 from
971 test.t1 a
972 join
973 test.t1 b
974 on
975 a.d = b.b;
976 commit;
977
978 Pushed scan originating sub-scans
979 Range scan on a.a > 10 getting a.d, feeding range scans on b.c = a.d
980 explain select a.a, a.d, b.d
981 from
982 test.t1 a
983 join
984 test.t1 b
985 on
986 b.c=a.d
987 where
988 a.a>10;
989 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
990 1 SIMPLE a # range PRIMARY,a PRIMARY 4 NULL # # Parent of 2 pushed join@1; Using pushed condition ((`test`.`a`.`a` > 10) and (`test`.`a`.`d` is not null)); Using MRR
991 1 SIMPLE b # ref c c 5 test.a.d # # Child of 'a' in pushed join@1
992 Warnings:
993 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`c` = `test`.`a`.`d`) and (`test`.`a`.`a` > 10))
994 Error insert to ensure that SPJ requests are purely local
995
996 begin;
997 select * from hints where i = 2;
998 select a.a, a.d, b.d
999 from
1000 test.t1 a
1001 join
1002 test.t1 b
1003 on
1004 b.c=a.d
1005 where
1006 a.a>10;
1007 commit;
1008
1009 Tests on T2 (Blobs)
1010 Test some basic NdbApi
1011 explain select * from test.t2 where t2.a=6;
1012 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
1013 1 SIMPLE t2 # eq_ref PRIMARY PRIMARY 4 const # # NULL
1014 Warnings:
1015 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` from `test`.`t2` where (`test`.`t2`.`a` = 6)
1016 Error insert to ensure that TC requests are purely local
1017
1018
1019 UI lookups
1020 explain select * from test.t2 where t2.b=6;
1021 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
1022 1 SIMPLE t2 # eq_ref b b 5 const # # NULL
1023 Warnings:
1024 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` from `test`.`t2` where (`test`.`t2`.`b` = 6)
1025 Error insert to ensure that TC requests are purely local
1026
1027
1028 OI scan
1029 explain select * from test.t2 where c > 6;
1030 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
1031 1 SIMPLE t2 # range c c 5 NULL # # Using pushed condition (`test`.`t2`.`c` > 6)
1032 Warnings:
1033 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` from `test`.`t2` where (`test`.`t2`.`c` > 6)
1034 Error insert to ensure that TC requests are purely local
1035
1036
1037 Table scan
1038 explain select * from test.t2;
1039 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
1040 1 SIMPLE t2 # ALL NULL NULL NULL NULL # # NULL
1041 Warnings:
1042 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` from `test`.`t2`
1043 Error insert to ensure that TC requests are purely local
1044
1045
1046 insert into hints values (1);
1047 Hint node by 1 of 2
1048 Tests on T1 (!Blobs)
1049 Test some basic NdbApi
1050 PK lookups
1051 explain select * from test.t1 where t1.a=6;
1052 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
1053 1 SIMPLE t1 # eq_ref PRIMARY,a PRIMARY 4 const # # NULL
1054 Warnings:
1055 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` from `test`.`t1` where (`test`.`t1`.`a` = 6)
1056 Error insert to ensure that TC requests are purely local
1057
1058
1059 UI lookups
1060 explain select * from test.t1 where t1.b=6;
1061 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
1062 1 SIMPLE t1 # eq_ref b b 5 const # # NULL
1063 Warnings:
1064 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` from `test`.`t1` where (`test`.`t1`.`b` = 6)
1065 Error insert to ensure that TC requests are purely local
1066
1067
1068 OI scan
1069 explain select * from test.t1 where c > 6;
1070 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
1071 1 SIMPLE t1 # range c c 5 NULL # # Using pushed condition (`test`.`t1`.`c` > 6); Using MRR
1072 Warnings:
1073 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` from `test`.`t1` where (`test`.`t1`.`c` > 6)
1074 Error insert to ensure that TC requests are purely local
1075
1076
1077 Table scan
1078 explain select * from test.t1;
1079 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
1080 1 SIMPLE t1 # ALL NULL NULL NULL NULL # # NULL
1081 Warnings:
1082 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` from `test`.`t1`
1083 Error insert to ensure that TC requests are purely local
1084
1085
1086 Test pushed queries (SPJ)
1087 Pushed pk->pk
1088 Lookup to get a.d, feeding pk lookup of b.a
1089 explain select a.a, a.d, b.d
1090 from
1091 test.t1 a
1092 join
1093 test.t1 b
1094 on
1095 a.d = b.a
1096 where a.a = 6;
1097 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
1098 1 SIMPLE a # eq_ref PRIMARY,a PRIMARY 4 const # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
1099 1 SIMPLE b # eq_ref PRIMARY,a PRIMARY 4 test.a.d # # Child of 'a' in pushed join@1
1100 Warnings:
1101 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`a` = `test`.`a`.`d`) and (`test`.`a`.`a` = 6))
1102 Error insert to ensure that SPJ requests are purely local
1103
1104
1105 Pushed uk->uk
1106 Lookup to get a.d, feeding uk lookup of b.b
1107 explain select a.a, a.d, b.d
1108 from
1109 test.t1 a
1110 join
1111 test.t1 b
1112 on
1113 a.d = b.b
1114 where a.b = 6;
1115 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
1116 1 SIMPLE a # eq_ref b b 5 const # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
1117 1 SIMPLE b # eq_ref b b 5 test.a.d # # Child of 'a' in pushed join@1
1118 Warnings:
1119 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`b` = `test`.`a`.`d`) and (`test`.`a`.`b` = 6))
1120 Error insert to ensure that SPJ requests are purely local
1121
1122
1123 Pushed uk->pk
1124 Lookup to get a.d, feeding pk lookup of b.a
1125 explain select a.a, a.d, b.d
1126 from
1127 test.t1 a
1128 join
1129 test.t1 b
1130 on
1131 a.d = b.a
1132 where a.b = 6;
1133 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
1134 1 SIMPLE a # eq_ref b b 5 const # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
1135 1 SIMPLE b # eq_ref PRIMARY,a PRIMARY 4 test.a.d # # Child of 'a' in pushed join@1
1136 Warnings:
1137 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`a` = `test`.`a`.`d`) and (`test`.`a`.`b` = 6))
1138 Error insert to ensure that SPJ requests are purely local
1139
1140
1141 Pushed pk->uk
1142 Lookup to get a.d, feeding uk lookup of b.b
1143 explain select a.a, a.d, b.d
1144 from
1145 test.t1 a
1146 join
1147 test.t1 b
1148 on
1149 a.d = b.b
1150 where a.a = 6;
1151 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
1152 1 SIMPLE a # eq_ref PRIMARY,a PRIMARY 4 const # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
1153 1 SIMPLE b # eq_ref b b 5 test.a.d # # Child of 'a' in pushed join@1
1154 Warnings:
1155 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`b` = `test`.`a`.`d`) and (`test`.`a`.`a` = 6))
1156 Error insert to ensure that SPJ requests are purely local
1157
1158
1159 Pushed scan originating sub-lookups
1160 Table scan to get a.d, feeding pk lookups of b.a
1161 explain select a.a, a.d, b.d
1162 from
1163 test.t1 a
1164 join
1165 test.t1 b
1166 on
1167 a.d = b.a;
1168 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
1169 1 SIMPLE a # ALL NULL NULL NULL NULL # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
1170 1 SIMPLE b # eq_ref PRIMARY,a PRIMARY 4 test.a.d # # Child of 'a' in pushed join@1
1171 Warnings:
1172 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where (`test`.`b`.`a` = `test`.`a`.`d`)
1173 Error insert to ensure that SPJ requests are purely local
1174
1175 begin;
1176 select * from hints where i = 1;
1177 select a.a, a.d, b.d
1178 from
1179 test.t1 a
1180 join
1181 test.t1 b
1182 on
1183 a.d = b.a;
1184 commit;
1185
1186 Pushed scan originating sub-lookups
1187 Table scan to get a.d, feeding uk lookups of b.b
1188 explain select a.a, a.d, b.d
1189 from
1190 test.t1 a
1191 join
1192 test.t1 b
1193 on
1194 a.d = b.b;
1195 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
1196 1 SIMPLE a # ALL NULL NULL NULL NULL # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
1197 1 SIMPLE b # eq_ref b b 5 test.a.d # # Child of 'a' in pushed join@1
1198 Warnings:
1199 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where (`test`.`b`.`b` = `test`.`a`.`d`)
1200 Error insert to ensure that SPJ requests are purely local
1201
1202 begin;
1203 select * from hints where i = 1;
1204 select a.a, a.d, b.d
1205 from
1206 test.t1 a
1207 join
1208 test.t1 b
1209 on
1210 a.d = b.b;
1211 commit;
1212
1213 Pushed scan originating sub-scans
1214 Range scan on a.a > 10 getting a.d, feeding range scans on b.c = a.d
1215 explain select a.a, a.d, b.d
1216 from
1217 test.t1 a
1218 join
1219 test.t1 b
1220 on
1221 b.c=a.d
1222 where
1223 a.a>10;
1224 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
1225 1 SIMPLE a # range PRIMARY,a PRIMARY 4 NULL # # Parent of 2 pushed join@1; Using pushed condition ((`test`.`a`.`a` > 10) and (`test`.`a`.`d` is not null)); Using MRR
1226 1 SIMPLE b # ref c c 5 test.a.d # # Child of 'a' in pushed join@1
1227 Warnings:
1228 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`c` = `test`.`a`.`d`) and (`test`.`a`.`a` > 10))
1229 Error insert to ensure that SPJ requests are purely local
1230
1231 begin;
1232 select * from hints where i = 1;
1233 select a.a, a.d, b.d
1234 from
1235 test.t1 a
1236 join
1237 test.t1 b
1238 on
1239 b.c=a.d
1240 where
1241 a.a>10;
1242 commit;
1243
1244 Tests on T2 (Blobs)
1245 Test some basic NdbApi
1246 explain select * from test.t2 where t2.a=6;
1247 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
1248 1 SIMPLE t2 # eq_ref PRIMARY PRIMARY 4 const # # NULL
1249 Warnings:
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` from `test`.`t2` where (`test`.`t2`.`a` = 6)
1251 Error insert to ensure that TC requests are purely local
1252
1253
1254 UI lookups
1255 explain select * from test.t2 where t2.b=6;
1256 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
1257 1 SIMPLE t2 # eq_ref b b 5 const # # NULL
1258 Warnings:
1259 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` from `test`.`t2` where (`test`.`t2`.`b` = 6)
1260 Error insert to ensure that TC requests are purely local
1261
1262
1263 OI scan
1264 explain select * from test.t2 where c > 6;
1265 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
1266 1 SIMPLE t2 # range c c 5 NULL # # Using pushed condition (`test`.`t2`.`c` > 6)
1267 Warnings:
1268 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` from `test`.`t2` where (`test`.`t2`.`c` > 6)
1269 Error insert to ensure that TC requests are purely local
1270
1271
1272 Table scan
1273 explain select * from test.t2;
1274 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
1275 1 SIMPLE t2 # ALL NULL NULL NULL NULL # # NULL
1276 Warnings:
1277 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` from `test`.`t2`
1278 Error insert to ensure that TC requests are purely local
1279
1280
1281 drop table hints;
1282 delete from t1;
1283 delete from t2;
1284 Executing RESTART on all nodes.
1285 Starting shutdown. This may take a while. Please wait...
1286 All DB nodes are being restarted.
1287
1288 -- t2 --
1289 Version: Any
1290 Fragment type: HashMapPartition
1291 K Value: 6
1292 Min load factor: 78
1293 Max load factor: 80
1294 Temporary table: no
1295 Number of attributes: 4
1296 Number of primary keys: 1
1297 Length of frm data: XXX
1298 Max Rows: 0
1299 Row Checksum: 1
1300 Row GCI: 1
1301 SingleUserMode: 0
1302 ForceVarPart: 1
1303 PartitionCount: 8
1304 FragmentCount: 8
1305 PartitionBalance: FOR_RP_BY_LDM
1306 ExtraRowGciBits: 0
1307 ExtraRowAuthorBits: 0
1308 TableStatus: Retrieved
1309 Table options: readbackup
1310 HashMap: DEFAULT-HASHMAP-3840-8
1311 -- Attributes --
1312 a Int PRIMARY KEY DISTRIBUTION KEY AT=FIXED ST=MEMORY
1313 b Int NULL AT=FIXED ST=MEMORY
1314 c Int NULL AT=FIXED ST=MEMORY
1315 d Text(256,2000,0;utf8mb4_0900_ai_ci) NULL AT=MEDIUM_VAR ST=MEMORY BV=2 BT=NDB$BLOB_XX_3
1316 -- Indexes --
1317 PRIMARY KEY(a) - UniqueHashIndex
1318 PRIMARY(a) - OrderedIndex
1319 b$unique(b) - UniqueHashIndex
1320 c(c) - OrderedIndex
1321 -- t2/PRIMARY --
1322 Version: Any
1323 Base table: t2
1324 Number of attributes: 1
1325 Logging: 0
1326 Index type: OrderedIndex
1327 Index status: Retrieved
1328 -- Attributes --
1329 a Int NOT NULL AT=FIXED ST=MEMORY
1330 -- IndexTable XX/PRIMARY --
1331 Version: Any
1332 Fragment type: FragUndefined
1333 K Value: 6
1334 Min load factor: 78
1335 Max load factor: 80
1336 Temporary table: yes
1337 Number of attributes: 2
1338 Number of primary keys: 1
1339 Length of frm data: XXX
1340 Max Rows: 0
1341 Row Checksum: 1
1342 Row GCI: 1
1343 SingleUserMode: 2
1344 ForceVarPart: 0
1345 PartitionCount: 8
1346 FragmentCount: 8
1347 PartitionBalance: FOR_RP_BY_LDM
1348 ExtraRowGciBits: 0
1349 ExtraRowAuthorBits: 0
1350 TableStatus: Retrieved
1351 Table options: readbackup
1352 -- Attributes --
1353 a Int NOT NULL DISTRIBUTION KEY AT=FIXED ST=MEMORY
1354 NDB$TNODE Unsigned [64] PRIMARY KEY DISTRIBUTION KEY AT=FIXED ST=MEMORY
1355 -- Indexes --
1356 PRIMARY KEY(NDB$TNODE) - UniqueHashIndex
1357
1358 -- t2/b$unique --
1359 Version: Any
1360 Base table: t2
1361 Number of attributes: 1
1362 Logging: 1
1363 Index type: UniqueHashIndex
1364 Index status: Retrieved
1365 -- Attributes --
1366 b Int PRIMARY KEY DISTRIBUTION KEY AT=FIXED ST=MEMORY
1367 -- IndexTable XX/b$unique --
1368 Version: Any
1369 Fragment type: HashMapPartition
1370 K Value: 6
1371 Min load factor: 78
1372 Max load factor: 80
1373 Temporary table: no
1374 Number of attributes: 2
1375 Number of primary keys: 1
1376 Length of frm data: XXX
1377 Max Rows: 0
1378 Row Checksum: 1
1379 Row GCI: 1
1380 SingleUserMode: 2
1381 ForceVarPart: 0
1382 PartitionCount: 8
1383 FragmentCount: 8
1384 PartitionBalance: FOR_RP_BY_LDM
1385 ExtraRowGciBits: 0
1386 ExtraRowAuthorBits: 0
1387 TableStatus: Retrieved
1388 Table options: readbackup
1389 HashMap: DEFAULT-HASHMAP-3840-8
1390 -- Attributes --
1391 b Int PRIMARY KEY DISTRIBUTION KEY AT=FIXED ST=MEMORY
1392 NDB$PK Unsigned [2] NOT NULL AT=FIXED ST=MEMORY
1393 -- Indexes --
1394 PRIMARY KEY(b) - UniqueHashIndex
1395
1396 -- t2/c --
1397 Version: Any
1398 Base table: t2
1399 Number of attributes: 1
1400 Logging: 0
1401 Index type: OrderedIndex
1402 Index status: Retrieved
1403 -- Attributes --
1404 c Int NULL AT=FIXED ST=MEMORY
1405 -- IndexTable XX/c --
1406 Version: Any
1407 Fragment type: FragUndefined
1408 K Value: 6
1409 Min load factor: 78
1410 Max load factor: 80
1411 Temporary table: yes
1412 Number of attributes: 2
1413 Number of primary keys: 1
1414 Length of frm data: XXX
1415 Max Rows: 0
1416 Row Checksum: 1
1417 Row GCI: 1
1418 SingleUserMode: 2
1419 ForceVarPart: 0
1420 PartitionCount: 8
1421 FragmentCount: 8
1422 PartitionBalance: FOR_RP_BY_LDM
1423 ExtraRowGciBits: 0
1424 ExtraRowAuthorBits: 0
1425 TableStatus: Retrieved
1426 Table options: readbackup
1427 -- Attributes --
1428 c Int NULL AT=FIXED ST=MEMORY
1429 NDB$TNODE Unsigned [64] PRIMARY KEY DISTRIBUTION KEY AT=FIXED ST=MEMORY
1430 -- Indexes --
1431 PRIMARY KEY(NDB$TNODE) - UniqueHashIndex
1432
1433 -- NDB$BLOB_XX_3 --
1434 Version: Any
1435 Fragment type: HashMapPartition
1436 K Value: 6
1437 Min load factor: 78
1438 Max load factor: 80
1439 Temporary table: no
1440 Number of attributes: 4
1441 Number of primary keys: 2
1442 Length of frm data: XXX
1443 Max Rows: 0
1444 Row Checksum: 1
1445 Row GCI: 1
1446 SingleUserMode: 0
1447 ForceVarPart: 0
1448 PartitionCount: 8
1449 FragmentCount: 8
1450 PartitionBalance: FOR_RP_BY_LDM
1451 ExtraRowGciBits: 0
1452 ExtraRowAuthorBits: 0
1453 TableStatus: Retrieved
1454 Table options: readbackup
1455 HashMap: DEFAULT-HASHMAP-3840-8
1456 -- Attributes --
1457 a Int PRIMARY KEY DISTRIBUTION KEY AT=FIXED ST=MEMORY
1458 NDB$PART Unsigned PRIMARY KEY AT=FIXED ST=MEMORY
1459 NDB$PKID Unsigned NOT NULL AT=FIXED ST=MEMORY
1460 NDB$DATA Longvarchar(2000;binary) NOT NULL AT=MEDIUM_VAR ST=MEMORY
1461 -- Indexes --
1462 PRIMARY KEY(a, NDB$PART) - UniqueHashIndex
1463
1464 select id into @t1_id from ndbinfo.ndb$dict_obj_info where fq_name = 'test/def/t1';
1465 select id into @t1ui_id from ndbinfo.ndb$dict_obj_info where parent_obj_id = @t1_id and type = 3;
1466 select id into @t2_id from ndbinfo.ndb$dict_obj_info where fq_name = 'test/def/t2';
1467 select id into @t2ui_id from ndbinfo.ndb$dict_obj_info where parent_obj_id = @t2_id and type = 3;
1468 select id into @t2bt_id from ndbinfo.ndb$dict_obj_info where parent_obj_id = @t2_id and fq_name like 'test/def/NDB$BLOB%';
1469 Put some data in.
1470 Make it more interesting for joining
1471 update test.t1 set c=c+1, d=d+1;
1472 select count(distinct node_id) into @nodes
1473 from ndbinfo.ndb$membership where group_id < 0xFFFFFF00;
1474 Check replicas
1475 select count(distinct node_id)
1476 from ndbinfo.operations_per_fragment
1477 where fq_name='test/def/t1'
1478 and fragment_num=0;
1479 count(distinct node_id)
1480 2
1481 Check nodes with table data
1482 select count(distinct node_id)
1483 from ndbinfo.operations_per_fragment
1484 where fq_name='test/def/t1';
1485 count(distinct node_id)
1486 2
1487 Check UI replicas
1488 select count(distinct node_id)
1489 from ndbinfo.operations_per_fragment
1490 where table_id = @t1ui_id
1491 and fragment_num=0;
1492 count(distinct node_id)
1493 2
1494 Check nodes with UI data
1495 select count(distinct node_id)
1496 from ndbinfo.operations_per_fragment
1497 where table_id = @t1ui_id;
1498 count(distinct node_id)
1499 2
1500 Put some data in.
1501 insert into test.t2 select a,b,c,repeat('BJC',300) from test.t1;
1502 Check blob table replicas
1503 select count(distinct node_id)
1504 from ndbinfo.operations_per_fragment
1505 where table_id = @t2bt_id
1506 and fragment_num=0;
1507 count(distinct node_id)
1508 2
1509 Check nodes with blob data
1510 select count(distinct node_id)
1511 from ndbinfo.operations_per_fragment
1512 where table_id = @t2bt_id;
1513 count(distinct node_id)
1514 2
1515 set @partitions = 'PARTITION p2 VALUES IN (2)';
1516 set @partitions = concat(@partitions,',PARTITION p1 VALUES IN (1)');
1517 set @@new = 1;
1518 Warnings:
1519 Warning 1287 '@@new' is deprecated and will be removed in a future release.
1520 create table hints (i int primary key) engine=ndb partition by list(i) (PARTITION p2 VALUES IN (2),PARTITION p1 VALUES IN (1));
1521 insert into hints values (2);
1522 Hint node by 2 of 2
1523 Tests on T1 (!Blobs)
1524 Test some basic NdbApi
1525 PK lookups
1526 explain select * from test.t1 where t1.a=6;
1527 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
1528 1 SIMPLE t1 # eq_ref PRIMARY,a PRIMARY 4 const # # NULL
1529 Warnings:
1530 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` from `test`.`t1` where (`test`.`t1`.`a` = 6)
1531 Error insert to ensure that TC requests are purely local
1532
1533
1534 UI lookups
1535 explain select * from test.t1 where t1.b=6;
1536 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
1537 1 SIMPLE t1 # eq_ref b b 5 const # # NULL
1538 Warnings:
1539 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` from `test`.`t1` where (`test`.`t1`.`b` = 6)
1540 Error insert to ensure that TC requests are purely local
1541
1542
1543 OI scan
1544 explain select * from test.t1 where c > 6;
1545 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
1546 1 SIMPLE t1 # range c c 5 NULL # # Using pushed condition (`test`.`t1`.`c` > 6); Using MRR
1547 Warnings:
1548 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` from `test`.`t1` where (`test`.`t1`.`c` > 6)
1549 Error insert to ensure that TC requests are purely local
1550
1551
1552 Table scan
1553 explain select * from test.t1;
1554 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
1555 1 SIMPLE t1 # ALL NULL NULL NULL NULL # # NULL
1556 Warnings:
1557 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` from `test`.`t1`
1558 Error insert to ensure that TC requests are purely local
1559
1560
1561 Test pushed queries (SPJ)
1562 Pushed pk->pk
1563 Lookup to get a.d, feeding pk lookup of b.a
1564 explain select a.a, a.d, b.d
1565 from
1566 test.t1 a
1567 join
1568 test.t1 b
1569 on
1570 a.d = b.a
1571 where a.a = 6;
1572 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
1573 1 SIMPLE a # eq_ref PRIMARY,a PRIMARY 4 const # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
1574 1 SIMPLE b # eq_ref PRIMARY,a PRIMARY 4 test.a.d # # Child of 'a' in pushed join@1
1575 Warnings:
1576 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`a` = `test`.`a`.`d`) and (`test`.`a`.`a` = 6))
1577 Error insert to ensure that SPJ requests are purely local
1578
1579
1580 Pushed uk->uk
1581 Lookup to get a.d, feeding uk lookup of b.b
1582 explain select a.a, a.d, b.d
1583 from
1584 test.t1 a
1585 join
1586 test.t1 b
1587 on
1588 a.d = b.b
1589 where a.b = 6;
1590 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
1591 1 SIMPLE a # eq_ref b b 5 const # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
1592 1 SIMPLE b # eq_ref b b 5 test.a.d # # Child of 'a' in pushed join@1
1593 Warnings:
1594 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`b` = `test`.`a`.`d`) and (`test`.`a`.`b` = 6))
1595 Error insert to ensure that SPJ requests are purely local
1596
1597
1598 Pushed uk->pk
1599 Lookup to get a.d, feeding pk lookup of b.a
1600 explain select a.a, a.d, b.d
1601 from
1602 test.t1 a
1603 join
1604 test.t1 b
1605 on
1606 a.d = b.a
1607 where a.b = 6;
1608 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
1609 1 SIMPLE a # eq_ref b b 5 const # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
1610 1 SIMPLE b # eq_ref PRIMARY,a PRIMARY 4 test.a.d # # Child of 'a' in pushed join@1
1611 Warnings:
1612 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`a` = `test`.`a`.`d`) and (`test`.`a`.`b` = 6))
1613 Error insert to ensure that SPJ requests are purely local
1614
1615
1616 Pushed pk->uk
1617 Lookup to get a.d, feeding uk lookup of b.b
1618 explain select a.a, a.d, b.d
1619 from
1620 test.t1 a
1621 join
1622 test.t1 b
1623 on
1624 a.d = b.b
1625 where a.a = 6;
1626 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
1627 1 SIMPLE a # eq_ref PRIMARY,a PRIMARY 4 const # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
1628 1 SIMPLE b # eq_ref b b 5 test.a.d # # Child of 'a' in pushed join@1
1629 Warnings:
1630 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`b` = `test`.`a`.`d`) and (`test`.`a`.`a` = 6))
1631 Error insert to ensure that SPJ requests are purely local
1632
1633
1634 Pushed scan originating sub-lookups
1635 Table scan to get a.d, feeding pk lookups of b.a
1636 explain select a.a, a.d, b.d
1637 from
1638 test.t1 a
1639 join
1640 test.t1 b
1641 on
1642 a.d = b.a;
1643 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
1644 1 SIMPLE a # ALL NULL NULL NULL NULL # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
1645 1 SIMPLE b # eq_ref PRIMARY,a PRIMARY 4 test.a.d # # Child of 'a' in pushed join@1
1646 Warnings:
1647 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where (`test`.`b`.`a` = `test`.`a`.`d`)
1648 Error insert to ensure that SPJ requests are purely local
1649
1650 begin;
1651 select * from hints where i = 2;
1652 select a.a, a.d, b.d
1653 from
1654 test.t1 a
1655 join
1656 test.t1 b
1657 on
1658 a.d = b.a;
1659 commit;
1660
1661 Pushed scan originating sub-lookups
1662 Table scan to get a.d, feeding uk lookups of b.b
1663 explain select a.a, a.d, b.d
1664 from
1665 test.t1 a
1666 join
1667 test.t1 b
1668 on
1669 a.d = b.b;
1670 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
1671 1 SIMPLE a # ALL NULL NULL NULL NULL # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
1672 1 SIMPLE b # eq_ref b b 5 test.a.d # # Child of 'a' in pushed join@1
1673 Warnings:
1674 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where (`test`.`b`.`b` = `test`.`a`.`d`)
1675 Error insert to ensure that SPJ requests are purely local
1676
1677 begin;
1678 select * from hints where i = 2;
1679 select a.a, a.d, b.d
1680 from
1681 test.t1 a
1682 join
1683 test.t1 b
1684 on
1685 a.d = b.b;
1686 commit;
1687
1688 Pushed scan originating sub-scans
1689 Range scan on a.a > 10 getting a.d, feeding range scans on b.c = a.d
1690 explain select a.a, a.d, b.d
1691 from
1692 test.t1 a
1693 join
1694 test.t1 b
1695 on
1696 b.c=a.d
1697 where
1698 a.a>10;
1699 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
1700 1 SIMPLE a # range PRIMARY,a PRIMARY 4 NULL # # Parent of 2 pushed join@1; Using pushed condition ((`test`.`a`.`a` > 10) and (`test`.`a`.`d` is not null)); Using MRR
1701 1 SIMPLE b # ref c c 5 test.a.d # # Child of 'a' in pushed join@1
1702 Warnings:
1703 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`c` = `test`.`a`.`d`) and (`test`.`a`.`a` > 10))
1704 Error insert to ensure that SPJ requests are purely local
1705
1706 begin;
1707 select * from hints where i = 2;
1708 select a.a, a.d, b.d
1709 from
1710 test.t1 a
1711 join
1712 test.t1 b
1713 on
1714 b.c=a.d
1715 where
1716 a.a>10;
1717 commit;
1718
1719 Tests on T2 (Blobs)
1720 Test some basic NdbApi
1721 explain select * from test.t2 where t2.a=6;
1722 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
1723 1 SIMPLE t2 # eq_ref PRIMARY PRIMARY 4 const # # NULL
1724 Warnings:
1725 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` from `test`.`t2` where (`test`.`t2`.`a` = 6)
1726 Error insert to ensure that TC requests are purely local
1727
1728
1729 UI lookups
1730 explain select * from test.t2 where t2.b=6;
1731 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
1732 1 SIMPLE t2 # eq_ref b b 5 const # # NULL
1733 Warnings:
1734 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` from `test`.`t2` where (`test`.`t2`.`b` = 6)
1735 Error insert to ensure that TC requests are purely local
1736
1737
1738 OI scan
1739 explain select * from test.t2 where c > 6;
1740 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
1741 1 SIMPLE t2 # range c c 5 NULL # # Using pushed condition (`test`.`t2`.`c` > 6)
1742 Warnings:
1743 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` from `test`.`t2` where (`test`.`t2`.`c` > 6)
1744 Error insert to ensure that TC requests are purely local
1745
1746
1747 Table scan
1748 explain select * from test.t2;
1749 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
1750 1 SIMPLE t2 # ALL NULL NULL NULL NULL # # NULL
1751 Warnings:
1752 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` from `test`.`t2`
1753 Error insert to ensure that TC requests are purely local
1754
1755
1756 insert into hints values (1);
1757 Hint node by 1 of 2
1758 Tests on T1 (!Blobs)
1759 Test some basic NdbApi
1760 PK lookups
1761 explain select * from test.t1 where t1.a=6;
1762 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
1763 1 SIMPLE t1 # eq_ref PRIMARY,a PRIMARY 4 const # # NULL
1764 Warnings:
1765 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` from `test`.`t1` where (`test`.`t1`.`a` = 6)
1766 Error insert to ensure that TC requests are purely local
1767
1768
1769 UI lookups
1770 explain select * from test.t1 where t1.b=6;
1771 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
1772 1 SIMPLE t1 # eq_ref b b 5 const # # NULL
1773 Warnings:
1774 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` from `test`.`t1` where (`test`.`t1`.`b` = 6)
1775 Error insert to ensure that TC requests are purely local
1776
1777
1778 OI scan
1779 explain select * from test.t1 where c > 6;
1780 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
1781 1 SIMPLE t1 # range c c 5 NULL # # Using pushed condition (`test`.`t1`.`c` > 6); Using MRR
1782 Warnings:
1783 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` from `test`.`t1` where (`test`.`t1`.`c` > 6)
1784 Error insert to ensure that TC requests are purely local
1785
1786
1787 Table scan
1788 explain select * from test.t1;
1789 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
1790 1 SIMPLE t1 # ALL NULL NULL NULL NULL # # NULL
1791 Warnings:
1792 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` from `test`.`t1`
1793 Error insert to ensure that TC requests are purely local
1794
1795
1796 Test pushed queries (SPJ)
1797 Pushed pk->pk
1798 Lookup to get a.d, feeding pk lookup of b.a
1799 explain select a.a, a.d, b.d
1800 from
1801 test.t1 a
1802 join
1803 test.t1 b
1804 on
1805 a.d = b.a
1806 where a.a = 6;
1807 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
1808 1 SIMPLE a # eq_ref PRIMARY,a PRIMARY 4 const # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
1809 1 SIMPLE b # eq_ref PRIMARY,a PRIMARY 4 test.a.d # # Child of 'a' in pushed join@1
1810 Warnings:
1811 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`a` = `test`.`a`.`d`) and (`test`.`a`.`a` = 6))
1812 Error insert to ensure that SPJ requests are purely local
1813
1814
1815 Pushed uk->uk
1816 Lookup to get a.d, feeding uk lookup of b.b
1817 explain select a.a, a.d, b.d
1818 from
1819 test.t1 a
1820 join
1821 test.t1 b
1822 on
1823 a.d = b.b
1824 where a.b = 6;
1825 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
1826 1 SIMPLE a # eq_ref b b 5 const # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
1827 1 SIMPLE b # eq_ref b b 5 test.a.d # # Child of 'a' in pushed join@1
1828 Warnings:
1829 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`b` = `test`.`a`.`d`) and (`test`.`a`.`b` = 6))
1830 Error insert to ensure that SPJ requests are purely local
1831
1832
1833 Pushed uk->pk
1834 Lookup to get a.d, feeding pk lookup of b.a
1835 explain select a.a, a.d, b.d
1836 from
1837 test.t1 a
1838 join
1839 test.t1 b
1840 on
1841 a.d = b.a
1842 where a.b = 6;
1843 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
1844 1 SIMPLE a # eq_ref b b 5 const # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
1845 1 SIMPLE b # eq_ref PRIMARY,a PRIMARY 4 test.a.d # # Child of 'a' in pushed join@1
1846 Warnings:
1847 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`a` = `test`.`a`.`d`) and (`test`.`a`.`b` = 6))
1848 Error insert to ensure that SPJ requests are purely local
1849
1850
1851 Pushed pk->uk
1852 Lookup to get a.d, feeding uk lookup of b.b
1853 explain select a.a, a.d, b.d
1854 from
1855 test.t1 a
1856 join
1857 test.t1 b
1858 on
1859 a.d = b.b
1860 where a.a = 6;
1861 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
1862 1 SIMPLE a # eq_ref PRIMARY,a PRIMARY 4 const # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
1863 1 SIMPLE b # eq_ref b b 5 test.a.d # # Child of 'a' in pushed join@1
1864 Warnings:
1865 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`b` = `test`.`a`.`d`) and (`test`.`a`.`a` = 6))
1866 Error insert to ensure that SPJ requests are purely local
1867
1868
1869 Pushed scan originating sub-lookups
1870 Table scan to get a.d, feeding pk lookups of b.a
1871 explain select a.a, a.d, b.d
1872 from
1873 test.t1 a
1874 join
1875 test.t1 b
1876 on
1877 a.d = b.a;
1878 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
1879 1 SIMPLE a # ALL NULL NULL NULL NULL # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
1880 1 SIMPLE b # eq_ref PRIMARY,a PRIMARY 4 test.a.d # # Child of 'a' in pushed join@1
1881 Warnings:
1882 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where (`test`.`b`.`a` = `test`.`a`.`d`)
1883 Error insert to ensure that SPJ requests are purely local
1884
1885 begin;
1886 select * from hints where i = 1;
1887 select a.a, a.d, b.d
1888 from
1889 test.t1 a
1890 join
1891 test.t1 b
1892 on
1893 a.d = b.a;
1894 commit;
1895
1896 Pushed scan originating sub-lookups
1897 Table scan to get a.d, feeding uk lookups of b.b
1898 explain select a.a, a.d, b.d
1899 from
1900 test.t1 a
1901 join
1902 test.t1 b
1903 on
1904 a.d = b.b;
1905 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
1906 1 SIMPLE a # ALL NULL NULL NULL NULL # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
1907 1 SIMPLE b # eq_ref b b 5 test.a.d # # Child of 'a' in pushed join@1
1908 Warnings:
1909 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where (`test`.`b`.`b` = `test`.`a`.`d`)
1910 Error insert to ensure that SPJ requests are purely local
1911
1912 begin;
1913 select * from hints where i = 1;
1914 select a.a, a.d, b.d
1915 from
1916 test.t1 a
1917 join
1918 test.t1 b
1919 on
1920 a.d = b.b;
1921 commit;
1922
1923 Pushed scan originating sub-scans
1924 Range scan on a.a > 10 getting a.d, feeding range scans on b.c = a.d
1925 explain select a.a, a.d, b.d
1926 from
1927 test.t1 a
1928 join
1929 test.t1 b
1930 on
1931 b.c=a.d
1932 where
1933 a.a>10;
1934 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
1935 1 SIMPLE a # range PRIMARY,a PRIMARY 4 NULL # # Parent of 2 pushed join@1; Using pushed condition ((`test`.`a`.`a` > 10) and (`test`.`a`.`d` is not null)); Using MRR
1936 1 SIMPLE b # ref c c 5 test.a.d # # Child of 'a' in pushed join@1
1937 Warnings:
1938 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`c` = `test`.`a`.`d`) and (`test`.`a`.`a` > 10))
1939 Error insert to ensure that SPJ requests are purely local
1940
1941 begin;
1942 select * from hints where i = 1;
1943 select a.a, a.d, b.d
1944 from
1945 test.t1 a
1946 join
1947 test.t1 b
1948 on
1949 b.c=a.d
1950 where
1951 a.a>10;
1952 commit;
1953
1954 Tests on T2 (Blobs)
1955 Test some basic NdbApi
1956 explain select * from test.t2 where t2.a=6;
1957 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
1958 1 SIMPLE t2 # eq_ref PRIMARY PRIMARY 4 const # # NULL
1959 Warnings:
1960 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` from `test`.`t2` where (`test`.`t2`.`a` = 6)
1961 Error insert to ensure that TC requests are purely local
1962
1963
1964 UI lookups
1965 explain select * from test.t2 where t2.b=6;
1966 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
1967 1 SIMPLE t2 # eq_ref b b 5 const # # NULL
1968 Warnings:
1969 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` from `test`.`t2` where (`test`.`t2`.`b` = 6)
1970 Error insert to ensure that TC requests are purely local
1971
1972
1973 OI scan
1974 explain select * from test.t2 where c > 6;
1975 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
1976 1 SIMPLE t2 # range c c 5 NULL # # Using pushed condition (`test`.`t2`.`c` > 6)
1977 Warnings:
1978 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` from `test`.`t2` where (`test`.`t2`.`c` > 6)
1979 Error insert to ensure that TC requests are purely local
1980
1981
1982 Table scan
1983 explain select * from test.t2;
1984 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
1985 1 SIMPLE t2 # ALL NULL NULL NULL NULL # # NULL
1986 Warnings:
1987 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` from `test`.`t2`
1988 Error insert to ensure that TC requests are purely local
1989
1990
1991 drop table hints;
1992 delete from t1;
1993 delete from t2;
1994 drop table test.t1;
1995 drop table test.t2;
1996 Test read-locality of FULLY-REPLICATED
1997 create table test.t1 (a int primary key,
1998 b int,
1999 c int,
2000 d int,
2001 unique(b) using hash,
2002 key(c),
2003 key(a,c))
2004 comment="NDB_TABLE=FULLY_REPLICATED=1"
2005 engine=ndb;
2006 Warnings:
2007 Warning 1121 Ndb does not support unique index on NULL valued attributes, index access with NULL value will become full table scan
2008 create table test.t2 (a int primary key,
2009 b int,
2010 c int,
2011 d text,
2012 unique(b) using hash,
2013 key(c))
2014 comment="NDB_TABLE=FULLY_REPLICATED=1"
2015 engine=ndb;
2016 Warnings:
2017 Warning 1121 Ndb does not support unique index on NULL valued attributes, index access with NULL value will become full table scan
2018 select id into @t1_id from ndbinfo.ndb$dict_obj_info where fq_name = 'test/def/t1';
2019 select id into @t1ui_id from ndbinfo.ndb$dict_obj_info where parent_obj_id = @t1_id and type = 3;
2020 select id into @t2_id from ndbinfo.ndb$dict_obj_info where fq_name = 'test/def/t2';
2021 select id into @t2ui_id from ndbinfo.ndb$dict_obj_info where parent_obj_id = @t2_id and type = 3;
2022 select id into @t2bt_id from ndbinfo.ndb$dict_obj_info where parent_obj_id = @t2_id and fq_name like 'test/def/NDB$BLOB%';
2023 Put some data in.
2024 Make it more interesting for joining
2025 update test.t1 set c=c+1, d=d+1;
2026 select count(distinct node_id) into @nodes
2027 from ndbinfo.ndb$membership where group_id < 0xFFFFFF00;
2028 Check replicas
2029 select count(distinct node_id)
2030 from ndbinfo.operations_per_fragment
2031 where fq_name='test/def/t1'
2032 and fragment_num=0;
2033 count(distinct node_id)
2034 2
2035 Check nodes with table data
2036 select count(distinct node_id)
2037 from ndbinfo.operations_per_fragment
2038 where fq_name='test/def/t1';
2039 count(distinct node_id)
2040 2
2041 Check UI replicas
2042 select count(distinct node_id)
2043 from ndbinfo.operations_per_fragment
2044 where table_id = @t1ui_id
2045 and fragment_num=0;
2046 count(distinct node_id)
2047 2
2048 Check nodes with UI data
2049 select count(distinct node_id)
2050 from ndbinfo.operations_per_fragment
2051 where table_id = @t1ui_id;
2052 count(distinct node_id)
2053 2
2054 Put some data in.
2055 insert into test.t2 select a,b,c,repeat('BJC',300) from test.t1;
2056 Check blob table replicas
2057 select count(distinct node_id)
2058 from ndbinfo.operations_per_fragment
2059 where table_id = @t2bt_id
2060 and fragment_num=0;
2061 count(distinct node_id)
2062 2
2063 Check nodes with blob data
2064 select count(distinct node_id)
2065 from ndbinfo.operations_per_fragment
2066 where table_id = @t2bt_id;
2067 count(distinct node_id)
2068 2
2069 set @partitions = 'PARTITION p2 VALUES IN (2)';
2070 set @partitions = concat(@partitions,',PARTITION p1 VALUES IN (1)');
2071 set @@new = 1;
2072 Warnings:
2073 Warning 1287 '@@new' is deprecated and will be removed in a future release.
2074 create table hints (i int primary key) engine=ndb partition by list(i) (PARTITION p2 VALUES IN (2),PARTITION p1 VALUES IN (1));
2075 insert into hints values (2);
2076 Hint node by 2 of 2
2077 Tests on T1 (!Blobs)
2078 Test some basic NdbApi
2079 PK lookups
2080 explain select * from test.t1 where t1.a=6;
2081 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
2082 1 SIMPLE t1 # eq_ref PRIMARY,a PRIMARY 4 const # # NULL
2083 Warnings:
2084 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` from `test`.`t1` where (`test`.`t1`.`a` = 6)
2085 Error insert to ensure that TC requests are purely local
2086
2087
2088 UI lookups
2089 explain select * from test.t1 where t1.b=6;
2090 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
2091 1 SIMPLE t1 # eq_ref b b 5 const # # NULL
2092 Warnings:
2093 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` from `test`.`t1` where (`test`.`t1`.`b` = 6)
2094 Error insert to ensure that TC requests are purely local
2095
2096
2097 OI scan
2098 explain select * from test.t1 where c > 6;
2099 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
2100 1 SIMPLE t1 # range c c 5 NULL # # Using pushed condition (`test`.`t1`.`c` > 6); Using MRR
2101 Warnings:
2102 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` from `test`.`t1` where (`test`.`t1`.`c` > 6)
2103 Error insert to ensure that TC requests are purely local
2104
2105
2106 Table scan
2107 explain select * from test.t1;
2108 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
2109 1 SIMPLE t1 # ALL NULL NULL NULL NULL # # NULL
2110 Warnings:
2111 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` from `test`.`t1`
2112 Error insert to ensure that TC requests are purely local
2113
2114
2115 Test pushed queries (SPJ)
2116 Pushed pk->pk
2117 Lookup to get a.d, feeding pk lookup of b.a
2118 explain select a.a, a.d, b.d
2119 from
2120 test.t1 a
2121 join
2122 test.t1 b
2123 on
2124 a.d = b.a
2125 where a.a = 6;
2126 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
2127 1 SIMPLE a # eq_ref PRIMARY,a PRIMARY 4 const # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
2128 1 SIMPLE b # eq_ref PRIMARY,a PRIMARY 4 test.a.d # # Child of 'a' in pushed join@1
2129 Warnings:
2130 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`a` = `test`.`a`.`d`) and (`test`.`a`.`a` = 6))
2131 Error insert to ensure that SPJ requests are purely local
2132
2133
2134 Pushed uk->uk
2135 Lookup to get a.d, feeding uk lookup of b.b
2136 explain select a.a, a.d, b.d
2137 from
2138 test.t1 a
2139 join
2140 test.t1 b
2141 on
2142 a.d = b.b
2143 where a.b = 6;
2144 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
2145 1 SIMPLE a # eq_ref b b 5 const # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
2146 1 SIMPLE b # eq_ref b b 5 test.a.d # # Child of 'a' in pushed join@1
2147 Warnings:
2148 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`b` = `test`.`a`.`d`) and (`test`.`a`.`b` = 6))
2149 Error insert to ensure that SPJ requests are purely local
2150
2151
2152 Pushed uk->pk
2153 Lookup to get a.d, feeding pk lookup of b.a
2154 explain select a.a, a.d, b.d
2155 from
2156 test.t1 a
2157 join
2158 test.t1 b
2159 on
2160 a.d = b.a
2161 where a.b = 6;
2162 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
2163 1 SIMPLE a # eq_ref b b 5 const # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
2164 1 SIMPLE b # eq_ref PRIMARY,a PRIMARY 4 test.a.d # # Child of 'a' in pushed join@1
2165 Warnings:
2166 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`a` = `test`.`a`.`d`) and (`test`.`a`.`b` = 6))
2167 Error insert to ensure that SPJ requests are purely local
2168
2169
2170 Pushed pk->uk
2171 Lookup to get a.d, feeding uk lookup of b.b
2172 explain select a.a, a.d, b.d
2173 from
2174 test.t1 a
2175 join
2176 test.t1 b
2177 on
2178 a.d = b.b
2179 where a.a = 6;
2180 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
2181 1 SIMPLE a # eq_ref PRIMARY,a PRIMARY 4 const # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
2182 1 SIMPLE b # eq_ref b b 5 test.a.d # # Child of 'a' in pushed join@1
2183 Warnings:
2184 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`b` = `test`.`a`.`d`) and (`test`.`a`.`a` = 6))
2185 Error insert to ensure that SPJ requests are purely local
2186
2187
2188 Pushed scan originating sub-lookups
2189 Table scan to get a.d, feeding pk lookups of b.a
2190 explain select a.a, a.d, b.d
2191 from
2192 test.t1 a
2193 join
2194 test.t1 b
2195 on
2196 a.d = b.a;
2197 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
2198 1 SIMPLE a # ALL NULL NULL NULL NULL # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
2199 1 SIMPLE b # eq_ref PRIMARY,a PRIMARY 4 test.a.d # # Child of 'a' in pushed join@1
2200 Warnings:
2201 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where (`test`.`b`.`a` = `test`.`a`.`d`)
2202 Error insert to ensure that SPJ requests are purely local
2203
2204 begin;
2205 select * from hints where i = 2;
2206 select a.a, a.d, b.d
2207 from
2208 test.t1 a
2209 join
2210 test.t1 b
2211 on
2212 a.d = b.a;
2213 commit;
2214
2215 Pushed scan originating sub-lookups
2216 Table scan to get a.d, feeding uk lookups of b.b
2217 explain select a.a, a.d, b.d
2218 from
2219 test.t1 a
2220 join
2221 test.t1 b
2222 on
2223 a.d = b.b;
2224 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
2225 1 SIMPLE a # ALL NULL NULL NULL NULL # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
2226 1 SIMPLE b # eq_ref b b 5 test.a.d # # Child of 'a' in pushed join@1
2227 Warnings:
2228 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where (`test`.`b`.`b` = `test`.`a`.`d`)
2229 Error insert to ensure that SPJ requests are purely local
2230
2231 begin;
2232 select * from hints where i = 2;
2233 select a.a, a.d, b.d
2234 from
2235 test.t1 a
2236 join
2237 test.t1 b
2238 on
2239 a.d = b.b;
2240 commit;
2241
2242 Pushed scan originating sub-scans
2243 Range scan on a.a > 10 getting a.d, feeding range scans on b.c = a.d
2244 explain select a.a, a.d, b.d
2245 from
2246 test.t1 a
2247 join
2248 test.t1 b
2249 on
2250 b.c=a.d
2251 where
2252 a.a>10;
2253 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
2254 1 SIMPLE a # range PRIMARY,a PRIMARY 4 NULL # # Parent of 2 pushed join@1; Using pushed condition ((`test`.`a`.`a` > 10) and (`test`.`a`.`d` is not null)); Using MRR
2255 1 SIMPLE b # ref c c 5 test.a.d # # Child of 'a' in pushed join@1
2256 Warnings:
2257 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`c` = `test`.`a`.`d`) and (`test`.`a`.`a` > 10))
2258 Error insert to ensure that SPJ requests are purely local
2259
2260 begin;
2261 select * from hints where i = 2;
2262 select a.a, a.d, b.d
2263 from
2264 test.t1 a
2265 join
2266 test.t1 b
2267 on
2268 b.c=a.d
2269 where
2270 a.a>10;
2271 commit;
2272
2273 Tests on T2 (Blobs)
2274 Test some basic NdbApi
2275 explain select * from test.t2 where t2.a=6;
2276 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
2277 1 SIMPLE t2 # eq_ref PRIMARY PRIMARY 4 const # # NULL
2278 Warnings:
2279 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` from `test`.`t2` where (`test`.`t2`.`a` = 6)
2280 Error insert to ensure that TC requests are purely local
2281
2282
2283 UI lookups
2284 explain select * from test.t2 where t2.b=6;
2285 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
2286 1 SIMPLE t2 # eq_ref b b 5 const # # NULL
2287 Warnings:
2288 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` from `test`.`t2` where (`test`.`t2`.`b` = 6)
2289 Error insert to ensure that TC requests are purely local
2290
2291
2292 OI scan
2293 explain select * from test.t2 where c > 6;
2294 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
2295 1 SIMPLE t2 # range c c 5 NULL # # Using pushed condition (`test`.`t2`.`c` > 6)
2296 Warnings:
2297 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` from `test`.`t2` where (`test`.`t2`.`c` > 6)
2298 Error insert to ensure that TC requests are purely local
2299
2300
2301 Table scan
2302 explain select * from test.t2;
2303 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
2304 1 SIMPLE t2 # ALL NULL NULL NULL NULL # # NULL
2305 Warnings:
2306 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` from `test`.`t2`
2307 Error insert to ensure that TC requests are purely local
2308
2309
2310 insert into hints values (1);
2311 Hint node by 1 of 2
2312 Tests on T1 (!Blobs)
2313 Test some basic NdbApi
2314 PK lookups
2315 explain select * from test.t1 where t1.a=6;
2316 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
2317 1 SIMPLE t1 # eq_ref PRIMARY,a PRIMARY 4 const # # NULL
2318 Warnings:
2319 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` from `test`.`t1` where (`test`.`t1`.`a` = 6)
2320 Error insert to ensure that TC requests are purely local
2321
2322
2323 UI lookups
2324 explain select * from test.t1 where t1.b=6;
2325 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
2326 1 SIMPLE t1 # eq_ref b b 5 const # # NULL
2327 Warnings:
2328 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` from `test`.`t1` where (`test`.`t1`.`b` = 6)
2329 Error insert to ensure that TC requests are purely local
2330
2331
2332 OI scan
2333 explain select * from test.t1 where c > 6;
2334 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
2335 1 SIMPLE t1 # range c c 5 NULL # # Using pushed condition (`test`.`t1`.`c` > 6); Using MRR
2336 Warnings:
2337 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` from `test`.`t1` where (`test`.`t1`.`c` > 6)
2338 Error insert to ensure that TC requests are purely local
2339
2340
2341 Table scan
2342 explain select * from test.t1;
2343 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
2344 1 SIMPLE t1 # ALL NULL NULL NULL NULL # # NULL
2345 Warnings:
2346 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` from `test`.`t1`
2347 Error insert to ensure that TC requests are purely local
2348
2349
2350 Test pushed queries (SPJ)
2351 Pushed pk->pk
2352 Lookup to get a.d, feeding pk lookup of b.a
2353 explain select a.a, a.d, b.d
2354 from
2355 test.t1 a
2356 join
2357 test.t1 b
2358 on
2359 a.d = b.a
2360 where a.a = 6;
2361 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
2362 1 SIMPLE a # eq_ref PRIMARY,a PRIMARY 4 const # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
2363 1 SIMPLE b # eq_ref PRIMARY,a PRIMARY 4 test.a.d # # Child of 'a' in pushed join@1
2364 Warnings:
2365 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`a` = `test`.`a`.`d`) and (`test`.`a`.`a` = 6))
2366 Error insert to ensure that SPJ requests are purely local
2367
2368
2369 Pushed uk->uk
2370 Lookup to get a.d, feeding uk lookup of b.b
2371 explain select a.a, a.d, b.d
2372 from
2373 test.t1 a
2374 join
2375 test.t1 b
2376 on
2377 a.d = b.b
2378 where a.b = 6;
2379 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
2380 1 SIMPLE a # eq_ref b b 5 const # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
2381 1 SIMPLE b # eq_ref b b 5 test.a.d # # Child of 'a' in pushed join@1
2382 Warnings:
2383 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`b` = `test`.`a`.`d`) and (`test`.`a`.`b` = 6))
2384 Error insert to ensure that SPJ requests are purely local
2385
2386
2387 Pushed uk->pk
2388 Lookup to get a.d, feeding pk lookup of b.a
2389 explain select a.a, a.d, b.d
2390 from
2391 test.t1 a
2392 join
2393 test.t1 b
2394 on
2395 a.d = b.a
2396 where a.b = 6;
2397 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
2398 1 SIMPLE a # eq_ref b b 5 const # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
2399 1 SIMPLE b # eq_ref PRIMARY,a PRIMARY 4 test.a.d # # Child of 'a' in pushed join@1
2400 Warnings:
2401 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`a` = `test`.`a`.`d`) and (`test`.`a`.`b` = 6))
2402 Error insert to ensure that SPJ requests are purely local
2403
2404
2405 Pushed pk->uk
2406 Lookup to get a.d, feeding uk lookup of b.b
2407 explain select a.a, a.d, b.d
2408 from
2409 test.t1 a
2410 join
2411 test.t1 b
2412 on
2413 a.d = b.b
2414 where a.a = 6;
2415 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
2416 1 SIMPLE a # eq_ref PRIMARY,a PRIMARY 4 const # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
2417 1 SIMPLE b # eq_ref b b 5 test.a.d # # Child of 'a' in pushed join@1
2418 Warnings:
2419 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`b` = `test`.`a`.`d`) and (`test`.`a`.`a` = 6))
2420 Error insert to ensure that SPJ requests are purely local
2421
2422
2423 Pushed scan originating sub-lookups
2424 Table scan to get a.d, feeding pk lookups of b.a
2425 explain select a.a, a.d, b.d
2426 from
2427 test.t1 a
2428 join
2429 test.t1 b
2430 on
2431 a.d = b.a;
2432 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
2433 1 SIMPLE a # ALL NULL NULL NULL NULL # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
2434 1 SIMPLE b # eq_ref PRIMARY,a PRIMARY 4 test.a.d # # Child of 'a' in pushed join@1
2435 Warnings:
2436 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where (`test`.`b`.`a` = `test`.`a`.`d`)
2437 Error insert to ensure that SPJ requests are purely local
2438
2439 begin;
2440 select * from hints where i = 1;
2441 select a.a, a.d, b.d
2442 from
2443 test.t1 a
2444 join
2445 test.t1 b
2446 on
2447 a.d = b.a;
2448 commit;
2449
2450 Pushed scan originating sub-lookups
2451 Table scan to get a.d, feeding uk lookups of b.b
2452 explain select a.a, a.d, b.d
2453 from
2454 test.t1 a
2455 join
2456 test.t1 b
2457 on
2458 a.d = b.b;
2459 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
2460 1 SIMPLE a # ALL NULL NULL NULL NULL # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
2461 1 SIMPLE b # eq_ref b b 5 test.a.d # # Child of 'a' in pushed join@1
2462 Warnings:
2463 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where (`test`.`b`.`b` = `test`.`a`.`d`)
2464 Error insert to ensure that SPJ requests are purely local
2465
2466 begin;
2467 select * from hints where i = 1;
2468 select a.a, a.d, b.d
2469 from
2470 test.t1 a
2471 join
2472 test.t1 b
2473 on
2474 a.d = b.b;
2475 commit;
2476
2477 Pushed scan originating sub-scans
2478 Range scan on a.a > 10 getting a.d, feeding range scans on b.c = a.d
2479 explain select a.a, a.d, b.d
2480 from
2481 test.t1 a
2482 join
2483 test.t1 b
2484 on
2485 b.c=a.d
2486 where
2487 a.a>10;
2488 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
2489 1 SIMPLE a # range PRIMARY,a PRIMARY 4 NULL # # Parent of 2 pushed join@1; Using pushed condition ((`test`.`a`.`a` > 10) and (`test`.`a`.`d` is not null)); Using MRR
2490 1 SIMPLE b # ref c c 5 test.a.d # # Child of 'a' in pushed join@1
2491 Warnings:
2492 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`c` = `test`.`a`.`d`) and (`test`.`a`.`a` > 10))
2493 Error insert to ensure that SPJ requests are purely local
2494
2495 begin;
2496 select * from hints where i = 1;
2497 select a.a, a.d, b.d
2498 from
2499 test.t1 a
2500 join
2501 test.t1 b
2502 on
2503 b.c=a.d
2504 where
2505 a.a>10;
2506 commit;
2507
2508 Tests on T2 (Blobs)
2509 Test some basic NdbApi
2510 explain select * from test.t2 where t2.a=6;
2511 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
2512 1 SIMPLE t2 # eq_ref PRIMARY PRIMARY 4 const # # NULL
2513 Warnings:
2514 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` from `test`.`t2` where (`test`.`t2`.`a` = 6)
2515 Error insert to ensure that TC requests are purely local
2516
2517
2518 UI lookups
2519 explain select * from test.t2 where t2.b=6;
2520 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
2521 1 SIMPLE t2 # eq_ref b b 5 const # # NULL
2522 Warnings:
2523 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` from `test`.`t2` where (`test`.`t2`.`b` = 6)
2524 Error insert to ensure that TC requests are purely local
2525
2526
2527 OI scan
2528 explain select * from test.t2 where c > 6;
2529 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
2530 1 SIMPLE t2 # range c c 5 NULL # # Using pushed condition (`test`.`t2`.`c` > 6)
2531 Warnings:
2532 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` from `test`.`t2` where (`test`.`t2`.`c` > 6)
2533 Error insert to ensure that TC requests are purely local
2534
2535
2536 Table scan
2537 explain select * from test.t2;
2538 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
2539 1 SIMPLE t2 # ALL NULL NULL NULL NULL # # NULL
2540 Warnings:
2541 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` from `test`.`t2`
2542 Error insert to ensure that TC requests are purely local
2543
2544
2545 drop table hints;
2546 delete from t1;
2547 delete from t2;
2548 Nodegroup 1 created
2549 alter table t1 algorithm=inplace, reorganize partition;
2550 alter table t2 algorithm=inplace, reorganize partition;
2551 select id into @t1_id from ndbinfo.ndb$dict_obj_info where fq_name = 'test/def/t1';
2552 select id into @t1ui_id from ndbinfo.ndb$dict_obj_info where parent_obj_id = @t1_id and type = 3;
2553 select id into @t2_id from ndbinfo.ndb$dict_obj_info where fq_name = 'test/def/t2';
2554 select id into @t2ui_id from ndbinfo.ndb$dict_obj_info where parent_obj_id = @t2_id and type = 3;
2555 select id into @t2bt_id from ndbinfo.ndb$dict_obj_info where parent_obj_id = @t2_id and fq_name like 'test/def/NDB$BLOB%';
2556 Put some data in.
2557 Make it more interesting for joining
2558 update test.t1 set c=c+1, d=d+1;
2559 select count(distinct node_id) into @nodes
2560 from ndbinfo.ndb$membership where group_id < 0xFFFFFF00;
2561 Check replicas
2562 select count(distinct node_id)
2563 from ndbinfo.operations_per_fragment
2564 where fq_name='test/def/t1'
2565 and fragment_num=0;
2566 count(distinct node_id)
2567 2
2568 Check nodes with table data
2569 select count(distinct node_id)
2570 from ndbinfo.operations_per_fragment
2571 where fq_name='test/def/t1';
2572 count(distinct node_id)
2573 4
2574 Check UI replicas
2575 select count(distinct node_id)
2576 from ndbinfo.operations_per_fragment
2577 where table_id = @t1ui_id
2578 and fragment_num=0;
2579 count(distinct node_id)
2580 2
2581 Check nodes with UI data
2582 select count(distinct node_id)
2583 from ndbinfo.operations_per_fragment
2584 where table_id = @t1ui_id;
2585 count(distinct node_id)
2586 4
2587 Put some data in.
2588 insert into test.t2 select a,b,c,repeat('BJC',300) from test.t1;
2589 Check blob table replicas
2590 select count(distinct node_id)
2591 from ndbinfo.operations_per_fragment
2592 where table_id = @t2bt_id
2593 and fragment_num=0;
2594 count(distinct node_id)
2595 2
2596 Check nodes with blob data
2597 select count(distinct node_id)
2598 from ndbinfo.operations_per_fragment
2599 where table_id = @t2bt_id;
2600 count(distinct node_id)
2601 4
2602 set @partitions = 'PARTITION p4 VALUES IN (4)';
2603 set @partitions = concat(@partitions,',PARTITION p3 VALUES IN (3)');
2604 set @partitions = concat(@partitions,',PARTITION p2 VALUES IN (2)');
2605 set @partitions = concat(@partitions,',PARTITION p1 VALUES IN (1)');
2606 set @@new = 1;
2607 Warnings:
2608 Warning 1287 '@@new' is deprecated and will be removed in a future release.
2609 create table hints (i int primary key) engine=ndb partition by list(i) (PARTITION p4 VALUES IN (4),PARTITION p3 VALUES IN (3),PARTITION p2 VALUES IN (2),PARTITION p1 VALUES IN (1));
2610 insert into hints values (4);
2611 Hint node by 4 of 4
2612 Tests on T1 (!Blobs)
2613 Test some basic NdbApi
2614 PK lookups
2615 explain select * from test.t1 where t1.a=6;
2616 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
2617 1 SIMPLE t1 # eq_ref PRIMARY,a PRIMARY 4 const # # NULL
2618 Warnings:
2619 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` from `test`.`t1` where (`test`.`t1`.`a` = 6)
2620 Error insert to ensure that TC requests are purely local
2621
2622
2623 UI lookups
2624 explain select * from test.t1 where t1.b=6;
2625 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
2626 1 SIMPLE t1 # eq_ref b b 5 const # # NULL
2627 Warnings:
2628 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` from `test`.`t1` where (`test`.`t1`.`b` = 6)
2629 Error insert to ensure that TC requests are purely local
2630
2631
2632 OI scan
2633 explain select * from test.t1 where c > 6;
2634 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
2635 1 SIMPLE t1 # range c c 5 NULL # # Using pushed condition (`test`.`t1`.`c` > 6); Using MRR
2636 Warnings:
2637 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` from `test`.`t1` where (`test`.`t1`.`c` > 6)
2638 Error insert to ensure that TC requests are purely local
2639
2640
2641 Table scan
2642 explain select * from test.t1;
2643 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
2644 1 SIMPLE t1 # ALL NULL NULL NULL NULL # # NULL
2645 Warnings:
2646 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` from `test`.`t1`
2647 Error insert to ensure that TC requests are purely local
2648
2649
2650 Test pushed queries (SPJ)
2651 Pushed pk->pk
2652 Lookup to get a.d, feeding pk lookup of b.a
2653 explain select a.a, a.d, b.d
2654 from
2655 test.t1 a
2656 join
2657 test.t1 b
2658 on
2659 a.d = b.a
2660 where a.a = 6;
2661 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
2662 1 SIMPLE a # eq_ref PRIMARY,a PRIMARY 4 const # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
2663 1 SIMPLE b # eq_ref PRIMARY,a PRIMARY 4 test.a.d # # Child of 'a' in pushed join@1
2664 Warnings:
2665 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`a` = `test`.`a`.`d`) and (`test`.`a`.`a` = 6))
2666 Error insert to ensure that SPJ requests are purely local
2667
2668
2669 Pushed uk->uk
2670 Lookup to get a.d, feeding uk lookup of b.b
2671 explain select a.a, a.d, b.d
2672 from
2673 test.t1 a
2674 join
2675 test.t1 b
2676 on
2677 a.d = b.b
2678 where a.b = 6;
2679 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
2680 1 SIMPLE a # eq_ref b b 5 const # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
2681 1 SIMPLE b # eq_ref b b 5 test.a.d # # Child of 'a' in pushed join@1
2682 Warnings:
2683 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`b` = `test`.`a`.`d`) and (`test`.`a`.`b` = 6))
2684 Error insert to ensure that SPJ requests are purely local
2685
2686
2687 Pushed uk->pk
2688 Lookup to get a.d, feeding pk lookup of b.a
2689 explain select a.a, a.d, b.d
2690 from
2691 test.t1 a
2692 join
2693 test.t1 b
2694 on
2695 a.d = b.a
2696 where a.b = 6;
2697 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
2698 1 SIMPLE a # eq_ref b b 5 const # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
2699 1 SIMPLE b # eq_ref PRIMARY,a PRIMARY 4 test.a.d # # Child of 'a' in pushed join@1
2700 Warnings:
2701 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`a` = `test`.`a`.`d`) and (`test`.`a`.`b` = 6))
2702 Error insert to ensure that SPJ requests are purely local
2703
2704
2705 Pushed pk->uk
2706 Lookup to get a.d, feeding uk lookup of b.b
2707 explain select a.a, a.d, b.d
2708 from
2709 test.t1 a
2710 join
2711 test.t1 b
2712 on
2713 a.d = b.b
2714 where a.a = 6;
2715 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
2716 1 SIMPLE a # eq_ref PRIMARY,a PRIMARY 4 const # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
2717 1 SIMPLE b # eq_ref b b 5 test.a.d # # Child of 'a' in pushed join@1
2718 Warnings:
2719 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`b` = `test`.`a`.`d`) and (`test`.`a`.`a` = 6))
2720 Error insert to ensure that SPJ requests are purely local
2721
2722
2723 Pushed scan originating sub-lookups
2724 Table scan to get a.d, feeding pk lookups of b.a
2725 explain select a.a, a.d, b.d
2726 from
2727 test.t1 a
2728 join
2729 test.t1 b
2730 on
2731 a.d = b.a;
2732 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
2733 1 SIMPLE a # ALL NULL NULL NULL NULL # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
2734 1 SIMPLE b # eq_ref PRIMARY,a PRIMARY 4 test.a.d # # Child of 'a' in pushed join@1
2735 Warnings:
2736 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where (`test`.`b`.`a` = `test`.`a`.`d`)
2737 Error insert to ensure that SPJ requests are purely local
2738
2739 begin;
2740 select * from hints where i = 4;
2741 select a.a, a.d, b.d
2742 from
2743 test.t1 a
2744 join
2745 test.t1 b
2746 on
2747 a.d = b.a;
2748 commit;
2749
2750 Pushed scan originating sub-lookups
2751 Table scan to get a.d, feeding uk lookups of b.b
2752 explain select a.a, a.d, b.d
2753 from
2754 test.t1 a
2755 join
2756 test.t1 b
2757 on
2758 a.d = b.b;
2759 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
2760 1 SIMPLE a # ALL NULL NULL NULL NULL # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
2761 1 SIMPLE b # eq_ref b b 5 test.a.d # # Child of 'a' in pushed join@1
2762 Warnings:
2763 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where (`test`.`b`.`b` = `test`.`a`.`d`)
2764 Error insert to ensure that SPJ requests are purely local
2765
2766 begin;
2767 select * from hints where i = 4;
2768 select a.a, a.d, b.d
2769 from
2770 test.t1 a
2771 join
2772 test.t1 b
2773 on
2774 a.d = b.b;
2775 commit;
2776
2777 Pushed scan originating sub-scans
2778 Range scan on a.a > 10 getting a.d, feeding range scans on b.c = a.d
2779 explain select a.a, a.d, b.d
2780 from
2781 test.t1 a
2782 join
2783 test.t1 b
2784 on
2785 b.c=a.d
2786 where
2787 a.a>10;
2788 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
2789 1 SIMPLE a # range PRIMARY,a PRIMARY 4 NULL # # Parent of 2 pushed join@1; Using pushed condition ((`test`.`a`.`a` > 10) and (`test`.`a`.`d` is not null)); Using MRR
2790 1 SIMPLE b # ref c c 5 test.a.d # # Child of 'a' in pushed join@1
2791 Warnings:
2792 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`c` = `test`.`a`.`d`) and (`test`.`a`.`a` > 10))
2793 Error insert to ensure that SPJ requests are purely local
2794
2795 begin;
2796 select * from hints where i = 4;
2797 select a.a, a.d, b.d
2798 from
2799 test.t1 a
2800 join
2801 test.t1 b
2802 on
2803 b.c=a.d
2804 where
2805 a.a>10;
2806 commit;
2807
2808 Tests on T2 (Blobs)
2809 Test some basic NdbApi
2810 explain select * from test.t2 where t2.a=6;
2811 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
2812 1 SIMPLE t2 # eq_ref PRIMARY PRIMARY 4 const # # NULL
2813 Warnings:
2814 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` from `test`.`t2` where (`test`.`t2`.`a` = 6)
2815 Error insert to ensure that TC requests are purely local
2816
2817
2818 UI lookups
2819 explain select * from test.t2 where t2.b=6;
2820 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
2821 1 SIMPLE t2 # eq_ref b b 5 const # # NULL
2822 Warnings:
2823 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` from `test`.`t2` where (`test`.`t2`.`b` = 6)
2824 Error insert to ensure that TC requests are purely local
2825
2826
2827 OI scan
2828 explain select * from test.t2 where c > 6;
2829 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
2830 1 SIMPLE t2 # range c c 5 NULL # # Using pushed condition (`test`.`t2`.`c` > 6)
2831 Warnings:
2832 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` from `test`.`t2` where (`test`.`t2`.`c` > 6)
2833 Error insert to ensure that TC requests are purely local
2834
2835
2836 Table scan
2837 explain select * from test.t2;
2838 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
2839 1 SIMPLE t2 # ALL NULL NULL NULL NULL # # NULL
2840 Warnings:
2841 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` from `test`.`t2`
2842 Error insert to ensure that TC requests are purely local
2843
2844
2845 insert into hints values (3);
2846 Hint node by 3 of 4
2847 Tests on T1 (!Blobs)
2848 Test some basic NdbApi
2849 PK lookups
2850 explain select * from test.t1 where t1.a=6;
2851 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
2852 1 SIMPLE t1 # eq_ref PRIMARY,a PRIMARY 4 const # # NULL
2853 Warnings:
2854 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` from `test`.`t1` where (`test`.`t1`.`a` = 6)
2855 Error insert to ensure that TC requests are purely local
2856
2857
2858 UI lookups
2859 explain select * from test.t1 where t1.b=6;
2860 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
2861 1 SIMPLE t1 # eq_ref b b 5 const # # NULL
2862 Warnings:
2863 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` from `test`.`t1` where (`test`.`t1`.`b` = 6)
2864 Error insert to ensure that TC requests are purely local
2865
2866
2867 OI scan
2868 explain select * from test.t1 where c > 6;
2869 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
2870 1 SIMPLE t1 # range c c 5 NULL # # Using pushed condition (`test`.`t1`.`c` > 6); Using MRR
2871 Warnings:
2872 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` from `test`.`t1` where (`test`.`t1`.`c` > 6)
2873 Error insert to ensure that TC requests are purely local
2874
2875
2876 Table scan
2877 explain select * from test.t1;
2878 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
2879 1 SIMPLE t1 # ALL NULL NULL NULL NULL # # NULL
2880 Warnings:
2881 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` from `test`.`t1`
2882 Error insert to ensure that TC requests are purely local
2883
2884
2885 Test pushed queries (SPJ)
2886 Pushed pk->pk
2887 Lookup to get a.d, feeding pk lookup of b.a
2888 explain select a.a, a.d, b.d
2889 from
2890 test.t1 a
2891 join
2892 test.t1 b
2893 on
2894 a.d = b.a
2895 where a.a = 6;
2896 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
2897 1 SIMPLE a # eq_ref PRIMARY,a PRIMARY 4 const # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
2898 1 SIMPLE b # eq_ref PRIMARY,a PRIMARY 4 test.a.d # # Child of 'a' in pushed join@1
2899 Warnings:
2900 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`a` = `test`.`a`.`d`) and (`test`.`a`.`a` = 6))
2901 Error insert to ensure that SPJ requests are purely local
2902
2903
2904 Pushed uk->uk
2905 Lookup to get a.d, feeding uk lookup of b.b
2906 explain select a.a, a.d, b.d
2907 from
2908 test.t1 a
2909 join
2910 test.t1 b
2911 on
2912 a.d = b.b
2913 where a.b = 6;
2914 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
2915 1 SIMPLE a # eq_ref b b 5 const # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
2916 1 SIMPLE b # eq_ref b b 5 test.a.d # # Child of 'a' in pushed join@1
2917 Warnings:
2918 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`b` = `test`.`a`.`d`) and (`test`.`a`.`b` = 6))
2919 Error insert to ensure that SPJ requests are purely local
2920
2921
2922 Pushed uk->pk
2923 Lookup to get a.d, feeding pk lookup of b.a
2924 explain select a.a, a.d, b.d
2925 from
2926 test.t1 a
2927 join
2928 test.t1 b
2929 on
2930 a.d = b.a
2931 where a.b = 6;
2932 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
2933 1 SIMPLE a # eq_ref b b 5 const # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
2934 1 SIMPLE b # eq_ref PRIMARY,a PRIMARY 4 test.a.d # # Child of 'a' in pushed join@1
2935 Warnings:
2936 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`a` = `test`.`a`.`d`) and (`test`.`a`.`b` = 6))
2937 Error insert to ensure that SPJ requests are purely local
2938
2939
2940 Pushed pk->uk
2941 Lookup to get a.d, feeding uk lookup of b.b
2942 explain select a.a, a.d, b.d
2943 from
2944 test.t1 a
2945 join
2946 test.t1 b
2947 on
2948 a.d = b.b
2949 where a.a = 6;
2950 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
2951 1 SIMPLE a # eq_ref PRIMARY,a PRIMARY 4 const # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
2952 1 SIMPLE b # eq_ref b b 5 test.a.d # # Child of 'a' in pushed join@1
2953 Warnings:
2954 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`b` = `test`.`a`.`d`) and (`test`.`a`.`a` = 6))
2955 Error insert to ensure that SPJ requests are purely local
2956
2957
2958 Pushed scan originating sub-lookups
2959 Table scan to get a.d, feeding pk lookups of b.a
2960 explain select a.a, a.d, b.d
2961 from
2962 test.t1 a
2963 join
2964 test.t1 b
2965 on
2966 a.d = b.a;
2967 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
2968 1 SIMPLE a # ALL NULL NULL NULL NULL # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
2969 1 SIMPLE b # eq_ref PRIMARY,a PRIMARY 4 test.a.d # # Child of 'a' in pushed join@1
2970 Warnings:
2971 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where (`test`.`b`.`a` = `test`.`a`.`d`)
2972 Error insert to ensure that SPJ requests are purely local
2973
2974 begin;
2975 select * from hints where i = 3;
2976 select a.a, a.d, b.d
2977 from
2978 test.t1 a
2979 join
2980 test.t1 b
2981 on
2982 a.d = b.a;
2983 commit;
2984
2985 Pushed scan originating sub-lookups
2986 Table scan to get a.d, feeding uk lookups of b.b
2987 explain select a.a, a.d, b.d
2988 from
2989 test.t1 a
2990 join
2991 test.t1 b
2992 on
2993 a.d = b.b;
2994 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
2995 1 SIMPLE a # ALL NULL NULL NULL NULL # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
2996 1 SIMPLE b # eq_ref b b 5 test.a.d # # Child of 'a' in pushed join@1
2997 Warnings:
2998 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where (`test`.`b`.`b` = `test`.`a`.`d`)
2999 Error insert to ensure that SPJ requests are purely local
3000
3001 begin;
3002 select * from hints where i = 3;
3003 select a.a, a.d, b.d
3004 from
3005 test.t1 a
3006 join
3007 test.t1 b
3008 on
3009 a.d = b.b;
3010 commit;
3011
3012 Pushed scan originating sub-scans
3013 Range scan on a.a > 10 getting a.d, feeding range scans on b.c = a.d
3014 explain select a.a, a.d, b.d
3015 from
3016 test.t1 a
3017 join
3018 test.t1 b
3019 on
3020 b.c=a.d
3021 where
3022 a.a>10;
3023 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
3024 1 SIMPLE a # range PRIMARY,a PRIMARY 4 NULL # # Parent of 2 pushed join@1; Using pushed condition ((`test`.`a`.`a` > 10) and (`test`.`a`.`d` is not null)); Using MRR
3025 1 SIMPLE b # ref c c 5 test.a.d # # Child of 'a' in pushed join@1
3026 Warnings:
3027 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`c` = `test`.`a`.`d`) and (`test`.`a`.`a` > 10))
3028 Error insert to ensure that SPJ requests are purely local
3029
3030 begin;
3031 select * from hints where i = 3;
3032 select a.a, a.d, b.d
3033 from
3034 test.t1 a
3035 join
3036 test.t1 b
3037 on
3038 b.c=a.d
3039 where
3040 a.a>10;
3041 commit;
3042
3043 Tests on T2 (Blobs)
3044 Test some basic NdbApi
3045 explain select * from test.t2 where t2.a=6;
3046 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
3047 1 SIMPLE t2 # eq_ref PRIMARY PRIMARY 4 const # # NULL
3048 Warnings:
3049 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` from `test`.`t2` where (`test`.`t2`.`a` = 6)
3050 Error insert to ensure that TC requests are purely local
3051
3052
3053 UI lookups
3054 explain select * from test.t2 where t2.b=6;
3055 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
3056 1 SIMPLE t2 # eq_ref b b 5 const # # NULL
3057 Warnings:
3058 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` from `test`.`t2` where (`test`.`t2`.`b` = 6)
3059 Error insert to ensure that TC requests are purely local
3060
3061
3062 OI scan
3063 explain select * from test.t2 where c > 6;
3064 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
3065 1 SIMPLE t2 # range c c 5 NULL # # Using pushed condition (`test`.`t2`.`c` > 6)
3066 Warnings:
3067 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` from `test`.`t2` where (`test`.`t2`.`c` > 6)
3068 Error insert to ensure that TC requests are purely local
3069
3070
3071 Table scan
3072 explain select * from test.t2;
3073 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
3074 1 SIMPLE t2 # ALL NULL NULL NULL NULL # # NULL
3075 Warnings:
3076 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` from `test`.`t2`
3077 Error insert to ensure that TC requests are purely local
3078
3079
3080 insert into hints values (2);
3081 Hint node by 2 of 4
3082 Tests on T1 (!Blobs)
3083 Test some basic NdbApi
3084 PK lookups
3085 explain select * from test.t1 where t1.a=6;
3086 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
3087 1 SIMPLE t1 # eq_ref PRIMARY,a PRIMARY 4 const # # NULL
3088 Warnings:
3089 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` from `test`.`t1` where (`test`.`t1`.`a` = 6)
3090 Error insert to ensure that TC requests are purely local
3091
3092
3093 UI lookups
3094 explain select * from test.t1 where t1.b=6;
3095 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
3096 1 SIMPLE t1 # eq_ref b b 5 const # # NULL
3097 Warnings:
3098 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` from `test`.`t1` where (`test`.`t1`.`b` = 6)
3099 Error insert to ensure that TC requests are purely local
3100
3101
3102 OI scan
3103 explain select * from test.t1 where c > 6;
3104 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
3105 1 SIMPLE t1 # range c c 5 NULL # # Using pushed condition (`test`.`t1`.`c` > 6); Using MRR
3106 Warnings:
3107 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` from `test`.`t1` where (`test`.`t1`.`c` > 6)
3108 Error insert to ensure that TC requests are purely local
3109
3110
3111 Table scan
3112 explain select * from test.t1;
3113 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
3114 1 SIMPLE t1 # ALL NULL NULL NULL NULL # # NULL
3115 Warnings:
3116 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` from `test`.`t1`
3117 Error insert to ensure that TC requests are purely local
3118
3119
3120 Test pushed queries (SPJ)
3121 Pushed pk->pk
3122 Lookup to get a.d, feeding pk lookup of b.a
3123 explain select a.a, a.d, b.d
3124 from
3125 test.t1 a
3126 join
3127 test.t1 b
3128 on
3129 a.d = b.a
3130 where a.a = 6;
3131 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
3132 1 SIMPLE a # eq_ref PRIMARY,a PRIMARY 4 const # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
3133 1 SIMPLE b # eq_ref PRIMARY,a PRIMARY 4 test.a.d # # Child of 'a' in pushed join@1
3134 Warnings:
3135 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`a` = `test`.`a`.`d`) and (`test`.`a`.`a` = 6))
3136 Error insert to ensure that SPJ requests are purely local
3137
3138
3139 Pushed uk->uk
3140 Lookup to get a.d, feeding uk lookup of b.b
3141 explain select a.a, a.d, b.d
3142 from
3143 test.t1 a
3144 join
3145 test.t1 b
3146 on
3147 a.d = b.b
3148 where a.b = 6;
3149 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
3150 1 SIMPLE a # eq_ref b b 5 const # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
3151 1 SIMPLE b # eq_ref b b 5 test.a.d # # Child of 'a' in pushed join@1
3152 Warnings:
3153 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`b` = `test`.`a`.`d`) and (`test`.`a`.`b` = 6))
3154 Error insert to ensure that SPJ requests are purely local
3155
3156
3157 Pushed uk->pk
3158 Lookup to get a.d, feeding pk lookup of b.a
3159 explain select a.a, a.d, b.d
3160 from
3161 test.t1 a
3162 join
3163 test.t1 b
3164 on
3165 a.d = b.a
3166 where a.b = 6;
3167 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
3168 1 SIMPLE a # eq_ref b b 5 const # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
3169 1 SIMPLE b # eq_ref PRIMARY,a PRIMARY 4 test.a.d # # Child of 'a' in pushed join@1
3170 Warnings:
3171 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`a` = `test`.`a`.`d`) and (`test`.`a`.`b` = 6))
3172 Error insert to ensure that SPJ requests are purely local
3173
3174
3175 Pushed pk->uk
3176 Lookup to get a.d, feeding uk lookup of b.b
3177 explain select a.a, a.d, b.d
3178 from
3179 test.t1 a
3180 join
3181 test.t1 b
3182 on
3183 a.d = b.b
3184 where a.a = 6;
3185 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
3186 1 SIMPLE a # eq_ref PRIMARY,a PRIMARY 4 const # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
3187 1 SIMPLE b # eq_ref b b 5 test.a.d # # Child of 'a' in pushed join@1
3188 Warnings:
3189 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`b` = `test`.`a`.`d`) and (`test`.`a`.`a` = 6))
3190 Error insert to ensure that SPJ requests are purely local
3191
3192
3193 Pushed scan originating sub-lookups
3194 Table scan to get a.d, feeding pk lookups of b.a
3195 explain select a.a, a.d, b.d
3196 from
3197 test.t1 a
3198 join
3199 test.t1 b
3200 on
3201 a.d = b.a;
3202 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
3203 1 SIMPLE a # ALL NULL NULL NULL NULL # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
3204 1 SIMPLE b # eq_ref PRIMARY,a PRIMARY 4 test.a.d # # Child of 'a' in pushed join@1
3205 Warnings:
3206 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where (`test`.`b`.`a` = `test`.`a`.`d`)
3207 Error insert to ensure that SPJ requests are purely local
3208
3209 begin;
3210 select * from hints where i = 2;
3211 select a.a, a.d, b.d
3212 from
3213 test.t1 a
3214 join
3215 test.t1 b
3216 on
3217 a.d = b.a;
3218 commit;
3219
3220 Pushed scan originating sub-lookups
3221 Table scan to get a.d, feeding uk lookups of b.b
3222 explain select a.a, a.d, b.d
3223 from
3224 test.t1 a
3225 join
3226 test.t1 b
3227 on
3228 a.d = b.b;
3229 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
3230 1 SIMPLE a # ALL NULL NULL NULL NULL # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
3231 1 SIMPLE b # eq_ref b b 5 test.a.d # # Child of 'a' in pushed join@1
3232 Warnings:
3233 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where (`test`.`b`.`b` = `test`.`a`.`d`)
3234 Error insert to ensure that SPJ requests are purely local
3235
3236 begin;
3237 select * from hints where i = 2;
3238 select a.a, a.d, b.d
3239 from
3240 test.t1 a
3241 join
3242 test.t1 b
3243 on
3244 a.d = b.b;
3245 commit;
3246
3247 Pushed scan originating sub-scans
3248 Range scan on a.a > 10 getting a.d, feeding range scans on b.c = a.d
3249 explain select a.a, a.d, b.d
3250 from
3251 test.t1 a
3252 join
3253 test.t1 b
3254 on
3255 b.c=a.d
3256 where
3257 a.a>10;
3258 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
3259 1 SIMPLE a # range PRIMARY,a PRIMARY 4 NULL # # Parent of 2 pushed join@1; Using pushed condition ((`test`.`a`.`a` > 10) and (`test`.`a`.`d` is not null)); Using MRR
3260 1 SIMPLE b # ref c c 5 test.a.d # # Child of 'a' in pushed join@1
3261 Warnings:
3262 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`c` = `test`.`a`.`d`) and (`test`.`a`.`a` > 10))
3263 Error insert to ensure that SPJ requests are purely local
3264
3265 begin;
3266 select * from hints where i = 2;
3267 select a.a, a.d, b.d
3268 from
3269 test.t1 a
3270 join
3271 test.t1 b
3272 on
3273 b.c=a.d
3274 where
3275 a.a>10;
3276 commit;
3277
3278 Tests on T2 (Blobs)
3279 Test some basic NdbApi
3280 explain select * from test.t2 where t2.a=6;
3281 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
3282 1 SIMPLE t2 # eq_ref PRIMARY PRIMARY 4 const # # NULL
3283 Warnings:
3284 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` from `test`.`t2` where (`test`.`t2`.`a` = 6)
3285 Error insert to ensure that TC requests are purely local
3286
3287
3288 UI lookups
3289 explain select * from test.t2 where t2.b=6;
3290 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
3291 1 SIMPLE t2 # eq_ref b b 5 const # # NULL
3292 Warnings:
3293 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` from `test`.`t2` where (`test`.`t2`.`b` = 6)
3294 Error insert to ensure that TC requests are purely local
3295
3296
3297 OI scan
3298 explain select * from test.t2 where c > 6;
3299 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
3300 1 SIMPLE t2 # range c c 5 NULL # # Using pushed condition (`test`.`t2`.`c` > 6)
3301 Warnings:
3302 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` from `test`.`t2` where (`test`.`t2`.`c` > 6)
3303 Error insert to ensure that TC requests are purely local
3304
3305
3306 Table scan
3307 explain select * from test.t2;
3308 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
3309 1 SIMPLE t2 # ALL NULL NULL NULL NULL # # NULL
3310 Warnings:
3311 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` from `test`.`t2`
3312 Error insert to ensure that TC requests are purely local
3313
3314
3315 insert into hints values (1);
3316 Hint node by 1 of 4
3317 Tests on T1 (!Blobs)
3318 Test some basic NdbApi
3319 PK lookups
3320 explain select * from test.t1 where t1.a=6;
3321 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
3322 1 SIMPLE t1 # eq_ref PRIMARY,a PRIMARY 4 const # # NULL
3323 Warnings:
3324 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` from `test`.`t1` where (`test`.`t1`.`a` = 6)
3325 Error insert to ensure that TC requests are purely local
3326
3327
3328 UI lookups
3329 explain select * from test.t1 where t1.b=6;
3330 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
3331 1 SIMPLE t1 # eq_ref b b 5 const # # NULL
3332 Warnings:
3333 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` from `test`.`t1` where (`test`.`t1`.`b` = 6)
3334 Error insert to ensure that TC requests are purely local
3335
3336
3337 OI scan
3338 explain select * from test.t1 where c > 6;
3339 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
3340 1 SIMPLE t1 # range c c 5 NULL # # Using pushed condition (`test`.`t1`.`c` > 6); Using MRR
3341 Warnings:
3342 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` from `test`.`t1` where (`test`.`t1`.`c` > 6)
3343 Error insert to ensure that TC requests are purely local
3344
3345
3346 Table scan
3347 explain select * from test.t1;
3348 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
3349 1 SIMPLE t1 # ALL NULL NULL NULL NULL # # NULL
3350 Warnings:
3351 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` from `test`.`t1`
3352 Error insert to ensure that TC requests are purely local
3353
3354
3355 Test pushed queries (SPJ)
3356 Pushed pk->pk
3357 Lookup to get a.d, feeding pk lookup of b.a
3358 explain select a.a, a.d, b.d
3359 from
3360 test.t1 a
3361 join
3362 test.t1 b
3363 on
3364 a.d = b.a
3365 where a.a = 6;
3366 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
3367 1 SIMPLE a # eq_ref PRIMARY,a PRIMARY 4 const # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
3368 1 SIMPLE b # eq_ref PRIMARY,a PRIMARY 4 test.a.d # # Child of 'a' in pushed join@1
3369 Warnings:
3370 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`a` = `test`.`a`.`d`) and (`test`.`a`.`a` = 6))
3371 Error insert to ensure that SPJ requests are purely local
3372
3373
3374 Pushed uk->uk
3375 Lookup to get a.d, feeding uk lookup of b.b
3376 explain select a.a, a.d, b.d
3377 from
3378 test.t1 a
3379 join
3380 test.t1 b
3381 on
3382 a.d = b.b
3383 where a.b = 6;
3384 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
3385 1 SIMPLE a # eq_ref b b 5 const # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
3386 1 SIMPLE b # eq_ref b b 5 test.a.d # # Child of 'a' in pushed join@1
3387 Warnings:
3388 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`b` = `test`.`a`.`d`) and (`test`.`a`.`b` = 6))
3389 Error insert to ensure that SPJ requests are purely local
3390
3391
3392 Pushed uk->pk
3393 Lookup to get a.d, feeding pk lookup of b.a
3394 explain select a.a, a.d, b.d
3395 from
3396 test.t1 a
3397 join
3398 test.t1 b
3399 on
3400 a.d = b.a
3401 where a.b = 6;
3402 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
3403 1 SIMPLE a # eq_ref b b 5 const # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
3404 1 SIMPLE b # eq_ref PRIMARY,a PRIMARY 4 test.a.d # # Child of 'a' in pushed join@1
3405 Warnings:
3406 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`a` = `test`.`a`.`d`) and (`test`.`a`.`b` = 6))
3407 Error insert to ensure that SPJ requests are purely local
3408
3409
3410 Pushed pk->uk
3411 Lookup to get a.d, feeding uk lookup of b.b
3412 explain select a.a, a.d, b.d
3413 from
3414 test.t1 a
3415 join
3416 test.t1 b
3417 on
3418 a.d = b.b
3419 where a.a = 6;
3420 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
3421 1 SIMPLE a # eq_ref PRIMARY,a PRIMARY 4 const # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
3422 1 SIMPLE b # eq_ref b b 5 test.a.d # # Child of 'a' in pushed join@1
3423 Warnings:
3424 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`b` = `test`.`a`.`d`) and (`test`.`a`.`a` = 6))
3425 Error insert to ensure that SPJ requests are purely local
3426
3427
3428 Pushed scan originating sub-lookups
3429 Table scan to get a.d, feeding pk lookups of b.a
3430 explain select a.a, a.d, b.d
3431 from
3432 test.t1 a
3433 join
3434 test.t1 b
3435 on
3436 a.d = b.a;
3437 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
3438 1 SIMPLE a # ALL NULL NULL NULL NULL # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
3439 1 SIMPLE b # eq_ref PRIMARY,a PRIMARY 4 test.a.d # # Child of 'a' in pushed join@1
3440 Warnings:
3441 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where (`test`.`b`.`a` = `test`.`a`.`d`)
3442 Error insert to ensure that SPJ requests are purely local
3443
3444 begin;
3445 select * from hints where i = 1;
3446 select a.a, a.d, b.d
3447 from
3448 test.t1 a
3449 join
3450 test.t1 b
3451 on
3452 a.d = b.a;
3453 commit;
3454
3455 Pushed scan originating sub-lookups
3456 Table scan to get a.d, feeding uk lookups of b.b
3457 explain select a.a, a.d, b.d
3458 from
3459 test.t1 a
3460 join
3461 test.t1 b
3462 on
3463 a.d = b.b;
3464 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
3465 1 SIMPLE a # ALL NULL NULL NULL NULL # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
3466 1 SIMPLE b # eq_ref b b 5 test.a.d # # Child of 'a' in pushed join@1
3467 Warnings:
3468 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where (`test`.`b`.`b` = `test`.`a`.`d`)
3469 Error insert to ensure that SPJ requests are purely local
3470
3471 begin;
3472 select * from hints where i = 1;
3473 select a.a, a.d, b.d
3474 from
3475 test.t1 a
3476 join
3477 test.t1 b
3478 on
3479 a.d = b.b;
3480 commit;
3481
3482 Pushed scan originating sub-scans
3483 Range scan on a.a > 10 getting a.d, feeding range scans on b.c = a.d
3484 explain select a.a, a.d, b.d
3485 from
3486 test.t1 a
3487 join
3488 test.t1 b
3489 on
3490 b.c=a.d
3491 where
3492 a.a>10;
3493 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
3494 1 SIMPLE a # range PRIMARY,a PRIMARY 4 NULL # # Parent of 2 pushed join@1; Using pushed condition ((`test`.`a`.`a` > 10) and (`test`.`a`.`d` is not null)); Using MRR
3495 1 SIMPLE b # ref c c 5 test.a.d # # Child of 'a' in pushed join@1
3496 Warnings:
3497 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`c` = `test`.`a`.`d`) and (`test`.`a`.`a` > 10))
3498 Error insert to ensure that SPJ requests are purely local
3499
3500 begin;
3501 select * from hints where i = 1;
3502 select a.a, a.d, b.d
3503 from
3504 test.t1 a
3505 join
3506 test.t1 b
3507 on
3508 b.c=a.d
3509 where
3510 a.a>10;
3511 commit;
3512
3513 Tests on T2 (Blobs)
3514 Test some basic NdbApi
3515 explain select * from test.t2 where t2.a=6;
3516 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
3517 1 SIMPLE t2 # eq_ref PRIMARY PRIMARY 4 const # # NULL
3518 Warnings:
3519 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` from `test`.`t2` where (`test`.`t2`.`a` = 6)
3520 Error insert to ensure that TC requests are purely local
3521
3522
3523 UI lookups
3524 explain select * from test.t2 where t2.b=6;
3525 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
3526 1 SIMPLE t2 # eq_ref b b 5 const # # NULL
3527 Warnings:
3528 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` from `test`.`t2` where (`test`.`t2`.`b` = 6)
3529 Error insert to ensure that TC requests are purely local
3530
3531
3532 OI scan
3533 explain select * from test.t2 where c > 6;
3534 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
3535 1 SIMPLE t2 # range c c 5 NULL # # Using pushed condition (`test`.`t2`.`c` > 6)
3536 Warnings:
3537 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` from `test`.`t2` where (`test`.`t2`.`c` > 6)
3538 Error insert to ensure that TC requests are purely local
3539
3540
3541 Table scan
3542 explain select * from test.t2;
3543 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
3544 1 SIMPLE t2 # ALL NULL NULL NULL NULL # # NULL
3545 Warnings:
3546 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` from `test`.`t2`
3547 Error insert to ensure that TC requests are purely local
3548
3549
3550 drop table hints;
3551 delete from t1;
3552 delete from t2;
3553 Nodegroup 2 created
3554 alter table t1 algorithm=inplace, reorganize partition;
3555 alter table t2 algorithm=inplace, reorganize partition;
3556 select id into @t1_id from ndbinfo.ndb$dict_obj_info where fq_name = 'test/def/t1';
3557 select id into @t1ui_id from ndbinfo.ndb$dict_obj_info where parent_obj_id = @t1_id and type = 3;
3558 select id into @t2_id from ndbinfo.ndb$dict_obj_info where fq_name = 'test/def/t2';
3559 select id into @t2ui_id from ndbinfo.ndb$dict_obj_info where parent_obj_id = @t2_id and type = 3;
3560 select id into @t2bt_id from ndbinfo.ndb$dict_obj_info where parent_obj_id = @t2_id and fq_name like 'test/def/NDB$BLOB%';
3561 Put some data in.
3562 Make it more interesting for joining
3563 update test.t1 set c=c+1, d=d+1;
3564 select count(distinct node_id) into @nodes
3565 from ndbinfo.ndb$membership where group_id < 0xFFFFFF00;
3566 Check replicas
3567 select count(distinct node_id)
3568 from ndbinfo.operations_per_fragment
3569 where fq_name='test/def/t1'
3570 and fragment_num=0;
3571 count(distinct node_id)
3572 2
3573 Check nodes with table data
3574 select count(distinct node_id)
3575 from ndbinfo.operations_per_fragment
3576 where fq_name='test/def/t1';
3577 count(distinct node_id)
3578 6
3579 Check UI replicas
3580 select count(distinct node_id)
3581 from ndbinfo.operations_per_fragment
3582 where table_id = @t1ui_id
3583 and fragment_num=0;
3584 count(distinct node_id)
3585 2
3586 Check nodes with UI data
3587 select count(distinct node_id)
3588 from ndbinfo.operations_per_fragment
3589 where table_id = @t1ui_id;
3590 count(distinct node_id)
3591 6
3592 Put some data in.
3593 insert into test.t2 select a,b,c,repeat('BJC',300) from test.t1;
3594 Check blob table replicas
3595 select count(distinct node_id)
3596 from ndbinfo.operations_per_fragment
3597 where table_id = @t2bt_id
3598 and fragment_num=0;
3599 count(distinct node_id)
3600 2
3601 Check nodes with blob data
3602 select count(distinct node_id)
3603 from ndbinfo.operations_per_fragment
3604 where table_id = @t2bt_id;
3605 count(distinct node_id)
3606 6
3607 set @partitions = 'PARTITION p6 VALUES IN (6)';
3608 set @partitions = concat(@partitions,',PARTITION p5 VALUES IN (5)');
3609 set @partitions = concat(@partitions,',PARTITION p4 VALUES IN (4)');
3610 set @partitions = concat(@partitions,',PARTITION p3 VALUES IN (3)');
3611 set @partitions = concat(@partitions,',PARTITION p2 VALUES IN (2)');
3612 set @partitions = concat(@partitions,',PARTITION p1 VALUES IN (1)');
3613 set @@new = 1;
3614 Warnings:
3615 Warning 1287 '@@new' is deprecated and will be removed in a future release.
3616 create table hints (i int primary key) engine=ndb partition by list(i) (PARTITION p6 VALUES IN (6),PARTITION p5 VALUES IN (5),PARTITION p4 VALUES IN (4),PARTITION p3 VALUES IN (3),PARTITION p2 VALUES IN (2),PARTITION p1 VALUES IN (1));
3617 insert into hints values (6);
3618 Hint node by 6 of 6
3619 Tests on T1 (!Blobs)
3620 Test some basic NdbApi
3621 PK lookups
3622 explain select * from test.t1 where t1.a=6;
3623 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
3624 1 SIMPLE t1 # eq_ref PRIMARY,a PRIMARY 4 const # # NULL
3625 Warnings:
3626 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` from `test`.`t1` where (`test`.`t1`.`a` = 6)
3627 Error insert to ensure that TC requests are purely local
3628
3629
3630 UI lookups
3631 explain select * from test.t1 where t1.b=6;
3632 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
3633 1 SIMPLE t1 # eq_ref b b 5 const # # NULL
3634 Warnings:
3635 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` from `test`.`t1` where (`test`.`t1`.`b` = 6)
3636 Error insert to ensure that TC requests are purely local
3637
3638
3639 OI scan
3640 explain select * from test.t1 where c > 6;
3641 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
3642 1 SIMPLE t1 # range c c 5 NULL # # Using pushed condition (`test`.`t1`.`c` > 6); Using MRR
3643 Warnings:
3644 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` from `test`.`t1` where (`test`.`t1`.`c` > 6)
3645 Error insert to ensure that TC requests are purely local
3646
3647
3648 Table scan
3649 explain select * from test.t1;
3650 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
3651 1 SIMPLE t1 # ALL NULL NULL NULL NULL # # NULL
3652 Warnings:
3653 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` from `test`.`t1`
3654 Error insert to ensure that TC requests are purely local
3655
3656
3657 Test pushed queries (SPJ)
3658 Pushed pk->pk
3659 Lookup to get a.d, feeding pk lookup of b.a
3660 explain select a.a, a.d, b.d
3661 from
3662 test.t1 a
3663 join
3664 test.t1 b
3665 on
3666 a.d = b.a
3667 where a.a = 6;
3668 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
3669 1 SIMPLE a # eq_ref PRIMARY,a PRIMARY 4 const # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
3670 1 SIMPLE b # eq_ref PRIMARY,a PRIMARY 4 test.a.d # # Child of 'a' in pushed join@1
3671 Warnings:
3672 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`a` = `test`.`a`.`d`) and (`test`.`a`.`a` = 6))
3673 Error insert to ensure that SPJ requests are purely local
3674
3675
3676 Pushed uk->uk
3677 Lookup to get a.d, feeding uk lookup of b.b
3678 explain select a.a, a.d, b.d
3679 from
3680 test.t1 a
3681 join
3682 test.t1 b
3683 on
3684 a.d = b.b
3685 where a.b = 6;
3686 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
3687 1 SIMPLE a # eq_ref b b 5 const # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
3688 1 SIMPLE b # eq_ref b b 5 test.a.d # # Child of 'a' in pushed join@1
3689 Warnings:
3690 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`b` = `test`.`a`.`d`) and (`test`.`a`.`b` = 6))
3691 Error insert to ensure that SPJ requests are purely local
3692
3693
3694 Pushed uk->pk
3695 Lookup to get a.d, feeding pk lookup of b.a
3696 explain select a.a, a.d, b.d
3697 from
3698 test.t1 a
3699 join
3700 test.t1 b
3701 on
3702 a.d = b.a
3703 where a.b = 6;
3704 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
3705 1 SIMPLE a # eq_ref b b 5 const # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
3706 1 SIMPLE b # eq_ref PRIMARY,a PRIMARY 4 test.a.d # # Child of 'a' in pushed join@1
3707 Warnings:
3708 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`a` = `test`.`a`.`d`) and (`test`.`a`.`b` = 6))
3709 Error insert to ensure that SPJ requests are purely local
3710
3711
3712 Pushed pk->uk
3713 Lookup to get a.d, feeding uk lookup of b.b
3714 explain select a.a, a.d, b.d
3715 from
3716 test.t1 a
3717 join
3718 test.t1 b
3719 on
3720 a.d = b.b
3721 where a.a = 6;
3722 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
3723 1 SIMPLE a # eq_ref PRIMARY,a PRIMARY 4 const # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
3724 1 SIMPLE b # eq_ref b b 5 test.a.d # # Child of 'a' in pushed join@1
3725 Warnings:
3726 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`b` = `test`.`a`.`d`) and (`test`.`a`.`a` = 6))
3727 Error insert to ensure that SPJ requests are purely local
3728
3729
3730 Pushed scan originating sub-lookups
3731 Table scan to get a.d, feeding pk lookups of b.a
3732 explain select a.a, a.d, b.d
3733 from
3734 test.t1 a
3735 join
3736 test.t1 b
3737 on
3738 a.d = b.a;
3739 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
3740 1 SIMPLE a # ALL NULL NULL NULL NULL # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
3741 1 SIMPLE b # eq_ref PRIMARY,a PRIMARY 4 test.a.d # # Child of 'a' in pushed join@1
3742 Warnings:
3743 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where (`test`.`b`.`a` = `test`.`a`.`d`)
3744 Error insert to ensure that SPJ requests are purely local
3745
3746 begin;
3747 select * from hints where i = 6;
3748 select a.a, a.d, b.d
3749 from
3750 test.t1 a
3751 join
3752 test.t1 b
3753 on
3754 a.d = b.a;
3755 commit;
3756
3757 Pushed scan originating sub-lookups
3758 Table scan to get a.d, feeding uk lookups of b.b
3759 explain select a.a, a.d, b.d
3760 from
3761 test.t1 a
3762 join
3763 test.t1 b
3764 on
3765 a.d = b.b;
3766 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
3767 1 SIMPLE a # ALL NULL NULL NULL NULL # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
3768 1 SIMPLE b # eq_ref b b 5 test.a.d # # Child of 'a' in pushed join@1
3769 Warnings:
3770 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where (`test`.`b`.`b` = `test`.`a`.`d`)
3771 Error insert to ensure that SPJ requests are purely local
3772
3773 begin;
3774 select * from hints where i = 6;
3775 select a.a, a.d, b.d
3776 from
3777 test.t1 a
3778 join
3779 test.t1 b
3780 on
3781 a.d = b.b;
3782 commit;
3783
3784 Pushed scan originating sub-scans
3785 Range scan on a.a > 10 getting a.d, feeding range scans on b.c = a.d
3786 explain select a.a, a.d, b.d
3787 from
3788 test.t1 a
3789 join
3790 test.t1 b
3791 on
3792 b.c=a.d
3793 where
3794 a.a>10;
3795 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
3796 1 SIMPLE a # range PRIMARY,a PRIMARY 4 NULL # # Parent of 2 pushed join@1; Using pushed condition ((`test`.`a`.`a` > 10) and (`test`.`a`.`d` is not null)); Using MRR
3797 1 SIMPLE b # ref c c 5 test.a.d # # Child of 'a' in pushed join@1
3798 Warnings:
3799 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`c` = `test`.`a`.`d`) and (`test`.`a`.`a` > 10))
3800 Error insert to ensure that SPJ requests are purely local
3801
3802 begin;
3803 select * from hints where i = 6;
3804 select a.a, a.d, b.d
3805 from
3806 test.t1 a
3807 join
3808 test.t1 b
3809 on
3810 b.c=a.d
3811 where
3812 a.a>10;
3813 commit;
3814
3815 Tests on T2 (Blobs)
3816 Test some basic NdbApi
3817 explain select * from test.t2 where t2.a=6;
3818 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
3819 1 SIMPLE t2 # eq_ref PRIMARY PRIMARY 4 const # # NULL
3820 Warnings:
3821 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` from `test`.`t2` where (`test`.`t2`.`a` = 6)
3822 Error insert to ensure that TC requests are purely local
3823
3824
3825 UI lookups
3826 explain select * from test.t2 where t2.b=6;
3827 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
3828 1 SIMPLE t2 # eq_ref b b 5 const # # NULL
3829 Warnings:
3830 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` from `test`.`t2` where (`test`.`t2`.`b` = 6)
3831 Error insert to ensure that TC requests are purely local
3832
3833
3834 OI scan
3835 explain select * from test.t2 where c > 6;
3836 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
3837 1 SIMPLE t2 # range c c 5 NULL # # Using pushed condition (`test`.`t2`.`c` > 6)
3838 Warnings:
3839 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` from `test`.`t2` where (`test`.`t2`.`c` > 6)
3840 Error insert to ensure that TC requests are purely local
3841
3842
3843 Table scan
3844 explain select * from test.t2;
3845 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
3846 1 SIMPLE t2 # ALL NULL NULL NULL NULL # # NULL
3847 Warnings:
3848 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` from `test`.`t2`
3849 Error insert to ensure that TC requests are purely local
3850
3851
3852 insert into hints values (5);
3853 Hint node by 5 of 6
3854 Tests on T1 (!Blobs)
3855 Test some basic NdbApi
3856 PK lookups
3857 explain select * from test.t1 where t1.a=6;
3858 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
3859 1 SIMPLE t1 # eq_ref PRIMARY,a PRIMARY 4 const # # NULL
3860 Warnings:
3861 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` from `test`.`t1` where (`test`.`t1`.`a` = 6)
3862 Error insert to ensure that TC requests are purely local
3863
3864
3865 UI lookups
3866 explain select * from test.t1 where t1.b=6;
3867 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
3868 1 SIMPLE t1 # eq_ref b b 5 const # # NULL
3869 Warnings:
3870 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` from `test`.`t1` where (`test`.`t1`.`b` = 6)
3871 Error insert to ensure that TC requests are purely local
3872
3873
3874 OI scan
3875 explain select * from test.t1 where c > 6;
3876 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
3877 1 SIMPLE t1 # range c c 5 NULL # # Using pushed condition (`test`.`t1`.`c` > 6); Using MRR
3878 Warnings:
3879 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` from `test`.`t1` where (`test`.`t1`.`c` > 6)
3880 Error insert to ensure that TC requests are purely local
3881
3882
3883 Table scan
3884 explain select * from test.t1;
3885 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
3886 1 SIMPLE t1 # ALL NULL NULL NULL NULL # # NULL
3887 Warnings:
3888 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` from `test`.`t1`
3889 Error insert to ensure that TC requests are purely local
3890
3891
3892 Test pushed queries (SPJ)
3893 Pushed pk->pk
3894 Lookup to get a.d, feeding pk lookup of b.a
3895 explain select a.a, a.d, b.d
3896 from
3897 test.t1 a
3898 join
3899 test.t1 b
3900 on
3901 a.d = b.a
3902 where a.a = 6;
3903 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
3904 1 SIMPLE a # eq_ref PRIMARY,a PRIMARY 4 const # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
3905 1 SIMPLE b # eq_ref PRIMARY,a PRIMARY 4 test.a.d # # Child of 'a' in pushed join@1
3906 Warnings:
3907 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`a` = `test`.`a`.`d`) and (`test`.`a`.`a` = 6))
3908 Error insert to ensure that SPJ requests are purely local
3909
3910
3911 Pushed uk->uk
3912 Lookup to get a.d, feeding uk lookup of b.b
3913 explain select a.a, a.d, b.d
3914 from
3915 test.t1 a
3916 join
3917 test.t1 b
3918 on
3919 a.d = b.b
3920 where a.b = 6;
3921 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
3922 1 SIMPLE a # eq_ref b b 5 const # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
3923 1 SIMPLE b # eq_ref b b 5 test.a.d # # Child of 'a' in pushed join@1
3924 Warnings:
3925 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`b` = `test`.`a`.`d`) and (`test`.`a`.`b` = 6))
3926 Error insert to ensure that SPJ requests are purely local
3927
3928
3929 Pushed uk->pk
3930 Lookup to get a.d, feeding pk lookup of b.a
3931 explain select a.a, a.d, b.d
3932 from
3933 test.t1 a
3934 join
3935 test.t1 b
3936 on
3937 a.d = b.a
3938 where a.b = 6;
3939 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
3940 1 SIMPLE a # eq_ref b b 5 const # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
3941 1 SIMPLE b # eq_ref PRIMARY,a PRIMARY 4 test.a.d # # Child of 'a' in pushed join@1
3942 Warnings:
3943 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`a` = `test`.`a`.`d`) and (`test`.`a`.`b` = 6))
3944 Error insert to ensure that SPJ requests are purely local
3945
3946
3947 Pushed pk->uk
3948 Lookup to get a.d, feeding uk lookup of b.b
3949 explain select a.a, a.d, b.d
3950 from
3951 test.t1 a
3952 join
3953 test.t1 b
3954 on
3955 a.d = b.b
3956 where a.a = 6;
3957 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
3958 1 SIMPLE a # eq_ref PRIMARY,a PRIMARY 4 const # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
3959 1 SIMPLE b # eq_ref b b 5 test.a.d # # Child of 'a' in pushed join@1
3960 Warnings:
3961 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`b` = `test`.`a`.`d`) and (`test`.`a`.`a` = 6))
3962 Error insert to ensure that SPJ requests are purely local
3963
3964
3965 Pushed scan originating sub-lookups
3966 Table scan to get a.d, feeding pk lookups of b.a
3967 explain select a.a, a.d, b.d
3968 from
3969 test.t1 a
3970 join
3971 test.t1 b
3972 on
3973 a.d = b.a;
3974 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
3975 1 SIMPLE a # ALL NULL NULL NULL NULL # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
3976 1 SIMPLE b # eq_ref PRIMARY,a PRIMARY 4 test.a.d # # Child of 'a' in pushed join@1
3977 Warnings:
3978 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where (`test`.`b`.`a` = `test`.`a`.`d`)
3979 Error insert to ensure that SPJ requests are purely local
3980
3981 begin;
3982 select * from hints where i = 5;
3983 select a.a, a.d, b.d
3984 from
3985 test.t1 a
3986 join
3987 test.t1 b
3988 on
3989 a.d = b.a;
3990 commit;
3991
3992 Pushed scan originating sub-lookups
3993 Table scan to get a.d, feeding uk lookups of b.b
3994 explain select a.a, a.d, b.d
3995 from
3996 test.t1 a
3997 join
3998 test.t1 b
3999 on
4000 a.d = b.b;
4001 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
4002 1 SIMPLE a # ALL NULL NULL NULL NULL # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
4003 1 SIMPLE b # eq_ref b b 5 test.a.d # # Child of 'a' in pushed join@1
4004 Warnings:
4005 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where (`test`.`b`.`b` = `test`.`a`.`d`)
4006 Error insert to ensure that SPJ requests are purely local
4007
4008 begin;
4009 select * from hints where i = 5;
4010 select a.a, a.d, b.d
4011 from
4012 test.t1 a
4013 join
4014 test.t1 b
4015 on
4016 a.d = b.b;
4017 commit;
4018
4019 Pushed scan originating sub-scans
4020 Range scan on a.a > 10 getting a.d, feeding range scans on b.c = a.d
4021 explain select a.a, a.d, b.d
4022 from
4023 test.t1 a
4024 join
4025 test.t1 b
4026 on
4027 b.c=a.d
4028 where
4029 a.a>10;
4030 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
4031 1 SIMPLE a # range PRIMARY,a PRIMARY 4 NULL # # Parent of 2 pushed join@1; Using pushed condition ((`test`.`a`.`a` > 10) and (`test`.`a`.`d` is not null)); Using MRR
4032 1 SIMPLE b # ref c c 5 test.a.d # # Child of 'a' in pushed join@1
4033 Warnings:
4034 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`c` = `test`.`a`.`d`) and (`test`.`a`.`a` > 10))
4035 Error insert to ensure that SPJ requests are purely local
4036
4037 begin;
4038 select * from hints where i = 5;
4039 select a.a, a.d, b.d
4040 from
4041 test.t1 a
4042 join
4043 test.t1 b
4044 on
4045 b.c=a.d
4046 where
4047 a.a>10;
4048 commit;
4049
4050 Tests on T2 (Blobs)
4051 Test some basic NdbApi
4052 explain select * from test.t2 where t2.a=6;
4053 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
4054 1 SIMPLE t2 # eq_ref PRIMARY PRIMARY 4 const # # NULL
4055 Warnings:
4056 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` from `test`.`t2` where (`test`.`t2`.`a` = 6)
4057 Error insert to ensure that TC requests are purely local
4058
4059
4060 UI lookups
4061 explain select * from test.t2 where t2.b=6;
4062 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
4063 1 SIMPLE t2 # eq_ref b b 5 const # # NULL
4064 Warnings:
4065 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` from `test`.`t2` where (`test`.`t2`.`b` = 6)
4066 Error insert to ensure that TC requests are purely local
4067
4068
4069 OI scan
4070 explain select * from test.t2 where c > 6;
4071 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
4072 1 SIMPLE t2 # range c c 5 NULL # # Using pushed condition (`test`.`t2`.`c` > 6)
4073 Warnings:
4074 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` from `test`.`t2` where (`test`.`t2`.`c` > 6)
4075 Error insert to ensure that TC requests are purely local
4076
4077
4078 Table scan
4079 explain select * from test.t2;
4080 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
4081 1 SIMPLE t2 # ALL NULL NULL NULL NULL # # NULL
4082 Warnings:
4083 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` from `test`.`t2`
4084 Error insert to ensure that TC requests are purely local
4085
4086
4087 insert into hints values (4);
4088 Hint node by 4 of 6
4089 Tests on T1 (!Blobs)
4090 Test some basic NdbApi
4091 PK lookups
4092 explain select * from test.t1 where t1.a=6;
4093 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
4094 1 SIMPLE t1 # eq_ref PRIMARY,a PRIMARY 4 const # # NULL
4095 Warnings:
4096 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` from `test`.`t1` where (`test`.`t1`.`a` = 6)
4097 Error insert to ensure that TC requests are purely local
4098
4099
4100 UI lookups
4101 explain select * from test.t1 where t1.b=6;
4102 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
4103 1 SIMPLE t1 # eq_ref b b 5 const # # NULL
4104 Warnings:
4105 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` from `test`.`t1` where (`test`.`t1`.`b` = 6)
4106 Error insert to ensure that TC requests are purely local
4107
4108
4109 OI scan
4110 explain select * from test.t1 where c > 6;
4111 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
4112 1 SIMPLE t1 # range c c 5 NULL # # Using pushed condition (`test`.`t1`.`c` > 6); Using MRR
4113 Warnings:
4114 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` from `test`.`t1` where (`test`.`t1`.`c` > 6)
4115 Error insert to ensure that TC requests are purely local
4116
4117
4118 Table scan
4119 explain select * from test.t1;
4120 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
4121 1 SIMPLE t1 # ALL NULL NULL NULL NULL # # NULL
4122 Warnings:
4123 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` from `test`.`t1`
4124 Error insert to ensure that TC requests are purely local
4125
4126
4127 Test pushed queries (SPJ)
4128 Pushed pk->pk
4129 Lookup to get a.d, feeding pk lookup of b.a
4130 explain select a.a, a.d, b.d
4131 from
4132 test.t1 a
4133 join
4134 test.t1 b
4135 on
4136 a.d = b.a
4137 where a.a = 6;
4138 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
4139 1 SIMPLE a # eq_ref PRIMARY,a PRIMARY 4 const # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
4140 1 SIMPLE b # eq_ref PRIMARY,a PRIMARY 4 test.a.d # # Child of 'a' in pushed join@1
4141 Warnings:
4142 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`a` = `test`.`a`.`d`) and (`test`.`a`.`a` = 6))
4143 Error insert to ensure that SPJ requests are purely local
4144
4145
4146 Pushed uk->uk
4147 Lookup to get a.d, feeding uk lookup of b.b
4148 explain select a.a, a.d, b.d
4149 from
4150 test.t1 a
4151 join
4152 test.t1 b
4153 on
4154 a.d = b.b
4155 where a.b = 6;
4156 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
4157 1 SIMPLE a # eq_ref b b 5 const # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
4158 1 SIMPLE b # eq_ref b b 5 test.a.d # # Child of 'a' in pushed join@1
4159 Warnings:
4160 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`b` = `test`.`a`.`d`) and (`test`.`a`.`b` = 6))
4161 Error insert to ensure that SPJ requests are purely local
4162
4163
4164 Pushed uk->pk
4165 Lookup to get a.d, feeding pk lookup of b.a
4166 explain select a.a, a.d, b.d
4167 from
4168 test.t1 a
4169 join
4170 test.t1 b
4171 on
4172 a.d = b.a
4173 where a.b = 6;
4174 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
4175 1 SIMPLE a # eq_ref b b 5 const # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
4176 1 SIMPLE b # eq_ref PRIMARY,a PRIMARY 4 test.a.d # # Child of 'a' in pushed join@1
4177 Warnings:
4178 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`a` = `test`.`a`.`d`) and (`test`.`a`.`b` = 6))
4179 Error insert to ensure that SPJ requests are purely local
4180
4181
4182 Pushed pk->uk
4183 Lookup to get a.d, feeding uk lookup of b.b
4184 explain select a.a, a.d, b.d
4185 from
4186 test.t1 a
4187 join
4188 test.t1 b
4189 on
4190 a.d = b.b
4191 where a.a = 6;
4192 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
4193 1 SIMPLE a # eq_ref PRIMARY,a PRIMARY 4 const # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
4194 1 SIMPLE b # eq_ref b b 5 test.a.d # # Child of 'a' in pushed join@1
4195 Warnings:
4196 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`b` = `test`.`a`.`d`) and (`test`.`a`.`a` = 6))
4197 Error insert to ensure that SPJ requests are purely local
4198
4199
4200 Pushed scan originating sub-lookups
4201 Table scan to get a.d, feeding pk lookups of b.a
4202 explain select a.a, a.d, b.d
4203 from
4204 test.t1 a
4205 join
4206 test.t1 b
4207 on
4208 a.d = b.a;
4209 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
4210 1 SIMPLE a # ALL NULL NULL NULL NULL # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
4211 1 SIMPLE b # eq_ref PRIMARY,a PRIMARY 4 test.a.d # # Child of 'a' in pushed join@1
4212 Warnings:
4213 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where (`test`.`b`.`a` = `test`.`a`.`d`)
4214 Error insert to ensure that SPJ requests are purely local
4215
4216 begin;
4217 select * from hints where i = 4;
4218 select a.a, a.d, b.d
4219 from
4220 test.t1 a
4221 join
4222 test.t1 b
4223 on
4224 a.d = b.a;
4225 commit;
4226
4227 Pushed scan originating sub-lookups
4228 Table scan to get a.d, feeding uk lookups of b.b
4229 explain select a.a, a.d, b.d
4230 from
4231 test.t1 a
4232 join
4233 test.t1 b
4234 on
4235 a.d = b.b;
4236 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
4237 1 SIMPLE a # ALL NULL NULL NULL NULL # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
4238 1 SIMPLE b # eq_ref b b 5 test.a.d # # Child of 'a' in pushed join@1
4239 Warnings:
4240 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where (`test`.`b`.`b` = `test`.`a`.`d`)
4241 Error insert to ensure that SPJ requests are purely local
4242
4243 begin;
4244 select * from hints where i = 4;
4245 select a.a, a.d, b.d
4246 from
4247 test.t1 a
4248 join
4249 test.t1 b
4250 on
4251 a.d = b.b;
4252 commit;
4253
4254 Pushed scan originating sub-scans
4255 Range scan on a.a > 10 getting a.d, feeding range scans on b.c = a.d
4256 explain select a.a, a.d, b.d
4257 from
4258 test.t1 a
4259 join
4260 test.t1 b
4261 on
4262 b.c=a.d
4263 where
4264 a.a>10;
4265 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
4266 1 SIMPLE a # range PRIMARY,a PRIMARY 4 NULL # # Parent of 2 pushed join@1; Using pushed condition ((`test`.`a`.`a` > 10) and (`test`.`a`.`d` is not null)); Using MRR
4267 1 SIMPLE b # ref c c 5 test.a.d # # Child of 'a' in pushed join@1
4268 Warnings:
4269 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`c` = `test`.`a`.`d`) and (`test`.`a`.`a` > 10))
4270 Error insert to ensure that SPJ requests are purely local
4271
4272 begin;
4273 select * from hints where i = 4;
4274 select a.a, a.d, b.d
4275 from
4276 test.t1 a
4277 join
4278 test.t1 b
4279 on
4280 b.c=a.d
4281 where
4282 a.a>10;
4283 commit;
4284
4285 Tests on T2 (Blobs)
4286 Test some basic NdbApi
4287 explain select * from test.t2 where t2.a=6;
4288 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
4289 1 SIMPLE t2 # eq_ref PRIMARY PRIMARY 4 const # # NULL
4290 Warnings:
4291 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` from `test`.`t2` where (`test`.`t2`.`a` = 6)
4292 Error insert to ensure that TC requests are purely local
4293
4294
4295 UI lookups
4296 explain select * from test.t2 where t2.b=6;
4297 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
4298 1 SIMPLE t2 # eq_ref b b 5 const # # NULL
4299 Warnings:
4300 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` from `test`.`t2` where (`test`.`t2`.`b` = 6)
4301 Error insert to ensure that TC requests are purely local
4302
4303
4304 OI scan
4305 explain select * from test.t2 where c > 6;
4306 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
4307 1 SIMPLE t2 # range c c 5 NULL # # Using pushed condition (`test`.`t2`.`c` > 6)
4308 Warnings:
4309 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` from `test`.`t2` where (`test`.`t2`.`c` > 6)
4310 Error insert to ensure that TC requests are purely local
4311
4312
4313 Table scan
4314 explain select * from test.t2;
4315 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
4316 1 SIMPLE t2 # ALL NULL NULL NULL NULL # # NULL
4317 Warnings:
4318 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` from `test`.`t2`
4319 Error insert to ensure that TC requests are purely local
4320
4321
4322 insert into hints values (3);
4323 Hint node by 3 of 6
4324 Tests on T1 (!Blobs)
4325 Test some basic NdbApi
4326 PK lookups
4327 explain select * from test.t1 where t1.a=6;
4328 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
4329 1 SIMPLE t1 # eq_ref PRIMARY,a PRIMARY 4 const # # NULL
4330 Warnings:
4331 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` from `test`.`t1` where (`test`.`t1`.`a` = 6)
4332 Error insert to ensure that TC requests are purely local
4333
4334
4335 UI lookups
4336 explain select * from test.t1 where t1.b=6;
4337 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
4338 1 SIMPLE t1 # eq_ref b b 5 const # # NULL
4339 Warnings:
4340 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` from `test`.`t1` where (`test`.`t1`.`b` = 6)
4341 Error insert to ensure that TC requests are purely local
4342
4343
4344 OI scan
4345 explain select * from test.t1 where c > 6;
4346 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
4347 1 SIMPLE t1 # range c c 5 NULL # # Using pushed condition (`test`.`t1`.`c` > 6); Using MRR
4348 Warnings:
4349 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` from `test`.`t1` where (`test`.`t1`.`c` > 6)
4350 Error insert to ensure that TC requests are purely local
4351
4352
4353 Table scan
4354 explain select * from test.t1;
4355 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
4356 1 SIMPLE t1 # ALL NULL NULL NULL NULL # # NULL
4357 Warnings:
4358 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` from `test`.`t1`
4359 Error insert to ensure that TC requests are purely local
4360
4361
4362 Test pushed queries (SPJ)
4363 Pushed pk->pk
4364 Lookup to get a.d, feeding pk lookup of b.a
4365 explain select a.a, a.d, b.d
4366 from
4367 test.t1 a
4368 join
4369 test.t1 b
4370 on
4371 a.d = b.a
4372 where a.a = 6;
4373 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
4374 1 SIMPLE a # eq_ref PRIMARY,a PRIMARY 4 const # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
4375 1 SIMPLE b # eq_ref PRIMARY,a PRIMARY 4 test.a.d # # Child of 'a' in pushed join@1
4376 Warnings:
4377 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`a` = `test`.`a`.`d`) and (`test`.`a`.`a` = 6))
4378 Error insert to ensure that SPJ requests are purely local
4379
4380
4381 Pushed uk->uk
4382 Lookup to get a.d, feeding uk lookup of b.b
4383 explain select a.a, a.d, b.d
4384 from
4385 test.t1 a
4386 join
4387 test.t1 b
4388 on
4389 a.d = b.b
4390 where a.b = 6;
4391 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
4392 1 SIMPLE a # eq_ref b b 5 const # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
4393 1 SIMPLE b # eq_ref b b 5 test.a.d # # Child of 'a' in pushed join@1
4394 Warnings:
4395 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`b` = `test`.`a`.`d`) and (`test`.`a`.`b` = 6))
4396 Error insert to ensure that SPJ requests are purely local
4397
4398
4399 Pushed uk->pk
4400 Lookup to get a.d, feeding pk lookup of b.a
4401 explain select a.a, a.d, b.d
4402 from
4403 test.t1 a
4404 join
4405 test.t1 b
4406 on
4407 a.d = b.a
4408 where a.b = 6;
4409 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
4410 1 SIMPLE a # eq_ref b b 5 const # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
4411 1 SIMPLE b # eq_ref PRIMARY,a PRIMARY 4 test.a.d # # Child of 'a' in pushed join@1
4412 Warnings:
4413 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`a` = `test`.`a`.`d`) and (`test`.`a`.`b` = 6))
4414 Error insert to ensure that SPJ requests are purely local
4415
4416
4417 Pushed pk->uk
4418 Lookup to get a.d, feeding uk lookup of b.b
4419 explain select a.a, a.d, b.d
4420 from
4421 test.t1 a
4422 join
4423 test.t1 b
4424 on
4425 a.d = b.b
4426 where a.a = 6;
4427 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
4428 1 SIMPLE a # eq_ref PRIMARY,a PRIMARY 4 const # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
4429 1 SIMPLE b # eq_ref b b 5 test.a.d # # Child of 'a' in pushed join@1
4430 Warnings:
4431 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`b` = `test`.`a`.`d`) and (`test`.`a`.`a` = 6))
4432 Error insert to ensure that SPJ requests are purely local
4433
4434
4435 Pushed scan originating sub-lookups
4436 Table scan to get a.d, feeding pk lookups of b.a
4437 explain select a.a, a.d, b.d
4438 from
4439 test.t1 a
4440 join
4441 test.t1 b
4442 on
4443 a.d = b.a;
4444 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
4445 1 SIMPLE a # ALL NULL NULL NULL NULL # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
4446 1 SIMPLE b # eq_ref PRIMARY,a PRIMARY 4 test.a.d # # Child of 'a' in pushed join@1
4447 Warnings:
4448 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where (`test`.`b`.`a` = `test`.`a`.`d`)
4449 Error insert to ensure that SPJ requests are purely local
4450
4451 begin;
4452 select * from hints where i = 3;
4453 select a.a, a.d, b.d
4454 from
4455 test.t1 a
4456 join
4457 test.t1 b
4458 on
4459 a.d = b.a;
4460 commit;
4461
4462 Pushed scan originating sub-lookups
4463 Table scan to get a.d, feeding uk lookups of b.b
4464 explain select a.a, a.d, b.d
4465 from
4466 test.t1 a
4467 join
4468 test.t1 b
4469 on
4470 a.d = b.b;
4471 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
4472 1 SIMPLE a # ALL NULL NULL NULL NULL # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
4473 1 SIMPLE b # eq_ref b b 5 test.a.d # # Child of 'a' in pushed join@1
4474 Warnings:
4475 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where (`test`.`b`.`b` = `test`.`a`.`d`)
4476 Error insert to ensure that SPJ requests are purely local
4477
4478 begin;
4479 select * from hints where i = 3;
4480 select a.a, a.d, b.d
4481 from
4482 test.t1 a
4483 join
4484 test.t1 b
4485 on
4486 a.d = b.b;
4487 commit;
4488
4489 Pushed scan originating sub-scans
4490 Range scan on a.a > 10 getting a.d, feeding range scans on b.c = a.d
4491 explain select a.a, a.d, b.d
4492 from
4493 test.t1 a
4494 join
4495 test.t1 b
4496 on
4497 b.c=a.d
4498 where
4499 a.a>10;
4500 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
4501 1 SIMPLE a # range PRIMARY,a PRIMARY 4 NULL # # Parent of 2 pushed join@1; Using pushed condition ((`test`.`a`.`a` > 10) and (`test`.`a`.`d` is not null)); Using MRR
4502 1 SIMPLE b # ref c c 5 test.a.d # # Child of 'a' in pushed join@1
4503 Warnings:
4504 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`c` = `test`.`a`.`d`) and (`test`.`a`.`a` > 10))
4505 Error insert to ensure that SPJ requests are purely local
4506
4507 begin;
4508 select * from hints where i = 3;
4509 select a.a, a.d, b.d
4510 from
4511 test.t1 a
4512 join
4513 test.t1 b
4514 on
4515 b.c=a.d
4516 where
4517 a.a>10;
4518 commit;
4519
4520 Tests on T2 (Blobs)
4521 Test some basic NdbApi
4522 explain select * from test.t2 where t2.a=6;
4523 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
4524 1 SIMPLE t2 # eq_ref PRIMARY PRIMARY 4 const # # NULL
4525 Warnings:
4526 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` from `test`.`t2` where (`test`.`t2`.`a` = 6)
4527 Error insert to ensure that TC requests are purely local
4528
4529
4530 UI lookups
4531 explain select * from test.t2 where t2.b=6;
4532 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
4533 1 SIMPLE t2 # eq_ref b b 5 const # # NULL
4534 Warnings:
4535 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` from `test`.`t2` where (`test`.`t2`.`b` = 6)
4536 Error insert to ensure that TC requests are purely local
4537
4538
4539 OI scan
4540 explain select * from test.t2 where c > 6;
4541 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
4542 1 SIMPLE t2 # range c c 5 NULL # # Using pushed condition (`test`.`t2`.`c` > 6)
4543 Warnings:
4544 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` from `test`.`t2` where (`test`.`t2`.`c` > 6)
4545 Error insert to ensure that TC requests are purely local
4546
4547
4548 Table scan
4549 explain select * from test.t2;
4550 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
4551 1 SIMPLE t2 # ALL NULL NULL NULL NULL # # NULL
4552 Warnings:
4553 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` from `test`.`t2`
4554 Error insert to ensure that TC requests are purely local
4555
4556
4557 insert into hints values (2);
4558 Hint node by 2 of 6
4559 Tests on T1 (!Blobs)
4560 Test some basic NdbApi
4561 PK lookups
4562 explain select * from test.t1 where t1.a=6;
4563 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
4564 1 SIMPLE t1 # eq_ref PRIMARY,a PRIMARY 4 const # # NULL
4565 Warnings:
4566 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` from `test`.`t1` where (`test`.`t1`.`a` = 6)
4567 Error insert to ensure that TC requests are purely local
4568
4569
4570 UI lookups
4571 explain select * from test.t1 where t1.b=6;
4572 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
4573 1 SIMPLE t1 # eq_ref b b 5 const # # NULL
4574 Warnings:
4575 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` from `test`.`t1` where (`test`.`t1`.`b` = 6)
4576 Error insert to ensure that TC requests are purely local
4577
4578
4579 OI scan
4580 explain select * from test.t1 where c > 6;
4581 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
4582 1 SIMPLE t1 # range c c 5 NULL # # Using pushed condition (`test`.`t1`.`c` > 6); Using MRR
4583 Warnings:
4584 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` from `test`.`t1` where (`test`.`t1`.`c` > 6)
4585 Error insert to ensure that TC requests are purely local
4586
4587
4588 Table scan
4589 explain select * from test.t1;
4590 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
4591 1 SIMPLE t1 # ALL NULL NULL NULL NULL # # NULL
4592 Warnings:
4593 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` from `test`.`t1`
4594 Error insert to ensure that TC requests are purely local
4595
4596
4597 Test pushed queries (SPJ)
4598 Pushed pk->pk
4599 Lookup to get a.d, feeding pk lookup of b.a
4600 explain select a.a, a.d, b.d
4601 from
4602 test.t1 a
4603 join
4604 test.t1 b
4605 on
4606 a.d = b.a
4607 where a.a = 6;
4608 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
4609 1 SIMPLE a # eq_ref PRIMARY,a PRIMARY 4 const # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
4610 1 SIMPLE b # eq_ref PRIMARY,a PRIMARY 4 test.a.d # # Child of 'a' in pushed join@1
4611 Warnings:
4612 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`a` = `test`.`a`.`d`) and (`test`.`a`.`a` = 6))
4613 Error insert to ensure that SPJ requests are purely local
4614
4615
4616 Pushed uk->uk
4617 Lookup to get a.d, feeding uk lookup of b.b
4618 explain select a.a, a.d, b.d
4619 from
4620 test.t1 a
4621 join
4622 test.t1 b
4623 on
4624 a.d = b.b
4625 where a.b = 6;
4626 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
4627 1 SIMPLE a # eq_ref b b 5 const # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
4628 1 SIMPLE b # eq_ref b b 5 test.a.d # # Child of 'a' in pushed join@1
4629 Warnings:
4630 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`b` = `test`.`a`.`d`) and (`test`.`a`.`b` = 6))
4631 Error insert to ensure that SPJ requests are purely local
4632
4633
4634 Pushed uk->pk
4635 Lookup to get a.d, feeding pk lookup of b.a
4636 explain select a.a, a.d, b.d
4637 from
4638 test.t1 a
4639 join
4640 test.t1 b
4641 on
4642 a.d = b.a
4643 where a.b = 6;
4644 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
4645 1 SIMPLE a # eq_ref b b 5 const # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
4646 1 SIMPLE b # eq_ref PRIMARY,a PRIMARY 4 test.a.d # # Child of 'a' in pushed join@1
4647 Warnings:
4648 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`a` = `test`.`a`.`d`) and (`test`.`a`.`b` = 6))
4649 Error insert to ensure that SPJ requests are purely local
4650
4651
4652 Pushed pk->uk
4653 Lookup to get a.d, feeding uk lookup of b.b
4654 explain select a.a, a.d, b.d
4655 from
4656 test.t1 a
4657 join
4658 test.t1 b
4659 on
4660 a.d = b.b
4661 where a.a = 6;
4662 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
4663 1 SIMPLE a # eq_ref PRIMARY,a PRIMARY 4 const # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
4664 1 SIMPLE b # eq_ref b b 5 test.a.d # # Child of 'a' in pushed join@1
4665 Warnings:
4666 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`b` = `test`.`a`.`d`) and (`test`.`a`.`a` = 6))
4667 Error insert to ensure that SPJ requests are purely local
4668
4669
4670 Pushed scan originating sub-lookups
4671 Table scan to get a.d, feeding pk lookups of b.a
4672 explain select a.a, a.d, b.d
4673 from
4674 test.t1 a
4675 join
4676 test.t1 b
4677 on
4678 a.d = b.a;
4679 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
4680 1 SIMPLE a # ALL NULL NULL NULL NULL # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
4681 1 SIMPLE b # eq_ref PRIMARY,a PRIMARY 4 test.a.d # # Child of 'a' in pushed join@1
4682 Warnings:
4683 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where (`test`.`b`.`a` = `test`.`a`.`d`)
4684 Error insert to ensure that SPJ requests are purely local
4685
4686 begin;
4687 select * from hints where i = 2;
4688 select a.a, a.d, b.d
4689 from
4690 test.t1 a
4691 join
4692 test.t1 b
4693 on
4694 a.d = b.a;
4695 commit;
4696
4697 Pushed scan originating sub-lookups
4698 Table scan to get a.d, feeding uk lookups of b.b
4699 explain select a.a, a.d, b.d
4700 from
4701 test.t1 a
4702 join
4703 test.t1 b
4704 on
4705 a.d = b.b;
4706 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
4707 1 SIMPLE a # ALL NULL NULL NULL NULL # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
4708 1 SIMPLE b # eq_ref b b 5 test.a.d # # Child of 'a' in pushed join@1
4709 Warnings:
4710 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where (`test`.`b`.`b` = `test`.`a`.`d`)
4711 Error insert to ensure that SPJ requests are purely local
4712
4713 begin;
4714 select * from hints where i = 2;
4715 select a.a, a.d, b.d
4716 from
4717 test.t1 a
4718 join
4719 test.t1 b
4720 on
4721 a.d = b.b;
4722 commit;
4723
4724 Pushed scan originating sub-scans
4725 Range scan on a.a > 10 getting a.d, feeding range scans on b.c = a.d
4726 explain select a.a, a.d, b.d
4727 from
4728 test.t1 a
4729 join
4730 test.t1 b
4731 on
4732 b.c=a.d
4733 where
4734 a.a>10;
4735 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
4736 1 SIMPLE a # range PRIMARY,a PRIMARY 4 NULL # # Parent of 2 pushed join@1; Using pushed condition ((`test`.`a`.`a` > 10) and (`test`.`a`.`d` is not null)); Using MRR
4737 1 SIMPLE b # ref c c 5 test.a.d # # Child of 'a' in pushed join@1
4738 Warnings:
4739 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`c` = `test`.`a`.`d`) and (`test`.`a`.`a` > 10))
4740 Error insert to ensure that SPJ requests are purely local
4741
4742 begin;
4743 select * from hints where i = 2;
4744 select a.a, a.d, b.d
4745 from
4746 test.t1 a
4747 join
4748 test.t1 b
4749 on
4750 b.c=a.d
4751 where
4752 a.a>10;
4753 commit;
4754
4755 Tests on T2 (Blobs)
4756 Test some basic NdbApi
4757 explain select * from test.t2 where t2.a=6;
4758 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
4759 1 SIMPLE t2 # eq_ref PRIMARY PRIMARY 4 const # # NULL
4760 Warnings:
4761 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` from `test`.`t2` where (`test`.`t2`.`a` = 6)
4762 Error insert to ensure that TC requests are purely local
4763
4764
4765 UI lookups
4766 explain select * from test.t2 where t2.b=6;
4767 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
4768 1 SIMPLE t2 # eq_ref b b 5 const # # NULL
4769 Warnings:
4770 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` from `test`.`t2` where (`test`.`t2`.`b` = 6)
4771 Error insert to ensure that TC requests are purely local
4772
4773
4774 OI scan
4775 explain select * from test.t2 where c > 6;
4776 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
4777 1 SIMPLE t2 # range c c 5 NULL # # Using pushed condition (`test`.`t2`.`c` > 6)
4778 Warnings:
4779 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` from `test`.`t2` where (`test`.`t2`.`c` > 6)
4780 Error insert to ensure that TC requests are purely local
4781
4782
4783 Table scan
4784 explain select * from test.t2;
4785 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
4786 1 SIMPLE t2 # ALL NULL NULL NULL NULL # # NULL
4787 Warnings:
4788 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` from `test`.`t2`
4789 Error insert to ensure that TC requests are purely local
4790
4791
4792 insert into hints values (1);
4793 Hint node by 1 of 6
4794 Tests on T1 (!Blobs)
4795 Test some basic NdbApi
4796 PK lookups
4797 explain select * from test.t1 where t1.a=6;
4798 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
4799 1 SIMPLE t1 # eq_ref PRIMARY,a PRIMARY 4 const # # NULL
4800 Warnings:
4801 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` from `test`.`t1` where (`test`.`t1`.`a` = 6)
4802 Error insert to ensure that TC requests are purely local
4803
4804
4805 UI lookups
4806 explain select * from test.t1 where t1.b=6;
4807 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
4808 1 SIMPLE t1 # eq_ref b b 5 const # # NULL
4809 Warnings:
4810 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` from `test`.`t1` where (`test`.`t1`.`b` = 6)
4811 Error insert to ensure that TC requests are purely local
4812
4813
4814 OI scan
4815 explain select * from test.t1 where c > 6;
4816 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
4817 1 SIMPLE t1 # range c c 5 NULL # # Using pushed condition (`test`.`t1`.`c` > 6); Using MRR
4818 Warnings:
4819 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` from `test`.`t1` where (`test`.`t1`.`c` > 6)
4820 Error insert to ensure that TC requests are purely local
4821
4822
4823 Table scan
4824 explain select * from test.t1;
4825 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
4826 1 SIMPLE t1 # ALL NULL NULL NULL NULL # # NULL
4827 Warnings:
4828 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` from `test`.`t1`
4829 Error insert to ensure that TC requests are purely local
4830
4831
4832 Test pushed queries (SPJ)
4833 Pushed pk->pk
4834 Lookup to get a.d, feeding pk lookup of b.a
4835 explain select a.a, a.d, b.d
4836 from
4837 test.t1 a
4838 join
4839 test.t1 b
4840 on
4841 a.d = b.a
4842 where a.a = 6;
4843 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
4844 1 SIMPLE a # eq_ref PRIMARY,a PRIMARY 4 const # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
4845 1 SIMPLE b # eq_ref PRIMARY,a PRIMARY 4 test.a.d # # Child of 'a' in pushed join@1
4846 Warnings:
4847 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`a` = `test`.`a`.`d`) and (`test`.`a`.`a` = 6))
4848 Error insert to ensure that SPJ requests are purely local
4849
4850
4851 Pushed uk->uk
4852 Lookup to get a.d, feeding uk lookup of b.b
4853 explain select a.a, a.d, b.d
4854 from
4855 test.t1 a
4856 join
4857 test.t1 b
4858 on
4859 a.d = b.b
4860 where a.b = 6;
4861 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
4862 1 SIMPLE a # eq_ref b b 5 const # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
4863 1 SIMPLE b # eq_ref b b 5 test.a.d # # Child of 'a' in pushed join@1
4864 Warnings:
4865 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`b` = `test`.`a`.`d`) and (`test`.`a`.`b` = 6))
4866 Error insert to ensure that SPJ requests are purely local
4867
4868
4869 Pushed uk->pk
4870 Lookup to get a.d, feeding pk lookup of b.a
4871 explain select a.a, a.d, b.d
4872 from
4873 test.t1 a
4874 join
4875 test.t1 b
4876 on
4877 a.d = b.a
4878 where a.b = 6;
4879 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
4880 1 SIMPLE a # eq_ref b b 5 const # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
4881 1 SIMPLE b # eq_ref PRIMARY,a PRIMARY 4 test.a.d # # Child of 'a' in pushed join@1
4882 Warnings:
4883 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`a` = `test`.`a`.`d`) and (`test`.`a`.`b` = 6))
4884 Error insert to ensure that SPJ requests are purely local
4885
4886
4887 Pushed pk->uk
4888 Lookup to get a.d, feeding uk lookup of b.b
4889 explain select a.a, a.d, b.d
4890 from
4891 test.t1 a
4892 join
4893 test.t1 b
4894 on
4895 a.d = b.b
4896 where a.a = 6;
4897 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
4898 1 SIMPLE a # eq_ref PRIMARY,a PRIMARY 4 const # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
4899 1 SIMPLE b # eq_ref b b 5 test.a.d # # Child of 'a' in pushed join@1
4900 Warnings:
4901 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`b` = `test`.`a`.`d`) and (`test`.`a`.`a` = 6))
4902 Error insert to ensure that SPJ requests are purely local
4903
4904
4905 Pushed scan originating sub-lookups
4906 Table scan to get a.d, feeding pk lookups of b.a
4907 explain select a.a, a.d, b.d
4908 from
4909 test.t1 a
4910 join
4911 test.t1 b
4912 on
4913 a.d = b.a;
4914 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
4915 1 SIMPLE a # ALL NULL NULL NULL NULL # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
4916 1 SIMPLE b # eq_ref PRIMARY,a PRIMARY 4 test.a.d # # Child of 'a' in pushed join@1
4917 Warnings:
4918 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where (`test`.`b`.`a` = `test`.`a`.`d`)
4919 Error insert to ensure that SPJ requests are purely local
4920
4921 begin;
4922 select * from hints where i = 1;
4923 select a.a, a.d, b.d
4924 from
4925 test.t1 a
4926 join
4927 test.t1 b
4928 on
4929 a.d = b.a;
4930 commit;
4931
4932 Pushed scan originating sub-lookups
4933 Table scan to get a.d, feeding uk lookups of b.b
4934 explain select a.a, a.d, b.d
4935 from
4936 test.t1 a
4937 join
4938 test.t1 b
4939 on
4940 a.d = b.b;
4941 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
4942 1 SIMPLE a # ALL NULL NULL NULL NULL # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
4943 1 SIMPLE b # eq_ref b b 5 test.a.d # # Child of 'a' in pushed join@1
4944 Warnings:
4945 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where (`test`.`b`.`b` = `test`.`a`.`d`)
4946 Error insert to ensure that SPJ requests are purely local
4947
4948 begin;
4949 select * from hints where i = 1;
4950 select a.a, a.d, b.d
4951 from
4952 test.t1 a
4953 join
4954 test.t1 b
4955 on
4956 a.d = b.b;
4957 commit;
4958
4959 Pushed scan originating sub-scans
4960 Range scan on a.a > 10 getting a.d, feeding range scans on b.c = a.d
4961 explain select a.a, a.d, b.d
4962 from
4963 test.t1 a
4964 join
4965 test.t1 b
4966 on
4967 b.c=a.d
4968 where
4969 a.a>10;
4970 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
4971 1 SIMPLE a # range PRIMARY,a PRIMARY 4 NULL # # Parent of 2 pushed join@1; Using pushed condition ((`test`.`a`.`a` > 10) and (`test`.`a`.`d` is not null)); Using MRR
4972 1 SIMPLE b # ref c c 5 test.a.d # # Child of 'a' in pushed join@1
4973 Warnings:
4974 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`c` = `test`.`a`.`d`) and (`test`.`a`.`a` > 10))
4975 Error insert to ensure that SPJ requests are purely local
4976
4977 begin;
4978 select * from hints where i = 1;
4979 select a.a, a.d, b.d
4980 from
4981 test.t1 a
4982 join
4983 test.t1 b
4984 on
4985 b.c=a.d
4986 where
4987 a.a>10;
4988 commit;
4989
4990 Tests on T2 (Blobs)
4991 Test some basic NdbApi
4992 explain select * from test.t2 where t2.a=6;
4993 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
4994 1 SIMPLE t2 # eq_ref PRIMARY PRIMARY 4 const # # NULL
4995 Warnings:
4996 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` from `test`.`t2` where (`test`.`t2`.`a` = 6)
4997 Error insert to ensure that TC requests are purely local
4998
4999
5000 UI lookups
5001 explain select * from test.t2 where t2.b=6;
5002 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
5003 1 SIMPLE t2 # eq_ref b b 5 const # # NULL
5004 Warnings:
5005 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` from `test`.`t2` where (`test`.`t2`.`b` = 6)
5006 Error insert to ensure that TC requests are purely local
5007
5008
5009 OI scan
5010 explain select * from test.t2 where c > 6;
5011 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
5012 1 SIMPLE t2 # range c c 5 NULL # # Using pushed condition (`test`.`t2`.`c` > 6)
5013 Warnings:
5014 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` from `test`.`t2` where (`test`.`t2`.`c` > 6)
5015 Error insert to ensure that TC requests are purely local
5016
5017
5018 Table scan
5019 explain select * from test.t2;
5020 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
5021 1 SIMPLE t2 # ALL NULL NULL NULL NULL # # NULL
5022 Warnings:
5023 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` from `test`.`t2`
5024 Error insert to ensure that TC requests are purely local
5025
5026
5027 drop table hints;
5028 delete from t1;
5029 delete from t2;
5030 drop table test.t1;
5031 drop table test.t2;
5032 Drop Node Group 2 done
5033 Drop Node Group 1 done
5034 Test read-locality of FULLY-REPLICATED with FOR_RA_BY_NODE
5035 create table test.t1 (a int primary key,
5036 b int,
5037 c int,
5038 d int,
5039 unique(b) using hash,
5040 key(c),
5041 key(a,c))
5042 comment="NDB_TABLE=FULLY_REPLICATED=1,PARTITION_BALANCE=FOR_RA_BY_NODE"
5043 engine=ndb;
5044 Warnings:
5045 Warning 1121 Ndb does not support unique index on NULL valued attributes, index access with NULL value will become full table scan
5046 create table test.t2 (a int primary key,
5047 b int,
5048 c int,
5049 d text,
5050 unique(b) using hash,
5051 key(c))
5052 comment="NDB_TABLE=FULLY_REPLICATED=1,PARTITION_BALANCE=FOR_RA_BY_NODE"
5053 engine=ndb;
5054 Warnings:
5055 Warning 1121 Ndb does not support unique index on NULL valued attributes, index access with NULL value will become full table scan
5056 select id into @t1_id from ndbinfo.ndb$dict_obj_info where fq_name = 'test/def/t1';
5057 select id into @t1ui_id from ndbinfo.ndb$dict_obj_info where parent_obj_id = @t1_id and type = 3;
5058 select id into @t2_id from ndbinfo.ndb$dict_obj_info where fq_name = 'test/def/t2';
5059 select id into @t2ui_id from ndbinfo.ndb$dict_obj_info where parent_obj_id = @t2_id and type = 3;
5060 select id into @t2bt_id from ndbinfo.ndb$dict_obj_info where parent_obj_id = @t2_id and fq_name like 'test/def/NDB$BLOB%';
5061 Put some data in.
5062 Make it more interesting for joining
5063 update test.t1 set c=c+1, d=d+1;
5064 select count(distinct node_id) into @nodes
5065 from ndbinfo.ndb$membership where group_id < 0xFFFFFF00;
5066 Check replicas
5067 select count(distinct node_id)
5068 from ndbinfo.operations_per_fragment
5069 where fq_name='test/def/t1'
5070 and fragment_num=0;
5071 count(distinct node_id)
5072 2
5073 Check nodes with table data
5074 select count(distinct node_id)
5075 from ndbinfo.operations_per_fragment
5076 where fq_name='test/def/t1';
5077 count(distinct node_id)
5078 2
5079 Check UI replicas
5080 select count(distinct node_id)
5081 from ndbinfo.operations_per_fragment
5082 where table_id = @t1ui_id
5083 and fragment_num=0;
5084 count(distinct node_id)
5085 2
5086 Check nodes with UI data
5087 select count(distinct node_id)
5088 from ndbinfo.operations_per_fragment
5089 where table_id = @t1ui_id;
5090 count(distinct node_id)
5091 2
5092 Put some data in.
5093 insert into test.t2 select a,b,c,repeat('BJC',300) from test.t1;
5094 Check blob table replicas
5095 select count(distinct node_id)
5096 from ndbinfo.operations_per_fragment
5097 where table_id = @t2bt_id
5098 and fragment_num=0;
5099 count(distinct node_id)
5100 2
5101 Check nodes with blob data
5102 select count(distinct node_id)
5103 from ndbinfo.operations_per_fragment
5104 where table_id = @t2bt_id;
5105 count(distinct node_id)
5106 2
5107 set @partitions = 'PARTITION p2 VALUES IN (2)';
5108 set @partitions = concat(@partitions,',PARTITION p1 VALUES IN (1)');
5109 set @@new = 1;
5110 Warnings:
5111 Warning 1287 '@@new' is deprecated and will be removed in a future release.
5112 create table hints (i int primary key) engine=ndb partition by list(i) (PARTITION p2 VALUES IN (2),PARTITION p1 VALUES IN (1));
5113 insert into hints values (2);
5114 Hint node by 2 of 2
5115 Tests on T1 (!Blobs)
5116 Test some basic NdbApi
5117 PK lookups
5118 explain select * from test.t1 where t1.a=6;
5119 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
5120 1 SIMPLE t1 # eq_ref PRIMARY,a PRIMARY 4 const # # NULL
5121 Warnings:
5122 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` from `test`.`t1` where (`test`.`t1`.`a` = 6)
5123 Error insert to ensure that TC requests are purely local
5124
5125
5126 UI lookups
5127 explain select * from test.t1 where t1.b=6;
5128 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
5129 1 SIMPLE t1 # eq_ref b b 5 const # # NULL
5130 Warnings:
5131 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` from `test`.`t1` where (`test`.`t1`.`b` = 6)
5132 Error insert to ensure that TC requests are purely local
5133
5134
5135 OI scan
5136 explain select * from test.t1 where c > 6;
5137 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
5138 1 SIMPLE t1 # range c c 5 NULL # # Using pushed condition (`test`.`t1`.`c` > 6); Using MRR
5139 Warnings:
5140 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` from `test`.`t1` where (`test`.`t1`.`c` > 6)
5141 Error insert to ensure that TC requests are purely local
5142
5143
5144 Table scan
5145 explain select * from test.t1;
5146 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
5147 1 SIMPLE t1 # ALL NULL NULL NULL NULL # # NULL
5148 Warnings:
5149 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` from `test`.`t1`
5150 Error insert to ensure that TC requests are purely local
5151
5152
5153 Test pushed queries (SPJ)
5154 Pushed pk->pk
5155 Lookup to get a.d, feeding pk lookup of b.a
5156 explain select a.a, a.d, b.d
5157 from
5158 test.t1 a
5159 join
5160 test.t1 b
5161 on
5162 a.d = b.a
5163 where a.a = 6;
5164 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
5165 1 SIMPLE a # eq_ref PRIMARY,a PRIMARY 4 const # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
5166 1 SIMPLE b # eq_ref PRIMARY,a PRIMARY 4 test.a.d # # Child of 'a' in pushed join@1
5167 Warnings:
5168 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`a` = `test`.`a`.`d`) and (`test`.`a`.`a` = 6))
5169 Error insert to ensure that SPJ requests are purely local
5170
5171
5172 Pushed uk->uk
5173 Lookup to get a.d, feeding uk lookup of b.b
5174 explain select a.a, a.d, b.d
5175 from
5176 test.t1 a
5177 join
5178 test.t1 b
5179 on
5180 a.d = b.b
5181 where a.b = 6;
5182 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
5183 1 SIMPLE a # eq_ref b b 5 const # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
5184 1 SIMPLE b # eq_ref b b 5 test.a.d # # Child of 'a' in pushed join@1
5185 Warnings:
5186 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`b` = `test`.`a`.`d`) and (`test`.`a`.`b` = 6))
5187 Error insert to ensure that SPJ requests are purely local
5188
5189
5190 Pushed uk->pk
5191 Lookup to get a.d, feeding pk lookup of b.a
5192 explain select a.a, a.d, b.d
5193 from
5194 test.t1 a
5195 join
5196 test.t1 b
5197 on
5198 a.d = b.a
5199 where a.b = 6;
5200 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
5201 1 SIMPLE a # eq_ref b b 5 const # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
5202 1 SIMPLE b # eq_ref PRIMARY,a PRIMARY 4 test.a.d # # Child of 'a' in pushed join@1
5203 Warnings:
5204 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`a` = `test`.`a`.`d`) and (`test`.`a`.`b` = 6))
5205 Error insert to ensure that SPJ requests are purely local
5206
5207
5208 Pushed pk->uk
5209 Lookup to get a.d, feeding uk lookup of b.b
5210 explain select a.a, a.d, b.d
5211 from
5212 test.t1 a
5213 join
5214 test.t1 b
5215 on
5216 a.d = b.b
5217 where a.a = 6;
5218 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
5219 1 SIMPLE a # eq_ref PRIMARY,a PRIMARY 4 const # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
5220 1 SIMPLE b # eq_ref b b 5 test.a.d # # Child of 'a' in pushed join@1
5221 Warnings:
5222 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`b` = `test`.`a`.`d`) and (`test`.`a`.`a` = 6))
5223 Error insert to ensure that SPJ requests are purely local
5224
5225
5226 Pushed scan originating sub-lookups
5227 Table scan to get a.d, feeding pk lookups of b.a
5228 explain select a.a, a.d, b.d
5229 from
5230 test.t1 a
5231 join
5232 test.t1 b
5233 on
5234 a.d = b.a;
5235 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
5236 1 SIMPLE a # ALL NULL NULL NULL NULL # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
5237 1 SIMPLE b # eq_ref PRIMARY,a PRIMARY 4 test.a.d # # Child of 'a' in pushed join@1
5238 Warnings:
5239 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where (`test`.`b`.`a` = `test`.`a`.`d`)
5240 Error insert to ensure that SPJ requests are purely local
5241
5242 begin;
5243 select * from hints where i = 2;
5244 select a.a, a.d, b.d
5245 from
5246 test.t1 a
5247 join
5248 test.t1 b
5249 on
5250 a.d = b.a;
5251 commit;
5252
5253 Pushed scan originating sub-lookups
5254 Table scan to get a.d, feeding uk lookups of b.b
5255 explain select a.a, a.d, b.d
5256 from
5257 test.t1 a
5258 join
5259 test.t1 b
5260 on
5261 a.d = b.b;
5262 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
5263 1 SIMPLE a # ALL NULL NULL NULL NULL # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
5264 1 SIMPLE b # eq_ref b b 5 test.a.d # # Child of 'a' in pushed join@1
5265 Warnings:
5266 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where (`test`.`b`.`b` = `test`.`a`.`d`)
5267 Error insert to ensure that SPJ requests are purely local
5268
5269 begin;
5270 select * from hints where i = 2;
5271 select a.a, a.d, b.d
5272 from
5273 test.t1 a
5274 join
5275 test.t1 b
5276 on
5277 a.d = b.b;
5278 commit;
5279
5280 Pushed scan originating sub-scans
5281 Range scan on a.a > 10 getting a.d, feeding range scans on b.c = a.d
5282 explain select a.a, a.d, b.d
5283 from
5284 test.t1 a
5285 join
5286 test.t1 b
5287 on
5288 b.c=a.d
5289 where
5290 a.a>10;
5291 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
5292 1 SIMPLE a # range PRIMARY,a PRIMARY 4 NULL # # Parent of 2 pushed join@1; Using pushed condition ((`test`.`a`.`a` > 10) and (`test`.`a`.`d` is not null)); Using MRR
5293 1 SIMPLE b # ref c c 5 test.a.d # # Child of 'a' in pushed join@1
5294 Warnings:
5295 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`c` = `test`.`a`.`d`) and (`test`.`a`.`a` > 10))
5296 Error insert to ensure that SPJ requests are purely local
5297
5298 begin;
5299 select * from hints where i = 2;
5300 select a.a, a.d, b.d
5301 from
5302 test.t1 a
5303 join
5304 test.t1 b
5305 on
5306 b.c=a.d
5307 where
5308 a.a>10;
5309 commit;
5310
5311 Tests on T2 (Blobs)
5312 Test some basic NdbApi
5313 explain select * from test.t2 where t2.a=6;
5314 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
5315 1 SIMPLE t2 # eq_ref PRIMARY PRIMARY 4 const # # NULL
5316 Warnings:
5317 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` from `test`.`t2` where (`test`.`t2`.`a` = 6)
5318 Error insert to ensure that TC requests are purely local
5319
5320
5321 UI lookups
5322 explain select * from test.t2 where t2.b=6;
5323 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
5324 1 SIMPLE t2 # eq_ref b b 5 const # # NULL
5325 Warnings:
5326 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` from `test`.`t2` where (`test`.`t2`.`b` = 6)
5327 Error insert to ensure that TC requests are purely local
5328
5329
5330 OI scan
5331 explain select * from test.t2 where c > 6;
5332 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
5333 1 SIMPLE t2 # range c c 5 NULL # # Using pushed condition (`test`.`t2`.`c` > 6)
5334 Warnings:
5335 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` from `test`.`t2` where (`test`.`t2`.`c` > 6)
5336 Error insert to ensure that TC requests are purely local
5337
5338
5339 Table scan
5340 explain select * from test.t2;
5341 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
5342 1 SIMPLE t2 # ALL NULL NULL NULL NULL # # NULL
5343 Warnings:
5344 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` from `test`.`t2`
5345 Error insert to ensure that TC requests are purely local
5346
5347
5348 insert into hints values (1);
5349 Hint node by 1 of 2
5350 Tests on T1 (!Blobs)
5351 Test some basic NdbApi
5352 PK lookups
5353 explain select * from test.t1 where t1.a=6;
5354 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
5355 1 SIMPLE t1 # eq_ref PRIMARY,a PRIMARY 4 const # # NULL
5356 Warnings:
5357 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` from `test`.`t1` where (`test`.`t1`.`a` = 6)
5358 Error insert to ensure that TC requests are purely local
5359
5360
5361 UI lookups
5362 explain select * from test.t1 where t1.b=6;
5363 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
5364 1 SIMPLE t1 # eq_ref b b 5 const # # NULL
5365 Warnings:
5366 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` from `test`.`t1` where (`test`.`t1`.`b` = 6)
5367 Error insert to ensure that TC requests are purely local
5368
5369
5370 OI scan
5371 explain select * from test.t1 where c > 6;
5372 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
5373 1 SIMPLE t1 # range c c 5 NULL # # Using pushed condition (`test`.`t1`.`c` > 6); Using MRR
5374 Warnings:
5375 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` from `test`.`t1` where (`test`.`t1`.`c` > 6)
5376 Error insert to ensure that TC requests are purely local
5377
5378
5379 Table scan
5380 explain select * from test.t1;
5381 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
5382 1 SIMPLE t1 # ALL NULL NULL NULL NULL # # NULL
5383 Warnings:
5384 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` from `test`.`t1`
5385 Error insert to ensure that TC requests are purely local
5386
5387
5388 Test pushed queries (SPJ)
5389 Pushed pk->pk
5390 Lookup to get a.d, feeding pk lookup of b.a
5391 explain select a.a, a.d, b.d
5392 from
5393 test.t1 a
5394 join
5395 test.t1 b
5396 on
5397 a.d = b.a
5398 where a.a = 6;
5399 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
5400 1 SIMPLE a # eq_ref PRIMARY,a PRIMARY 4 const # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
5401 1 SIMPLE b # eq_ref PRIMARY,a PRIMARY 4 test.a.d # # Child of 'a' in pushed join@1
5402 Warnings:
5403 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`a` = `test`.`a`.`d`) and (`test`.`a`.`a` = 6))
5404 Error insert to ensure that SPJ requests are purely local
5405
5406
5407 Pushed uk->uk
5408 Lookup to get a.d, feeding uk lookup of b.b
5409 explain select a.a, a.d, b.d
5410 from
5411 test.t1 a
5412 join
5413 test.t1 b
5414 on
5415 a.d = b.b
5416 where a.b = 6;
5417 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
5418 1 SIMPLE a # eq_ref b b 5 const # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
5419 1 SIMPLE b # eq_ref b b 5 test.a.d # # Child of 'a' in pushed join@1
5420 Warnings:
5421 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`b` = `test`.`a`.`d`) and (`test`.`a`.`b` = 6))
5422 Error insert to ensure that SPJ requests are purely local
5423
5424
5425 Pushed uk->pk
5426 Lookup to get a.d, feeding pk lookup of b.a
5427 explain select a.a, a.d, b.d
5428 from
5429 test.t1 a
5430 join
5431 test.t1 b
5432 on
5433 a.d = b.a
5434 where a.b = 6;
5435 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
5436 1 SIMPLE a # eq_ref b b 5 const # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
5437 1 SIMPLE b # eq_ref PRIMARY,a PRIMARY 4 test.a.d # # Child of 'a' in pushed join@1
5438 Warnings:
5439 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`a` = `test`.`a`.`d`) and (`test`.`a`.`b` = 6))
5440 Error insert to ensure that SPJ requests are purely local
5441
5442
5443 Pushed pk->uk
5444 Lookup to get a.d, feeding uk lookup of b.b
5445 explain select a.a, a.d, b.d
5446 from
5447 test.t1 a
5448 join
5449 test.t1 b
5450 on
5451 a.d = b.b
5452 where a.a = 6;
5453 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
5454 1 SIMPLE a # eq_ref PRIMARY,a PRIMARY 4 const # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
5455 1 SIMPLE b # eq_ref b b 5 test.a.d # # Child of 'a' in pushed join@1
5456 Warnings:
5457 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`b` = `test`.`a`.`d`) and (`test`.`a`.`a` = 6))
5458 Error insert to ensure that SPJ requests are purely local
5459
5460
5461 Pushed scan originating sub-lookups
5462 Table scan to get a.d, feeding pk lookups of b.a
5463 explain select a.a, a.d, b.d
5464 from
5465 test.t1 a
5466 join
5467 test.t1 b
5468 on
5469 a.d = b.a;
5470 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
5471 1 SIMPLE a # ALL NULL NULL NULL NULL # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
5472 1 SIMPLE b # eq_ref PRIMARY,a PRIMARY 4 test.a.d # # Child of 'a' in pushed join@1
5473 Warnings:
5474 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where (`test`.`b`.`a` = `test`.`a`.`d`)
5475 Error insert to ensure that SPJ requests are purely local
5476
5477 begin;
5478 select * from hints where i = 1;
5479 select a.a, a.d, b.d
5480 from
5481 test.t1 a
5482 join
5483 test.t1 b
5484 on
5485 a.d = b.a;
5486 commit;
5487
5488 Pushed scan originating sub-lookups
5489 Table scan to get a.d, feeding uk lookups of b.b
5490 explain select a.a, a.d, b.d
5491 from
5492 test.t1 a
5493 join
5494 test.t1 b
5495 on
5496 a.d = b.b;
5497 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
5498 1 SIMPLE a # ALL NULL NULL NULL NULL # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
5499 1 SIMPLE b # eq_ref b b 5 test.a.d # # Child of 'a' in pushed join@1
5500 Warnings:
5501 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where (`test`.`b`.`b` = `test`.`a`.`d`)
5502 Error insert to ensure that SPJ requests are purely local
5503
5504 begin;
5505 select * from hints where i = 1;
5506 select a.a, a.d, b.d
5507 from
5508 test.t1 a
5509 join
5510 test.t1 b
5511 on
5512 a.d = b.b;
5513 commit;
5514
5515 Pushed scan originating sub-scans
5516 Range scan on a.a > 10 getting a.d, feeding range scans on b.c = a.d
5517 explain select a.a, a.d, b.d
5518 from
5519 test.t1 a
5520 join
5521 test.t1 b
5522 on
5523 b.c=a.d
5524 where
5525 a.a>10;
5526 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
5527 1 SIMPLE a # range PRIMARY,a PRIMARY 4 NULL # # Parent of 2 pushed join@1; Using pushed condition ((`test`.`a`.`a` > 10) and (`test`.`a`.`d` is not null)); Using MRR
5528 1 SIMPLE b # ref c c 5 test.a.d # # Child of 'a' in pushed join@1
5529 Warnings:
5530 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`c` = `test`.`a`.`d`) and (`test`.`a`.`a` > 10))
5531 Error insert to ensure that SPJ requests are purely local
5532
5533 begin;
5534 select * from hints where i = 1;
5535 select a.a, a.d, b.d
5536 from
5537 test.t1 a
5538 join
5539 test.t1 b
5540 on
5541 b.c=a.d
5542 where
5543 a.a>10;
5544 commit;
5545
5546 Tests on T2 (Blobs)
5547 Test some basic NdbApi
5548 explain select * from test.t2 where t2.a=6;
5549 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
5550 1 SIMPLE t2 # eq_ref PRIMARY PRIMARY 4 const # # NULL
5551 Warnings:
5552 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` from `test`.`t2` where (`test`.`t2`.`a` = 6)
5553 Error insert to ensure that TC requests are purely local
5554
5555
5556 UI lookups
5557 explain select * from test.t2 where t2.b=6;
5558 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
5559 1 SIMPLE t2 # eq_ref b b 5 const # # NULL
5560 Warnings:
5561 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` from `test`.`t2` where (`test`.`t2`.`b` = 6)
5562 Error insert to ensure that TC requests are purely local
5563
5564
5565 OI scan
5566 explain select * from test.t2 where c > 6;
5567 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
5568 1 SIMPLE t2 # range c c 5 NULL # # Using pushed condition (`test`.`t2`.`c` > 6)
5569 Warnings:
5570 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` from `test`.`t2` where (`test`.`t2`.`c` > 6)
5571 Error insert to ensure that TC requests are purely local
5572
5573
5574 Table scan
5575 explain select * from test.t2;
5576 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
5577 1 SIMPLE t2 # ALL NULL NULL NULL NULL # # NULL
5578 Warnings:
5579 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` from `test`.`t2`
5580 Error insert to ensure that TC requests are purely local
5581
5582
5583 drop table hints;
5584 delete from t1;
5585 delete from t2;
5586 Nodegroup 1 created
5587 alter table t1 algorithm=inplace, reorganize partition;
5588 alter table t2 algorithm=inplace, reorganize partition;
5589 select id into @t1_id from ndbinfo.ndb$dict_obj_info where fq_name = 'test/def/t1';
5590 select id into @t1ui_id from ndbinfo.ndb$dict_obj_info where parent_obj_id = @t1_id and type = 3;
5591 select id into @t2_id from ndbinfo.ndb$dict_obj_info where fq_name = 'test/def/t2';
5592 select id into @t2ui_id from ndbinfo.ndb$dict_obj_info where parent_obj_id = @t2_id and type = 3;
5593 select id into @t2bt_id from ndbinfo.ndb$dict_obj_info where parent_obj_id = @t2_id and fq_name like 'test/def/NDB$BLOB%';
5594 Put some data in.
5595 Make it more interesting for joining
5596 update test.t1 set c=c+1, d=d+1;
5597 select count(distinct node_id) into @nodes
5598 from ndbinfo.ndb$membership where group_id < 0xFFFFFF00;
5599 Check replicas
5600 select count(distinct node_id)
5601 from ndbinfo.operations_per_fragment
5602 where fq_name='test/def/t1'
5603 and fragment_num=0;
5604 count(distinct node_id)
5605 2
5606 Check nodes with table data
5607 select count(distinct node_id)
5608 from ndbinfo.operations_per_fragment
5609 where fq_name='test/def/t1';
5610 count(distinct node_id)
5611 4
5612 Check UI replicas
5613 select count(distinct node_id)
5614 from ndbinfo.operations_per_fragment
5615 where table_id = @t1ui_id
5616 and fragment_num=0;
5617 count(distinct node_id)
5618 2
5619 Check nodes with UI data
5620 select count(distinct node_id)
5621 from ndbinfo.operations_per_fragment
5622 where table_id = @t1ui_id;
5623 count(distinct node_id)
5624 4
5625 Put some data in.
5626 insert into test.t2 select a,b,c,repeat('BJC',300) from test.t1;
5627 Check blob table replicas
5628 select count(distinct node_id)
5629 from ndbinfo.operations_per_fragment
5630 where table_id = @t2bt_id
5631 and fragment_num=0;
5632 count(distinct node_id)
5633 2
5634 Check nodes with blob data
5635 select count(distinct node_id)
5636 from ndbinfo.operations_per_fragment
5637 where table_id = @t2bt_id;
5638 count(distinct node_id)
5639 4
5640 set @partitions = 'PARTITION p4 VALUES IN (4)';
5641 set @partitions = concat(@partitions,',PARTITION p3 VALUES IN (3)');
5642 set @partitions = concat(@partitions,',PARTITION p2 VALUES IN (2)');
5643 set @partitions = concat(@partitions,',PARTITION p1 VALUES IN (1)');
5644 set @@new = 1;
5645 Warnings:
5646 Warning 1287 '@@new' is deprecated and will be removed in a future release.
5647 create table hints (i int primary key) engine=ndb partition by list(i) (PARTITION p4 VALUES IN (4),PARTITION p3 VALUES IN (3),PARTITION p2 VALUES IN (2),PARTITION p1 VALUES IN (1));
5648 insert into hints values (4);
5649 Hint node by 4 of 4
5650 Tests on T1 (!Blobs)
5651 Test some basic NdbApi
5652 PK lookups
5653 explain select * from test.t1 where t1.a=6;
5654 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
5655 1 SIMPLE t1 # eq_ref PRIMARY,a PRIMARY 4 const # # NULL
5656 Warnings:
5657 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` from `test`.`t1` where (`test`.`t1`.`a` = 6)
5658 Error insert to ensure that TC requests are purely local
5659
5660
5661 UI lookups
5662 explain select * from test.t1 where t1.b=6;
5663 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
5664 1 SIMPLE t1 # eq_ref b b 5 const # # NULL
5665 Warnings:
5666 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` from `test`.`t1` where (`test`.`t1`.`b` = 6)
5667 Error insert to ensure that TC requests are purely local
5668
5669
5670 OI scan
5671 explain select * from test.t1 where c > 6;
5672 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
5673 1 SIMPLE t1 # range c c 5 NULL # # Using pushed condition (`test`.`t1`.`c` > 6); Using MRR
5674 Warnings:
5675 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` from `test`.`t1` where (`test`.`t1`.`c` > 6)
5676 Error insert to ensure that TC requests are purely local
5677
5678
5679 Table scan
5680 explain select * from test.t1;
5681 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
5682 1 SIMPLE t1 # ALL NULL NULL NULL NULL # # NULL
5683 Warnings:
5684 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` from `test`.`t1`
5685 Error insert to ensure that TC requests are purely local
5686
5687
5688 Test pushed queries (SPJ)
5689 Pushed pk->pk
5690 Lookup to get a.d, feeding pk lookup of b.a
5691 explain select a.a, a.d, b.d
5692 from
5693 test.t1 a
5694 join
5695 test.t1 b
5696 on
5697 a.d = b.a
5698 where a.a = 6;
5699 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
5700 1 SIMPLE a # eq_ref PRIMARY,a PRIMARY 4 const # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
5701 1 SIMPLE b # eq_ref PRIMARY,a PRIMARY 4 test.a.d # # Child of 'a' in pushed join@1
5702 Warnings:
5703 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`a` = `test`.`a`.`d`) and (`test`.`a`.`a` = 6))
5704 Error insert to ensure that SPJ requests are purely local
5705
5706
5707 Pushed uk->uk
5708 Lookup to get a.d, feeding uk lookup of b.b
5709 explain select a.a, a.d, b.d
5710 from
5711 test.t1 a
5712 join
5713 test.t1 b
5714 on
5715 a.d = b.b
5716 where a.b = 6;
5717 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
5718 1 SIMPLE a # eq_ref b b 5 const # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
5719 1 SIMPLE b # eq_ref b b 5 test.a.d # # Child of 'a' in pushed join@1
5720 Warnings:
5721 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`b` = `test`.`a`.`d`) and (`test`.`a`.`b` = 6))
5722 Error insert to ensure that SPJ requests are purely local
5723
5724
5725 Pushed uk->pk
5726 Lookup to get a.d, feeding pk lookup of b.a
5727 explain select a.a, a.d, b.d
5728 from
5729 test.t1 a
5730 join
5731 test.t1 b
5732 on
5733 a.d = b.a
5734 where a.b = 6;
5735 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
5736 1 SIMPLE a # eq_ref b b 5 const # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
5737 1 SIMPLE b # eq_ref PRIMARY,a PRIMARY 4 test.a.d # # Child of 'a' in pushed join@1
5738 Warnings:
5739 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`a` = `test`.`a`.`d`) and (`test`.`a`.`b` = 6))
5740 Error insert to ensure that SPJ requests are purely local
5741
5742
5743 Pushed pk->uk
5744 Lookup to get a.d, feeding uk lookup of b.b
5745 explain select a.a, a.d, b.d
5746 from
5747 test.t1 a
5748 join
5749 test.t1 b
5750 on
5751 a.d = b.b
5752 where a.a = 6;
5753 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
5754 1 SIMPLE a # eq_ref PRIMARY,a PRIMARY 4 const # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
5755 1 SIMPLE b # eq_ref b b 5 test.a.d # # Child of 'a' in pushed join@1
5756 Warnings:
5757 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`b` = `test`.`a`.`d`) and (`test`.`a`.`a` = 6))
5758 Error insert to ensure that SPJ requests are purely local
5759
5760
5761 Pushed scan originating sub-lookups
5762 Table scan to get a.d, feeding pk lookups of b.a
5763 explain select a.a, a.d, b.d
5764 from
5765 test.t1 a
5766 join
5767 test.t1 b
5768 on
5769 a.d = b.a;
5770 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
5771 1 SIMPLE a # ALL NULL NULL NULL NULL # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
5772 1 SIMPLE b # eq_ref PRIMARY,a PRIMARY 4 test.a.d # # Child of 'a' in pushed join@1
5773 Warnings:
5774 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where (`test`.`b`.`a` = `test`.`a`.`d`)
5775 Error insert to ensure that SPJ requests are purely local
5776
5777 begin;
5778 select * from hints where i = 4;
5779 select a.a, a.d, b.d
5780 from
5781 test.t1 a
5782 join
5783 test.t1 b
5784 on
5785 a.d = b.a;
5786 commit;
5787
5788 Pushed scan originating sub-lookups
5789 Table scan to get a.d, feeding uk lookups of b.b
5790 explain select a.a, a.d, b.d
5791 from
5792 test.t1 a
5793 join
5794 test.t1 b
5795 on
5796 a.d = b.b;
5797 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
5798 1 SIMPLE a # ALL NULL NULL NULL NULL # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
5799 1 SIMPLE b # eq_ref b b 5 test.a.d # # Child of 'a' in pushed join@1
5800 Warnings:
5801 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where (`test`.`b`.`b` = `test`.`a`.`d`)
5802 Error insert to ensure that SPJ requests are purely local
5803
5804 begin;
5805 select * from hints where i = 4;
5806 select a.a, a.d, b.d
5807 from
5808 test.t1 a
5809 join
5810 test.t1 b
5811 on
5812 a.d = b.b;
5813 commit;
5814
5815 Pushed scan originating sub-scans
5816 Range scan on a.a > 10 getting a.d, feeding range scans on b.c = a.d
5817 explain select a.a, a.d, b.d
5818 from
5819 test.t1 a
5820 join
5821 test.t1 b
5822 on
5823 b.c=a.d
5824 where
5825 a.a>10;
5826 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
5827 1 SIMPLE a # range PRIMARY,a PRIMARY 4 NULL # # Parent of 2 pushed join@1; Using pushed condition ((`test`.`a`.`a` > 10) and (`test`.`a`.`d` is not null)); Using MRR
5828 1 SIMPLE b # ref c c 5 test.a.d # # Child of 'a' in pushed join@1
5829 Warnings:
5830 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`c` = `test`.`a`.`d`) and (`test`.`a`.`a` > 10))
5831 Error insert to ensure that SPJ requests are purely local
5832
5833 begin;
5834 select * from hints where i = 4;
5835 select a.a, a.d, b.d
5836 from
5837 test.t1 a
5838 join
5839 test.t1 b
5840 on
5841 b.c=a.d
5842 where
5843 a.a>10;
5844 commit;
5845
5846 Tests on T2 (Blobs)
5847 Test some basic NdbApi
5848 explain select * from test.t2 where t2.a=6;
5849 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
5850 1 SIMPLE t2 # eq_ref PRIMARY PRIMARY 4 const # # NULL
5851 Warnings:
5852 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` from `test`.`t2` where (`test`.`t2`.`a` = 6)
5853 Error insert to ensure that TC requests are purely local
5854
5855
5856 UI lookups
5857 explain select * from test.t2 where t2.b=6;
5858 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
5859 1 SIMPLE t2 # eq_ref b b 5 const # # NULL
5860 Warnings:
5861 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` from `test`.`t2` where (`test`.`t2`.`b` = 6)
5862 Error insert to ensure that TC requests are purely local
5863
5864
5865 OI scan
5866 explain select * from test.t2 where c > 6;
5867 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
5868 1 SIMPLE t2 # range c c 5 NULL # # Using pushed condition (`test`.`t2`.`c` > 6)
5869 Warnings:
5870 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` from `test`.`t2` where (`test`.`t2`.`c` > 6)
5871 Error insert to ensure that TC requests are purely local
5872
5873
5874 Table scan
5875 explain select * from test.t2;
5876 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
5877 1 SIMPLE t2 # ALL NULL NULL NULL NULL # # NULL
5878 Warnings:
5879 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` from `test`.`t2`
5880 Error insert to ensure that TC requests are purely local
5881
5882
5883 insert into hints values (3);
5884 Hint node by 3 of 4
5885 Tests on T1 (!Blobs)
5886 Test some basic NdbApi
5887 PK lookups
5888 explain select * from test.t1 where t1.a=6;
5889 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
5890 1 SIMPLE t1 # eq_ref PRIMARY,a PRIMARY 4 const # # NULL
5891 Warnings:
5892 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` from `test`.`t1` where (`test`.`t1`.`a` = 6)
5893 Error insert to ensure that TC requests are purely local
5894
5895
5896 UI lookups
5897 explain select * from test.t1 where t1.b=6;
5898 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
5899 1 SIMPLE t1 # eq_ref b b 5 const # # NULL
5900 Warnings:
5901 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` from `test`.`t1` where (`test`.`t1`.`b` = 6)
5902 Error insert to ensure that TC requests are purely local
5903
5904
5905 OI scan
5906 explain select * from test.t1 where c > 6;
5907 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
5908 1 SIMPLE t1 # range c c 5 NULL # # Using pushed condition (`test`.`t1`.`c` > 6); Using MRR
5909 Warnings:
5910 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` from `test`.`t1` where (`test`.`t1`.`c` > 6)
5911 Error insert to ensure that TC requests are purely local
5912
5913
5914 Table scan
5915 explain select * from test.t1;
5916 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
5917 1 SIMPLE t1 # ALL NULL NULL NULL NULL # # NULL
5918 Warnings:
5919 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` from `test`.`t1`
5920 Error insert to ensure that TC requests are purely local
5921
5922
5923 Test pushed queries (SPJ)
5924 Pushed pk->pk
5925 Lookup to get a.d, feeding pk lookup of b.a
5926 explain select a.a, a.d, b.d
5927 from
5928 test.t1 a
5929 join
5930 test.t1 b
5931 on
5932 a.d = b.a
5933 where a.a = 6;
5934 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
5935 1 SIMPLE a # eq_ref PRIMARY,a PRIMARY 4 const # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
5936 1 SIMPLE b # eq_ref PRIMARY,a PRIMARY 4 test.a.d # # Child of 'a' in pushed join@1
5937 Warnings:
5938 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`a` = `test`.`a`.`d`) and (`test`.`a`.`a` = 6))
5939 Error insert to ensure that SPJ requests are purely local
5940
5941
5942 Pushed uk->uk
5943 Lookup to get a.d, feeding uk lookup of b.b
5944 explain select a.a, a.d, b.d
5945 from
5946 test.t1 a
5947 join
5948 test.t1 b
5949 on
5950 a.d = b.b
5951 where a.b = 6;
5952 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
5953 1 SIMPLE a # eq_ref b b 5 const # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
5954 1 SIMPLE b # eq_ref b b 5 test.a.d # # Child of 'a' in pushed join@1
5955 Warnings:
5956 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`b` = `test`.`a`.`d`) and (`test`.`a`.`b` = 6))
5957 Error insert to ensure that SPJ requests are purely local
5958
5959
5960 Pushed uk->pk
5961 Lookup to get a.d, feeding pk lookup of b.a
5962 explain select a.a, a.d, b.d
5963 from
5964 test.t1 a
5965 join
5966 test.t1 b
5967 on
5968 a.d = b.a
5969 where a.b = 6;
5970 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
5971 1 SIMPLE a # eq_ref b b 5 const # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
5972 1 SIMPLE b # eq_ref PRIMARY,a PRIMARY 4 test.a.d # # Child of 'a' in pushed join@1
5973 Warnings:
5974 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`a` = `test`.`a`.`d`) and (`test`.`a`.`b` = 6))
5975 Error insert to ensure that SPJ requests are purely local
5976
5977
5978 Pushed pk->uk
5979 Lookup to get a.d, feeding uk lookup of b.b
5980 explain select a.a, a.d, b.d
5981 from
5982 test.t1 a
5983 join
5984 test.t1 b
5985 on
5986 a.d = b.b
5987 where a.a = 6;
5988 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
5989 1 SIMPLE a # eq_ref PRIMARY,a PRIMARY 4 const # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
5990 1 SIMPLE b # eq_ref b b 5 test.a.d # # Child of 'a' in pushed join@1
5991 Warnings:
5992 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`b` = `test`.`a`.`d`) and (`test`.`a`.`a` = 6))
5993 Error insert to ensure that SPJ requests are purely local
5994
5995
5996 Pushed scan originating sub-lookups
5997 Table scan to get a.d, feeding pk lookups of b.a
5998 explain select a.a, a.d, b.d
5999 from
6000 test.t1 a
6001 join
6002 test.t1 b
6003 on
6004 a.d = b.a;
6005 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
6006 1 SIMPLE a # ALL NULL NULL NULL NULL # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
6007 1 SIMPLE b # eq_ref PRIMARY,a PRIMARY 4 test.a.d # # Child of 'a' in pushed join@1
6008 Warnings:
6009 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where (`test`.`b`.`a` = `test`.`a`.`d`)
6010 Error insert to ensure that SPJ requests are purely local
6011
6012 begin;
6013 select * from hints where i = 3;
6014 select a.a, a.d, b.d
6015 from
6016 test.t1 a
6017 join
6018 test.t1 b
6019 on
6020 a.d = b.a;
6021 commit;
6022
6023 Pushed scan originating sub-lookups
6024 Table scan to get a.d, feeding uk lookups of b.b
6025 explain select a.a, a.d, b.d
6026 from
6027 test.t1 a
6028 join
6029 test.t1 b
6030 on
6031 a.d = b.b;
6032 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
6033 1 SIMPLE a # ALL NULL NULL NULL NULL # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
6034 1 SIMPLE b # eq_ref b b 5 test.a.d # # Child of 'a' in pushed join@1
6035 Warnings:
6036 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where (`test`.`b`.`b` = `test`.`a`.`d`)
6037 Error insert to ensure that SPJ requests are purely local
6038
6039 begin;
6040 select * from hints where i = 3;
6041 select a.a, a.d, b.d
6042 from
6043 test.t1 a
6044 join
6045 test.t1 b
6046 on
6047 a.d = b.b;
6048 commit;
6049
6050 Pushed scan originating sub-scans
6051 Range scan on a.a > 10 getting a.d, feeding range scans on b.c = a.d
6052 explain select a.a, a.d, b.d
6053 from
6054 test.t1 a
6055 join
6056 test.t1 b
6057 on
6058 b.c=a.d
6059 where
6060 a.a>10;
6061 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
6062 1 SIMPLE a # range PRIMARY,a PRIMARY 4 NULL # # Parent of 2 pushed join@1; Using pushed condition ((`test`.`a`.`a` > 10) and (`test`.`a`.`d` is not null)); Using MRR
6063 1 SIMPLE b # ref c c 5 test.a.d # # Child of 'a' in pushed join@1
6064 Warnings:
6065 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`c` = `test`.`a`.`d`) and (`test`.`a`.`a` > 10))
6066 Error insert to ensure that SPJ requests are purely local
6067
6068 begin;
6069 select * from hints where i = 3;
6070 select a.a, a.d, b.d
6071 from
6072 test.t1 a
6073 join
6074 test.t1 b
6075 on
6076 b.c=a.d
6077 where
6078 a.a>10;
6079 commit;
6080
6081 Tests on T2 (Blobs)
6082 Test some basic NdbApi
6083 explain select * from test.t2 where t2.a=6;
6084 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
6085 1 SIMPLE t2 # eq_ref PRIMARY PRIMARY 4 const # # NULL
6086 Warnings:
6087 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` from `test`.`t2` where (`test`.`t2`.`a` = 6)
6088 Error insert to ensure that TC requests are purely local
6089
6090
6091 UI lookups
6092 explain select * from test.t2 where t2.b=6;
6093 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
6094 1 SIMPLE t2 # eq_ref b b 5 const # # NULL
6095 Warnings:
6096 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` from `test`.`t2` where (`test`.`t2`.`b` = 6)
6097 Error insert to ensure that TC requests are purely local
6098
6099
6100 OI scan
6101 explain select * from test.t2 where c > 6;
6102 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
6103 1 SIMPLE t2 # range c c 5 NULL # # Using pushed condition (`test`.`t2`.`c` > 6)
6104 Warnings:
6105 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` from `test`.`t2` where (`test`.`t2`.`c` > 6)
6106 Error insert to ensure that TC requests are purely local
6107
6108
6109 Table scan
6110 explain select * from test.t2;
6111 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
6112 1 SIMPLE t2 # ALL NULL NULL NULL NULL # # NULL
6113 Warnings:
6114 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` from `test`.`t2`
6115 Error insert to ensure that TC requests are purely local
6116
6117
6118 insert into hints values (2);
6119 Hint node by 2 of 4
6120 Tests on T1 (!Blobs)
6121 Test some basic NdbApi
6122 PK lookups
6123 explain select * from test.t1 where t1.a=6;
6124 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
6125 1 SIMPLE t1 # eq_ref PRIMARY,a PRIMARY 4 const # # NULL
6126 Warnings:
6127 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` from `test`.`t1` where (`test`.`t1`.`a` = 6)
6128 Error insert to ensure that TC requests are purely local
6129
6130
6131 UI lookups
6132 explain select * from test.t1 where t1.b=6;
6133 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
6134 1 SIMPLE t1 # eq_ref b b 5 const # # NULL
6135 Warnings:
6136 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` from `test`.`t1` where (`test`.`t1`.`b` = 6)
6137 Error insert to ensure that TC requests are purely local
6138
6139
6140 OI scan
6141 explain select * from test.t1 where c > 6;
6142 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
6143 1 SIMPLE t1 # range c c 5 NULL # # Using pushed condition (`test`.`t1`.`c` > 6); Using MRR
6144 Warnings:
6145 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` from `test`.`t1` where (`test`.`t1`.`c` > 6)
6146 Error insert to ensure that TC requests are purely local
6147
6148
6149 Table scan
6150 explain select * from test.t1;
6151 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
6152 1 SIMPLE t1 # ALL NULL NULL NULL NULL # # NULL
6153 Warnings:
6154 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` from `test`.`t1`
6155 Error insert to ensure that TC requests are purely local
6156
6157
6158 Test pushed queries (SPJ)
6159 Pushed pk->pk
6160 Lookup to get a.d, feeding pk lookup of b.a
6161 explain select a.a, a.d, b.d
6162 from
6163 test.t1 a
6164 join
6165 test.t1 b
6166 on
6167 a.d = b.a
6168 where a.a = 6;
6169 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
6170 1 SIMPLE a # eq_ref PRIMARY,a PRIMARY 4 const # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
6171 1 SIMPLE b # eq_ref PRIMARY,a PRIMARY 4 test.a.d # # Child of 'a' in pushed join@1
6172 Warnings:
6173 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`a` = `test`.`a`.`d`) and (`test`.`a`.`a` = 6))
6174 Error insert to ensure that SPJ requests are purely local
6175
6176
6177 Pushed uk->uk
6178 Lookup to get a.d, feeding uk lookup of b.b
6179 explain select a.a, a.d, b.d
6180 from
6181 test.t1 a
6182 join
6183 test.t1 b
6184 on
6185 a.d = b.b
6186 where a.b = 6;
6187 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
6188 1 SIMPLE a # eq_ref b b 5 const # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
6189 1 SIMPLE b # eq_ref b b 5 test.a.d # # Child of 'a' in pushed join@1
6190 Warnings:
6191 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`b` = `test`.`a`.`d`) and (`test`.`a`.`b` = 6))
6192 Error insert to ensure that SPJ requests are purely local
6193
6194
6195 Pushed uk->pk
6196 Lookup to get a.d, feeding pk lookup of b.a
6197 explain select a.a, a.d, b.d
6198 from
6199 test.t1 a
6200 join
6201 test.t1 b
6202 on
6203 a.d = b.a
6204 where a.b = 6;
6205 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
6206 1 SIMPLE a # eq_ref b b 5 const # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
6207 1 SIMPLE b # eq_ref PRIMARY,a PRIMARY 4 test.a.d # # Child of 'a' in pushed join@1
6208 Warnings:
6209 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`a` = `test`.`a`.`d`) and (`test`.`a`.`b` = 6))
6210 Error insert to ensure that SPJ requests are purely local
6211
6212
6213 Pushed pk->uk
6214 Lookup to get a.d, feeding uk lookup of b.b
6215 explain select a.a, a.d, b.d
6216 from
6217 test.t1 a
6218 join
6219 test.t1 b
6220 on
6221 a.d = b.b
6222 where a.a = 6;
6223 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
6224 1 SIMPLE a # eq_ref PRIMARY,a PRIMARY 4 const # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
6225 1 SIMPLE b # eq_ref b b 5 test.a.d # # Child of 'a' in pushed join@1
6226 Warnings:
6227 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`b` = `test`.`a`.`d`) and (`test`.`a`.`a` = 6))
6228 Error insert to ensure that SPJ requests are purely local
6229
6230
6231 Pushed scan originating sub-lookups
6232 Table scan to get a.d, feeding pk lookups of b.a
6233 explain select a.a, a.d, b.d
6234 from
6235 test.t1 a
6236 join
6237 test.t1 b
6238 on
6239 a.d = b.a;
6240 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
6241 1 SIMPLE a # ALL NULL NULL NULL NULL # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
6242 1 SIMPLE b # eq_ref PRIMARY,a PRIMARY 4 test.a.d # # Child of 'a' in pushed join@1
6243 Warnings:
6244 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where (`test`.`b`.`a` = `test`.`a`.`d`)
6245 Error insert to ensure that SPJ requests are purely local
6246
6247 begin;
6248 select * from hints where i = 2;
6249 select a.a, a.d, b.d
6250 from
6251 test.t1 a
6252 join
6253 test.t1 b
6254 on
6255 a.d = b.a;
6256 commit;
6257
6258 Pushed scan originating sub-lookups
6259 Table scan to get a.d, feeding uk lookups of b.b
6260 explain select a.a, a.d, b.d
6261 from
6262 test.t1 a
6263 join
6264 test.t1 b
6265 on
6266 a.d = b.b;
6267 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
6268 1 SIMPLE a # ALL NULL NULL NULL NULL # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
6269 1 SIMPLE b # eq_ref b b 5 test.a.d # # Child of 'a' in pushed join@1
6270 Warnings:
6271 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where (`test`.`b`.`b` = `test`.`a`.`d`)
6272 Error insert to ensure that SPJ requests are purely local
6273
6274 begin;
6275 select * from hints where i = 2;
6276 select a.a, a.d, b.d
6277 from
6278 test.t1 a
6279 join
6280 test.t1 b
6281 on
6282 a.d = b.b;
6283 commit;
6284
6285 Pushed scan originating sub-scans
6286 Range scan on a.a > 10 getting a.d, feeding range scans on b.c = a.d
6287 explain select a.a, a.d, b.d
6288 from
6289 test.t1 a
6290 join
6291 test.t1 b
6292 on
6293 b.c=a.d
6294 where
6295 a.a>10;
6296 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
6297 1 SIMPLE a # range PRIMARY,a PRIMARY 4 NULL # # Parent of 2 pushed join@1; Using pushed condition ((`test`.`a`.`a` > 10) and (`test`.`a`.`d` is not null)); Using MRR
6298 1 SIMPLE b # ref c c 5 test.a.d # # Child of 'a' in pushed join@1
6299 Warnings:
6300 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`c` = `test`.`a`.`d`) and (`test`.`a`.`a` > 10))
6301 Error insert to ensure that SPJ requests are purely local
6302
6303 begin;
6304 select * from hints where i = 2;
6305 select a.a, a.d, b.d
6306 from
6307 test.t1 a
6308 join
6309 test.t1 b
6310 on
6311 b.c=a.d
6312 where
6313 a.a>10;
6314 commit;
6315
6316 Tests on T2 (Blobs)
6317 Test some basic NdbApi
6318 explain select * from test.t2 where t2.a=6;
6319 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
6320 1 SIMPLE t2 # eq_ref PRIMARY PRIMARY 4 const # # NULL
6321 Warnings:
6322 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` from `test`.`t2` where (`test`.`t2`.`a` = 6)
6323 Error insert to ensure that TC requests are purely local
6324
6325
6326 UI lookups
6327 explain select * from test.t2 where t2.b=6;
6328 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
6329 1 SIMPLE t2 # eq_ref b b 5 const # # NULL
6330 Warnings:
6331 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` from `test`.`t2` where (`test`.`t2`.`b` = 6)
6332 Error insert to ensure that TC requests are purely local
6333
6334
6335 OI scan
6336 explain select * from test.t2 where c > 6;
6337 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
6338 1 SIMPLE t2 # range c c 5 NULL # # Using pushed condition (`test`.`t2`.`c` > 6)
6339 Warnings:
6340 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` from `test`.`t2` where (`test`.`t2`.`c` > 6)
6341 Error insert to ensure that TC requests are purely local
6342
6343
6344 Table scan
6345 explain select * from test.t2;
6346 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
6347 1 SIMPLE t2 # ALL NULL NULL NULL NULL # # NULL
6348 Warnings:
6349 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` from `test`.`t2`
6350 Error insert to ensure that TC requests are purely local
6351
6352
6353 insert into hints values (1);
6354 Hint node by 1 of 4
6355 Tests on T1 (!Blobs)
6356 Test some basic NdbApi
6357 PK lookups
6358 explain select * from test.t1 where t1.a=6;
6359 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
6360 1 SIMPLE t1 # eq_ref PRIMARY,a PRIMARY 4 const # # NULL
6361 Warnings:
6362 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` from `test`.`t1` where (`test`.`t1`.`a` = 6)
6363 Error insert to ensure that TC requests are purely local
6364
6365
6366 UI lookups
6367 explain select * from test.t1 where t1.b=6;
6368 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
6369 1 SIMPLE t1 # eq_ref b b 5 const # # NULL
6370 Warnings:
6371 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` from `test`.`t1` where (`test`.`t1`.`b` = 6)
6372 Error insert to ensure that TC requests are purely local
6373
6374
6375 OI scan
6376 explain select * from test.t1 where c > 6;
6377 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
6378 1 SIMPLE t1 # range c c 5 NULL # # Using pushed condition (`test`.`t1`.`c` > 6); Using MRR
6379 Warnings:
6380 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` from `test`.`t1` where (`test`.`t1`.`c` > 6)
6381 Error insert to ensure that TC requests are purely local
6382
6383
6384 Table scan
6385 explain select * from test.t1;
6386 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
6387 1 SIMPLE t1 # ALL NULL NULL NULL NULL # # NULL
6388 Warnings:
6389 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` from `test`.`t1`
6390 Error insert to ensure that TC requests are purely local
6391
6392
6393 Test pushed queries (SPJ)
6394 Pushed pk->pk
6395 Lookup to get a.d, feeding pk lookup of b.a
6396 explain select a.a, a.d, b.d
6397 from
6398 test.t1 a
6399 join
6400 test.t1 b
6401 on
6402 a.d = b.a
6403 where a.a = 6;
6404 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
6405 1 SIMPLE a # eq_ref PRIMARY,a PRIMARY 4 const # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
6406 1 SIMPLE b # eq_ref PRIMARY,a PRIMARY 4 test.a.d # # Child of 'a' in pushed join@1
6407 Warnings:
6408 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`a` = `test`.`a`.`d`) and (`test`.`a`.`a` = 6))
6409 Error insert to ensure that SPJ requests are purely local
6410
6411
6412 Pushed uk->uk
6413 Lookup to get a.d, feeding uk lookup of b.b
6414 explain select a.a, a.d, b.d
6415 from
6416 test.t1 a
6417 join
6418 test.t1 b
6419 on
6420 a.d = b.b
6421 where a.b = 6;
6422 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
6423 1 SIMPLE a # eq_ref b b 5 const # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
6424 1 SIMPLE b # eq_ref b b 5 test.a.d # # Child of 'a' in pushed join@1
6425 Warnings:
6426 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`b` = `test`.`a`.`d`) and (`test`.`a`.`b` = 6))
6427 Error insert to ensure that SPJ requests are purely local
6428
6429
6430 Pushed uk->pk
6431 Lookup to get a.d, feeding pk lookup of b.a
6432 explain select a.a, a.d, b.d
6433 from
6434 test.t1 a
6435 join
6436 test.t1 b
6437 on
6438 a.d = b.a
6439 where a.b = 6;
6440 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
6441 1 SIMPLE a # eq_ref b b 5 const # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
6442 1 SIMPLE b # eq_ref PRIMARY,a PRIMARY 4 test.a.d # # Child of 'a' in pushed join@1
6443 Warnings:
6444 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`a` = `test`.`a`.`d`) and (`test`.`a`.`b` = 6))
6445 Error insert to ensure that SPJ requests are purely local
6446
6447
6448 Pushed pk->uk
6449 Lookup to get a.d, feeding uk lookup of b.b
6450 explain select a.a, a.d, b.d
6451 from
6452 test.t1 a
6453 join
6454 test.t1 b
6455 on
6456 a.d = b.b
6457 where a.a = 6;
6458 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
6459 1 SIMPLE a # eq_ref PRIMARY,a PRIMARY 4 const # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
6460 1 SIMPLE b # eq_ref b b 5 test.a.d # # Child of 'a' in pushed join@1
6461 Warnings:
6462 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`b` = `test`.`a`.`d`) and (`test`.`a`.`a` = 6))
6463 Error insert to ensure that SPJ requests are purely local
6464
6465
6466 Pushed scan originating sub-lookups
6467 Table scan to get a.d, feeding pk lookups of b.a
6468 explain select a.a, a.d, b.d
6469 from
6470 test.t1 a
6471 join
6472 test.t1 b
6473 on
6474 a.d = b.a;
6475 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
6476 1 SIMPLE a # ALL NULL NULL NULL NULL # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
6477 1 SIMPLE b # eq_ref PRIMARY,a PRIMARY 4 test.a.d # # Child of 'a' in pushed join@1
6478 Warnings:
6479 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where (`test`.`b`.`a` = `test`.`a`.`d`)
6480 Error insert to ensure that SPJ requests are purely local
6481
6482 begin;
6483 select * from hints where i = 1;
6484 select a.a, a.d, b.d
6485 from
6486 test.t1 a
6487 join
6488 test.t1 b
6489 on
6490 a.d = b.a;
6491 commit;
6492
6493 Pushed scan originating sub-lookups
6494 Table scan to get a.d, feeding uk lookups of b.b
6495 explain select a.a, a.d, b.d
6496 from
6497 test.t1 a
6498 join
6499 test.t1 b
6500 on
6501 a.d = b.b;
6502 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
6503 1 SIMPLE a # ALL NULL NULL NULL NULL # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
6504 1 SIMPLE b # eq_ref b b 5 test.a.d # # Child of 'a' in pushed join@1
6505 Warnings:
6506 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where (`test`.`b`.`b` = `test`.`a`.`d`)
6507 Error insert to ensure that SPJ requests are purely local
6508
6509 begin;
6510 select * from hints where i = 1;
6511 select a.a, a.d, b.d
6512 from
6513 test.t1 a
6514 join
6515 test.t1 b
6516 on
6517 a.d = b.b;
6518 commit;
6519
6520 Pushed scan originating sub-scans
6521 Range scan on a.a > 10 getting a.d, feeding range scans on b.c = a.d
6522 explain select a.a, a.d, b.d
6523 from
6524 test.t1 a
6525 join
6526 test.t1 b
6527 on
6528 b.c=a.d
6529 where
6530 a.a>10;
6531 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
6532 1 SIMPLE a # range PRIMARY,a PRIMARY 4 NULL # # Parent of 2 pushed join@1; Using pushed condition ((`test`.`a`.`a` > 10) and (`test`.`a`.`d` is not null)); Using MRR
6533 1 SIMPLE b # ref c c 5 test.a.d # # Child of 'a' in pushed join@1
6534 Warnings:
6535 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`c` = `test`.`a`.`d`) and (`test`.`a`.`a` > 10))
6536 Error insert to ensure that SPJ requests are purely local
6537
6538 begin;
6539 select * from hints where i = 1;
6540 select a.a, a.d, b.d
6541 from
6542 test.t1 a
6543 join
6544 test.t1 b
6545 on
6546 b.c=a.d
6547 where
6548 a.a>10;
6549 commit;
6550
6551 Tests on T2 (Blobs)
6552 Test some basic NdbApi
6553 explain select * from test.t2 where t2.a=6;
6554 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
6555 1 SIMPLE t2 # eq_ref PRIMARY PRIMARY 4 const # # NULL
6556 Warnings:
6557 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` from `test`.`t2` where (`test`.`t2`.`a` = 6)
6558 Error insert to ensure that TC requests are purely local
6559
6560
6561 UI lookups
6562 explain select * from test.t2 where t2.b=6;
6563 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
6564 1 SIMPLE t2 # eq_ref b b 5 const # # NULL
6565 Warnings:
6566 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` from `test`.`t2` where (`test`.`t2`.`b` = 6)
6567 Error insert to ensure that TC requests are purely local
6568
6569
6570 OI scan
6571 explain select * from test.t2 where c > 6;
6572 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
6573 1 SIMPLE t2 # range c c 5 NULL # # Using pushed condition (`test`.`t2`.`c` > 6)
6574 Warnings:
6575 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` from `test`.`t2` where (`test`.`t2`.`c` > 6)
6576 Error insert to ensure that TC requests are purely local
6577
6578
6579 Table scan
6580 explain select * from test.t2;
6581 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
6582 1 SIMPLE t2 # ALL NULL NULL NULL NULL # # NULL
6583 Warnings:
6584 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` from `test`.`t2`
6585 Error insert to ensure that TC requests are purely local
6586
6587
6588 drop table hints;
6589 delete from t1;
6590 delete from t2;
6591 Nodegroup 2 created
6592 alter table t1 algorithm=inplace, reorganize partition;
6593 alter table t2 algorithm=inplace, reorganize partition;
6594 select id into @t1_id from ndbinfo.ndb$dict_obj_info where fq_name = 'test/def/t1';
6595 select id into @t1ui_id from ndbinfo.ndb$dict_obj_info where parent_obj_id = @t1_id and type = 3;
6596 select id into @t2_id from ndbinfo.ndb$dict_obj_info where fq_name = 'test/def/t2';
6597 select id into @t2ui_id from ndbinfo.ndb$dict_obj_info where parent_obj_id = @t2_id and type = 3;
6598 select id into @t2bt_id from ndbinfo.ndb$dict_obj_info where parent_obj_id = @t2_id and fq_name like 'test/def/NDB$BLOB%';
6599 Put some data in.
6600 Make it more interesting for joining
6601 update test.t1 set c=c+1, d=d+1;
6602 select count(distinct node_id) into @nodes
6603 from ndbinfo.ndb$membership where group_id < 0xFFFFFF00;
6604 Check replicas
6605 select count(distinct node_id)
6606 from ndbinfo.operations_per_fragment
6607 where fq_name='test/def/t1'
6608 and fragment_num=0;
6609 count(distinct node_id)
6610 2
6611 Check nodes with table data
6612 select count(distinct node_id)
6613 from ndbinfo.operations_per_fragment
6614 where fq_name='test/def/t1';
6615 count(distinct node_id)
6616 6
6617 Check UI replicas
6618 select count(distinct node_id)
6619 from ndbinfo.operations_per_fragment
6620 where table_id = @t1ui_id
6621 and fragment_num=0;
6622 count(distinct node_id)
6623 2
6624 Check nodes with UI data
6625 select count(distinct node_id)
6626 from ndbinfo.operations_per_fragment
6627 where table_id = @t1ui_id;
6628 count(distinct node_id)
6629 6
6630 Put some data in.
6631 insert into test.t2 select a,b,c,repeat('BJC',300) from test.t1;
6632 Check blob table replicas
6633 select count(distinct node_id)
6634 from ndbinfo.operations_per_fragment
6635 where table_id = @t2bt_id
6636 and fragment_num=0;
6637 count(distinct node_id)
6638 2
6639 Check nodes with blob data
6640 select count(distinct node_id)
6641 from ndbinfo.operations_per_fragment
6642 where table_id = @t2bt_id;
6643 count(distinct node_id)
6644 6
6645 set @partitions = 'PARTITION p6 VALUES IN (6)';
6646 set @partitions = concat(@partitions,',PARTITION p5 VALUES IN (5)');
6647 set @partitions = concat(@partitions,',PARTITION p4 VALUES IN (4)');
6648 set @partitions = concat(@partitions,',PARTITION p3 VALUES IN (3)');
6649 set @partitions = concat(@partitions,',PARTITION p2 VALUES IN (2)');
6650 set @partitions = concat(@partitions,',PARTITION p1 VALUES IN (1)');
6651 set @@new = 1;
6652 Warnings:
6653 Warning 1287 '@@new' is deprecated and will be removed in a future release.
6654 create table hints (i int primary key) engine=ndb partition by list(i) (PARTITION p6 VALUES IN (6),PARTITION p5 VALUES IN (5),PARTITION p4 VALUES IN (4),PARTITION p3 VALUES IN (3),PARTITION p2 VALUES IN (2),PARTITION p1 VALUES IN (1));
6655 insert into hints values (6);
6656 Hint node by 6 of 6
6657 Tests on T1 (!Blobs)
6658 Test some basic NdbApi
6659 PK lookups
6660 explain select * from test.t1 where t1.a=6;
6661 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
6662 1 SIMPLE t1 # eq_ref PRIMARY,a PRIMARY 4 const # # NULL
6663 Warnings:
6664 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` from `test`.`t1` where (`test`.`t1`.`a` = 6)
6665 Error insert to ensure that TC requests are purely local
6666
6667
6668 UI lookups
6669 explain select * from test.t1 where t1.b=6;
6670 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
6671 1 SIMPLE t1 # eq_ref b b 5 const # # NULL
6672 Warnings:
6673 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` from `test`.`t1` where (`test`.`t1`.`b` = 6)
6674 Error insert to ensure that TC requests are purely local
6675
6676
6677 OI scan
6678 explain select * from test.t1 where c > 6;
6679 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
6680 1 SIMPLE t1 # range c c 5 NULL # # Using pushed condition (`test`.`t1`.`c` > 6); Using MRR
6681 Warnings:
6682 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` from `test`.`t1` where (`test`.`t1`.`c` > 6)
6683 Error insert to ensure that TC requests are purely local
6684
6685
6686 Table scan
6687 explain select * from test.t1;
6688 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
6689 1 SIMPLE t1 # ALL NULL NULL NULL NULL # # NULL
6690 Warnings:
6691 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` from `test`.`t1`
6692 Error insert to ensure that TC requests are purely local
6693
6694
6695 Test pushed queries (SPJ)
6696 Pushed pk->pk
6697 Lookup to get a.d, feeding pk lookup of b.a
6698 explain select a.a, a.d, b.d
6699 from
6700 test.t1 a
6701 join
6702 test.t1 b
6703 on
6704 a.d = b.a
6705 where a.a = 6;
6706 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
6707 1 SIMPLE a # eq_ref PRIMARY,a PRIMARY 4 const # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
6708 1 SIMPLE b # eq_ref PRIMARY,a PRIMARY 4 test.a.d # # Child of 'a' in pushed join@1
6709 Warnings:
6710 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`a` = `test`.`a`.`d`) and (`test`.`a`.`a` = 6))
6711 Error insert to ensure that SPJ requests are purely local
6712
6713
6714 Pushed uk->uk
6715 Lookup to get a.d, feeding uk lookup of b.b
6716 explain select a.a, a.d, b.d
6717 from
6718 test.t1 a
6719 join
6720 test.t1 b
6721 on
6722 a.d = b.b
6723 where a.b = 6;
6724 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
6725 1 SIMPLE a # eq_ref b b 5 const # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
6726 1 SIMPLE b # eq_ref b b 5 test.a.d # # Child of 'a' in pushed join@1
6727 Warnings:
6728 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`b` = `test`.`a`.`d`) and (`test`.`a`.`b` = 6))
6729 Error insert to ensure that SPJ requests are purely local
6730
6731
6732 Pushed uk->pk
6733 Lookup to get a.d, feeding pk lookup of b.a
6734 explain select a.a, a.d, b.d
6735 from
6736 test.t1 a
6737 join
6738 test.t1 b
6739 on
6740 a.d = b.a
6741 where a.b = 6;
6742 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
6743 1 SIMPLE a # eq_ref b b 5 const # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
6744 1 SIMPLE b # eq_ref PRIMARY,a PRIMARY 4 test.a.d # # Child of 'a' in pushed join@1
6745 Warnings:
6746 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`a` = `test`.`a`.`d`) and (`test`.`a`.`b` = 6))
6747 Error insert to ensure that SPJ requests are purely local
6748
6749
6750 Pushed pk->uk
6751 Lookup to get a.d, feeding uk lookup of b.b
6752 explain select a.a, a.d, b.d
6753 from
6754 test.t1 a
6755 join
6756 test.t1 b
6757 on
6758 a.d = b.b
6759 where a.a = 6;
6760 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
6761 1 SIMPLE a # eq_ref PRIMARY,a PRIMARY 4 const # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
6762 1 SIMPLE b # eq_ref b b 5 test.a.d # # Child of 'a' in pushed join@1
6763 Warnings:
6764 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`b` = `test`.`a`.`d`) and (`test`.`a`.`a` = 6))
6765 Error insert to ensure that SPJ requests are purely local
6766
6767
6768 Pushed scan originating sub-lookups
6769 Table scan to get a.d, feeding pk lookups of b.a
6770 explain select a.a, a.d, b.d
6771 from
6772 test.t1 a
6773 join
6774 test.t1 b
6775 on
6776 a.d = b.a;
6777 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
6778 1 SIMPLE a # ALL NULL NULL NULL NULL # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
6779 1 SIMPLE b # eq_ref PRIMARY,a PRIMARY 4 test.a.d # # Child of 'a' in pushed join@1
6780 Warnings:
6781 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where (`test`.`b`.`a` = `test`.`a`.`d`)
6782 Error insert to ensure that SPJ requests are purely local
6783
6784 begin;
6785 select * from hints where i = 6;
6786 select a.a, a.d, b.d
6787 from
6788 test.t1 a
6789 join
6790 test.t1 b
6791 on
6792 a.d = b.a;
6793 commit;
6794
6795 Pushed scan originating sub-lookups
6796 Table scan to get a.d, feeding uk lookups of b.b
6797 explain select a.a, a.d, b.d
6798 from
6799 test.t1 a
6800 join
6801 test.t1 b
6802 on
6803 a.d = b.b;
6804 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
6805 1 SIMPLE a # ALL NULL NULL NULL NULL # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
6806 1 SIMPLE b # eq_ref b b 5 test.a.d # # Child of 'a' in pushed join@1
6807 Warnings:
6808 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where (`test`.`b`.`b` = `test`.`a`.`d`)
6809 Error insert to ensure that SPJ requests are purely local
6810
6811 begin;
6812 select * from hints where i = 6;
6813 select a.a, a.d, b.d
6814 from
6815 test.t1 a
6816 join
6817 test.t1 b
6818 on
6819 a.d = b.b;
6820 commit;
6821
6822 Pushed scan originating sub-scans
6823 Range scan on a.a > 10 getting a.d, feeding range scans on b.c = a.d
6824 explain select a.a, a.d, b.d
6825 from
6826 test.t1 a
6827 join
6828 test.t1 b
6829 on
6830 b.c=a.d
6831 where
6832 a.a>10;
6833 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
6834 1 SIMPLE a # range PRIMARY,a PRIMARY 4 NULL # # Parent of 2 pushed join@1; Using pushed condition ((`test`.`a`.`a` > 10) and (`test`.`a`.`d` is not null)); Using MRR
6835 1 SIMPLE b # ref c c 5 test.a.d # # Child of 'a' in pushed join@1
6836 Warnings:
6837 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`c` = `test`.`a`.`d`) and (`test`.`a`.`a` > 10))
6838 Error insert to ensure that SPJ requests are purely local
6839
6840 begin;
6841 select * from hints where i = 6;
6842 select a.a, a.d, b.d
6843 from
6844 test.t1 a
6845 join
6846 test.t1 b
6847 on
6848 b.c=a.d
6849 where
6850 a.a>10;
6851 commit;
6852
6853 Tests on T2 (Blobs)
6854 Test some basic NdbApi
6855 explain select * from test.t2 where t2.a=6;
6856 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
6857 1 SIMPLE t2 # eq_ref PRIMARY PRIMARY 4 const # # NULL
6858 Warnings:
6859 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` from `test`.`t2` where (`test`.`t2`.`a` = 6)
6860 Error insert to ensure that TC requests are purely local
6861
6862
6863 UI lookups
6864 explain select * from test.t2 where t2.b=6;
6865 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
6866 1 SIMPLE t2 # eq_ref b b 5 const # # NULL
6867 Warnings:
6868 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` from `test`.`t2` where (`test`.`t2`.`b` = 6)
6869 Error insert to ensure that TC requests are purely local
6870
6871
6872 OI scan
6873 explain select * from test.t2 where c > 6;
6874 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
6875 1 SIMPLE t2 # range c c 5 NULL # # Using pushed condition (`test`.`t2`.`c` > 6)
6876 Warnings:
6877 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` from `test`.`t2` where (`test`.`t2`.`c` > 6)
6878 Error insert to ensure that TC requests are purely local
6879
6880
6881 Table scan
6882 explain select * from test.t2;
6883 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
6884 1 SIMPLE t2 # ALL NULL NULL NULL NULL # # NULL
6885 Warnings:
6886 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` from `test`.`t2`
6887 Error insert to ensure that TC requests are purely local
6888
6889
6890 insert into hints values (5);
6891 Hint node by 5 of 6
6892 Tests on T1 (!Blobs)
6893 Test some basic NdbApi
6894 PK lookups
6895 explain select * from test.t1 where t1.a=6;
6896 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
6897 1 SIMPLE t1 # eq_ref PRIMARY,a PRIMARY 4 const # # NULL
6898 Warnings:
6899 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` from `test`.`t1` where (`test`.`t1`.`a` = 6)
6900 Error insert to ensure that TC requests are purely local
6901
6902
6903 UI lookups
6904 explain select * from test.t1 where t1.b=6;
6905 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
6906 1 SIMPLE t1 # eq_ref b b 5 const # # NULL
6907 Warnings:
6908 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` from `test`.`t1` where (`test`.`t1`.`b` = 6)
6909 Error insert to ensure that TC requests are purely local
6910
6911
6912 OI scan
6913 explain select * from test.t1 where c > 6;
6914 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
6915 1 SIMPLE t1 # range c c 5 NULL # # Using pushed condition (`test`.`t1`.`c` > 6); Using MRR
6916 Warnings:
6917 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` from `test`.`t1` where (`test`.`t1`.`c` > 6)
6918 Error insert to ensure that TC requests are purely local
6919
6920
6921 Table scan
6922 explain select * from test.t1;
6923 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
6924 1 SIMPLE t1 # ALL NULL NULL NULL NULL # # NULL
6925 Warnings:
6926 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` from `test`.`t1`
6927 Error insert to ensure that TC requests are purely local
6928
6929
6930 Test pushed queries (SPJ)
6931 Pushed pk->pk
6932 Lookup to get a.d, feeding pk lookup of b.a
6933 explain select a.a, a.d, b.d
6934 from
6935 test.t1 a
6936 join
6937 test.t1 b
6938 on
6939 a.d = b.a
6940 where a.a = 6;
6941 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
6942 1 SIMPLE a # eq_ref PRIMARY,a PRIMARY 4 const # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
6943 1 SIMPLE b # eq_ref PRIMARY,a PRIMARY 4 test.a.d # # Child of 'a' in pushed join@1
6944 Warnings:
6945 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`a` = `test`.`a`.`d`) and (`test`.`a`.`a` = 6))
6946 Error insert to ensure that SPJ requests are purely local
6947
6948
6949 Pushed uk->uk
6950 Lookup to get a.d, feeding uk lookup of b.b
6951 explain select a.a, a.d, b.d
6952 from
6953 test.t1 a
6954 join
6955 test.t1 b
6956 on
6957 a.d = b.b
6958 where a.b = 6;
6959 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
6960 1 SIMPLE a # eq_ref b b 5 const # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
6961 1 SIMPLE b # eq_ref b b 5 test.a.d # # Child of 'a' in pushed join@1
6962 Warnings:
6963 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`b` = `test`.`a`.`d`) and (`test`.`a`.`b` = 6))
6964 Error insert to ensure that SPJ requests are purely local
6965
6966
6967 Pushed uk->pk
6968 Lookup to get a.d, feeding pk lookup of b.a
6969 explain select a.a, a.d, b.d
6970 from
6971 test.t1 a
6972 join
6973 test.t1 b
6974 on
6975 a.d = b.a
6976 where a.b = 6;
6977 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
6978 1 SIMPLE a # eq_ref b b 5 const # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
6979 1 SIMPLE b # eq_ref PRIMARY,a PRIMARY 4 test.a.d # # Child of 'a' in pushed join@1
6980 Warnings:
6981 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`a` = `test`.`a`.`d`) and (`test`.`a`.`b` = 6))
6982 Error insert to ensure that SPJ requests are purely local
6983
6984
6985 Pushed pk->uk
6986 Lookup to get a.d, feeding uk lookup of b.b
6987 explain select a.a, a.d, b.d
6988 from
6989 test.t1 a
6990 join
6991 test.t1 b
6992 on
6993 a.d = b.b
6994 where a.a = 6;
6995 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
6996 1 SIMPLE a # eq_ref PRIMARY,a PRIMARY 4 const # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
6997 1 SIMPLE b # eq_ref b b 5 test.a.d # # Child of 'a' in pushed join@1
6998 Warnings:
6999 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`b` = `test`.`a`.`d`) and (`test`.`a`.`a` = 6))
7000 Error insert to ensure that SPJ requests are purely local
7001
7002
7003 Pushed scan originating sub-lookups
7004 Table scan to get a.d, feeding pk lookups of b.a
7005 explain select a.a, a.d, b.d
7006 from
7007 test.t1 a
7008 join
7009 test.t1 b
7010 on
7011 a.d = b.a;
7012 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
7013 1 SIMPLE a # ALL NULL NULL NULL NULL # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
7014 1 SIMPLE b # eq_ref PRIMARY,a PRIMARY 4 test.a.d # # Child of 'a' in pushed join@1
7015 Warnings:
7016 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where (`test`.`b`.`a` = `test`.`a`.`d`)
7017 Error insert to ensure that SPJ requests are purely local
7018
7019 begin;
7020 select * from hints where i = 5;
7021 select a.a, a.d, b.d
7022 from
7023 test.t1 a
7024 join
7025 test.t1 b
7026 on
7027 a.d = b.a;
7028 commit;
7029
7030 Pushed scan originating sub-lookups
7031 Table scan to get a.d, feeding uk lookups of b.b
7032 explain select a.a, a.d, b.d
7033 from
7034 test.t1 a
7035 join
7036 test.t1 b
7037 on
7038 a.d = b.b;
7039 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
7040 1 SIMPLE a # ALL NULL NULL NULL NULL # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
7041 1 SIMPLE b # eq_ref b b 5 test.a.d # # Child of 'a' in pushed join@1
7042 Warnings:
7043 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where (`test`.`b`.`b` = `test`.`a`.`d`)
7044 Error insert to ensure that SPJ requests are purely local
7045
7046 begin;
7047 select * from hints where i = 5;
7048 select a.a, a.d, b.d
7049 from
7050 test.t1 a
7051 join
7052 test.t1 b
7053 on
7054 a.d = b.b;
7055 commit;
7056
7057 Pushed scan originating sub-scans
7058 Range scan on a.a > 10 getting a.d, feeding range scans on b.c = a.d
7059 explain select a.a, a.d, b.d
7060 from
7061 test.t1 a
7062 join
7063 test.t1 b
7064 on
7065 b.c=a.d
7066 where
7067 a.a>10;
7068 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
7069 1 SIMPLE a # range PRIMARY,a PRIMARY 4 NULL # # Parent of 2 pushed join@1; Using pushed condition ((`test`.`a`.`a` > 10) and (`test`.`a`.`d` is not null)); Using MRR
7070 1 SIMPLE b # ref c c 5 test.a.d # # Child of 'a' in pushed join@1
7071 Warnings:
7072 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`c` = `test`.`a`.`d`) and (`test`.`a`.`a` > 10))
7073 Error insert to ensure that SPJ requests are purely local
7074
7075 begin;
7076 select * from hints where i = 5;
7077 select a.a, a.d, b.d
7078 from
7079 test.t1 a
7080 join
7081 test.t1 b
7082 on
7083 b.c=a.d
7084 where
7085 a.a>10;
7086 commit;
7087
7088 Tests on T2 (Blobs)
7089 Test some basic NdbApi
7090 explain select * from test.t2 where t2.a=6;
7091 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
7092 1 SIMPLE t2 # eq_ref PRIMARY PRIMARY 4 const # # NULL
7093 Warnings:
7094 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` from `test`.`t2` where (`test`.`t2`.`a` = 6)
7095 Error insert to ensure that TC requests are purely local
7096
7097
7098 UI lookups
7099 explain select * from test.t2 where t2.b=6;
7100 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
7101 1 SIMPLE t2 # eq_ref b b 5 const # # NULL
7102 Warnings:
7103 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` from `test`.`t2` where (`test`.`t2`.`b` = 6)
7104 Error insert to ensure that TC requests are purely local
7105
7106
7107 OI scan
7108 explain select * from test.t2 where c > 6;
7109 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
7110 1 SIMPLE t2 # range c c 5 NULL # # Using pushed condition (`test`.`t2`.`c` > 6)
7111 Warnings:
7112 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` from `test`.`t2` where (`test`.`t2`.`c` > 6)
7113 Error insert to ensure that TC requests are purely local
7114
7115
7116 Table scan
7117 explain select * from test.t2;
7118 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
7119 1 SIMPLE t2 # ALL NULL NULL NULL NULL # # NULL
7120 Warnings:
7121 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` from `test`.`t2`
7122 Error insert to ensure that TC requests are purely local
7123
7124
7125 insert into hints values (4);
7126 Hint node by 4 of 6
7127 Tests on T1 (!Blobs)
7128 Test some basic NdbApi
7129 PK lookups
7130 explain select * from test.t1 where t1.a=6;
7131 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
7132 1 SIMPLE t1 # eq_ref PRIMARY,a PRIMARY 4 const # # NULL
7133 Warnings:
7134 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` from `test`.`t1` where (`test`.`t1`.`a` = 6)
7135 Error insert to ensure that TC requests are purely local
7136
7137
7138 UI lookups
7139 explain select * from test.t1 where t1.b=6;
7140 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
7141 1 SIMPLE t1 # eq_ref b b 5 const # # NULL
7142 Warnings:
7143 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` from `test`.`t1` where (`test`.`t1`.`b` = 6)
7144 Error insert to ensure that TC requests are purely local
7145
7146
7147 OI scan
7148 explain select * from test.t1 where c > 6;
7149 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
7150 1 SIMPLE t1 # range c c 5 NULL # # Using pushed condition (`test`.`t1`.`c` > 6); Using MRR
7151 Warnings:
7152 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` from `test`.`t1` where (`test`.`t1`.`c` > 6)
7153 Error insert to ensure that TC requests are purely local
7154
7155
7156 Table scan
7157 explain select * from test.t1;
7158 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
7159 1 SIMPLE t1 # ALL NULL NULL NULL NULL # # NULL
7160 Warnings:
7161 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` from `test`.`t1`
7162 Error insert to ensure that TC requests are purely local
7163
7164
7165 Test pushed queries (SPJ)
7166 Pushed pk->pk
7167 Lookup to get a.d, feeding pk lookup of b.a
7168 explain select a.a, a.d, b.d
7169 from
7170 test.t1 a
7171 join
7172 test.t1 b
7173 on
7174 a.d = b.a
7175 where a.a = 6;
7176 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
7177 1 SIMPLE a # eq_ref PRIMARY,a PRIMARY 4 const # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
7178 1 SIMPLE b # eq_ref PRIMARY,a PRIMARY 4 test.a.d # # Child of 'a' in pushed join@1
7179 Warnings:
7180 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`a` = `test`.`a`.`d`) and (`test`.`a`.`a` = 6))
7181 Error insert to ensure that SPJ requests are purely local
7182
7183
7184 Pushed uk->uk
7185 Lookup to get a.d, feeding uk lookup of b.b
7186 explain select a.a, a.d, b.d
7187 from
7188 test.t1 a
7189 join
7190 test.t1 b
7191 on
7192 a.d = b.b
7193 where a.b = 6;
7194 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
7195 1 SIMPLE a # eq_ref b b 5 const # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
7196 1 SIMPLE b # eq_ref b b 5 test.a.d # # Child of 'a' in pushed join@1
7197 Warnings:
7198 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`b` = `test`.`a`.`d`) and (`test`.`a`.`b` = 6))
7199 Error insert to ensure that SPJ requests are purely local
7200
7201
7202 Pushed uk->pk
7203 Lookup to get a.d, feeding pk lookup of b.a
7204 explain select a.a, a.d, b.d
7205 from
7206 test.t1 a
7207 join
7208 test.t1 b
7209 on
7210 a.d = b.a
7211 where a.b = 6;
7212 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
7213 1 SIMPLE a # eq_ref b b 5 const # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
7214 1 SIMPLE b # eq_ref PRIMARY,a PRIMARY 4 test.a.d # # Child of 'a' in pushed join@1
7215 Warnings:
7216 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`a` = `test`.`a`.`d`) and (`test`.`a`.`b` = 6))
7217 Error insert to ensure that SPJ requests are purely local
7218
7219
7220 Pushed pk->uk
7221 Lookup to get a.d, feeding uk lookup of b.b
7222 explain select a.a, a.d, b.d
7223 from
7224 test.t1 a
7225 join
7226 test.t1 b
7227 on
7228 a.d = b.b
7229 where a.a = 6;
7230 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
7231 1 SIMPLE a # eq_ref PRIMARY,a PRIMARY 4 const # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
7232 1 SIMPLE b # eq_ref b b 5 test.a.d # # Child of 'a' in pushed join@1
7233 Warnings:
7234 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`b` = `test`.`a`.`d`) and (`test`.`a`.`a` = 6))
7235 Error insert to ensure that SPJ requests are purely local
7236
7237
7238 Pushed scan originating sub-lookups
7239 Table scan to get a.d, feeding pk lookups of b.a
7240 explain select a.a, a.d, b.d
7241 from
7242 test.t1 a
7243 join
7244 test.t1 b
7245 on
7246 a.d = b.a;
7247 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
7248 1 SIMPLE a # ALL NULL NULL NULL NULL # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
7249 1 SIMPLE b # eq_ref PRIMARY,a PRIMARY 4 test.a.d # # Child of 'a' in pushed join@1
7250 Warnings:
7251 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where (`test`.`b`.`a` = `test`.`a`.`d`)
7252 Error insert to ensure that SPJ requests are purely local
7253
7254 begin;
7255 select * from hints where i = 4;
7256 select a.a, a.d, b.d
7257 from
7258 test.t1 a
7259 join
7260 test.t1 b
7261 on
7262 a.d = b.a;
7263 commit;
7264
7265 Pushed scan originating sub-lookups
7266 Table scan to get a.d, feeding uk lookups of b.b
7267 explain select a.a, a.d, b.d
7268 from
7269 test.t1 a
7270 join
7271 test.t1 b
7272 on
7273 a.d = b.b;
7274 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
7275 1 SIMPLE a # ALL NULL NULL NULL NULL # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
7276 1 SIMPLE b # eq_ref b b 5 test.a.d # # Child of 'a' in pushed join@1
7277 Warnings:
7278 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where (`test`.`b`.`b` = `test`.`a`.`d`)
7279 Error insert to ensure that SPJ requests are purely local
7280
7281 begin;
7282 select * from hints where i = 4;
7283 select a.a, a.d, b.d
7284 from
7285 test.t1 a
7286 join
7287 test.t1 b
7288 on
7289 a.d = b.b;
7290 commit;
7291
7292 Pushed scan originating sub-scans
7293 Range scan on a.a > 10 getting a.d, feeding range scans on b.c = a.d
7294 explain select a.a, a.d, b.d
7295 from
7296 test.t1 a
7297 join
7298 test.t1 b
7299 on
7300 b.c=a.d
7301 where
7302 a.a>10;
7303 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
7304 1 SIMPLE a # range PRIMARY,a PRIMARY 4 NULL # # Parent of 2 pushed join@1; Using pushed condition ((`test`.`a`.`a` > 10) and (`test`.`a`.`d` is not null)); Using MRR
7305 1 SIMPLE b # ref c c 5 test.a.d # # Child of 'a' in pushed join@1
7306 Warnings:
7307 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`c` = `test`.`a`.`d`) and (`test`.`a`.`a` > 10))
7308 Error insert to ensure that SPJ requests are purely local
7309
7310 begin;
7311 select * from hints where i = 4;
7312 select a.a, a.d, b.d
7313 from
7314 test.t1 a
7315 join
7316 test.t1 b
7317 on
7318 b.c=a.d
7319 where
7320 a.a>10;
7321 commit;
7322
7323 Tests on T2 (Blobs)
7324 Test some basic NdbApi
7325 explain select * from test.t2 where t2.a=6;
7326 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
7327 1 SIMPLE t2 # eq_ref PRIMARY PRIMARY 4 const # # NULL
7328 Warnings:
7329 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` from `test`.`t2` where (`test`.`t2`.`a` = 6)
7330 Error insert to ensure that TC requests are purely local
7331
7332
7333 UI lookups
7334 explain select * from test.t2 where t2.b=6;
7335 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
7336 1 SIMPLE t2 # eq_ref b b 5 const # # NULL
7337 Warnings:
7338 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` from `test`.`t2` where (`test`.`t2`.`b` = 6)
7339 Error insert to ensure that TC requests are purely local
7340
7341
7342 OI scan
7343 explain select * from test.t2 where c > 6;
7344 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
7345 1 SIMPLE t2 # range c c 5 NULL # # Using pushed condition (`test`.`t2`.`c` > 6)
7346 Warnings:
7347 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` from `test`.`t2` where (`test`.`t2`.`c` > 6)
7348 Error insert to ensure that TC requests are purely local
7349
7350
7351 Table scan
7352 explain select * from test.t2;
7353 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
7354 1 SIMPLE t2 # ALL NULL NULL NULL NULL # # NULL
7355 Warnings:
7356 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` from `test`.`t2`
7357 Error insert to ensure that TC requests are purely local
7358
7359
7360 insert into hints values (3);
7361 Hint node by 3 of 6
7362 Tests on T1 (!Blobs)
7363 Test some basic NdbApi
7364 PK lookups
7365 explain select * from test.t1 where t1.a=6;
7366 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
7367 1 SIMPLE t1 # eq_ref PRIMARY,a PRIMARY 4 const # # NULL
7368 Warnings:
7369 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` from `test`.`t1` where (`test`.`t1`.`a` = 6)
7370 Error insert to ensure that TC requests are purely local
7371
7372
7373 UI lookups
7374 explain select * from test.t1 where t1.b=6;
7375 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
7376 1 SIMPLE t1 # eq_ref b b 5 const # # NULL
7377 Warnings:
7378 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` from `test`.`t1` where (`test`.`t1`.`b` = 6)
7379 Error insert to ensure that TC requests are purely local
7380
7381
7382 OI scan
7383 explain select * from test.t1 where c > 6;
7384 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
7385 1 SIMPLE t1 # range c c 5 NULL # # Using pushed condition (`test`.`t1`.`c` > 6); Using MRR
7386 Warnings:
7387 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` from `test`.`t1` where (`test`.`t1`.`c` > 6)
7388 Error insert to ensure that TC requests are purely local
7389
7390
7391 Table scan
7392 explain select * from test.t1;
7393 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
7394 1 SIMPLE t1 # ALL NULL NULL NULL NULL # # NULL
7395 Warnings:
7396 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` from `test`.`t1`
7397 Error insert to ensure that TC requests are purely local
7398
7399
7400 Test pushed queries (SPJ)
7401 Pushed pk->pk
7402 Lookup to get a.d, feeding pk lookup of b.a
7403 explain select a.a, a.d, b.d
7404 from
7405 test.t1 a
7406 join
7407 test.t1 b
7408 on
7409 a.d = b.a
7410 where a.a = 6;
7411 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
7412 1 SIMPLE a # eq_ref PRIMARY,a PRIMARY 4 const # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
7413 1 SIMPLE b # eq_ref PRIMARY,a PRIMARY 4 test.a.d # # Child of 'a' in pushed join@1
7414 Warnings:
7415 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`a` = `test`.`a`.`d`) and (`test`.`a`.`a` = 6))
7416 Error insert to ensure that SPJ requests are purely local
7417
7418
7419 Pushed uk->uk
7420 Lookup to get a.d, feeding uk lookup of b.b
7421 explain select a.a, a.d, b.d
7422 from
7423 test.t1 a
7424 join
7425 test.t1 b
7426 on
7427 a.d = b.b
7428 where a.b = 6;
7429 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
7430 1 SIMPLE a # eq_ref b b 5 const # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
7431 1 SIMPLE b # eq_ref b b 5 test.a.d # # Child of 'a' in pushed join@1
7432 Warnings:
7433 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`b` = `test`.`a`.`d`) and (`test`.`a`.`b` = 6))
7434 Error insert to ensure that SPJ requests are purely local
7435
7436
7437 Pushed uk->pk
7438 Lookup to get a.d, feeding pk lookup of b.a
7439 explain select a.a, a.d, b.d
7440 from
7441 test.t1 a
7442 join
7443 test.t1 b
7444 on
7445 a.d = b.a
7446 where a.b = 6;
7447 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
7448 1 SIMPLE a # eq_ref b b 5 const # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
7449 1 SIMPLE b # eq_ref PRIMARY,a PRIMARY 4 test.a.d # # Child of 'a' in pushed join@1
7450 Warnings:
7451 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`a` = `test`.`a`.`d`) and (`test`.`a`.`b` = 6))
7452 Error insert to ensure that SPJ requests are purely local
7453
7454
7455 Pushed pk->uk
7456 Lookup to get a.d, feeding uk lookup of b.b
7457 explain select a.a, a.d, b.d
7458 from
7459 test.t1 a
7460 join
7461 test.t1 b
7462 on
7463 a.d = b.b
7464 where a.a = 6;
7465 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
7466 1 SIMPLE a # eq_ref PRIMARY,a PRIMARY 4 const # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
7467 1 SIMPLE b # eq_ref b b 5 test.a.d # # Child of 'a' in pushed join@1
7468 Warnings:
7469 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`b` = `test`.`a`.`d`) and (`test`.`a`.`a` = 6))
7470 Error insert to ensure that SPJ requests are purely local
7471
7472
7473 Pushed scan originating sub-lookups
7474 Table scan to get a.d, feeding pk lookups of b.a
7475 explain select a.a, a.d, b.d
7476 from
7477 test.t1 a
7478 join
7479 test.t1 b
7480 on
7481 a.d = b.a;
7482 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
7483 1 SIMPLE a # ALL NULL NULL NULL NULL # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
7484 1 SIMPLE b # eq_ref PRIMARY,a PRIMARY 4 test.a.d # # Child of 'a' in pushed join@1
7485 Warnings:
7486 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where (`test`.`b`.`a` = `test`.`a`.`d`)
7487 Error insert to ensure that SPJ requests are purely local
7488
7489 begin;
7490 select * from hints where i = 3;
7491 select a.a, a.d, b.d
7492 from
7493 test.t1 a
7494 join
7495 test.t1 b
7496 on
7497 a.d = b.a;
7498 commit;
7499
7500 Pushed scan originating sub-lookups
7501 Table scan to get a.d, feeding uk lookups of b.b
7502 explain select a.a, a.d, b.d
7503 from
7504 test.t1 a
7505 join
7506 test.t1 b
7507 on
7508 a.d = b.b;
7509 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
7510 1 SIMPLE a # ALL NULL NULL NULL NULL # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
7511 1 SIMPLE b # eq_ref b b 5 test.a.d # # Child of 'a' in pushed join@1
7512 Warnings:
7513 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where (`test`.`b`.`b` = `test`.`a`.`d`)
7514 Error insert to ensure that SPJ requests are purely local
7515
7516 begin;
7517 select * from hints where i = 3;
7518 select a.a, a.d, b.d
7519 from
7520 test.t1 a
7521 join
7522 test.t1 b
7523 on
7524 a.d = b.b;
7525 commit;
7526
7527 Pushed scan originating sub-scans
7528 Range scan on a.a > 10 getting a.d, feeding range scans on b.c = a.d
7529 explain select a.a, a.d, b.d
7530 from
7531 test.t1 a
7532 join
7533 test.t1 b
7534 on
7535 b.c=a.d
7536 where
7537 a.a>10;
7538 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
7539 1 SIMPLE a # range PRIMARY,a PRIMARY 4 NULL # # Parent of 2 pushed join@1; Using pushed condition ((`test`.`a`.`a` > 10) and (`test`.`a`.`d` is not null)); Using MRR
7540 1 SIMPLE b # ref c c 5 test.a.d # # Child of 'a' in pushed join@1
7541 Warnings:
7542 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`c` = `test`.`a`.`d`) and (`test`.`a`.`a` > 10))
7543 Error insert to ensure that SPJ requests are purely local
7544
7545 begin;
7546 select * from hints where i = 3;
7547 select a.a, a.d, b.d
7548 from
7549 test.t1 a
7550 join
7551 test.t1 b
7552 on
7553 b.c=a.d
7554 where
7555 a.a>10;
7556 commit;
7557
7558 Tests on T2 (Blobs)
7559 Test some basic NdbApi
7560 explain select * from test.t2 where t2.a=6;
7561 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
7562 1 SIMPLE t2 # eq_ref PRIMARY PRIMARY 4 const # # NULL
7563 Warnings:
7564 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` from `test`.`t2` where (`test`.`t2`.`a` = 6)
7565 Error insert to ensure that TC requests are purely local
7566
7567
7568 UI lookups
7569 explain select * from test.t2 where t2.b=6;
7570 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
7571 1 SIMPLE t2 # eq_ref b b 5 const # # NULL
7572 Warnings:
7573 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` from `test`.`t2` where (`test`.`t2`.`b` = 6)
7574 Error insert to ensure that TC requests are purely local
7575
7576
7577 OI scan
7578 explain select * from test.t2 where c > 6;
7579 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
7580 1 SIMPLE t2 # range c c 5 NULL # # Using pushed condition (`test`.`t2`.`c` > 6)
7581 Warnings:
7582 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` from `test`.`t2` where (`test`.`t2`.`c` > 6)
7583 Error insert to ensure that TC requests are purely local
7584
7585
7586 Table scan
7587 explain select * from test.t2;
7588 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
7589 1 SIMPLE t2 # ALL NULL NULL NULL NULL # # NULL
7590 Warnings:
7591 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` from `test`.`t2`
7592 Error insert to ensure that TC requests are purely local
7593
7594
7595 insert into hints values (2);
7596 Hint node by 2 of 6
7597 Tests on T1 (!Blobs)
7598 Test some basic NdbApi
7599 PK lookups
7600 explain select * from test.t1 where t1.a=6;
7601 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
7602 1 SIMPLE t1 # eq_ref PRIMARY,a PRIMARY 4 const # # NULL
7603 Warnings:
7604 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` from `test`.`t1` where (`test`.`t1`.`a` = 6)
7605 Error insert to ensure that TC requests are purely local
7606
7607
7608 UI lookups
7609 explain select * from test.t1 where t1.b=6;
7610 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
7611 1 SIMPLE t1 # eq_ref b b 5 const # # NULL
7612 Warnings:
7613 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` from `test`.`t1` where (`test`.`t1`.`b` = 6)
7614 Error insert to ensure that TC requests are purely local
7615
7616
7617 OI scan
7618 explain select * from test.t1 where c > 6;
7619 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
7620 1 SIMPLE t1 # range c c 5 NULL # # Using pushed condition (`test`.`t1`.`c` > 6); Using MRR
7621 Warnings:
7622 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` from `test`.`t1` where (`test`.`t1`.`c` > 6)
7623 Error insert to ensure that TC requests are purely local
7624
7625
7626 Table scan
7627 explain select * from test.t1;
7628 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
7629 1 SIMPLE t1 # ALL NULL NULL NULL NULL # # NULL
7630 Warnings:
7631 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` from `test`.`t1`
7632 Error insert to ensure that TC requests are purely local
7633
7634
7635 Test pushed queries (SPJ)
7636 Pushed pk->pk
7637 Lookup to get a.d, feeding pk lookup of b.a
7638 explain select a.a, a.d, b.d
7639 from
7640 test.t1 a
7641 join
7642 test.t1 b
7643 on
7644 a.d = b.a
7645 where a.a = 6;
7646 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
7647 1 SIMPLE a # eq_ref PRIMARY,a PRIMARY 4 const # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
7648 1 SIMPLE b # eq_ref PRIMARY,a PRIMARY 4 test.a.d # # Child of 'a' in pushed join@1
7649 Warnings:
7650 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`a` = `test`.`a`.`d`) and (`test`.`a`.`a` = 6))
7651 Error insert to ensure that SPJ requests are purely local
7652
7653
7654 Pushed uk->uk
7655 Lookup to get a.d, feeding uk lookup of b.b
7656 explain select a.a, a.d, b.d
7657 from
7658 test.t1 a
7659 join
7660 test.t1 b
7661 on
7662 a.d = b.b
7663 where a.b = 6;
7664 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
7665 1 SIMPLE a # eq_ref b b 5 const # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
7666 1 SIMPLE b # eq_ref b b 5 test.a.d # # Child of 'a' in pushed join@1
7667 Warnings:
7668 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`b` = `test`.`a`.`d`) and (`test`.`a`.`b` = 6))
7669 Error insert to ensure that SPJ requests are purely local
7670
7671
7672 Pushed uk->pk
7673 Lookup to get a.d, feeding pk lookup of b.a
7674 explain select a.a, a.d, b.d
7675 from
7676 test.t1 a
7677 join
7678 test.t1 b
7679 on
7680 a.d = b.a
7681 where a.b = 6;
7682 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
7683 1 SIMPLE a # eq_ref b b 5 const # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
7684 1 SIMPLE b # eq_ref PRIMARY,a PRIMARY 4 test.a.d # # Child of 'a' in pushed join@1
7685 Warnings:
7686 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`a` = `test`.`a`.`d`) and (`test`.`a`.`b` = 6))
7687 Error insert to ensure that SPJ requests are purely local
7688
7689
7690 Pushed pk->uk
7691 Lookup to get a.d, feeding uk lookup of b.b
7692 explain select a.a, a.d, b.d
7693 from
7694 test.t1 a
7695 join
7696 test.t1 b
7697 on
7698 a.d = b.b
7699 where a.a = 6;
7700 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
7701 1 SIMPLE a # eq_ref PRIMARY,a PRIMARY 4 const # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
7702 1 SIMPLE b # eq_ref b b 5 test.a.d # # Child of 'a' in pushed join@1
7703 Warnings:
7704 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`b` = `test`.`a`.`d`) and (`test`.`a`.`a` = 6))
7705 Error insert to ensure that SPJ requests are purely local
7706
7707
7708 Pushed scan originating sub-lookups
7709 Table scan to get a.d, feeding pk lookups of b.a
7710 explain select a.a, a.d, b.d
7711 from
7712 test.t1 a
7713 join
7714 test.t1 b
7715 on
7716 a.d = b.a;
7717 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
7718 1 SIMPLE a # ALL NULL NULL NULL NULL # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
7719 1 SIMPLE b # eq_ref PRIMARY,a PRIMARY 4 test.a.d # # Child of 'a' in pushed join@1
7720 Warnings:
7721 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where (`test`.`b`.`a` = `test`.`a`.`d`)
7722 Error insert to ensure that SPJ requests are purely local
7723
7724 begin;
7725 select * from hints where i = 2;
7726 select a.a, a.d, b.d
7727 from
7728 test.t1 a
7729 join
7730 test.t1 b
7731 on
7732 a.d = b.a;
7733 commit;
7734
7735 Pushed scan originating sub-lookups
7736 Table scan to get a.d, feeding uk lookups of b.b
7737 explain select a.a, a.d, b.d
7738 from
7739 test.t1 a
7740 join
7741 test.t1 b
7742 on
7743 a.d = b.b;
7744 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
7745 1 SIMPLE a # ALL NULL NULL NULL NULL # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
7746 1 SIMPLE b # eq_ref b b 5 test.a.d # # Child of 'a' in pushed join@1
7747 Warnings:
7748 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where (`test`.`b`.`b` = `test`.`a`.`d`)
7749 Error insert to ensure that SPJ requests are purely local
7750
7751 begin;
7752 select * from hints where i = 2;
7753 select a.a, a.d, b.d
7754 from
7755 test.t1 a
7756 join
7757 test.t1 b
7758 on
7759 a.d = b.b;
7760 commit;
7761
7762 Pushed scan originating sub-scans
7763 Range scan on a.a > 10 getting a.d, feeding range scans on b.c = a.d
7764 explain select a.a, a.d, b.d
7765 from
7766 test.t1 a
7767 join
7768 test.t1 b
7769 on
7770 b.c=a.d
7771 where
7772 a.a>10;
7773 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
7774 1 SIMPLE a # range PRIMARY,a PRIMARY 4 NULL # # Parent of 2 pushed join@1; Using pushed condition ((`test`.`a`.`a` > 10) and (`test`.`a`.`d` is not null)); Using MRR
7775 1 SIMPLE b # ref c c 5 test.a.d # # Child of 'a' in pushed join@1
7776 Warnings:
7777 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`c` = `test`.`a`.`d`) and (`test`.`a`.`a` > 10))
7778 Error insert to ensure that SPJ requests are purely local
7779
7780 begin;
7781 select * from hints where i = 2;
7782 select a.a, a.d, b.d
7783 from
7784 test.t1 a
7785 join
7786 test.t1 b
7787 on
7788 b.c=a.d
7789 where
7790 a.a>10;
7791 commit;
7792
7793 Tests on T2 (Blobs)
7794 Test some basic NdbApi
7795 explain select * from test.t2 where t2.a=6;
7796 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
7797 1 SIMPLE t2 # eq_ref PRIMARY PRIMARY 4 const # # NULL
7798 Warnings:
7799 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` from `test`.`t2` where (`test`.`t2`.`a` = 6)
7800 Error insert to ensure that TC requests are purely local
7801
7802
7803 UI lookups
7804 explain select * from test.t2 where t2.b=6;
7805 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
7806 1 SIMPLE t2 # eq_ref b b 5 const # # NULL
7807 Warnings:
7808 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` from `test`.`t2` where (`test`.`t2`.`b` = 6)
7809 Error insert to ensure that TC requests are purely local
7810
7811
7812 OI scan
7813 explain select * from test.t2 where c > 6;
7814 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
7815 1 SIMPLE t2 # range c c 5 NULL # # Using pushed condition (`test`.`t2`.`c` > 6)
7816 Warnings:
7817 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` from `test`.`t2` where (`test`.`t2`.`c` > 6)
7818 Error insert to ensure that TC requests are purely local
7819
7820
7821 Table scan
7822 explain select * from test.t2;
7823 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
7824 1 SIMPLE t2 # ALL NULL NULL NULL NULL # # NULL
7825 Warnings:
7826 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` from `test`.`t2`
7827 Error insert to ensure that TC requests are purely local
7828
7829
7830 insert into hints values (1);
7831 Hint node by 1 of 6
7832 Tests on T1 (!Blobs)
7833 Test some basic NdbApi
7834 PK lookups
7835 explain select * from test.t1 where t1.a=6;
7836 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
7837 1 SIMPLE t1 # eq_ref PRIMARY,a PRIMARY 4 const # # NULL
7838 Warnings:
7839 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` from `test`.`t1` where (`test`.`t1`.`a` = 6)
7840 Error insert to ensure that TC requests are purely local
7841
7842
7843 UI lookups
7844 explain select * from test.t1 where t1.b=6;
7845 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
7846 1 SIMPLE t1 # eq_ref b b 5 const # # NULL
7847 Warnings:
7848 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` from `test`.`t1` where (`test`.`t1`.`b` = 6)
7849 Error insert to ensure that TC requests are purely local
7850
7851
7852 OI scan
7853 explain select * from test.t1 where c > 6;
7854 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
7855 1 SIMPLE t1 # range c c 5 NULL # # Using pushed condition (`test`.`t1`.`c` > 6); Using MRR
7856 Warnings:
7857 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` from `test`.`t1` where (`test`.`t1`.`c` > 6)
7858 Error insert to ensure that TC requests are purely local
7859
7860
7861 Table scan
7862 explain select * from test.t1;
7863 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
7864 1 SIMPLE t1 # ALL NULL NULL NULL NULL # # NULL
7865 Warnings:
7866 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` from `test`.`t1`
7867 Error insert to ensure that TC requests are purely local
7868
7869
7870 Test pushed queries (SPJ)
7871 Pushed pk->pk
7872 Lookup to get a.d, feeding pk lookup of b.a
7873 explain select a.a, a.d, b.d
7874 from
7875 test.t1 a
7876 join
7877 test.t1 b
7878 on
7879 a.d = b.a
7880 where a.a = 6;
7881 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
7882 1 SIMPLE a # eq_ref PRIMARY,a PRIMARY 4 const # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
7883 1 SIMPLE b # eq_ref PRIMARY,a PRIMARY 4 test.a.d # # Child of 'a' in pushed join@1
7884 Warnings:
7885 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`a` = `test`.`a`.`d`) and (`test`.`a`.`a` = 6))
7886 Error insert to ensure that SPJ requests are purely local
7887
7888
7889 Pushed uk->uk
7890 Lookup to get a.d, feeding uk lookup of b.b
7891 explain select a.a, a.d, b.d
7892 from
7893 test.t1 a
7894 join
7895 test.t1 b
7896 on
7897 a.d = b.b
7898 where a.b = 6;
7899 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
7900 1 SIMPLE a # eq_ref b b 5 const # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
7901 1 SIMPLE b # eq_ref b b 5 test.a.d # # Child of 'a' in pushed join@1
7902 Warnings:
7903 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`b` = `test`.`a`.`d`) and (`test`.`a`.`b` = 6))
7904 Error insert to ensure that SPJ requests are purely local
7905
7906
7907 Pushed uk->pk
7908 Lookup to get a.d, feeding pk lookup of b.a
7909 explain select a.a, a.d, b.d
7910 from
7911 test.t1 a
7912 join
7913 test.t1 b
7914 on
7915 a.d = b.a
7916 where a.b = 6;
7917 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
7918 1 SIMPLE a # eq_ref b b 5 const # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
7919 1 SIMPLE b # eq_ref PRIMARY,a PRIMARY 4 test.a.d # # Child of 'a' in pushed join@1
7920 Warnings:
7921 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`a` = `test`.`a`.`d`) and (`test`.`a`.`b` = 6))
7922 Error insert to ensure that SPJ requests are purely local
7923
7924
7925 Pushed pk->uk
7926 Lookup to get a.d, feeding uk lookup of b.b
7927 explain select a.a, a.d, b.d
7928 from
7929 test.t1 a
7930 join
7931 test.t1 b
7932 on
7933 a.d = b.b
7934 where a.a = 6;
7935 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
7936 1 SIMPLE a # eq_ref PRIMARY,a PRIMARY 4 const # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
7937 1 SIMPLE b # eq_ref b b 5 test.a.d # # Child of 'a' in pushed join@1
7938 Warnings:
7939 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`b` = `test`.`a`.`d`) and (`test`.`a`.`a` = 6))
7940 Error insert to ensure that SPJ requests are purely local
7941
7942
7943 Pushed scan originating sub-lookups
7944 Table scan to get a.d, feeding pk lookups of b.a
7945 explain select a.a, a.d, b.d
7946 from
7947 test.t1 a
7948 join
7949 test.t1 b
7950 on
7951 a.d = b.a;
7952 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
7953 1 SIMPLE a # ALL NULL NULL NULL NULL # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
7954 1 SIMPLE b # eq_ref PRIMARY,a PRIMARY 4 test.a.d # # Child of 'a' in pushed join@1
7955 Warnings:
7956 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where (`test`.`b`.`a` = `test`.`a`.`d`)
7957 Error insert to ensure that SPJ requests are purely local
7958
7959 begin;
7960 select * from hints where i = 1;
7961 select a.a, a.d, b.d
7962 from
7963 test.t1 a
7964 join
7965 test.t1 b
7966 on
7967 a.d = b.a;
7968 commit;
7969
7970 Pushed scan originating sub-lookups
7971 Table scan to get a.d, feeding uk lookups of b.b
7972 explain select a.a, a.d, b.d
7973 from
7974 test.t1 a
7975 join
7976 test.t1 b
7977 on
7978 a.d = b.b;
7979 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
7980 1 SIMPLE a # ALL NULL NULL NULL NULL # # Parent of 2 pushed join@1; Using pushed condition (`test`.`a`.`d` is not null)
7981 1 SIMPLE b # eq_ref b b 5 test.a.d # # Child of 'a' in pushed join@1
7982 Warnings:
7983 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where (`test`.`b`.`b` = `test`.`a`.`d`)
7984 Error insert to ensure that SPJ requests are purely local
7985
7986 begin;
7987 select * from hints where i = 1;
7988 select a.a, a.d, b.d
7989 from
7990 test.t1 a
7991 join
7992 test.t1 b
7993 on
7994 a.d = b.b;
7995 commit;
7996
7997 Pushed scan originating sub-scans
7998 Range scan on a.a > 10 getting a.d, feeding range scans on b.c = a.d
7999 explain select a.a, a.d, b.d
8000 from
8001 test.t1 a
8002 join
8003 test.t1 b
8004 on
8005 b.c=a.d
8006 where
8007 a.a>10;
8008 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
8009 1 SIMPLE a # range PRIMARY,a PRIMARY 4 NULL # # Parent of 2 pushed join@1; Using pushed condition ((`test`.`a`.`a` > 10) and (`test`.`a`.`d` is not null)); Using MRR
8010 1 SIMPLE b # ref c c 5 test.a.d # # Child of 'a' in pushed join@1
8011 Warnings:
8012 Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`d` AS `d`,`test`.`b`.`d` AS `d` from `test`.`t1` `a` join `test`.`t1` `b` where ((`test`.`b`.`c` = `test`.`a`.`d`) and (`test`.`a`.`a` > 10))
8013 Error insert to ensure that SPJ requests are purely local
8014
8015 begin;
8016 select * from hints where i = 1;
8017 select a.a, a.d, b.d
8018 from
8019 test.t1 a
8020 join
8021 test.t1 b
8022 on
8023 b.c=a.d
8024 where
8025 a.a>10;
8026 commit;
8027
8028 Tests on T2 (Blobs)
8029 Test some basic NdbApi
8030 explain select * from test.t2 where t2.a=6;
8031 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
8032 1 SIMPLE t2 # eq_ref PRIMARY PRIMARY 4 const # # NULL
8033 Warnings:
8034 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` from `test`.`t2` where (`test`.`t2`.`a` = 6)
8035 Error insert to ensure that TC requests are purely local
8036
8037
8038 UI lookups
8039 explain select * from test.t2 where t2.b=6;
8040 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
8041 1 SIMPLE t2 # eq_ref b b 5 const # # NULL
8042 Warnings:
8043 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` from `test`.`t2` where (`test`.`t2`.`b` = 6)
8044 Error insert to ensure that TC requests are purely local
8045
8046
8047 OI scan
8048 explain select * from test.t2 where c > 6;
8049 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
8050 1 SIMPLE t2 # range c c 5 NULL # # Using pushed condition (`test`.`t2`.`c` > 6)
8051 Warnings:
8052 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` from `test`.`t2` where (`test`.`t2`.`c` > 6)
8053 Error insert to ensure that TC requests are purely local
8054
8055
8056 Table scan
8057 explain select * from test.t2;
8058 id select_type table partitions type possible_keys key key_len ref rows filtered Extra
8059 1 SIMPLE t2 # ALL NULL NULL NULL NULL # # NULL
8060 Warnings:
8061 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` from `test`.`t2`
8062 Error insert to ensure that TC requests are purely local
8063
8064
8065 drop table hints;
8066 delete from t1;
8067 delete from t2;
8068 drop table test.t1;
8069 drop table test.t2;
8070 Drop Node Group 1 done
8071 Drop Node Group 2 done