1
DROP TABLE IF EXISTS t0,t1,t2,t3,t4,t5,t6,t7,t8,t9;
2
CREATE TABLE t0 (a int, b int, c int);
3
CREATE TABLE t1 (a int, b int, c int);
4
CREATE TABLE t2 (a int, b int, c int);
5
CREATE TABLE t3 (a int, b int, c int);
6
CREATE TABLE t4 (a int, b int, c int);
7
CREATE TABLE t5 (a int, b int, c int);
8
CREATE TABLE t6 (a int, b int, c int);
9
CREATE TABLE t7 (a int, b int, c int);
10
CREATE TABLE t8 (a int, b int, c int);
11
CREATE TABLE t9 (a int, b int, c int);
12
INSERT INTO t0 VALUES (1,1,0), (1,2,0), (2,2,0);
13
INSERT INTO t1 VALUES (1,3,0), (2,2,0), (3,2,0);
14
INSERT INTO t2 VALUES (3,3,0), (4,2,0), (5,3,0);
15
INSERT INTO t3 VALUES (1,2,0), (2,2,0);
16
INSERT INTO t4 VALUES (3,2,0), (4,2,0);
17
INSERT INTO t5 VALUES (3,1,0), (2,2,0), (3,3,0);
18
INSERT INTO t6 VALUES (3,2,0), (6,2,0), (6,1,0);
19
INSERT INTO t7 VALUES (1,1,0), (2,2,0);
20
INSERT INTO t8 VALUES (0,2,0), (1,2,0);
21
INSERT INTO t9 VALUES (1,1,0), (1,2,0), (3,3,0);
38
SELECT t3.a,t3.b,t4.a,t4.b
45
SELECT t2.a,t2.b,t3.a,t3.b,t4.a,t4.b
51
3 3 NULL NULL NULL NULL
56
5 3 NULL NULL NULL NULL
57
SELECT t2.a,t2.b,t3.a,t3.b,t4.a,t4.b
61
ON t3.a=1 AND t2.b=t4.b;
63
3 3 NULL NULL NULL NULL
66
5 3 NULL NULL NULL NULL
68
SELECT t2.a,t2.b,t3.a,t3.b,t4.a,t4.b
73
WHERE t3.a=1 OR t3.c IS NULL;
74
id select_type table type possible_keys key key_len ref rows filtered Extra
75
1 SIMPLE t2 ALL NULL NULL NULL NULL 3 100.00
76
1 SIMPLE t3 ALL NULL NULL NULL NULL 2 100.00 Using where
77
1 SIMPLE t4 ALL NULL NULL NULL NULL 2 100.00
79
Note 1003 select "test"."t2"."a" AS "a","test"."t2"."b" AS "b","test"."t3"."a" AS "a","test"."t3"."b" AS "b","test"."t4"."a" AS "a","test"."t4"."b" AS "b" from "test"."t2" left join ("test"."t3" join "test"."t4") on(("test"."t4"."b" = "test"."t2"."b")) where (("test"."t3"."a" = 1) or isnull("test"."t3"."c"))
80
SELECT t2.a,t2.b,t3.a,t3.b,t4.a,t4.b
85
WHERE t3.a=1 OR t3.c IS NULL;
87
3 3 NULL NULL NULL NULL
90
5 3 NULL NULL NULL NULL
91
SELECT t2.a,t2.b,t3.a,t3.b,t4.a,t4.b
96
WHERE t3.a>1 OR t3.c IS NULL;
98
3 3 NULL NULL NULL NULL
101
5 3 NULL NULL NULL NULL
108
SELECT t3.a,t3.b,t4.a,t4.b,t5.a,t5.b
123
SELECT t2.a,t2.b,t3.a,t3.b,t4.a,t4.b,t5.a,t5.b
129
3 3 NULL NULL NULL NULL NULL NULL
142
5 3 NULL NULL NULL NULL NULL NULL
144
SELECT t2.a,t2.b,t3.a,t3.b,t4.a,t4.b,t5.a,t5.b
149
WHERE t3.a>1 OR t3.c IS NULL;
150
id select_type table type possible_keys key key_len ref rows filtered Extra
151
1 SIMPLE t2 ALL NULL NULL NULL NULL 3 100.00
152
1 SIMPLE t3 ALL NULL NULL NULL NULL 2 100.00 Using where
153
1 SIMPLE t4 ALL NULL NULL NULL NULL 2 100.00
154
1 SIMPLE t5 ALL NULL NULL NULL NULL 3 100.00
156
Note 1003 select "test"."t2"."a" AS "a","test"."t2"."b" AS "b","test"."t3"."a" AS "a","test"."t3"."b" AS "b","test"."t4"."a" AS "a","test"."t4"."b" AS "b","test"."t5"."a" AS "a","test"."t5"."b" AS "b" from "test"."t2" left join ("test"."t3" join "test"."t4" join "test"."t5") on(("test"."t4"."b" = "test"."t2"."b")) where (("test"."t3"."a" > 1) or isnull("test"."t3"."c"))
157
SELECT t2.a,t2.b,t3.a,t3.b,t4.a,t4.b,t5.a,t5.b
162
WHERE t3.a>1 OR t3.c IS NULL;
164
3 3 NULL NULL NULL NULL NULL NULL
171
5 3 NULL NULL NULL NULL NULL NULL
173
SELECT t2.a,t2.b,t3.a,t3.b,t4.a,t4.b,t5.a,t5.b
178
WHERE (t3.a>1 OR t3.c IS NULL) AND
179
(t5.a<3 OR t5.c IS NULL);
180
id select_type table type possible_keys key key_len ref rows filtered Extra
181
1 SIMPLE t2 ALL NULL NULL NULL NULL 3 100.00
182
1 SIMPLE t3 ALL NULL NULL NULL NULL 2 100.00 Using where
183
1 SIMPLE t4 ALL NULL NULL NULL NULL 2 100.00
184
1 SIMPLE t5 ALL NULL NULL NULL NULL 3 100.00 Using where
186
Note 1003 select "test"."t2"."a" AS "a","test"."t2"."b" AS "b","test"."t3"."a" AS "a","test"."t3"."b" AS "b","test"."t4"."a" AS "a","test"."t4"."b" AS "b","test"."t5"."a" AS "a","test"."t5"."b" AS "b" from "test"."t2" left join ("test"."t3" join "test"."t4" join "test"."t5") on(("test"."t4"."b" = "test"."t2"."b")) where ((("test"."t3"."a" > 1) or isnull("test"."t3"."c")) and (("test"."t5"."a" < 3) or isnull("test"."t5"."c")))
187
SELECT t2.a,t2.b,t3.a,t3.b,t4.a,t4.b,t5.a,t5.b
192
WHERE (t3.a>1 OR t3.c IS NULL) AND
193
(t5.a<3 OR t5.c IS NULL);
195
3 3 NULL NULL NULL NULL NULL NULL
198
5 3 NULL NULL NULL NULL NULL NULL
210
SELECT t6.a,t6.b,t7.a,t7.b
225
SELECT t6.a,t6.b,t7.a,t7.b,t8.a,t8.b
229
ON t7.b=t8.b AND t6.b < 10;
230
id select_type table type possible_keys key key_len ref rows filtered Extra
231
1 SIMPLE t7 ALL NULL NULL NULL NULL 2 100.00
232
1 SIMPLE t6 ALL NULL NULL NULL NULL 3 100.00 Using join buffer
233
1 SIMPLE t8 ALL NULL NULL NULL NULL 2 100.00
235
Note 1003 select "test"."t6"."a" AS "a","test"."t6"."b" AS "b","test"."t7"."a" AS "a","test"."t7"."b" AS "b","test"."t8"."a" AS "a","test"."t8"."b" AS "b" from "test"."t6" join "test"."t7" left join "test"."t8" on((("test"."t7"."b" = "test"."t8"."b") and ("test"."t6"."b" < 10))) where 1
236
SELECT t6.a,t6.b,t7.a,t7.b,t8.a,t8.b
240
ON t7.b=t8.b AND t6.b < 10;
257
SELECT t5.a,t5.b,t6.a,t6.b,t7.a,t7.b,t8.a,t8.b
264
ON t7.b=t8.b AND t6.b < 10
266
ON t6.b >= 2 AND t5.b=t7.b;
268
3 1 3 2 1 1 NULL NULL
269
3 1 6 2 1 1 NULL NULL
274
3 3 NULL NULL NULL NULL NULL NULL
275
SELECT t5.a,t5.b,t6.a,t6.b,t7.a,t7.b,t8.a,t8.b
282
ON t7.b=t8.b AND t6.b < 10
284
ON t6.b >= 2 AND t5.b=t7.b AND
285
(t8.a < 1 OR t8.c IS NULL);
287
3 1 3 2 1 1 NULL NULL
288
3 1 6 2 1 1 NULL NULL
291
3 3 NULL NULL NULL NULL NULL NULL
292
SELECT t2.a,t2.b,t3.a,t3.b,t4.a,t4.b
296
ON t3.a=1 AND t2.b=t4.b;
298
3 3 NULL NULL NULL NULL
301
5 3 NULL NULL NULL NULL
302
SELECT t2.a,t2.b,t3.a,t3.b,t4.a,t4.b,
303
t5.a,t5.b,t6.a,t6.b,t7.a,t7.b,t8.a,t8.b
307
ON t3.a=1 AND t2.b=t4.b,
314
ON t7.b=t8.b AND t6.b < 10
316
ON t6.b >= 2 AND t5.b=t7.b;
317
a b a b a b a b a b a b a b
318
3 3 NULL NULL NULL NULL 3 1 3 2 1 1 NULL NULL
319
3 3 NULL NULL NULL NULL 3 1 6 2 1 1 NULL NULL
320
4 2 1 2 3 2 3 1 3 2 1 1 NULL NULL
321
4 2 1 2 3 2 3 1 6 2 1 1 NULL NULL
322
4 2 1 2 4 2 3 1 3 2 1 1 NULL NULL
323
4 2 1 2 4 2 3 1 6 2 1 1 NULL NULL
324
5 3 NULL NULL NULL NULL 3 1 3 2 1 1 NULL NULL
325
5 3 NULL NULL NULL NULL 3 1 6 2 1 1 NULL NULL
326
3 3 NULL NULL NULL NULL 2 2 3 2 2 2 0 2
327
3 3 NULL NULL NULL NULL 2 2 3 2 2 2 1 2
328
3 3 NULL NULL NULL NULL 2 2 6 2 2 2 0 2
329
3 3 NULL NULL NULL NULL 2 2 6 2 2 2 1 2
330
4 2 1 2 3 2 2 2 3 2 2 2 0 2
331
4 2 1 2 3 2 2 2 3 2 2 2 1 2
332
4 2 1 2 3 2 2 2 6 2 2 2 0 2
333
4 2 1 2 3 2 2 2 6 2 2 2 1 2
334
4 2 1 2 4 2 2 2 3 2 2 2 0 2
335
4 2 1 2 4 2 2 2 3 2 2 2 1 2
336
4 2 1 2 4 2 2 2 6 2 2 2 0 2
337
4 2 1 2 4 2 2 2 6 2 2 2 1 2
338
5 3 NULL NULL NULL NULL 2 2 3 2 2 2 0 2
339
5 3 NULL NULL NULL NULL 2 2 3 2 2 2 1 2
340
5 3 NULL NULL NULL NULL 2 2 6 2 2 2 0 2
341
5 3 NULL NULL NULL NULL 2 2 6 2 2 2 1 2
342
3 3 NULL NULL NULL NULL 3 3 NULL NULL NULL NULL NULL NULL
343
4 2 1 2 3 2 3 3 NULL NULL NULL NULL NULL NULL
344
4 2 1 2 4 2 3 3 NULL NULL NULL NULL NULL NULL
345
5 3 NULL NULL NULL NULL 3 3 NULL NULL NULL NULL NULL NULL
346
SELECT t2.a,t2.b,t3.a,t3.b,t4.a,t4.b,
347
t5.a,t5.b,t6.a,t6.b,t7.a,t7.b,t8.a,t8.b
351
ON t3.a=1 AND t2.b=t4.b,
358
ON t7.b=t8.b AND t6.b < 10
360
ON t6.b >= 2 AND t5.b=t7.b
362
(t6.a < 6 OR t6.c IS NULL);
363
a b a b a b a b a b a b a b
364
4 2 1 2 3 2 3 1 3 2 1 1 NULL NULL
365
4 2 1 2 4 2 3 1 3 2 1 1 NULL NULL
366
5 3 NULL NULL NULL NULL 3 1 3 2 1 1 NULL NULL
367
4 2 1 2 3 2 2 2 3 2 2 2 0 2
368
4 2 1 2 3 2 2 2 3 2 2 2 1 2
369
4 2 1 2 4 2 2 2 3 2 2 2 0 2
370
4 2 1 2 4 2 2 2 3 2 2 2 1 2
371
5 3 NULL NULL NULL NULL 2 2 3 2 2 2 0 2
372
5 3 NULL NULL NULL NULL 2 2 3 2 2 2 1 2
373
4 2 1 2 3 2 3 3 NULL NULL NULL NULL NULL NULL
374
4 2 1 2 4 2 3 3 NULL NULL NULL NULL NULL NULL
375
5 3 NULL NULL NULL NULL 3 3 NULL NULL NULL NULL NULL NULL
382
SELECT t1.a,t1.b,t2.a,t2.b,t3.a,t3.b,t4.a,t4.b,
383
t5.a,t5.b,t6.a,t6.b,t7.a,t7.b,t8.a,t8.b
390
ON t3.a=1 AND t2.b=t4.b,
397
ON t7.b=t8.b AND t6.b < 10
399
ON t6.b >= 2 AND t5.b=t7.b
401
ON (t3.b=2 OR t3.c IS NULL) AND (t6.b=2 OR t6.c IS NULL) AND
402
(t1.b=t5.b OR t3.c IS NULL OR t6.c IS NULL or t8.c IS NULL) AND
404
a b a b a b a b a b a b a b a b
405
1 3 3 3 NULL NULL NULL NULL 3 1 3 2 1 1 NULL NULL
406
1 3 3 3 NULL NULL NULL NULL 3 1 6 2 1 1 NULL NULL
407
1 3 3 3 NULL NULL NULL NULL 2 2 3 2 2 2 0 2
408
1 3 3 3 NULL NULL NULL NULL 2 2 3 2 2 2 1 2
409
1 3 3 3 NULL NULL NULL NULL 2 2 6 2 2 2 0 2
410
1 3 3 3 NULL NULL NULL NULL 2 2 6 2 2 2 1 2
411
1 3 3 3 NULL NULL NULL NULL 3 3 NULL NULL NULL NULL NULL NULL
412
1 3 4 2 1 2 3 2 3 1 3 2 1 1 NULL NULL
413
1 3 4 2 1 2 3 2 3 1 6 2 1 1 NULL NULL
414
1 3 4 2 1 2 3 2 3 3 NULL NULL NULL NULL NULL NULL
415
1 3 4 2 1 2 4 2 3 1 3 2 1 1 NULL NULL
416
1 3 4 2 1 2 4 2 3 1 6 2 1 1 NULL NULL
417
1 3 4 2 1 2 4 2 3 3 NULL NULL NULL NULL NULL NULL
418
1 3 5 3 NULL NULL NULL NULL 3 1 3 2 1 1 NULL NULL
419
1 3 5 3 NULL NULL NULL NULL 3 1 6 2 1 1 NULL NULL
420
1 3 5 3 NULL NULL NULL NULL 2 2 3 2 2 2 0 2
421
1 3 5 3 NULL NULL NULL NULL 2 2 3 2 2 2 1 2
422
1 3 5 3 NULL NULL NULL NULL 2 2 6 2 2 2 0 2
423
1 3 5 3 NULL NULL NULL NULL 2 2 6 2 2 2 1 2
424
1 3 5 3 NULL NULL NULL NULL 3 3 NULL NULL NULL NULL NULL NULL
425
2 2 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
426
3 2 3 3 NULL NULL NULL NULL 3 1 3 2 1 1 NULL NULL
427
3 2 3 3 NULL NULL NULL NULL 3 1 6 2 1 1 NULL NULL
428
3 2 3 3 NULL NULL NULL NULL 2 2 3 2 2 2 0 2
429
3 2 3 3 NULL NULL NULL NULL 2 2 3 2 2 2 1 2
430
3 2 3 3 NULL NULL NULL NULL 2 2 6 2 2 2 0 2
431
3 2 3 3 NULL NULL NULL NULL 2 2 6 2 2 2 1 2
432
3 2 3 3 NULL NULL NULL NULL 3 3 NULL NULL NULL NULL NULL NULL
433
3 2 4 2 1 2 3 2 3 1 3 2 1 1 NULL NULL
434
3 2 4 2 1 2 3 2 3 1 6 2 1 1 NULL NULL
435
3 2 4 2 1 2 3 2 2 2 3 2 2 2 0 2
436
3 2 4 2 1 2 3 2 2 2 3 2 2 2 1 2
437
3 2 4 2 1 2 3 2 2 2 6 2 2 2 0 2
438
3 2 4 2 1 2 3 2 2 2 6 2 2 2 1 2
439
3 2 4 2 1 2 3 2 3 3 NULL NULL NULL NULL NULL NULL
440
3 2 4 2 1 2 4 2 3 1 3 2 1 1 NULL NULL
441
3 2 4 2 1 2 4 2 3 1 6 2 1 1 NULL NULL
442
3 2 4 2 1 2 4 2 2 2 3 2 2 2 0 2
443
3 2 4 2 1 2 4 2 2 2 3 2 2 2 1 2
444
3 2 4 2 1 2 4 2 2 2 6 2 2 2 0 2
445
3 2 4 2 1 2 4 2 2 2 6 2 2 2 1 2
446
3 2 4 2 1 2 4 2 3 3 NULL NULL NULL NULL NULL NULL
447
3 2 5 3 NULL NULL NULL NULL 3 1 3 2 1 1 NULL NULL
448
3 2 5 3 NULL NULL NULL NULL 3 1 6 2 1 1 NULL NULL
449
3 2 5 3 NULL NULL NULL NULL 2 2 3 2 2 2 0 2
450
3 2 5 3 NULL NULL NULL NULL 2 2 3 2 2 2 1 2
451
3 2 5 3 NULL NULL NULL NULL 2 2 6 2 2 2 0 2
452
3 2 5 3 NULL NULL NULL NULL 2 2 6 2 2 2 1 2
453
3 2 5 3 NULL NULL NULL NULL 3 3 NULL NULL NULL NULL NULL NULL
454
SELECT t1.a,t1.b,t2.a,t2.b,t3.a,t3.b,t4.a,t4.b,
455
t5.a,t5.b,t6.a,t6.b,t7.a,t7.b,t8.a,t8.b
462
ON t3.a=1 AND t2.b=t4.b,
469
ON t7.b=t8.b AND t6.b < 10
471
ON t6.b >= 2 AND t5.b=t7.b
473
ON (t3.b=2 OR t3.c IS NULL) AND (t6.b=2 OR t6.c IS NULL) AND
474
(t1.b=t5.b OR t3.c IS NULL OR t6.c IS NULL or t8.c IS NULL) AND
476
WHERE (t2.a >= 4 OR t2.c IS NULL);
477
a b a b a b a b a b a b a b a b
478
1 3 4 2 1 2 3 2 3 1 3 2 1 1 NULL NULL
479
1 3 4 2 1 2 3 2 3 1 6 2 1 1 NULL NULL
480
1 3 4 2 1 2 3 2 3 3 NULL NULL NULL NULL NULL NULL
481
1 3 4 2 1 2 4 2 3 1 3 2 1 1 NULL NULL
482
1 3 4 2 1 2 4 2 3 1 6 2 1 1 NULL NULL
483
1 3 4 2 1 2 4 2 3 3 NULL NULL NULL NULL NULL NULL
484
1 3 5 3 NULL NULL NULL NULL 3 1 3 2 1 1 NULL NULL
485
1 3 5 3 NULL NULL NULL NULL 3 1 6 2 1 1 NULL NULL
486
1 3 5 3 NULL NULL NULL NULL 2 2 3 2 2 2 0 2
487
1 3 5 3 NULL NULL NULL NULL 2 2 3 2 2 2 1 2
488
1 3 5 3 NULL NULL NULL NULL 2 2 6 2 2 2 0 2
489
1 3 5 3 NULL NULL NULL NULL 2 2 6 2 2 2 1 2
490
1 3 5 3 NULL NULL NULL NULL 3 3 NULL NULL NULL NULL NULL NULL
491
2 2 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
492
3 2 4 2 1 2 3 2 3 1 3 2 1 1 NULL NULL
493
3 2 4 2 1 2 3 2 3 1 6 2 1 1 NULL NULL
494
3 2 4 2 1 2 3 2 2 2 3 2 2 2 0 2
495
3 2 4 2 1 2 3 2 2 2 3 2 2 2 1 2
496
3 2 4 2 1 2 3 2 2 2 6 2 2 2 0 2
497
3 2 4 2 1 2 3 2 2 2 6 2 2 2 1 2
498
3 2 4 2 1 2 3 2 3 3 NULL NULL NULL NULL NULL NULL
499
3 2 4 2 1 2 4 2 3 1 3 2 1 1 NULL NULL
500
3 2 4 2 1 2 4 2 3 1 6 2 1 1 NULL NULL
501
3 2 4 2 1 2 4 2 2 2 3 2 2 2 0 2
502
3 2 4 2 1 2 4 2 2 2 3 2 2 2 1 2
503
3 2 4 2 1 2 4 2 2 2 6 2 2 2 0 2
504
3 2 4 2 1 2 4 2 2 2 6 2 2 2 1 2
505
3 2 4 2 1 2 4 2 3 3 NULL NULL NULL NULL NULL NULL
506
3 2 5 3 NULL NULL NULL NULL 3 1 3 2 1 1 NULL NULL
507
3 2 5 3 NULL NULL NULL NULL 3 1 6 2 1 1 NULL NULL
508
3 2 5 3 NULL NULL NULL NULL 2 2 3 2 2 2 0 2
509
3 2 5 3 NULL NULL NULL NULL 2 2 3 2 2 2 1 2
510
3 2 5 3 NULL NULL NULL NULL 2 2 6 2 2 2 0 2
511
3 2 5 3 NULL NULL NULL NULL 2 2 6 2 2 2 1 2
512
3 2 5 3 NULL NULL NULL NULL 3 3 NULL NULL NULL NULL NULL NULL
520
SELECT t0.a,t0.b,t1.a,t1.b,t2.a,t2.b,t3.a,t3.b,t4.a,t4.b,
521
t5.a,t5.b,t6.a,t6.b,t7.a,t7.b,t8.a,t8.b
528
ON t3.a=1 AND t2.b=t4.b,
535
ON t7.b=t8.b AND t6.b < 10
537
ON t6.b >= 2 AND t5.b=t7.b
539
ON (t3.b=2 OR t3.c IS NULL) AND (t6.b=2 OR t6.c IS NULL) AND
540
(t1.b=t5.b OR t3.c IS NULL OR t6.c IS NULL or t8.c IS NULL) AND
544
(t2.a >= 4 OR t2.c IS NULL);
545
id select_type table type possible_keys key key_len ref rows filtered Extra
546
1 SIMPLE t0 ALL NULL NULL NULL NULL 3 100.00 Using where
547
1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer
548
1 SIMPLE t2 ALL NULL NULL NULL NULL 3 100.00 Using where
549
1 SIMPLE t3 ALL NULL NULL NULL NULL 2 100.00
550
1 SIMPLE t4 ALL NULL NULL NULL NULL 2 100.00
551
1 SIMPLE t5 ALL NULL NULL NULL NULL 3 100.00
552
1 SIMPLE t7 ALL NULL NULL NULL NULL 2 100.00
553
1 SIMPLE t6 ALL NULL NULL NULL NULL 3 100.00
554
1 SIMPLE t8 ALL NULL NULL NULL NULL 2 100.00
556
Note 1003 select "test"."t0"."a" AS "a","test"."t0"."b" AS "b","test"."t1"."a" AS "a","test"."t1"."b" AS "b","test"."t2"."a" AS "a","test"."t2"."b" AS "b","test"."t3"."a" AS "a","test"."t3"."b" AS "b","test"."t4"."a" AS "a","test"."t4"."b" AS "b","test"."t5"."a" AS "a","test"."t5"."b" AS "b","test"."t6"."a" AS "a","test"."t6"."b" AS "b","test"."t7"."a" AS "a","test"."t7"."b" AS "b","test"."t8"."a" AS "a","test"."t8"."b" AS "b" from "test"."t0" join "test"."t1" left join ("test"."t2" left join ("test"."t3" join "test"."t4") on((("test"."t4"."b" = "test"."t2"."b") and ("test"."t3"."a" = 1))) join "test"."t5" left join ("test"."t6" join "test"."t7" left join "test"."t8" on((("test"."t8"."b" = "test"."t5"."b") and ("test"."t6"."b" < 10)))) on((("test"."t7"."b" = "test"."t5"."b") and ("test"."t6"."b" >= 2)))) on(((("test"."t3"."b" = 2) or isnull("test"."t3"."c")) and (("test"."t6"."b" = 2) or isnull("test"."t6"."c")) and (("test"."t5"."b" = "test"."t0"."b") or isnull("test"."t3"."c") or isnull("test"."t6"."c") or isnull("test"."t8"."c")) and ("test"."t1"."a" <> 2))) where (("test"."t1"."b" = "test"."t0"."b") and ("test"."t0"."a" = 1) and (("test"."t2"."a" >= 4) or isnull("test"."t2"."c")))
557
SELECT t0.a,t0.b,t1.a,t1.b,t2.a,t2.b,t3.a,t3.b,t4.a,t4.b,
558
t5.a,t5.b,t6.a,t6.b,t7.a,t7.b,t8.a,t8.b
565
ON t3.a=1 AND t2.b=t4.b,
572
ON t7.b=t8.b AND t6.b < 10
574
ON t6.b >= 2 AND t5.b=t7.b
576
ON (t3.b=2 OR t3.c IS NULL) AND (t6.b=2 OR t6.c IS NULL) AND
577
(t1.b=t5.b OR t3.c IS NULL OR t6.c IS NULL or t8.c IS NULL) AND
581
(t2.a >= 4 OR t2.c IS NULL);
582
a b a b a b a b a b a b a b a b a b
583
1 2 2 2 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
584
1 2 3 2 4 2 1 2 3 2 3 1 3 2 1 1 NULL NULL
585
1 2 3 2 4 2 1 2 3 2 3 1 6 2 1 1 NULL NULL
586
1 2 3 2 4 2 1 2 3 2 2 2 3 2 2 2 0 2
587
1 2 3 2 4 2 1 2 3 2 2 2 3 2 2 2 1 2
588
1 2 3 2 4 2 1 2 3 2 2 2 6 2 2 2 0 2
589
1 2 3 2 4 2 1 2 3 2 2 2 6 2 2 2 1 2
590
1 2 3 2 4 2 1 2 3 2 3 3 NULL NULL NULL NULL NULL NULL
591
1 2 3 2 4 2 1 2 4 2 3 1 3 2 1 1 NULL NULL
592
1 2 3 2 4 2 1 2 4 2 3 1 6 2 1 1 NULL NULL
593
1 2 3 2 4 2 1 2 4 2 2 2 3 2 2 2 0 2
594
1 2 3 2 4 2 1 2 4 2 2 2 3 2 2 2 1 2
595
1 2 3 2 4 2 1 2 4 2 2 2 6 2 2 2 0 2
596
1 2 3 2 4 2 1 2 4 2 2 2 6 2 2 2 1 2
597
1 2 3 2 4 2 1 2 4 2 3 3 NULL NULL NULL NULL NULL NULL
598
1 2 3 2 5 3 NULL NULL NULL NULL 3 1 3 2 1 1 NULL NULL
599
1 2 3 2 5 3 NULL NULL NULL NULL 3 1 6 2 1 1 NULL NULL
600
1 2 3 2 5 3 NULL NULL NULL NULL 2 2 3 2 2 2 0 2
601
1 2 3 2 5 3 NULL NULL NULL NULL 2 2 3 2 2 2 1 2
602
1 2 3 2 5 3 NULL NULL NULL NULL 2 2 6 2 2 2 0 2
603
1 2 3 2 5 3 NULL NULL NULL NULL 2 2 6 2 2 2 1 2
604
1 2 3 2 5 3 NULL NULL NULL NULL 3 3 NULL NULL NULL NULL NULL NULL
606
SELECT t0.a,t0.b,t1.a,t1.b,t2.a,t2.b,t3.a,t3.b,t4.a,t4.b,
607
t5.a,t5.b,t6.a,t6.b,t7.a,t7.b,t8.a,t8.b,t9.a,t9.b
614
ON t3.a=1 AND t2.b=t4.b,
621
ON t7.b=t8.b AND t6.b < 10
623
ON t6.b >= 2 AND t5.b=t7.b
625
ON (t3.b=2 OR t3.c IS NULL) AND (t6.b=2 OR t6.c IS NULL) AND
626
(t1.b=t5.b OR t3.c IS NULL OR t6.c IS NULL or t8.c IS NULL) AND
631
(t2.a >= 4 OR t2.c IS NULL) AND
632
(t3.a < 5 OR t3.c IS NULL) AND
633
(t3.b=t4.b OR t3.c IS NULL OR t4.c IS NULL) AND
634
(t5.a >=2 OR t5.c IS NULL) AND
635
(t6.a >=4 OR t6.c IS NULL) AND
636
(t7.a <= 2 OR t7.c IS NULL) AND
637
(t8.a < 1 OR t8.c IS NULL) AND
638
(t8.b=t9.b OR t8.c IS NULL) AND
640
id select_type table type possible_keys key key_len ref rows filtered Extra
641
1 SIMPLE t0 ALL NULL NULL NULL NULL 3 100.00 Using where
642
1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer
643
1 SIMPLE t2 ALL NULL NULL NULL NULL 3 100.00 Using where
644
1 SIMPLE t3 ALL NULL NULL NULL NULL 2 100.00 Using where
645
1 SIMPLE t4 ALL NULL NULL NULL NULL 2 100.00 Using where
646
1 SIMPLE t5 ALL NULL NULL NULL NULL 3 100.00 Using where
647
1 SIMPLE t7 ALL NULL NULL NULL NULL 2 100.00 Using where
648
1 SIMPLE t6 ALL NULL NULL NULL NULL 3 100.00 Using where
649
1 SIMPLE t8 ALL NULL NULL NULL NULL 2 100.00 Using where
650
1 SIMPLE t9 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer
652
Note 1003 select "test"."t0"."a" AS "a","test"."t0"."b" AS "b","test"."t1"."a" AS "a","test"."t1"."b" AS "b","test"."t2"."a" AS "a","test"."t2"."b" AS "b","test"."t3"."a" AS "a","test"."t3"."b" AS "b","test"."t4"."a" AS "a","test"."t4"."b" AS "b","test"."t5"."a" AS "a","test"."t5"."b" AS "b","test"."t6"."a" AS "a","test"."t6"."b" AS "b","test"."t7"."a" AS "a","test"."t7"."b" AS "b","test"."t8"."a" AS "a","test"."t8"."b" AS "b","test"."t9"."a" AS "a","test"."t9"."b" AS "b" from "test"."t0" join "test"."t1" left join ("test"."t2" left join ("test"."t3" join "test"."t4") on((("test"."t4"."b" = "test"."t2"."b") and ("test"."t3"."a" = 1))) join "test"."t5" left join ("test"."t6" join "test"."t7" left join "test"."t8" on((("test"."t8"."b" = "test"."t5"."b") and ("test"."t6"."b" < 10)))) on((("test"."t7"."b" = "test"."t5"."b") and ("test"."t6"."b" >= 2)))) on(((("test"."t3"."b" = 2) or isnull("test"."t3"."c")) and (("test"."t6"."b" = 2) or isnull("test"."t6"."c")) and (("test"."t5"."b" = "test"."t0"."b") or isnull("test"."t3"."c") or isnull("test"."t6"."c") or isnull("test"."t8"."c")) and ("test"."t1"."a" <> 2))) join "test"."t9" where (("test"."t9"."a" = 1) and ("test"."t1"."b" = "test"."t0"."b") and ("test"."t0"."a" = 1) and (("test"."t2"."a" >= 4) or isnull("test"."t2"."c")) and (("test"."t3"."a" < 5) or isnull("test"."t3"."c")) and (("test"."t4"."b" = "test"."t3"."b") or isnull("test"."t3"."c") or isnull("test"."t4"."c")) and (("test"."t5"."a" >= 2) or isnull("test"."t5"."c")) and (("test"."t6"."a" >= 4) or isnull("test"."t6"."c")) and (("test"."t7"."a" <= 2) or isnull("test"."t7"."c")) and (("test"."t8"."a" < 1) or isnull("test"."t8"."c")) and (("test"."t9"."b" = "test"."t8"."b") or isnull("test"."t8"."c")))
659
SELECT t0.a,t0.b,t1.a,t1.b,t2.a,t2.b,t3.a,t3.b,t4.a,t4.b,
660
t5.a,t5.b,t6.a,t6.b,t7.a,t7.b,t8.a,t8.b,t9.a,t9.b
667
ON t3.a=1 AND t2.b=t4.b,
674
ON t7.b=t8.b AND t6.b < 10
676
ON t6.b >= 2 AND t5.b=t7.b
678
ON (t3.b=2 OR t3.c IS NULL) AND (t6.b=2 OR t6.c IS NULL) AND
679
(t1.b=t5.b OR t3.c IS NULL OR t6.c IS NULL or t8.c IS NULL) AND
684
(t2.a >= 4 OR t2.c IS NULL) AND
685
(t3.a < 5 OR t3.c IS NULL) AND
686
(t3.b=t4.b OR t3.c IS NULL OR t4.c IS NULL) AND
687
(t5.a >=2 OR t5.c IS NULL) AND
688
(t6.a >=4 OR t6.c IS NULL) AND
689
(t7.a <= 2 OR t7.c IS NULL) AND
690
(t8.a < 1 OR t8.c IS NULL) AND
691
(t8.b=t9.b OR t8.c IS NULL) AND
693
a b a b a b a b a b a b a b a b a b a b
694
1 2 2 2 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1 1
695
1 2 3 2 4 2 1 2 3 2 3 1 6 2 1 1 NULL NULL 1 1
696
1 2 3 2 4 2 1 2 3 2 3 3 NULL NULL NULL NULL NULL NULL 1 1
697
1 2 3 2 4 2 1 2 4 2 3 1 6 2 1 1 NULL NULL 1 1
698
1 2 3 2 4 2 1 2 4 2 3 3 NULL NULL NULL NULL NULL NULL 1 1
699
1 2 3 2 5 3 NULL NULL NULL NULL 3 1 6 2 1 1 NULL NULL 1 1
700
1 2 3 2 5 3 NULL NULL NULL NULL 3 3 NULL NULL NULL NULL NULL NULL 1 1
701
1 2 2 2 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1 2
702
1 2 3 2 4 2 1 2 3 2 3 1 6 2 1 1 NULL NULL 1 2
703
1 2 3 2 4 2 1 2 3 2 2 2 6 2 2 2 0 2 1 2
704
1 2 3 2 4 2 1 2 3 2 3 3 NULL NULL NULL NULL NULL NULL 1 2
705
1 2 3 2 4 2 1 2 4 2 3 1 6 2 1 1 NULL NULL 1 2
706
1 2 3 2 4 2 1 2 4 2 2 2 6 2 2 2 0 2 1 2
707
1 2 3 2 4 2 1 2 4 2 3 3 NULL NULL NULL NULL NULL NULL 1 2
708
1 2 3 2 5 3 NULL NULL NULL NULL 3 1 6 2 1 1 NULL NULL 1 2
709
1 2 3 2 5 3 NULL NULL NULL NULL 2 2 6 2 2 2 0 2 1 2
710
1 2 3 2 5 3 NULL NULL NULL NULL 3 3 NULL NULL NULL NULL NULL NULL 1 2
728
SELECT t2.a,t2.b,t3.a,t3.b
738
SELECT t1.a,t1.b,t2.a,t2.b,t3.a,t3.b
753
SELECT t1.a,t1.b,t2.a,t2.b,t3.a,t3.b
768
SELECT t3.a,t3.b,t4.a,t4.b
775
SELECT t2.a,t2.b,t3.a,t3.b,t4.a,t4.b
779
ON t3.a=1 AND t2.b=t4.b;
781
3 3 NULL NULL NULL NULL
784
5 3 NULL NULL NULL NULL
785
SELECT t1.a,t1.b,t2.a,t2.b,t3.a,t3.b,t4.a,t4.b
789
ON t3.a=1 AND t2.b=t4.b
792
1 3 3 3 NULL NULL NULL NULL
793
2 2 3 3 NULL NULL NULL NULL
798
1 3 5 3 NULL NULL NULL NULL
799
2 2 5 3 NULL NULL NULL NULL
800
SELECT t1.a,t1.b,t2.a,t2.b,t3.a,t3.b,t4.a,t4.b
804
ON t3.a=1 AND t2.b=t4.b
807
1 3 3 3 NULL NULL NULL NULL
808
2 2 3 3 NULL NULL NULL NULL
813
1 3 5 3 NULL NULL NULL NULL
814
2 2 5 3 NULL NULL NULL NULL
815
SELECT t1.a,t1.b,t2.a,t2.b,t3.a,t3.b,t4.a,t4.b
819
ON t3.a=1 AND t2.b=t4.b
822
1 3 3 3 NULL NULL NULL NULL
823
2 2 3 3 NULL NULL NULL NULL
828
1 3 5 3 NULL NULL NULL NULL
829
2 2 5 3 NULL NULL NULL NULL
831
SELECT t1.a,t1.b,t2.a,t2.b,t3.a,t3.b,t4.a,t4.b
835
ON t3.a=1 AND t2.b=t4.b
837
id select_type table type possible_keys key key_len ref rows filtered Extra
838
1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
839
1 SIMPLE t2 ALL NULL NULL NULL NULL 3 100.00 Using join buffer
840
1 SIMPLE t3 ALL NULL NULL NULL NULL 2 100.00
841
1 SIMPLE t4 ALL NULL NULL NULL NULL 2 100.00
843
Note 1003 select "test"."t1"."a" AS "a","test"."t1"."b" AS "b","test"."t2"."a" AS "a","test"."t2"."b" AS "b","test"."t3"."a" AS "a","test"."t3"."b" AS "b","test"."t4"."a" AS "a","test"."t4"."b" AS "b" from "test"."t1" join "test"."t2" left join ("test"."t3" join "test"."t4") on((("test"."t4"."b" = "test"."t2"."b") and ("test"."t3"."a" = 1))) where ("test"."t1"."a" <= 2)
844
CREATE INDEX idx_b ON t2(b);
846
SELECT t2.a,t2.b,t3.a,t3.b,t4.a,t4.b
850
ON t3.a=1 AND t3.b=t2.b AND t2.b=t4.b;
851
id select_type table type possible_keys key key_len ref rows filtered Extra
852
1 SIMPLE t3 ALL NULL NULL NULL NULL 2 100.00
853
1 SIMPLE t4 ALL NULL NULL NULL NULL 2 100.00 Using join buffer
854
1 SIMPLE t2 ref idx_b idx_b 5 test.t3.b 2 100.00
855
1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00
857
Note 1003 select "test"."t2"."a" AS "a","test"."t2"."b" AS "b","test"."t3"."a" AS "a","test"."t3"."b" AS "b","test"."t4"."a" AS "a","test"."t4"."b" AS "b" from "test"."t3" join "test"."t4" left join ("test"."t1" join "test"."t2") on((("test"."t3"."a" = 1) and ("test"."t3"."b" = "test"."t2"."b") and ("test"."t2"."b" = "test"."t4"."b"))) where 1
858
SELECT t2.a,t2.b,t3.a,t3.b,t4.a,t4.b
862
ON t3.a=1 AND t3.b=t2.b AND t2.b=t4.b;
873
SELECT t0.a,t0.b,t1.a,t1.b,t2.a,t2.b,t3.a,t3.b,t4.a,t4.b,
874
t5.a,t5.b,t6.a,t6.b,t7.a,t7.b,t8.a,t8.b,t9.a,t9.b
881
ON t3.a=1 AND t2.b=t4.b,
888
ON t7.b=t8.b AND t6.b < 10
890
ON t6.b >= 2 AND t5.b=t7.b
892
ON (t3.b=2 OR t3.c IS NULL) AND (t6.b=2 OR t6.c IS NULL) AND
893
(t1.b=t5.b OR t3.c IS NULL OR t6.c IS NULL or t8.c IS NULL) AND
898
(t2.a >= 4 OR t2.c IS NULL) AND
899
(t3.a < 5 OR t3.c IS NULL) AND
900
(t3.b=t4.b OR t3.c IS NULL OR t4.c IS NULL) AND
901
(t5.a >=2 OR t5.c IS NULL) AND
902
(t6.a >=4 OR t6.c IS NULL) AND
903
(t7.a <= 2 OR t7.c IS NULL) AND
904
(t8.a < 1 OR t8.c IS NULL) AND
905
(t8.b=t9.b OR t8.c IS NULL) AND
907
id select_type table type possible_keys key key_len ref rows filtered Extra
908
1 SIMPLE t0 ALL NULL NULL NULL NULL 3 100.00 Using where
909
1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer
910
1 SIMPLE t2 ALL NULL NULL NULL NULL 3 100.00 Using where
911
1 SIMPLE t3 ALL NULL NULL NULL NULL 2 100.00 Using where
912
1 SIMPLE t4 ALL NULL NULL NULL NULL 2 100.00 Using where
913
1 SIMPLE t5 ALL NULL NULL NULL NULL 3 100.00 Using where
914
1 SIMPLE t7 ALL NULL NULL NULL NULL 2 100.00 Using where
915
1 SIMPLE t6 ALL NULL NULL NULL NULL 3 100.00 Using where
916
1 SIMPLE t8 ALL NULL NULL NULL NULL 2 100.00 Using where
917
1 SIMPLE t9 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer
919
Note 1003 select "test"."t0"."a" AS "a","test"."t0"."b" AS "b","test"."t1"."a" AS "a","test"."t1"."b" AS "b","test"."t2"."a" AS "a","test"."t2"."b" AS "b","test"."t3"."a" AS "a","test"."t3"."b" AS "b","test"."t4"."a" AS "a","test"."t4"."b" AS "b","test"."t5"."a" AS "a","test"."t5"."b" AS "b","test"."t6"."a" AS "a","test"."t6"."b" AS "b","test"."t7"."a" AS "a","test"."t7"."b" AS "b","test"."t8"."a" AS "a","test"."t8"."b" AS "b","test"."t9"."a" AS "a","test"."t9"."b" AS "b" from "test"."t0" join "test"."t1" left join ("test"."t2" left join ("test"."t3" join "test"."t4") on((("test"."t4"."b" = "test"."t2"."b") and ("test"."t3"."a" = 1))) join "test"."t5" left join ("test"."t6" join "test"."t7" left join "test"."t8" on((("test"."t8"."b" = "test"."t5"."b") and ("test"."t6"."b" < 10)))) on((("test"."t7"."b" = "test"."t5"."b") and ("test"."t6"."b" >= 2)))) on(((("test"."t3"."b" = 2) or isnull("test"."t3"."c")) and (("test"."t6"."b" = 2) or isnull("test"."t6"."c")) and (("test"."t5"."b" = "test"."t0"."b") or isnull("test"."t3"."c") or isnull("test"."t6"."c") or isnull("test"."t8"."c")) and ("test"."t1"."a" <> 2))) join "test"."t9" where (("test"."t9"."a" = 1) and ("test"."t1"."b" = "test"."t0"."b") and ("test"."t0"."a" = 1) and (("test"."t2"."a" >= 4) or isnull("test"."t2"."c")) and (("test"."t3"."a" < 5) or isnull("test"."t3"."c")) and (("test"."t4"."b" = "test"."t3"."b") or isnull("test"."t3"."c") or isnull("test"."t4"."c")) and (("test"."t5"."a" >= 2) or isnull("test"."t5"."c")) and (("test"."t6"."a" >= 4) or isnull("test"."t6"."c")) and (("test"."t7"."a" <= 2) or isnull("test"."t7"."c")) and (("test"."t8"."a" < 1) or isnull("test"."t8"."c")) and (("test"."t9"."b" = "test"."t8"."b") or isnull("test"."t8"."c")))
920
CREATE INDEX idx_b ON t4(b);
921
CREATE INDEX idx_b ON t5(b);
923
SELECT t0.a,t0.b,t1.a,t1.b,t2.a,t2.b,t3.a,t3.b,t4.a,t4.b,
924
t5.a,t5.b,t6.a,t6.b,t7.a,t7.b,t8.a,t8.b,t9.a,t9.b
931
ON t3.a=1 AND t2.b=t4.b,
938
ON t7.b=t8.b AND t6.b < 10
940
ON t6.b >= 2 AND t5.b=t7.b
942
ON (t3.b=2 OR t3.c IS NULL) AND (t6.b=2 OR t6.c IS NULL) AND
943
(t1.b=t5.b OR t3.c IS NULL OR t6.c IS NULL or t8.c IS NULL) AND
948
(t2.a >= 4 OR t2.c IS NULL) AND
949
(t3.a < 5 OR t3.c IS NULL) AND
950
(t3.b=t4.b OR t3.c IS NULL OR t4.c IS NULL) AND
951
(t5.a >=2 OR t5.c IS NULL) AND
952
(t6.a >=4 OR t6.c IS NULL) AND
953
(t7.a <= 2 OR t7.c IS NULL) AND
954
(t8.a < 1 OR t8.c IS NULL) AND
955
(t8.b=t9.b OR t8.c IS NULL) AND
957
id select_type table type possible_keys key key_len ref rows filtered Extra
958
1 SIMPLE t0 ALL NULL NULL NULL NULL 3 100.00 Using where
959
1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer
960
1 SIMPLE t2 ALL NULL NULL NULL NULL 3 100.00 Using where
961
1 SIMPLE t3 ALL NULL NULL NULL NULL 2 100.00 Using where
962
1 SIMPLE t4 ref idx_b idx_b 5 test.t2.b 2 100.00 Using where
963
1 SIMPLE t5 ALL idx_b NULL NULL NULL 3 100.00 Using where
964
1 SIMPLE t7 ALL NULL NULL NULL NULL 2 100.00 Using where
965
1 SIMPLE t6 ALL NULL NULL NULL NULL 3 100.00 Using where
966
1 SIMPLE t8 ALL NULL NULL NULL NULL 2 100.00 Using where
967
1 SIMPLE t9 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer
969
Note 1003 select "test"."t0"."a" AS "a","test"."t0"."b" AS "b","test"."t1"."a" AS "a","test"."t1"."b" AS "b","test"."t2"."a" AS "a","test"."t2"."b" AS "b","test"."t3"."a" AS "a","test"."t3"."b" AS "b","test"."t4"."a" AS "a","test"."t4"."b" AS "b","test"."t5"."a" AS "a","test"."t5"."b" AS "b","test"."t6"."a" AS "a","test"."t6"."b" AS "b","test"."t7"."a" AS "a","test"."t7"."b" AS "b","test"."t8"."a" AS "a","test"."t8"."b" AS "b","test"."t9"."a" AS "a","test"."t9"."b" AS "b" from "test"."t0" join "test"."t1" left join ("test"."t2" left join ("test"."t3" join "test"."t4") on((("test"."t4"."b" = "test"."t2"."b") and ("test"."t3"."a" = 1))) join "test"."t5" left join ("test"."t6" join "test"."t7" left join "test"."t8" on((("test"."t8"."b" = "test"."t5"."b") and ("test"."t6"."b" < 10)))) on((("test"."t7"."b" = "test"."t5"."b") and ("test"."t6"."b" >= 2)))) on(((("test"."t3"."b" = 2) or isnull("test"."t3"."c")) and (("test"."t6"."b" = 2) or isnull("test"."t6"."c")) and (("test"."t5"."b" = "test"."t0"."b") or isnull("test"."t3"."c") or isnull("test"."t6"."c") or isnull("test"."t8"."c")) and ("test"."t1"."a" <> 2))) join "test"."t9" where (("test"."t9"."a" = 1) and ("test"."t1"."b" = "test"."t0"."b") and ("test"."t0"."a" = 1) and (("test"."t2"."a" >= 4) or isnull("test"."t2"."c")) and (("test"."t3"."a" < 5) or isnull("test"."t3"."c")) and (("test"."t4"."b" = "test"."t3"."b") or isnull("test"."t3"."c") or isnull("test"."t4"."c")) and (("test"."t5"."a" >= 2) or isnull("test"."t5"."c")) and (("test"."t6"."a" >= 4) or isnull("test"."t6"."c")) and (("test"."t7"."a" <= 2) or isnull("test"."t7"."c")) and (("test"."t8"."a" < 1) or isnull("test"."t8"."c")) and (("test"."t9"."b" = "test"."t8"."b") or isnull("test"."t8"."c")))
970
CREATE INDEX idx_b ON t8(b);
972
SELECT t0.a,t0.b,t1.a,t1.b,t2.a,t2.b,t3.a,t3.b,t4.a,t4.b,
973
t5.a,t5.b,t6.a,t6.b,t7.a,t7.b,t8.a,t8.b,t9.a,t9.b
980
ON t3.a=1 AND t2.b=t4.b,
987
ON t7.b=t8.b AND t6.b < 10
989
ON t6.b >= 2 AND t5.b=t7.b
991
ON (t3.b=2 OR t3.c IS NULL) AND (t6.b=2 OR t6.c IS NULL) AND
992
(t1.b=t5.b OR t3.c IS NULL OR t6.c IS NULL or t8.c IS NULL) AND
997
(t2.a >= 4 OR t2.c IS NULL) AND
998
(t3.a < 5 OR t3.c IS NULL) AND
999
(t3.b=t4.b OR t3.c IS NULL OR t4.c IS NULL) AND
1000
(t5.a >=2 OR t5.c IS NULL) AND
1001
(t6.a >=4 OR t6.c IS NULL) AND
1002
(t7.a <= 2 OR t7.c IS NULL) AND
1003
(t8.a < 1 OR t8.c IS NULL) AND
1004
(t8.b=t9.b OR t8.c IS NULL) AND
1006
id select_type table type possible_keys key key_len ref rows filtered Extra
1007
1 SIMPLE t0 ALL NULL NULL NULL NULL 3 100.00 Using where
1008
1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer
1009
1 SIMPLE t2 ALL NULL NULL NULL NULL 3 100.00 Using where
1010
1 SIMPLE t3 ALL NULL NULL NULL NULL 2 100.00 Using where
1011
1 SIMPLE t4 ref idx_b idx_b 5 test.t2.b 2 100.00 Using where
1012
1 SIMPLE t5 ALL idx_b NULL NULL NULL 3 100.00 Using where
1013
1 SIMPLE t7 ALL NULL NULL NULL NULL 2 100.00 Using where
1014
1 SIMPLE t6 ALL NULL NULL NULL NULL 3 100.00 Using where
1015
1 SIMPLE t8 ref idx_b idx_b 5 test.t5.b 2 100.00 Using where
1016
1 SIMPLE t9 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer
1018
Note 1003 select "test"."t0"."a" AS "a","test"."t0"."b" AS "b","test"."t1"."a" AS "a","test"."t1"."b" AS "b","test"."t2"."a" AS "a","test"."t2"."b" AS "b","test"."t3"."a" AS "a","test"."t3"."b" AS "b","test"."t4"."a" AS "a","test"."t4"."b" AS "b","test"."t5"."a" AS "a","test"."t5"."b" AS "b","test"."t6"."a" AS "a","test"."t6"."b" AS "b","test"."t7"."a" AS "a","test"."t7"."b" AS "b","test"."t8"."a" AS "a","test"."t8"."b" AS "b","test"."t9"."a" AS "a","test"."t9"."b" AS "b" from "test"."t0" join "test"."t1" left join ("test"."t2" left join ("test"."t3" join "test"."t4") on((("test"."t4"."b" = "test"."t2"."b") and ("test"."t3"."a" = 1))) join "test"."t5" left join ("test"."t6" join "test"."t7" left join "test"."t8" on((("test"."t8"."b" = "test"."t5"."b") and ("test"."t6"."b" < 10)))) on((("test"."t7"."b" = "test"."t5"."b") and ("test"."t6"."b" >= 2)))) on(((("test"."t3"."b" = 2) or isnull("test"."t3"."c")) and (("test"."t6"."b" = 2) or isnull("test"."t6"."c")) and (("test"."t5"."b" = "test"."t0"."b") or isnull("test"."t3"."c") or isnull("test"."t6"."c") or isnull("test"."t8"."c")) and ("test"."t1"."a" <> 2))) join "test"."t9" where (("test"."t9"."a" = 1) and ("test"."t1"."b" = "test"."t0"."b") and ("test"."t0"."a" = 1) and (("test"."t2"."a" >= 4) or isnull("test"."t2"."c")) and (("test"."t3"."a" < 5) or isnull("test"."t3"."c")) and (("test"."t4"."b" = "test"."t3"."b") or isnull("test"."t3"."c") or isnull("test"."t4"."c")) and (("test"."t5"."a" >= 2) or isnull("test"."t5"."c")) and (("test"."t6"."a" >= 4) or isnull("test"."t6"."c")) and (("test"."t7"."a" <= 2) or isnull("test"."t7"."c")) and (("test"."t8"."a" < 1) or isnull("test"."t8"."c")) and (("test"."t9"."b" = "test"."t8"."b") or isnull("test"."t8"."c")))
1019
CREATE INDEX idx_b ON t1(b);
1020
CREATE INDEX idx_a ON t0(a);
1022
SELECT t0.a,t0.b,t1.a,t1.b,t2.a,t2.b,t3.a,t3.b,t4.a,t4.b,
1023
t5.a,t5.b,t6.a,t6.b,t7.a,t7.b,t8.a,t8.b,t9.a,t9.b
1030
ON t3.a=1 AND t2.b=t4.b,
1037
ON t7.b=t8.b AND t6.b < 10
1039
ON t6.b >= 2 AND t5.b=t7.b
1041
ON (t3.b=2 OR t3.c IS NULL) AND (t6.b=2 OR t6.c IS NULL) AND
1042
(t1.b=t5.b OR t3.c IS NULL OR t6.c IS NULL or t8.c IS NULL) AND
1047
(t2.a >= 4 OR t2.c IS NULL) AND
1048
(t3.a < 5 OR t3.c IS NULL) AND
1049
(t3.b=t4.b OR t3.c IS NULL OR t4.c IS NULL) AND
1050
(t5.a >=2 OR t5.c IS NULL) AND
1051
(t6.a >=4 OR t6.c IS NULL) AND
1052
(t7.a <= 2 OR t7.c IS NULL) AND
1053
(t8.a < 1 OR t8.c IS NULL) AND
1054
(t8.b=t9.b OR t8.c IS NULL) AND
1056
id select_type table type possible_keys key key_len ref rows filtered Extra
1057
1 SIMPLE t0 ref idx_a idx_a 5 const 1 100.00
1058
1 SIMPLE t1 ref idx_b idx_b 5 test.t0.b 2 100.00
1059
1 SIMPLE t2 ALL NULL NULL NULL NULL 3 100.00 Using where
1060
1 SIMPLE t3 ALL NULL NULL NULL NULL 2 100.00 Using where
1061
1 SIMPLE t4 ref idx_b idx_b 5 test.t2.b 2 100.00 Using where
1062
1 SIMPLE t5 ALL idx_b NULL NULL NULL 3 100.00 Using where
1063
1 SIMPLE t7 ALL NULL NULL NULL NULL 2 100.00 Using where
1064
1 SIMPLE t6 ALL NULL NULL NULL NULL 3 100.00 Using where
1065
1 SIMPLE t8 ref idx_b idx_b 5 test.t5.b 2 100.00 Using where
1066
1 SIMPLE t9 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer
1068
Note 1003 select "test"."t0"."a" AS "a","test"."t0"."b" AS "b","test"."t1"."a" AS "a","test"."t1"."b" AS "b","test"."t2"."a" AS "a","test"."t2"."b" AS "b","test"."t3"."a" AS "a","test"."t3"."b" AS "b","test"."t4"."a" AS "a","test"."t4"."b" AS "b","test"."t5"."a" AS "a","test"."t5"."b" AS "b","test"."t6"."a" AS "a","test"."t6"."b" AS "b","test"."t7"."a" AS "a","test"."t7"."b" AS "b","test"."t8"."a" AS "a","test"."t8"."b" AS "b","test"."t9"."a" AS "a","test"."t9"."b" AS "b" from "test"."t0" join "test"."t1" left join ("test"."t2" left join ("test"."t3" join "test"."t4") on((("test"."t4"."b" = "test"."t2"."b") and ("test"."t3"."a" = 1))) join "test"."t5" left join ("test"."t6" join "test"."t7" left join "test"."t8" on((("test"."t8"."b" = "test"."t5"."b") and ("test"."t6"."b" < 10)))) on((("test"."t7"."b" = "test"."t5"."b") and ("test"."t6"."b" >= 2)))) on(((("test"."t3"."b" = 2) or isnull("test"."t3"."c")) and (("test"."t6"."b" = 2) or isnull("test"."t6"."c")) and (("test"."t5"."b" = "test"."t0"."b") or isnull("test"."t3"."c") or isnull("test"."t6"."c") or isnull("test"."t8"."c")) and ("test"."t1"."a" <> 2))) join "test"."t9" where (("test"."t9"."a" = 1) and ("test"."t1"."b" = "test"."t0"."b") and ("test"."t0"."a" = 1) and (("test"."t2"."a" >= 4) or isnull("test"."t2"."c")) and (("test"."t3"."a" < 5) or isnull("test"."t3"."c")) and (("test"."t4"."b" = "test"."t3"."b") or isnull("test"."t3"."c") or isnull("test"."t4"."c")) and (("test"."t5"."a" >= 2) or isnull("test"."t5"."c")) and (("test"."t6"."a" >= 4) or isnull("test"."t6"."c")) and (("test"."t7"."a" <= 2) or isnull("test"."t7"."c")) and (("test"."t8"."a" < 1) or isnull("test"."t8"."c")) and (("test"."t9"."b" = "test"."t8"."b") or isnull("test"."t8"."c")))
1069
SELECT t0.a,t0.b,t1.a,t1.b,t2.a,t2.b,t3.a,t3.b,t4.a,t4.b,
1070
t5.a,t5.b,t6.a,t6.b,t7.a,t7.b,t8.a,t8.b,t9.a,t9.b
1077
ON t3.a=1 AND t2.b=t4.b,
1084
ON t7.b=t8.b AND t6.b < 10
1086
ON t6.b >= 2 AND t5.b=t7.b
1088
ON (t3.b=2 OR t3.c IS NULL) AND (t6.b=2 OR t6.c IS NULL) AND
1089
(t1.b=t5.b OR t3.c IS NULL OR t6.c IS NULL or t8.c IS NULL) AND
1094
(t2.a >= 4 OR t2.c IS NULL) AND
1095
(t3.a < 5 OR t3.c IS NULL) AND
1096
(t3.b=t4.b OR t3.c IS NULL OR t4.c IS NULL) AND
1097
(t5.a >=2 OR t5.c IS NULL) AND
1098
(t6.a >=4 OR t6.c IS NULL) AND
1099
(t7.a <= 2 OR t7.c IS NULL) AND
1100
(t8.a < 1 OR t8.c IS NULL) AND
1101
(t8.b=t9.b OR t8.c IS NULL) AND
1103
a b a b a b a b a b a b a b a b a b a b
1104
1 2 2 2 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1 1
1105
1 2 3 2 4 2 1 2 3 2 3 1 6 2 1 1 NULL NULL 1 1
1106
1 2 3 2 4 2 1 2 3 2 3 3 NULL NULL NULL NULL NULL NULL 1 1
1107
1 2 3 2 4 2 1 2 4 2 3 1 6 2 1 1 NULL NULL 1 1
1108
1 2 3 2 4 2 1 2 4 2 3 3 NULL NULL NULL NULL NULL NULL 1 1
1109
1 2 3 2 5 3 NULL NULL NULL NULL 3 1 6 2 1 1 NULL NULL 1 1
1110
1 2 3 2 5 3 NULL NULL NULL NULL 3 3 NULL NULL NULL NULL NULL NULL 1 1
1111
1 2 2 2 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1 2
1112
1 2 3 2 4 2 1 2 3 2 3 1 6 2 1 1 NULL NULL 1 2
1113
1 2 3 2 4 2 1 2 3 2 2 2 6 2 2 2 0 2 1 2
1114
1 2 3 2 4 2 1 2 3 2 3 3 NULL NULL NULL NULL NULL NULL 1 2
1115
1 2 3 2 4 2 1 2 4 2 3 1 6 2 1 1 NULL NULL 1 2
1116
1 2 3 2 4 2 1 2 4 2 2 2 6 2 2 2 0 2 1 2
1117
1 2 3 2 4 2 1 2 4 2 3 3 NULL NULL NULL NULL NULL NULL 1 2
1118
1 2 3 2 5 3 NULL NULL NULL NULL 3 1 6 2 1 1 NULL NULL 1 2
1119
1 2 3 2 5 3 NULL NULL NULL NULL 2 2 6 2 2 2 0 2 1 2
1120
1 2 3 2 5 3 NULL NULL NULL NULL 3 3 NULL NULL NULL NULL NULL NULL 1 2
1132
SELECT t2.a,t2.b,t3.a,t3.b
1133
FROM t2 LEFT JOIN t3 ON t2.b=t3.b
1134
WHERE t2.a = 4 OR (t2.a > 4 AND t3.a IS NULL);
1139
SELECT t2.a,t2.b,t3.a,t3.b
1140
FROM t2 LEFT JOIN (t3) ON t2.b=t3.b
1141
WHERE t2.a = 4 OR (t2.a > 4 AND t3.a IS NULL);
1147
CHANGE COLUMN a a1 int,
1148
CHANGE COLUMN c c1 int;
1149
SELECT t2.a,t2.b,t3.a1,t3.b
1150
FROM t2 LEFT JOIN t3 ON t2.b=t3.b
1151
WHERE t2.a = 4 OR (t2.a > 4 AND t3.a1 IS NULL);
1156
SELECT t2.a,t2.b,t3.a1,t3.b
1157
FROM t2 NATURAL LEFT JOIN t3
1158
WHERE t2.a = 4 OR (t2.a > 4 AND t3.a1 IS NULL);
1163
DROP TABLE t0,t1,t2,t3,t4,t5,t6,t7,t8,t9;
1164
CREATE TABLE t1 (a int);
1165
CREATE TABLE t2 (a int);
1166
CREATE TABLE t3 (a int);
1167
INSERT INTO t1 VALUES (1);
1168
INSERT INTO t2 VALUES (2);
1169
INSERT INTO t3 VALUES (2);
1170
INSERT INTO t1 VALUES (2);
1171
SELECT * FROM t1 LEFT JOIN (t2 LEFT JOIN t3 ON t2.a=t3.a) ON t1.a=t3.a;
1175
SELECT * FROM t1 LEFT JOIN t2 LEFT JOIN t3 ON t2.a=t3.a ON t1.a=t3.a;
1179
DELETE FROM t1 WHERE a=2;
1180
SELECT * FROM t1 LEFT JOIN t2 LEFT JOIN t3 ON t2.a=t3.a ON t1.a=t3.a;
1184
SELECT * FROM t1 LEFT JOIN t2 LEFT JOIN t3 ON t2.a=t3.a ON t1.a=t3.a;
1187
DROP TABLE t1,t2,t3;
1188
CREATE TABLE t1(a int, key (a));
1189
CREATE TABLE t2(b int, key (b));
1190
CREATE TABLE t3(c int, key (c));
1191
INSERT INTO t1 VALUES (NULL), (0), (1), (2), (3), (4), (5), (6), (7), (8), (9),
1192
(10), (11), (12), (13), (14), (15), (16), (17), (18), (19);
1193
INSERT INTO t2 VALUES (NULL), (0), (1), (2), (3), (4), (5), (6), (7), (8), (9),
1194
(10), (11), (12), (13), (14), (15), (16), (17), (18), (19);
1195
INSERT INTO t3 VALUES (0), (1), (2), (3), (4), (5);
1196
EXPLAIN SELECT a, b, c FROM t1 LEFT JOIN (t2, t3) ON c < 3 and b = c;
1197
id select_type table type possible_keys key key_len ref rows Extra
1198
1 SIMPLE t1 index NULL a 5 NULL 21 Using index
1199
1 SIMPLE t3 index c c 5 NULL 6 Using index
1200
1 SIMPLE t2 ref b b 5 test.t3.c 2 Using index
1201
EXPLAIN SELECT a, b, c FROM t1 LEFT JOIN (t2, t3) ON b < 3 and b = c;
1202
id select_type table type possible_keys key key_len ref rows Extra
1203
1 SIMPLE t1 index NULL a 5 NULL 21 Using index
1204
1 SIMPLE t3 index c c 5 NULL 6 Using index
1205
1 SIMPLE t2 ref b b 5 test.t3.c 2 Using index
1206
SELECT a, b, c FROM t1 LEFT JOIN (t2, t3) ON b < 3 and b = c;
1272
EXPLAIN SELECT a, b, c FROM t1 LEFT JOIN (t2, t3) ON b < 3 and b = c;
1273
id select_type table type possible_keys key key_len ref rows Extra
1274
1 SIMPLE t1 index NULL a 5 NULL 21 Using index
1275
1 SIMPLE t3 index c c 5 NULL 0 Using index
1276
1 SIMPLE t2 ref b b 5 test.t3.c 2 Using index
1277
SELECT a, b, c FROM t1 LEFT JOIN (t2, t3) ON b < 3 and b = c;
1300
DROP TABLE t1,t2,t3;
1301
CREATE TABLE t1 (c11 int);
1302
CREATE TABLE t2 (c21 int);
1303
CREATE TABLE t3 (c31 int);
1304
INSERT INTO t1 VALUES (4), (5);
1305
SELECT * FROM t1 LEFT JOIN t2 ON c11=c21;
1309
EXPLAIN SELECT * FROM t1 LEFT JOIN t2 ON c11=c21;
1310
id select_type table type possible_keys key key_len ref rows Extra
1311
1 SIMPLE t2 system NULL NULL NULL NULL 0 const row not found
1312
1 SIMPLE t1 ALL NULL NULL NULL NULL 2
1313
SELECT * FROM t1 LEFT JOIN (t2 LEFT JOIN t3 ON c21=c31) ON c11=c21;
1317
EXPLAIN SELECT * FROM t1 LEFT JOIN (t2 LEFT JOIN t3 ON c21=c31) ON c11=c21;
1318
id select_type table type possible_keys key key_len ref rows Extra
1319
1 SIMPLE t1 ALL NULL NULL NULL NULL 2
1320
1 SIMPLE t2 ALL NULL NULL NULL NULL 0
1321
1 SIMPLE t3 ALL NULL NULL NULL NULL 0
1322
DROP TABLE t1,t2,t3;
1323
create table t1 (a int);
1324
insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
1325
create table t2 (a int, filler char(100), key(a));
1326
insert into t2 select A.a + 10*B.a, '' from t1 A, t1 B;
1327
create table t3 like t2;
1328
insert into t3 select * from t2;
1329
explain select * from t1 left join
1330
(t2 left join t3 on (t2.a = t3.a))
1332
id select_type table type possible_keys key key_len ref rows Extra
1333
1 SIMPLE t1 ALL NULL NULL NULL NULL 10
1334
1 SIMPLE t2 ref a a 5 test.t1.a 1
1335
1 SIMPLE t3 ref a a 5 test.t2.a 1
1336
drop table t1, t2, t3;
1338
id int NOT NULL PRIMARY KEY,
1339
ct int DEFAULT NULL,
1340
pc int DEFAULT NULL,
1344
INSERT INTO t1 VALUES
1345
(1,NULL,NULL),(2,NULL,NULL),(3,NULL,NULL),(4,NULL,NULL),(5,NULL,NULL);
1347
id int NOT NULL PRIMARY KEY,
1349
nm varchar(255) NOT NULL,
1352
INSERT INTO t2 VALUES
1353
(2441905,4308,'LesAbymes'),(2441906,4308,'Anse-Bertrand');
1355
id int NOT NULL PRIMARY KEY,
1362
id int NOT NULL PRIMARY KEY,
1363
nm varchar(255) NOT NULL
1365
INSERT INTO t4 VALUES (4308,'Guadeloupe'),(4309,'Martinique');
1368
(t2 LEFT JOIN t3 ON t3.ct=t2.id AND t3.ln='5') ON t1.ct=t2.id
1374
(t2 LEFT JOIN t3 ON t3.ct=t2.id AND t3.ln='5') ON t1.ct=t2.id
1375
LEFT JOIN t4 ON t2.sr=t4.id
1379
DROP TABLE t1,t2,t3,t4;
1380
CREATE TABLE t1 (a INT, b INT);
1381
CREATE TABLE t2 (a INT);
1382
CREATE TABLE t3 (a INT, c INT);
1383
CREATE TABLE t4 (a INT, c INT);
1384
CREATE TABLE t5 (a INT, c INT);
1385
SELECT b FROM t1 JOIN (t2 LEFT JOIN t3 USING (a) LEFT JOIN t4 USING (a)
1386
LEFT JOIN t5 USING (a)) USING (a);
1388
SELECT c FROM t1 JOIN (t2 LEFT JOIN t3 USING (a) LEFT JOIN t4 USING (a)
1389
LEFT JOIN t5 USING (a)) USING (a);
1390
ERROR 23000: Column 'c' in field list is ambiguous
1391
SELECT b FROM t1 JOIN (t2 JOIN t3 USING (a) JOIN t4 USING (a)
1392
JOIN t5 USING (a)) USING (a);
1394
SELECT c FROM t1 JOIN (t2 JOIN t3 USING (a) JOIN t4 USING (a)
1395
JOIN t5 USING (a)) USING (a);
1396
ERROR 23000: Column 'c' in field list is ambiguous
1397
DROP TABLE t1,t2,t3,t4,t5;
1398
CREATE TABLE t1 (a INT, b INT);
1399
CREATE TABLE t2 (a INT, b INT);
1400
CREATE TABLE t3 (a INT, b INT);
1401
INSERT INTO t1 VALUES (1,1);
1402
INSERT INTO t2 VALUES (1,1);
1403
INSERT INTO t3 VALUES (1,1);
1404
SELECT * FROM t1 JOIN (t2 JOIN t3 USING (b)) USING (a);
1405
ERROR 23000: Column 'a' in from clause is ambiguous
1406
DROP TABLE t1,t2,t3;
1408
carrier char(2) default NULL,
1409
id int NOT NULL auto_increment PRIMARY KEY
1411
INSERT INTO t1 VALUES
1412
('CO',235371754),('CO',235376554),('CO',235376884),('CO',235377874),
1413
('CO',231060394),('CO',231059224),('CO',231059314),('CO',231060484),
1414
('CO',231060274),('CO',231060124),('CO',231060244),('CO',231058594),
1415
('CO',231058924),('CO',231058504),('CO',231059344),('CO',231060424),
1416
('CO',231059554),('CO',231060304),('CO',231059644),('CO',231059464),
1417
('CO',231059764),('CO',231058294),('CO',231058624),('CO',231058864),
1418
('CO',231059374),('CO',231059584),('CO',231059734),('CO',231059014),
1419
('CO',231059854),('CO',231059494),('CO',231059794),('CO',231058534),
1420
('CO',231058324),('CO',231058684),('CO',231059524),('CO',231059974);
1422
scan_date date default NULL,
1423
package_id int default NULL,
1424
INDEX scan_date(scan_date),
1425
INDEX package_id(package_id)
1427
INSERT INTO t2 VALUES
1428
('2008-12-29',231062944),('2008-12-29',231065764),('2008-12-29',231066124),
1429
('2008-12-29',231060094),('2008-12-29',231061054),('2008-12-29',231065644),
1430
('2008-12-29',231064384),('2008-12-29',231064444),('2008-12-29',231073774),
1431
('2008-12-29',231058594),('2008-12-29',231059374),('2008-12-29',231066004),
1432
('2008-12-29',231068494),('2008-12-29',231070174),('2008-12-29',231071884),
1433
('2008-12-29',231063274),('2008-12-29',231063754),('2008-12-29',231064144),
1434
('2008-12-29',231069424),('2008-12-29',231073714),('2008-12-29',231058414),
1435
('2008-12-29',231060994),('2008-12-29',231069154),('2008-12-29',231068614),
1436
('2008-12-29',231071464),('2008-12-29',231074014),('2008-12-29',231059614),
1437
('2008-12-29',231059074),('2008-12-29',231059464),('2008-12-29',231069094),
1438
('2008-12-29',231067294),('2008-12-29',231070144),('2008-12-29',231073804),
1439
('2008-12-29',231072634),('2008-12-29',231058294),('2008-12-29',231065344),
1440
('2008-12-29',231066094),('2008-12-29',231069034),('2008-12-29',231058594),
1441
('2008-12-29',231059854),('2008-12-29',231059884),('2008-12-29',231059914),
1442
('2008-12-29',231063664),('2008-12-29',231063814),('2008-12-29',231063904);
1444
package_id int default NULL,
1445
INDEX package_id(package_id)
1447
INSERT INTO t3 VALUES
1448
(231058294),(231058324),(231058354),(231058384),(231058414),(231058444),
1449
(231058474),(231058504),(231058534),(231058564),(231058594),(231058624),
1450
(231058684),(231058744),(231058804),(231058864),(231058924),(231058954),
1451
(231059014),(231059074),(231059104),(231059134),(231059164),(231059194),
1452
(231059224),(231059254),(231059284),(231059314),(231059344),(231059374),
1453
(231059404),(231059434),(231059464),(231059494),(231059524),(231059554),
1454
(231059584),(231059614),(231059644),(231059674),(231059704),(231059734),
1455
(231059764),(231059794),(231059824),(231059854),(231059884),(231059914),
1456
(231059944),(231059974),(231060004),(231060034),(231060064),(231060094),
1457
(231060124),(231060154),(231060184),(231060214),(231060244),(231060274),
1458
(231060304),(231060334),(231060364),(231060394),(231060424),(231060454),
1459
(231060484),(231060514),(231060544),(231060574),(231060604),(231060634),
1460
(231060664),(231060694),(231060724),(231060754),(231060784),(231060814),
1461
(231060844),(231060874),(231060904),(231060934),(231060964),(231060994),
1462
(231061024),(231061054),(231061084),(231061144),(231061174),(231061204),
1463
(231061234),(231061294),(231061354),(231061384),(231061414),(231061474),
1464
(231061564),(231061594),(231061624),(231061684),(231061714),(231061774),
1465
(231061804),(231061894),(231061984),(231062074),(231062134),(231062224),
1466
(231062254),(231062314),(231062374),(231062434),(231062494),(231062554),
1467
(231062584),(231062614),(231062644),(231062704),(231062734),(231062794),
1468
(231062854),(231062884),(231062944),(231063004),(231063034),(231063064),
1469
(231063124),(231063154),(231063184),(231063214),(231063274),(231063334),
1470
(231063394),(231063424),(231063454),(231063514),(231063574),(231063664);
1472
carrier char(2) NOT NULL default '' PRIMARY KEY,
1473
id int(11) default NULL,
1476
INSERT INTO t4 VALUES
1477
('99',6),('SK',456),('UA',486),('AI',1081),('OS',1111),('VS',1510);
1479
carrier_id int default NULL,
1480
INDEX carrier_id(carrier_id)
1482
INSERT INTO t5 VALUES
1483
(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),
1484
(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),
1485
(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),
1486
(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),
1487
(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),
1488
(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(456),(456),(456),
1489
(456),(456),(456),(456),(456),(456),(456),(456),(456),(456),(456),(456),
1490
(456),(486),(1081),(1111),(1111),(1111),(1111),(1510);
1492
FROM((t2 JOIN t1 ON t2.package_id = t1.id)
1493
JOIN t3 ON t3.package_id = t1.id);
1498
FROM ((t2 JOIN t1 ON t2.package_id = t1.id)
1499
JOIN t3 ON t3.package_id = t1.id)
1501
(t5 JOIN t4 ON t5.carrier_id = t4.id)
1502
ON t4.carrier = t1.carrier;
1503
id select_type table type possible_keys key key_len ref rows Extra
1504
1 SIMPLE t2 index package_id package_id 5 NULL 45 Using index
1505
1 SIMPLE t1 eq_ref PRIMARY PRIMARY 4 test.t2.package_id 1
1506
1 SIMPLE t4 eq_ref PRIMARY,id PRIMARY 2 test.t1.carrier 1
1507
1 SIMPLE t5 ref carrier_id carrier_id 5 test.t4.id 22 Using index
1508
1 SIMPLE t3 ref package_id package_id 5 test.t1.id 1 Using where; Using index
1510
FROM ((t2 JOIN t1 ON t2.package_id = t1.id)
1511
JOIN t3 ON t3.package_id = t1.id)
1513
(t5 JOIN t4 ON t5.carrier_id = t4.id)
1514
ON t4.carrier = t1.carrier;
1517
DROP TABLE t1,t2,t3,t4,t5;