6520 lines
866 KiB
Plaintext
6520 lines
866 KiB
Plaintext
|
|
drop table if exists t1,t2,t3,t4;
|
||
|
|
create temporary table server_counts_at_startup
|
||
|
|
select * from information_schema.global_status
|
||
|
|
where variable_name in
|
||
|
|
('Ndb_pruned_scan_count',
|
||
|
|
'Ndb_sorted_scan_count',
|
||
|
|
'Ndb_pushed_queries_defined',
|
||
|
|
'Ndb_pushed_queries_dropped');
|
||
|
|
set @save_debug = @@global.debug;
|
||
|
|
set @save_ndb_join_pushdown = @@session.ndb_join_pushdown;
|
||
|
|
set ndb_join_pushdown = true;
|
||
|
|
create table t1 (
|
||
|
|
a int not null,
|
||
|
|
b int not null,
|
||
|
|
c int not null,
|
||
|
|
d int not null,
|
||
|
|
primary key (`a`,`b`)
|
||
|
|
) engine=ndbcluster
|
||
|
|
partition by key() partitions 8;
|
||
|
|
insert into t1 values
|
||
|
|
(1,1,1,1), (2,2,2,2), (3,3,3,3), (4,4,4,4),
|
||
|
|
(1,2,5,1), (1,3,1,2), (1,4,2,3),
|
||
|
|
(2,1,3,4), (2,3,4,5), (2,4,5,1),
|
||
|
|
(3,1,1,2), (3,2,2,3), (3,4,3,4),
|
||
|
|
(4,1,4,5), (4,2,5,1), (4,3,1,2);
|
||
|
|
explain extended
|
||
|
|
select *
|
||
|
|
from t1
|
||
|
|
join t1 as t2 on t2.a = t1.b and t2.b = t1.c;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 16 100.00 Parent of 2 pushed join@1
|
||
|
|
1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.b,test.t1.c 1 100.00 Child of 't1' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t1`.`d` AS `d`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d` from `test`.`t1` join `test`.`t1` `t2` where ((`test`.`t2`.`b` = `test`.`t1`.`c`) and (`test`.`t2`.`a` = `test`.`t1`.`b`))
|
||
|
|
select *
|
||
|
|
from t1
|
||
|
|
join t1 as t2 on t2.a = t1.b and t2.b = t1.c;
|
||
|
|
a b c d a b c d
|
||
|
|
1 1 1 1 1 1 1 1
|
||
|
|
1 3 1 2 3 1 1 2
|
||
|
|
1 4 2 3 4 2 5 1
|
||
|
|
2 1 3 4 1 3 1 2
|
||
|
|
2 2 2 2 2 2 2 2
|
||
|
|
2 3 4 5 3 4 3 4
|
||
|
|
3 1 1 2 1 1 1 1
|
||
|
|
3 2 2 3 2 2 2 2
|
||
|
|
3 3 3 3 3 3 3 3
|
||
|
|
3 4 3 4 4 3 1 2
|
||
|
|
4 1 4 5 1 4 2 3
|
||
|
|
4 3 1 2 3 1 1 2
|
||
|
|
4 4 4 4 4 4 4 4
|
||
|
|
explain format=JSON
|
||
|
|
select *
|
||
|
|
from t1
|
||
|
|
join t1 as t2 on t2.a = t1.b and t2.b = t1.c;
|
||
|
|
EXPLAIN
|
||
|
|
{
|
||
|
|
"query_block": {
|
||
|
|
"select_id": 1,
|
||
|
|
"cost_info": {
|
||
|
|
"query_cost": "16022.40"
|
||
|
|
},
|
||
|
|
"nested_loop": [
|
||
|
|
{
|
||
|
|
"table": {
|
||
|
|
"table_name": "t1",
|
||
|
|
"partitions": [
|
||
|
|
"p0",
|
||
|
|
"p1",
|
||
|
|
"p2",
|
||
|
|
"p3",
|
||
|
|
"p4",
|
||
|
|
"p5",
|
||
|
|
"p6",
|
||
|
|
"p7"
|
||
|
|
],
|
||
|
|
"access_type": "ALL",
|
||
|
|
"rows_examined_per_scan": 16,
|
||
|
|
"rows_produced_per_join": 16,
|
||
|
|
"filtered": "100.00",
|
||
|
|
"pushed_join": "Parent of 2 pushed join@1",
|
||
|
|
"cost_info": {
|
||
|
|
"read_cost": "16000.00",
|
||
|
|
"eval_cost": "3.20",
|
||
|
|
"prefix_cost": "16003.20",
|
||
|
|
"data_read_per_join": "384"
|
||
|
|
},
|
||
|
|
"used_columns": [
|
||
|
|
"a",
|
||
|
|
"b",
|
||
|
|
"c",
|
||
|
|
"d"
|
||
|
|
]
|
||
|
|
}
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"table": {
|
||
|
|
"table_name": "t2",
|
||
|
|
"partitions": [
|
||
|
|
"p0",
|
||
|
|
"p1",
|
||
|
|
"p2",
|
||
|
|
"p3",
|
||
|
|
"p4",
|
||
|
|
"p5",
|
||
|
|
"p6",
|
||
|
|
"p7"
|
||
|
|
],
|
||
|
|
"access_type": "eq_ref",
|
||
|
|
"possible_keys": [
|
||
|
|
"PRIMARY"
|
||
|
|
],
|
||
|
|
"key": "PRIMARY",
|
||
|
|
"used_key_parts": [
|
||
|
|
"a",
|
||
|
|
"b"
|
||
|
|
],
|
||
|
|
"key_length": "8",
|
||
|
|
"ref": [
|
||
|
|
"test.t1.b",
|
||
|
|
"test.t1.c"
|
||
|
|
],
|
||
|
|
"rows_examined_per_scan": 1,
|
||
|
|
"rows_produced_per_join": 16,
|
||
|
|
"filtered": "100.00",
|
||
|
|
"pushed_join": "Child of 't1' in pushed join@1",
|
||
|
|
"cost_info": {
|
||
|
|
"read_cost": "16.00",
|
||
|
|
"eval_cost": "3.20",
|
||
|
|
"prefix_cost": "16022.40",
|
||
|
|
"data_read_per_join": "384"
|
||
|
|
},
|
||
|
|
"used_columns": [
|
||
|
|
"a",
|
||
|
|
"b",
|
||
|
|
"c",
|
||
|
|
"d"
|
||
|
|
]
|
||
|
|
}
|
||
|
|
}
|
||
|
|
]
|
||
|
|
}
|
||
|
|
}
|
||
|
|
Warnings:
|
||
|
|
Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t1`.`d` AS `d`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d` from `test`.`t1` join `test`.`t1` `t2` where ((`test`.`t2`.`b` = `test`.`t1`.`c`) and (`test`.`t2`.`a` = `test`.`t1`.`b`))
|
||
|
|
explain extended
|
||
|
|
select straight_join count(*)
|
||
|
|
from t1 as x1
|
||
|
|
join t1 as x2 on x1.d > x2.a + 1000
|
||
|
|
join t1 as x3 on x1.c=x3.a and x1.d=x3.b;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE x1 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 16 100.00 NULL
|
||
|
|
1 SIMPLE x2 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 16 100.00 Using where; Using join buffer (Block Nested Loop)
|
||
|
|
1 SIMPLE x3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.x1.c,test.x1.d 1 100.00 NULL
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 Can't push table 'x2' as child, 'type' must be a 'ref' access
|
||
|
|
Note 1003 Cannot push table 'x3' as child of table 'x1'. Doing so would prevent using join buffer for table 'x2'.
|
||
|
|
Note 1003 Cannot push table 'x3' as child of 'x2', since it referes to column 'x1.c' which will be stored in a join buffer.
|
||
|
|
Note 1003 /* select#1 */ select straight_join count(0) AS `count(*)` from `test`.`t1` `x1` join `test`.`t1` `x2` join `test`.`t1` `x3` where ((`test`.`x3`.`b` = `test`.`x1`.`d`) and (`test`.`x3`.`a` = `test`.`x1`.`c`) and (`test`.`x1`.`d` > (`test`.`x2`.`a` + 1000)))
|
||
|
|
select straight_join count(*)
|
||
|
|
from t1 as x1
|
||
|
|
join t1 as x2 on x1.d > x2.a + 1000
|
||
|
|
join t1 as x3 on x1.c=x3.a and x1.d=x3.b;
|
||
|
|
count(*)
|
||
|
|
0
|
||
|
|
explain extended select *
|
||
|
|
from t1 as x1
|
||
|
|
join t1 as x2 on x1.a=1 and x1.c=x2.a and x1.d=x2.b
|
||
|
|
join t1 as x3
|
||
|
|
join t1 as x4 where x4.a=x3.c and x4.b=x1.d;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE x1 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 const 3 100.00 Parent of 2 pushed join@1
|
||
|
|
1 SIMPLE x2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.x1.c,test.x1.d 1 100.00 Child of 'x1' in pushed join@1
|
||
|
|
1 SIMPLE x3 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 16 100.00 Using join buffer (Block Nested Loop)
|
||
|
|
1 SIMPLE x4 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.x3.c,test.x1.d 1 100.00 NULL
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 Can't push table 'x3' as child, 'type' must be a 'ref' access
|
||
|
|
Note 1003 Cannot push table 'x4' as child of table 'x1'. Doing so would prevent using join buffer for table 'x3'.
|
||
|
|
Note 1003 Cannot push table 'x4' as child of 'x3', since it referes to column 'x1.d' which will be stored in a join buffer.
|
||
|
|
Note 1003 /* select#1 */ select `test`.`x1`.`a` AS `a`,`test`.`x1`.`b` AS `b`,`test`.`x1`.`c` AS `c`,`test`.`x1`.`d` AS `d`,`test`.`x2`.`a` AS `a`,`test`.`x2`.`b` AS `b`,`test`.`x2`.`c` AS `c`,`test`.`x2`.`d` AS `d`,`test`.`x3`.`a` AS `a`,`test`.`x3`.`b` AS `b`,`test`.`x3`.`c` AS `c`,`test`.`x3`.`d` AS `d`,`test`.`x4`.`a` AS `a`,`test`.`x4`.`b` AS `b`,`test`.`x4`.`c` AS `c`,`test`.`x4`.`d` AS `d` from `test`.`t1` `x1` join `test`.`t1` `x2` join `test`.`t1` `x3` join `test`.`t1` `x4` where ((`test`.`x2`.`a` = `test`.`x1`.`c`) and (`test`.`x1`.`a` = 1) and (`test`.`x2`.`b` = `test`.`x1`.`d`) and (`test`.`x4`.`b` = `test`.`x1`.`d`) and (`test`.`x4`.`a` = `test`.`x3`.`c`))
|
||
|
|
select *
|
||
|
|
from t1 as x1
|
||
|
|
join t1 as x2 on x1.a=1 and x1.c=x2.a and x1.d=x2.b
|
||
|
|
join t1 as x3
|
||
|
|
join t1 as x4 where x4.a=x3.c and x4.b=x1.d;
|
||
|
|
a b c d a b c d a b c d a b c d
|
||
|
|
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
|
||
|
|
1 1 1 1 1 1 1 1 1 3 1 2 1 1 1 1
|
||
|
|
1 1 1 1 1 1 1 1 1 4 2 3 2 1 3 4
|
||
|
|
1 1 1 1 1 1 1 1 2 1 3 4 3 1 1 2
|
||
|
|
1 1 1 1 1 1 1 1 2 2 2 2 2 1 3 4
|
||
|
|
1 1 1 1 1 1 1 1 2 3 4 5 4 1 4 5
|
||
|
|
1 1 1 1 1 1 1 1 3 1 1 2 1 1 1 1
|
||
|
|
1 1 1 1 1 1 1 1 3 2 2 3 2 1 3 4
|
||
|
|
1 1 1 1 1 1 1 1 3 3 3 3 3 1 1 2
|
||
|
|
1 1 1 1 1 1 1 1 3 4 3 4 3 1 1 2
|
||
|
|
1 1 1 1 1 1 1 1 4 1 4 5 4 1 4 5
|
||
|
|
1 1 1 1 1 1 1 1 4 3 1 2 1 1 1 1
|
||
|
|
1 1 1 1 1 1 1 1 4 4 4 4 4 1 4 5
|
||
|
|
1 3 1 2 1 2 5 1 1 1 1 1 1 2 5 1
|
||
|
|
1 3 1 2 1 2 5 1 1 3 1 2 1 2 5 1
|
||
|
|
1 3 1 2 1 2 5 1 1 4 2 3 2 2 2 2
|
||
|
|
1 3 1 2 1 2 5 1 2 1 3 4 3 2 2 3
|
||
|
|
1 3 1 2 1 2 5 1 2 2 2 2 2 2 2 2
|
||
|
|
1 3 1 2 1 2 5 1 2 3 4 5 4 2 5 1
|
||
|
|
1 3 1 2 1 2 5 1 3 1 1 2 1 2 5 1
|
||
|
|
1 3 1 2 1 2 5 1 3 2 2 3 2 2 2 2
|
||
|
|
1 3 1 2 1 2 5 1 3 3 3 3 3 2 2 3
|
||
|
|
1 3 1 2 1 2 5 1 3 4 3 4 3 2 2 3
|
||
|
|
1 3 1 2 1 2 5 1 4 1 4 5 4 2 5 1
|
||
|
|
1 3 1 2 1 2 5 1 4 3 1 2 1 2 5 1
|
||
|
|
1 3 1 2 1 2 5 1 4 4 4 4 4 2 5 1
|
||
|
|
1 4 2 3 2 3 4 5 1 1 1 1 1 3 1 2
|
||
|
|
1 4 2 3 2 3 4 5 1 3 1 2 1 3 1 2
|
||
|
|
1 4 2 3 2 3 4 5 1 4 2 3 2 3 4 5
|
||
|
|
1 4 2 3 2 3 4 5 2 1 3 4 3 3 3 3
|
||
|
|
1 4 2 3 2 3 4 5 2 2 2 2 2 3 4 5
|
||
|
|
1 4 2 3 2 3 4 5 2 3 4 5 4 3 1 2
|
||
|
|
1 4 2 3 2 3 4 5 3 1 1 2 1 3 1 2
|
||
|
|
1 4 2 3 2 3 4 5 3 2 2 3 2 3 4 5
|
||
|
|
1 4 2 3 2 3 4 5 3 3 3 3 3 3 3 3
|
||
|
|
1 4 2 3 2 3 4 5 3 4 3 4 3 3 3 3
|
||
|
|
1 4 2 3 2 3 4 5 4 1 4 5 4 3 1 2
|
||
|
|
1 4 2 3 2 3 4 5 4 3 1 2 1 3 1 2
|
||
|
|
1 4 2 3 2 3 4 5 4 4 4 4 4 3 1 2
|
||
|
|
explain extended
|
||
|
|
select *
|
||
|
|
from t1
|
||
|
|
left join t1 as t2 on t2.a = t1.b and t2.b = t1.c;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 16 100.00 Parent of 2 pushed join@1
|
||
|
|
1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.b,test.t1.c 1 100.00 Child of 't1' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t1`.`d` AS `d`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d` from `test`.`t1` left join `test`.`t1` `t2` on(((`test`.`t2`.`a` = `test`.`t1`.`b`) and (`test`.`t2`.`b` = `test`.`t1`.`c`))) where 1
|
||
|
|
select *
|
||
|
|
from t1
|
||
|
|
left join t1 as t2 on t2.a = t1.b and t2.b = t1.c;
|
||
|
|
a b c d a b c d
|
||
|
|
1 1 1 1 1 1 1 1
|
||
|
|
1 2 5 1 NULL NULL NULL NULL
|
||
|
|
1 3 1 2 3 1 1 2
|
||
|
|
1 4 2 3 4 2 5 1
|
||
|
|
2 1 3 4 1 3 1 2
|
||
|
|
2 2 2 2 2 2 2 2
|
||
|
|
2 3 4 5 3 4 3 4
|
||
|
|
2 4 5 1 NULL NULL NULL NULL
|
||
|
|
3 1 1 2 1 1 1 1
|
||
|
|
3 2 2 3 2 2 2 2
|
||
|
|
3 3 3 3 3 3 3 3
|
||
|
|
3 4 3 4 4 3 1 2
|
||
|
|
4 1 4 5 1 4 2 3
|
||
|
|
4 2 5 1 NULL NULL NULL NULL
|
||
|
|
4 3 1 2 3 1 1 2
|
||
|
|
4 4 4 4 4 4 4 4
|
||
|
|
explain extended
|
||
|
|
select *
|
||
|
|
from t1
|
||
|
|
join t1 as t2 on t2.a = t1.b and t2.b = t1.c
|
||
|
|
join t1 as t3 on t3.a = t2.a and t3.b = t2.b
|
||
|
|
where t1.a = 1 and t1.b = 1;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE t1 p7 eq_ref PRIMARY PRIMARY 8 const,const 1 100.00 Parent of 3 pushed join@1
|
||
|
|
1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 const,test.t1.c 1 100.00 Child of 't1' in pushed join@1
|
||
|
|
1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 const,test.t1.c 1 100.00 Child of 't2' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t1`.`d` AS `d`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t3`.`c` AS `c`,`test`.`t3`.`d` AS `d` from `test`.`t1` join `test`.`t1` `t2` join `test`.`t1` `t3` where ((`test`.`t2`.`b` = `test`.`t1`.`c`) and (`test`.`t3`.`b` = `test`.`t1`.`c`) and (`test`.`t1`.`b` = 1) and (`test`.`t2`.`a` = 1) and (`test`.`t3`.`a` = 1) and (`test`.`t1`.`a` = 1))
|
||
|
|
select *
|
||
|
|
from t1
|
||
|
|
join t1 as t2 on t2.a = t1.b and t2.b = t1.c
|
||
|
|
join t1 as t3 on t3.a = t2.a and t3.b = t2.b
|
||
|
|
where t1.a = 1 and t1.b = 1;
|
||
|
|
a b c d a b c d a b c d
|
||
|
|
1 1 1 1 1 1 1 1 1 1 1 1
|
||
|
|
explain extended
|
||
|
|
select *
|
||
|
|
from t1
|
||
|
|
join t1 as t2 on t2.a = t1.b and t2.b = t1.c
|
||
|
|
join t1 as t3 on t3.a = t2.a and t3.b = t2.b;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 16 100.00 Parent of 3 pushed join@1
|
||
|
|
1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.b,test.t1.c 1 100.00 Child of 't1' in pushed join@1
|
||
|
|
1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.b,test.t1.c 1 100.00 Child of 't2' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t1`.`d` AS `d`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t3`.`c` AS `c`,`test`.`t3`.`d` AS `d` from `test`.`t1` join `test`.`t1` `t2` join `test`.`t1` `t3` where ((`test`.`t2`.`b` = `test`.`t1`.`c`) and (`test`.`t3`.`b` = `test`.`t1`.`c`) and (`test`.`t2`.`a` = `test`.`t1`.`b`) and (`test`.`t3`.`a` = `test`.`t1`.`b`))
|
||
|
|
select *
|
||
|
|
from t1
|
||
|
|
join t1 as t2 on t2.a = t1.b and t2.b = t1.c
|
||
|
|
join t1 as t3 on t3.a = t2.a and t3.b = t2.b;
|
||
|
|
a b c d a b c d a b c d
|
||
|
|
1 1 1 1 1 1 1 1 1 1 1 1
|
||
|
|
1 3 1 2 3 1 1 2 3 1 1 2
|
||
|
|
1 4 2 3 4 2 5 1 4 2 5 1
|
||
|
|
2 1 3 4 1 3 1 2 1 3 1 2
|
||
|
|
2 2 2 2 2 2 2 2 2 2 2 2
|
||
|
|
2 3 4 5 3 4 3 4 3 4 3 4
|
||
|
|
3 1 1 2 1 1 1 1 1 1 1 1
|
||
|
|
3 2 2 3 2 2 2 2 2 2 2 2
|
||
|
|
3 3 3 3 3 3 3 3 3 3 3 3
|
||
|
|
3 4 3 4 4 3 1 2 4 3 1 2
|
||
|
|
4 1 4 5 1 4 2 3 1 4 2 3
|
||
|
|
4 3 1 2 3 1 1 2 3 1 1 2
|
||
|
|
4 4 4 4 4 4 4 4 4 4 4 4
|
||
|
|
explain extended
|
||
|
|
select *
|
||
|
|
from t1
|
||
|
|
join t1 as t2 on t2.a = t1.b and t2.b = t1.c
|
||
|
|
left join t1 as t3 on t3.a = t2.a and t3.b = t2.b;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 16 100.00 Parent of 3 pushed join@1
|
||
|
|
1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.b,test.t1.c 1 100.00 Child of 't1' in pushed join@1
|
||
|
|
1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.b,test.t1.c 1 100.00 Child of 't2' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t1`.`d` AS `d`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t3`.`c` AS `c`,`test`.`t3`.`d` AS `d` from `test`.`t1` join `test`.`t1` `t2` left join `test`.`t1` `t3` on(((`test`.`t3`.`b` = `test`.`t1`.`c`) and (`test`.`t3`.`a` = `test`.`t1`.`b`))) where ((`test`.`t2`.`b` = `test`.`t1`.`c`) and (`test`.`t2`.`a` = `test`.`t1`.`b`))
|
||
|
|
select *
|
||
|
|
from t1
|
||
|
|
join t1 as t2 on t2.a = t1.b and t2.b = t1.c
|
||
|
|
left join t1 as t3 on t3.a = t2.a and t3.b = t2.b;
|
||
|
|
a b c d a b c d a b c d
|
||
|
|
1 1 1 1 1 1 1 1 1 1 1 1
|
||
|
|
1 3 1 2 3 1 1 2 3 1 1 2
|
||
|
|
1 4 2 3 4 2 5 1 4 2 5 1
|
||
|
|
2 1 3 4 1 3 1 2 1 3 1 2
|
||
|
|
2 2 2 2 2 2 2 2 2 2 2 2
|
||
|
|
2 3 4 5 3 4 3 4 3 4 3 4
|
||
|
|
3 1 1 2 1 1 1 1 1 1 1 1
|
||
|
|
3 2 2 3 2 2 2 2 2 2 2 2
|
||
|
|
3 3 3 3 3 3 3 3 3 3 3 3
|
||
|
|
3 4 3 4 4 3 1 2 4 3 1 2
|
||
|
|
4 1 4 5 1 4 2 3 1 4 2 3
|
||
|
|
4 3 1 2 3 1 1 2 3 1 1 2
|
||
|
|
4 4 4 4 4 4 4 4 4 4 4 4
|
||
|
|
explain extended
|
||
|
|
select *
|
||
|
|
from t1
|
||
|
|
left join t1 as t2 on t2.a = t1.b and t2.b = t1.c
|
||
|
|
left join t1 as t3 on t3.a = t2.a and t3.b = t2.b;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 16 100.00 Parent of 3 pushed join@1
|
||
|
|
1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.b,test.t1.c 1 100.00 Child of 't1' in pushed join@1
|
||
|
|
1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t2.a,test.t2.b 1 100.00 Child of 't2' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t1`.`d` AS `d`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t3`.`c` AS `c`,`test`.`t3`.`d` AS `d` from `test`.`t1` left join `test`.`t1` `t2` on(((`test`.`t2`.`a` = `test`.`t1`.`b`) and (`test`.`t2`.`b` = `test`.`t1`.`c`))) left join `test`.`t1` `t3` on(((`test`.`t3`.`a` = `test`.`t2`.`a`) and (`test`.`t3`.`b` = `test`.`t2`.`b`))) where 1
|
||
|
|
select *
|
||
|
|
from t1
|
||
|
|
left join t1 as t2 on t2.a = t1.b and t2.b = t1.c
|
||
|
|
left join t1 as t3 on t3.a = t2.a and t3.b = t2.b;
|
||
|
|
a b c d a b c d a b c d
|
||
|
|
1 1 1 1 1 1 1 1 1 1 1 1
|
||
|
|
1 2 5 1 NULL NULL NULL NULL NULL NULL NULL NULL
|
||
|
|
1 3 1 2 3 1 1 2 3 1 1 2
|
||
|
|
1 4 2 3 4 2 5 1 4 2 5 1
|
||
|
|
2 1 3 4 1 3 1 2 1 3 1 2
|
||
|
|
2 2 2 2 2 2 2 2 2 2 2 2
|
||
|
|
2 3 4 5 3 4 3 4 3 4 3 4
|
||
|
|
2 4 5 1 NULL NULL NULL NULL NULL NULL NULL NULL
|
||
|
|
3 1 1 2 1 1 1 1 1 1 1 1
|
||
|
|
3 2 2 3 2 2 2 2 2 2 2 2
|
||
|
|
3 3 3 3 3 3 3 3 3 3 3 3
|
||
|
|
3 4 3 4 4 3 1 2 4 3 1 2
|
||
|
|
4 1 4 5 1 4 2 3 1 4 2 3
|
||
|
|
4 2 5 1 NULL NULL NULL NULL NULL NULL NULL NULL
|
||
|
|
4 3 1 2 3 1 1 2 3 1 1 2
|
||
|
|
4 4 4 4 4 4 4 4 4 4 4 4
|
||
|
|
set ndb_join_pushdown=true;
|
||
|
|
explain extended
|
||
|
|
select *
|
||
|
|
from t1
|
||
|
|
join t1 as t2 on t2.a = t1.c and t2.b = t1.d procedure analyse();
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 16 100.00 Parent of 2 pushed join@1
|
||
|
|
1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.c,test.t1.d 1 100.00 Child of 't1' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Warning 1681 'PROCEDURE ANALYSE' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t1`.`d` AS `d`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d` from `test`.`t1` join `test`.`t1` `t2` where ((`test`.`t2`.`b` = `test`.`t1`.`d`) and (`test`.`t2`.`a` = `test`.`t1`.`c`))
|
||
|
|
explain extended
|
||
|
|
select *
|
||
|
|
from t1
|
||
|
|
join t1 as t2 on t2.a = t1.c and t2.b = t1.d
|
||
|
|
where t1.a = 2 and t1.b = 3;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE t1 p0 eq_ref PRIMARY PRIMARY 8 const,const 1 100.00 Parent of 2 pushed join@1
|
||
|
|
1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.c,test.t1.d 1 100.00 Child of 't1' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t1`.`d` AS `d`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d` from `test`.`t1` join `test`.`t1` `t2` where ((`test`.`t2`.`b` = `test`.`t1`.`d`) and (`test`.`t2`.`a` = `test`.`t1`.`c`) and (`test`.`t1`.`b` = 3) and (`test`.`t1`.`a` = 2))
|
||
|
|
select *
|
||
|
|
from t1
|
||
|
|
join t1 as t2 on t2.a = t1.c and t2.b = t1.d
|
||
|
|
where t1.a = 2 and t1.b = 3;
|
||
|
|
a b c d a b c d
|
||
|
|
LOCK TABLES t1 read, t1 as t2 read;
|
||
|
|
explain
|
||
|
|
select *
|
||
|
|
from t1
|
||
|
|
join t1 as t2 on t2.a = t1.c and t2.b = t1.d
|
||
|
|
where t1.a = 2 and t1.b = 3;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE t1 p0 eq_ref PRIMARY PRIMARY 8 const,const 1 100.00 Parent of 2 pushed join@1
|
||
|
|
1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.c,test.t1.d 1 100.00 Child of 't1' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t1`.`d` AS `d`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d` from `test`.`t1` join `test`.`t1` `t2` where ((`test`.`t2`.`b` = `test`.`t1`.`d`) and (`test`.`t2`.`a` = `test`.`t1`.`c`) and (`test`.`t1`.`b` = 3) and (`test`.`t1`.`a` = 2))
|
||
|
|
select *
|
||
|
|
from t1
|
||
|
|
join t1 as t2 on t2.a = t1.c and t2.b = t1.d
|
||
|
|
where t1.a = 2 and t1.b = 3;
|
||
|
|
a b c d a b c d
|
||
|
|
select *
|
||
|
|
from t1
|
||
|
|
join t1 as t2 on t2.a = t1.c and t2.b = t1.d
|
||
|
|
where t1.a = 3 and t1.b = 3;
|
||
|
|
a b c d a b c d
|
||
|
|
3 3 3 3 3 3 3 3
|
||
|
|
UNLOCK TABLES;
|
||
|
|
explain extended
|
||
|
|
select *
|
||
|
|
from t1
|
||
|
|
left join t1 as t2 on t2.a = t1.c and t2.b = t1.d
|
||
|
|
where t1.a = 2 and t1.b = 3;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE t1 p0 eq_ref PRIMARY PRIMARY 8 const,const 1 100.00 Parent of 2 pushed join@1
|
||
|
|
1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.c,test.t1.d 1 100.00 Child of 't1' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t1`.`d` AS `d`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d` from `test`.`t1` left join `test`.`t1` `t2` on(((`test`.`t2`.`b` = `test`.`t1`.`d`) and (`test`.`t2`.`a` = `test`.`t1`.`c`))) where ((`test`.`t1`.`b` = 3) and (`test`.`t1`.`a` = 2))
|
||
|
|
select *
|
||
|
|
from t1
|
||
|
|
left join t1 as t2 on t2.a = t1.c and t2.b = t1.d
|
||
|
|
where t1.a = 2 and t1.b = 3;
|
||
|
|
a b c d a b c d
|
||
|
|
2 3 4 5 NULL NULL NULL NULL
|
||
|
|
explain extended
|
||
|
|
select *
|
||
|
|
from t1
|
||
|
|
left join t1 as t2 on t2.a = t1.c and t2.b = t1.d
|
||
|
|
where t1.a = 2 and t1.b = 3
|
||
|
|
order by t1.c;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE t1 p0 eq_ref PRIMARY PRIMARY 8 const,const 1 100.00 Parent of 2 pushed join@1; Using where
|
||
|
|
1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.c,test.t1.d 1 100.00 Child of 't1' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t1`.`d` AS `d`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d` from `test`.`t1` left join `test`.`t1` `t2` on(((`test`.`t2`.`b` = `test`.`t1`.`d`) and (`test`.`t2`.`a` = `test`.`t1`.`c`))) where ((`test`.`t1`.`b` = 3) and (`test`.`t1`.`a` = 2)) order by `test`.`t1`.`c`
|
||
|
|
select *
|
||
|
|
from t1
|
||
|
|
left join t1 as t2 on t2.a = t1.c and t2.b = t1.d
|
||
|
|
where t1.a = 2 and t1.b = 3
|
||
|
|
order by t1.c;
|
||
|
|
a b c d a b c d
|
||
|
|
2 3 4 5 NULL NULL NULL NULL
|
||
|
|
set ndb_join_pushdown=false;
|
||
|
|
explain extended
|
||
|
|
select *
|
||
|
|
from t1
|
||
|
|
join t1 as t2 on t2.a = t1.c and t2.b = t1.d
|
||
|
|
where t1.a = 2 and t1.b = 3;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select '2' AS `a`,'3' AS `b`,'4' AS `c`,'5' AS `d`,NULL AS `a`,NULL AS `b`,NULL AS `c`,NULL AS `d` from `test`.`t1` join `test`.`t1` `t2` where (multiple equal(2) and multiple equal(3) and multiple equal('4', NULL) and multiple equal('5', NULL))
|
||
|
|
select *
|
||
|
|
from t1
|
||
|
|
join t1 as t2 on t2.a = t1.c and t2.b = t1.d
|
||
|
|
where t1.a = 2 and t1.b = 3;
|
||
|
|
a b c d a b c d
|
||
|
|
explain extended
|
||
|
|
select *
|
||
|
|
from t1
|
||
|
|
left join t1 as t2 on t2.a = t1.c and t2.b = t1.d
|
||
|
|
where t1.a = 2 and t1.b = 3;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE t1 p0 const PRIMARY PRIMARY 8 const,const 1 100.00 NULL
|
||
|
|
1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 const PRIMARY PRIMARY 8 const,const 0 0.00 unique row not found
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select '2' AS `a`,'3' AS `b`,'4' AS `c`,'5' AS `d`,NULL AS `a`,NULL AS `b`,NULL AS `c`,NULL AS `d` from `test`.`t1` left join `test`.`t1` `t2` on((multiple equal('4', NULL) and multiple equal('5', NULL))) where 1
|
||
|
|
select *
|
||
|
|
from t1
|
||
|
|
left join t1 as t2 on t2.a = t1.c and t2.b = t1.d
|
||
|
|
where t1.a = 2 and t1.b = 3;
|
||
|
|
a b c d a b c d
|
||
|
|
2 3 4 5 NULL NULL NULL NULL
|
||
|
|
set ndb_join_pushdown=true;
|
||
|
|
explain extended
|
||
|
|
select *
|
||
|
|
from t1
|
||
|
|
join t1 as t2 on t2.a = t1.c and t2.b = t1.d
|
||
|
|
where t1.a = 1 and t1.b = 1;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE t1 p7 eq_ref PRIMARY PRIMARY 8 const,const 1 100.00 Parent of 2 pushed join@1
|
||
|
|
1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.c,test.t1.d 1 100.00 Child of 't1' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t1`.`d` AS `d`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d` from `test`.`t1` join `test`.`t1` `t2` where ((`test`.`t2`.`b` = `test`.`t1`.`d`) and (`test`.`t2`.`a` = `test`.`t1`.`c`) and (`test`.`t1`.`b` = 1) and (`test`.`t1`.`a` = 1))
|
||
|
|
select *
|
||
|
|
from t1
|
||
|
|
join t1 as t2 on t2.a = t1.c and t2.b = t1.d
|
||
|
|
where t1.a = 1 and t1.b = 1;
|
||
|
|
a b c d a b c d
|
||
|
|
1 1 1 1 1 1 1 1
|
||
|
|
explain extended
|
||
|
|
select *
|
||
|
|
from t1
|
||
|
|
left join t1 as t2 on t2.a = t1.c and t2.b = t1.d
|
||
|
|
where t1.a = 1 and t1.b = 1;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE t1 p7 eq_ref PRIMARY PRIMARY 8 const,const 1 100.00 Parent of 2 pushed join@1
|
||
|
|
1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.c,test.t1.d 1 100.00 Child of 't1' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t1`.`d` AS `d`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d` from `test`.`t1` left join `test`.`t1` `t2` on(((`test`.`t2`.`b` = `test`.`t1`.`d`) and (`test`.`t2`.`a` = `test`.`t1`.`c`))) where ((`test`.`t1`.`b` = 1) and (`test`.`t1`.`a` = 1))
|
||
|
|
select *
|
||
|
|
from t1
|
||
|
|
left join t1 as t2 on t2.a = t1.c and t2.b = t1.d
|
||
|
|
where t1.a = 1 and t1.b = 1;
|
||
|
|
a b c d a b c d
|
||
|
|
1 1 1 1 1 1 1 1
|
||
|
|
set ndb_join_pushdown=false;
|
||
|
|
explain extended
|
||
|
|
select *
|
||
|
|
from t1
|
||
|
|
join t1 as t2 on t2.a = t1.c and t2.b = t1.d
|
||
|
|
where t1.a = 1 and t1.b = 1;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE t1 p7 const PRIMARY PRIMARY 8 const,const 1 100.00 NULL
|
||
|
|
1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 const PRIMARY PRIMARY 8 const,const 1 100.00 NULL
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select '1' AS `a`,'1' AS `b`,'1' AS `c`,'1' AS `d`,'1' AS `a`,'1' AS `b`,'1' AS `c`,'1' AS `d` from `test`.`t1` join `test`.`t1` `t2` where 1
|
||
|
|
select *
|
||
|
|
from t1
|
||
|
|
join t1 as t2 on t2.a = t1.c and t2.b = t1.d
|
||
|
|
where t1.a = 1 and t1.b = 1;
|
||
|
|
a b c d a b c d
|
||
|
|
1 1 1 1 1 1 1 1
|
||
|
|
explain extended
|
||
|
|
select *
|
||
|
|
from t1
|
||
|
|
left join t1 as t2 on t2.a = t1.c and t2.b = t1.d
|
||
|
|
where t1.a = 1 and t1.b = 1;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE t1 p7 const PRIMARY PRIMARY 8 const,const 1 100.00 NULL
|
||
|
|
1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 const PRIMARY PRIMARY 8 const,const 1 100.00 NULL
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select '1' AS `a`,'1' AS `b`,'1' AS `c`,'1' AS `d`,'1' AS `a`,'1' AS `b`,'1' AS `c`,'1' AS `d` from `test`.`t1` left join `test`.`t1` `t2` on((multiple equal('1', '1') and multiple equal('1', '1'))) where 1
|
||
|
|
select *
|
||
|
|
from t1
|
||
|
|
left join t1 as t2 on t2.a = t1.c and t2.b = t1.d
|
||
|
|
where t1.a = 1 and t1.b = 1;
|
||
|
|
a b c d a b c d
|
||
|
|
1 1 1 1 1 1 1 1
|
||
|
|
set ndb_join_pushdown=true;
|
||
|
|
explain extended
|
||
|
|
select *
|
||
|
|
from t1
|
||
|
|
join t1 as t2 on t2.a = t1.c
|
||
|
|
join t1 as t3 on t3.a = t1.c and t3.b = t2.b;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 16 100.00 Parent of 3 pushed join@1
|
||
|
|
1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.t1.c 1 100.00 Child of 't1' in pushed join@1
|
||
|
|
1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.c,test.t2.b 1 100.00 Child of 't2' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t1`.`d` AS `d`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t3`.`c` AS `c`,`test`.`t3`.`d` AS `d` from `test`.`t1` join `test`.`t1` `t2` join `test`.`t1` `t3` where ((`test`.`t3`.`b` = `test`.`t2`.`b`) and (`test`.`t2`.`a` = `test`.`t1`.`c`) and (`test`.`t3`.`a` = `test`.`t1`.`c`))
|
||
|
|
select *
|
||
|
|
from t1
|
||
|
|
join t1 as t2 on t2.a = t1.c
|
||
|
|
join t1 as t3 on t3.a = t1.c and t3.b = t2.b;
|
||
|
|
a b c d a b c d a b c d
|
||
|
|
1 1 1 1 1 1 1 1 1 1 1 1
|
||
|
|
1 1 1 1 1 2 5 1 1 2 5 1
|
||
|
|
1 1 1 1 1 3 1 2 1 3 1 2
|
||
|
|
1 1 1 1 1 4 2 3 1 4 2 3
|
||
|
|
1 3 1 2 1 1 1 1 1 1 1 1
|
||
|
|
1 3 1 2 1 2 5 1 1 2 5 1
|
||
|
|
1 3 1 2 1 3 1 2 1 3 1 2
|
||
|
|
1 3 1 2 1 4 2 3 1 4 2 3
|
||
|
|
1 4 2 3 2 1 3 4 2 1 3 4
|
||
|
|
1 4 2 3 2 2 2 2 2 2 2 2
|
||
|
|
1 4 2 3 2 3 4 5 2 3 4 5
|
||
|
|
1 4 2 3 2 4 5 1 2 4 5 1
|
||
|
|
2 1 3 4 3 1 1 2 3 1 1 2
|
||
|
|
2 1 3 4 3 2 2 3 3 2 2 3
|
||
|
|
2 1 3 4 3 3 3 3 3 3 3 3
|
||
|
|
2 1 3 4 3 4 3 4 3 4 3 4
|
||
|
|
2 2 2 2 2 1 3 4 2 1 3 4
|
||
|
|
2 2 2 2 2 2 2 2 2 2 2 2
|
||
|
|
2 2 2 2 2 3 4 5 2 3 4 5
|
||
|
|
2 2 2 2 2 4 5 1 2 4 5 1
|
||
|
|
2 3 4 5 4 1 4 5 4 1 4 5
|
||
|
|
2 3 4 5 4 2 5 1 4 2 5 1
|
||
|
|
2 3 4 5 4 3 1 2 4 3 1 2
|
||
|
|
2 3 4 5 4 4 4 4 4 4 4 4
|
||
|
|
3 1 1 2 1 1 1 1 1 1 1 1
|
||
|
|
3 1 1 2 1 2 5 1 1 2 5 1
|
||
|
|
3 1 1 2 1 3 1 2 1 3 1 2
|
||
|
|
3 1 1 2 1 4 2 3 1 4 2 3
|
||
|
|
3 2 2 3 2 1 3 4 2 1 3 4
|
||
|
|
3 2 2 3 2 2 2 2 2 2 2 2
|
||
|
|
3 2 2 3 2 3 4 5 2 3 4 5
|
||
|
|
3 2 2 3 2 4 5 1 2 4 5 1
|
||
|
|
3 3 3 3 3 1 1 2 3 1 1 2
|
||
|
|
3 3 3 3 3 2 2 3 3 2 2 3
|
||
|
|
3 3 3 3 3 3 3 3 3 3 3 3
|
||
|
|
3 3 3 3 3 4 3 4 3 4 3 4
|
||
|
|
3 4 3 4 3 1 1 2 3 1 1 2
|
||
|
|
3 4 3 4 3 2 2 3 3 2 2 3
|
||
|
|
3 4 3 4 3 3 3 3 3 3 3 3
|
||
|
|
3 4 3 4 3 4 3 4 3 4 3 4
|
||
|
|
4 1 4 5 4 1 4 5 4 1 4 5
|
||
|
|
4 1 4 5 4 2 5 1 4 2 5 1
|
||
|
|
4 1 4 5 4 3 1 2 4 3 1 2
|
||
|
|
4 1 4 5 4 4 4 4 4 4 4 4
|
||
|
|
4 3 1 2 1 1 1 1 1 1 1 1
|
||
|
|
4 3 1 2 1 2 5 1 1 2 5 1
|
||
|
|
4 3 1 2 1 3 1 2 1 3 1 2
|
||
|
|
4 3 1 2 1 4 2 3 1 4 2 3
|
||
|
|
4 4 4 4 4 1 4 5 4 1 4 5
|
||
|
|
4 4 4 4 4 2 5 1 4 2 5 1
|
||
|
|
4 4 4 4 4 3 1 2 4 3 1 2
|
||
|
|
4 4 4 4 4 4 4 4 4 4 4 4
|
||
|
|
explain extended
|
||
|
|
select straight_join *
|
||
|
|
from (t1 as x cross join t1 as y)
|
||
|
|
join t1 as z on z.a=x.a and z.b=y.b;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 ALL PRIMARY NULL NULL NULL 16 100.00 NULL
|
||
|
|
1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 16 100.00 Using join buffer (Block Nested Loop)
|
||
|
|
1 SIMPLE z p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.x.a,test.y.b 1 100.00 NULL
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 Can't push table 'y' as child, 'type' must be a 'ref' access
|
||
|
|
Note 1003 Cannot push table 'z' as child of table 'x'. Doing so would prevent using join buffer for table 'y'.
|
||
|
|
Note 1003 Cannot push table 'z' as child of 'y', since it referes to column 'x.a' which will be stored in a join buffer.
|
||
|
|
Note 1003 /* select#1 */ select straight_join `test`.`x`.`a` AS `a`,`test`.`x`.`b` AS `b`,`test`.`x`.`c` AS `c`,`test`.`x`.`d` AS `d`,`test`.`y`.`a` AS `a`,`test`.`y`.`b` AS `b`,`test`.`y`.`c` AS `c`,`test`.`y`.`d` AS `d`,`test`.`z`.`a` AS `a`,`test`.`z`.`b` AS `b`,`test`.`z`.`c` AS `c`,`test`.`z`.`d` AS `d` from `test`.`t1` `x` join `test`.`t1` `y` join `test`.`t1` `z` where ((`test`.`z`.`b` = `test`.`y`.`b`) and (`test`.`z`.`a` = `test`.`x`.`a`))
|
||
|
|
select straight_join *
|
||
|
|
from (t1 as x cross join t1 as y)
|
||
|
|
join t1 as z on z.a=x.a and z.b=y.b;
|
||
|
|
a b c d a b c d a b c d
|
||
|
|
1 1 1 1 1 1 1 1 1 1 1 1
|
||
|
|
1 1 1 1 1 2 5 1 1 2 5 1
|
||
|
|
1 1 1 1 1 3 1 2 1 3 1 2
|
||
|
|
1 1 1 1 1 4 2 3 1 4 2 3
|
||
|
|
1 1 1 1 2 1 3 4 1 1 1 1
|
||
|
|
1 1 1 1 2 2 2 2 1 2 5 1
|
||
|
|
1 1 1 1 2 3 4 5 1 3 1 2
|
||
|
|
1 1 1 1 2 4 5 1 1 4 2 3
|
||
|
|
1 1 1 1 3 1 1 2 1 1 1 1
|
||
|
|
1 1 1 1 3 2 2 3 1 2 5 1
|
||
|
|
1 1 1 1 3 3 3 3 1 3 1 2
|
||
|
|
1 1 1 1 3 4 3 4 1 4 2 3
|
||
|
|
1 1 1 1 4 1 4 5 1 1 1 1
|
||
|
|
1 1 1 1 4 2 5 1 1 2 5 1
|
||
|
|
1 1 1 1 4 3 1 2 1 3 1 2
|
||
|
|
1 1 1 1 4 4 4 4 1 4 2 3
|
||
|
|
1 2 5 1 1 1 1 1 1 1 1 1
|
||
|
|
1 2 5 1 1 2 5 1 1 2 5 1
|
||
|
|
1 2 5 1 1 3 1 2 1 3 1 2
|
||
|
|
1 2 5 1 1 4 2 3 1 4 2 3
|
||
|
|
1 2 5 1 2 1 3 4 1 1 1 1
|
||
|
|
1 2 5 1 2 2 2 2 1 2 5 1
|
||
|
|
1 2 5 1 2 3 4 5 1 3 1 2
|
||
|
|
1 2 5 1 2 4 5 1 1 4 2 3
|
||
|
|
1 2 5 1 3 1 1 2 1 1 1 1
|
||
|
|
1 2 5 1 3 2 2 3 1 2 5 1
|
||
|
|
1 2 5 1 3 3 3 3 1 3 1 2
|
||
|
|
1 2 5 1 3 4 3 4 1 4 2 3
|
||
|
|
1 2 5 1 4 1 4 5 1 1 1 1
|
||
|
|
1 2 5 1 4 2 5 1 1 2 5 1
|
||
|
|
1 2 5 1 4 3 1 2 1 3 1 2
|
||
|
|
1 2 5 1 4 4 4 4 1 4 2 3
|
||
|
|
1 3 1 2 1 1 1 1 1 1 1 1
|
||
|
|
1 3 1 2 1 2 5 1 1 2 5 1
|
||
|
|
1 3 1 2 1 3 1 2 1 3 1 2
|
||
|
|
1 3 1 2 1 4 2 3 1 4 2 3
|
||
|
|
1 3 1 2 2 1 3 4 1 1 1 1
|
||
|
|
1 3 1 2 2 2 2 2 1 2 5 1
|
||
|
|
1 3 1 2 2 3 4 5 1 3 1 2
|
||
|
|
1 3 1 2 2 4 5 1 1 4 2 3
|
||
|
|
1 3 1 2 3 1 1 2 1 1 1 1
|
||
|
|
1 3 1 2 3 2 2 3 1 2 5 1
|
||
|
|
1 3 1 2 3 3 3 3 1 3 1 2
|
||
|
|
1 3 1 2 3 4 3 4 1 4 2 3
|
||
|
|
1 3 1 2 4 1 4 5 1 1 1 1
|
||
|
|
1 3 1 2 4 2 5 1 1 2 5 1
|
||
|
|
1 3 1 2 4 3 1 2 1 3 1 2
|
||
|
|
1 3 1 2 4 4 4 4 1 4 2 3
|
||
|
|
1 4 2 3 1 1 1 1 1 1 1 1
|
||
|
|
1 4 2 3 1 2 5 1 1 2 5 1
|
||
|
|
1 4 2 3 1 3 1 2 1 3 1 2
|
||
|
|
1 4 2 3 1 4 2 3 1 4 2 3
|
||
|
|
1 4 2 3 2 1 3 4 1 1 1 1
|
||
|
|
1 4 2 3 2 2 2 2 1 2 5 1
|
||
|
|
1 4 2 3 2 3 4 5 1 3 1 2
|
||
|
|
1 4 2 3 2 4 5 1 1 4 2 3
|
||
|
|
1 4 2 3 3 1 1 2 1 1 1 1
|
||
|
|
1 4 2 3 3 2 2 3 1 2 5 1
|
||
|
|
1 4 2 3 3 3 3 3 1 3 1 2
|
||
|
|
1 4 2 3 3 4 3 4 1 4 2 3
|
||
|
|
1 4 2 3 4 1 4 5 1 1 1 1
|
||
|
|
1 4 2 3 4 2 5 1 1 2 5 1
|
||
|
|
1 4 2 3 4 3 1 2 1 3 1 2
|
||
|
|
1 4 2 3 4 4 4 4 1 4 2 3
|
||
|
|
2 1 3 4 1 1 1 1 2 1 3 4
|
||
|
|
2 1 3 4 1 2 5 1 2 2 2 2
|
||
|
|
2 1 3 4 1 3 1 2 2 3 4 5
|
||
|
|
2 1 3 4 1 4 2 3 2 4 5 1
|
||
|
|
2 1 3 4 2 1 3 4 2 1 3 4
|
||
|
|
2 1 3 4 2 2 2 2 2 2 2 2
|
||
|
|
2 1 3 4 2 3 4 5 2 3 4 5
|
||
|
|
2 1 3 4 2 4 5 1 2 4 5 1
|
||
|
|
2 1 3 4 3 1 1 2 2 1 3 4
|
||
|
|
2 1 3 4 3 2 2 3 2 2 2 2
|
||
|
|
2 1 3 4 3 3 3 3 2 3 4 5
|
||
|
|
2 1 3 4 3 4 3 4 2 4 5 1
|
||
|
|
2 1 3 4 4 1 4 5 2 1 3 4
|
||
|
|
2 1 3 4 4 2 5 1 2 2 2 2
|
||
|
|
2 1 3 4 4 3 1 2 2 3 4 5
|
||
|
|
2 1 3 4 4 4 4 4 2 4 5 1
|
||
|
|
2 2 2 2 1 1 1 1 2 1 3 4
|
||
|
|
2 2 2 2 1 2 5 1 2 2 2 2
|
||
|
|
2 2 2 2 1 3 1 2 2 3 4 5
|
||
|
|
2 2 2 2 1 4 2 3 2 4 5 1
|
||
|
|
2 2 2 2 2 1 3 4 2 1 3 4
|
||
|
|
2 2 2 2 2 2 2 2 2 2 2 2
|
||
|
|
2 2 2 2 2 3 4 5 2 3 4 5
|
||
|
|
2 2 2 2 2 4 5 1 2 4 5 1
|
||
|
|
2 2 2 2 3 1 1 2 2 1 3 4
|
||
|
|
2 2 2 2 3 2 2 3 2 2 2 2
|
||
|
|
2 2 2 2 3 3 3 3 2 3 4 5
|
||
|
|
2 2 2 2 3 4 3 4 2 4 5 1
|
||
|
|
2 2 2 2 4 1 4 5 2 1 3 4
|
||
|
|
2 2 2 2 4 2 5 1 2 2 2 2
|
||
|
|
2 2 2 2 4 3 1 2 2 3 4 5
|
||
|
|
2 2 2 2 4 4 4 4 2 4 5 1
|
||
|
|
2 3 4 5 1 1 1 1 2 1 3 4
|
||
|
|
2 3 4 5 1 2 5 1 2 2 2 2
|
||
|
|
2 3 4 5 1 3 1 2 2 3 4 5
|
||
|
|
2 3 4 5 1 4 2 3 2 4 5 1
|
||
|
|
2 3 4 5 2 1 3 4 2 1 3 4
|
||
|
|
2 3 4 5 2 2 2 2 2 2 2 2
|
||
|
|
2 3 4 5 2 3 4 5 2 3 4 5
|
||
|
|
2 3 4 5 2 4 5 1 2 4 5 1
|
||
|
|
2 3 4 5 3 1 1 2 2 1 3 4
|
||
|
|
2 3 4 5 3 2 2 3 2 2 2 2
|
||
|
|
2 3 4 5 3 3 3 3 2 3 4 5
|
||
|
|
2 3 4 5 3 4 3 4 2 4 5 1
|
||
|
|
2 3 4 5 4 1 4 5 2 1 3 4
|
||
|
|
2 3 4 5 4 2 5 1 2 2 2 2
|
||
|
|
2 3 4 5 4 3 1 2 2 3 4 5
|
||
|
|
2 3 4 5 4 4 4 4 2 4 5 1
|
||
|
|
2 4 5 1 1 1 1 1 2 1 3 4
|
||
|
|
2 4 5 1 1 2 5 1 2 2 2 2
|
||
|
|
2 4 5 1 1 3 1 2 2 3 4 5
|
||
|
|
2 4 5 1 1 4 2 3 2 4 5 1
|
||
|
|
2 4 5 1 2 1 3 4 2 1 3 4
|
||
|
|
2 4 5 1 2 2 2 2 2 2 2 2
|
||
|
|
2 4 5 1 2 3 4 5 2 3 4 5
|
||
|
|
2 4 5 1 2 4 5 1 2 4 5 1
|
||
|
|
2 4 5 1 3 1 1 2 2 1 3 4
|
||
|
|
2 4 5 1 3 2 2 3 2 2 2 2
|
||
|
|
2 4 5 1 3 3 3 3 2 3 4 5
|
||
|
|
2 4 5 1 3 4 3 4 2 4 5 1
|
||
|
|
2 4 5 1 4 1 4 5 2 1 3 4
|
||
|
|
2 4 5 1 4 2 5 1 2 2 2 2
|
||
|
|
2 4 5 1 4 3 1 2 2 3 4 5
|
||
|
|
2 4 5 1 4 4 4 4 2 4 5 1
|
||
|
|
3 1 1 2 1 1 1 1 3 1 1 2
|
||
|
|
3 1 1 2 1 2 5 1 3 2 2 3
|
||
|
|
3 1 1 2 1 3 1 2 3 3 3 3
|
||
|
|
3 1 1 2 1 4 2 3 3 4 3 4
|
||
|
|
3 1 1 2 2 1 3 4 3 1 1 2
|
||
|
|
3 1 1 2 2 2 2 2 3 2 2 3
|
||
|
|
3 1 1 2 2 3 4 5 3 3 3 3
|
||
|
|
3 1 1 2 2 4 5 1 3 4 3 4
|
||
|
|
3 1 1 2 3 1 1 2 3 1 1 2
|
||
|
|
3 1 1 2 3 2 2 3 3 2 2 3
|
||
|
|
3 1 1 2 3 3 3 3 3 3 3 3
|
||
|
|
3 1 1 2 3 4 3 4 3 4 3 4
|
||
|
|
3 1 1 2 4 1 4 5 3 1 1 2
|
||
|
|
3 1 1 2 4 2 5 1 3 2 2 3
|
||
|
|
3 1 1 2 4 3 1 2 3 3 3 3
|
||
|
|
3 1 1 2 4 4 4 4 3 4 3 4
|
||
|
|
3 2 2 3 1 1 1 1 3 1 1 2
|
||
|
|
3 2 2 3 1 2 5 1 3 2 2 3
|
||
|
|
3 2 2 3 1 3 1 2 3 3 3 3
|
||
|
|
3 2 2 3 1 4 2 3 3 4 3 4
|
||
|
|
3 2 2 3 2 1 3 4 3 1 1 2
|
||
|
|
3 2 2 3 2 2 2 2 3 2 2 3
|
||
|
|
3 2 2 3 2 3 4 5 3 3 3 3
|
||
|
|
3 2 2 3 2 4 5 1 3 4 3 4
|
||
|
|
3 2 2 3 3 1 1 2 3 1 1 2
|
||
|
|
3 2 2 3 3 2 2 3 3 2 2 3
|
||
|
|
3 2 2 3 3 3 3 3 3 3 3 3
|
||
|
|
3 2 2 3 3 4 3 4 3 4 3 4
|
||
|
|
3 2 2 3 4 1 4 5 3 1 1 2
|
||
|
|
3 2 2 3 4 2 5 1 3 2 2 3
|
||
|
|
3 2 2 3 4 3 1 2 3 3 3 3
|
||
|
|
3 2 2 3 4 4 4 4 3 4 3 4
|
||
|
|
3 3 3 3 1 1 1 1 3 1 1 2
|
||
|
|
3 3 3 3 1 2 5 1 3 2 2 3
|
||
|
|
3 3 3 3 1 3 1 2 3 3 3 3
|
||
|
|
3 3 3 3 1 4 2 3 3 4 3 4
|
||
|
|
3 3 3 3 2 1 3 4 3 1 1 2
|
||
|
|
3 3 3 3 2 2 2 2 3 2 2 3
|
||
|
|
3 3 3 3 2 3 4 5 3 3 3 3
|
||
|
|
3 3 3 3 2 4 5 1 3 4 3 4
|
||
|
|
3 3 3 3 3 1 1 2 3 1 1 2
|
||
|
|
3 3 3 3 3 2 2 3 3 2 2 3
|
||
|
|
3 3 3 3 3 3 3 3 3 3 3 3
|
||
|
|
3 3 3 3 3 4 3 4 3 4 3 4
|
||
|
|
3 3 3 3 4 1 4 5 3 1 1 2
|
||
|
|
3 3 3 3 4 2 5 1 3 2 2 3
|
||
|
|
3 3 3 3 4 3 1 2 3 3 3 3
|
||
|
|
3 3 3 3 4 4 4 4 3 4 3 4
|
||
|
|
3 4 3 4 1 1 1 1 3 1 1 2
|
||
|
|
3 4 3 4 1 2 5 1 3 2 2 3
|
||
|
|
3 4 3 4 1 3 1 2 3 3 3 3
|
||
|
|
3 4 3 4 1 4 2 3 3 4 3 4
|
||
|
|
3 4 3 4 2 1 3 4 3 1 1 2
|
||
|
|
3 4 3 4 2 2 2 2 3 2 2 3
|
||
|
|
3 4 3 4 2 3 4 5 3 3 3 3
|
||
|
|
3 4 3 4 2 4 5 1 3 4 3 4
|
||
|
|
3 4 3 4 3 1 1 2 3 1 1 2
|
||
|
|
3 4 3 4 3 2 2 3 3 2 2 3
|
||
|
|
3 4 3 4 3 3 3 3 3 3 3 3
|
||
|
|
3 4 3 4 3 4 3 4 3 4 3 4
|
||
|
|
3 4 3 4 4 1 4 5 3 1 1 2
|
||
|
|
3 4 3 4 4 2 5 1 3 2 2 3
|
||
|
|
3 4 3 4 4 3 1 2 3 3 3 3
|
||
|
|
3 4 3 4 4 4 4 4 3 4 3 4
|
||
|
|
4 1 4 5 1 1 1 1 4 1 4 5
|
||
|
|
4 1 4 5 1 2 5 1 4 2 5 1
|
||
|
|
4 1 4 5 1 3 1 2 4 3 1 2
|
||
|
|
4 1 4 5 1 4 2 3 4 4 4 4
|
||
|
|
4 1 4 5 2 1 3 4 4 1 4 5
|
||
|
|
4 1 4 5 2 2 2 2 4 2 5 1
|
||
|
|
4 1 4 5 2 3 4 5 4 3 1 2
|
||
|
|
4 1 4 5 2 4 5 1 4 4 4 4
|
||
|
|
4 1 4 5 3 1 1 2 4 1 4 5
|
||
|
|
4 1 4 5 3 2 2 3 4 2 5 1
|
||
|
|
4 1 4 5 3 3 3 3 4 3 1 2
|
||
|
|
4 1 4 5 3 4 3 4 4 4 4 4
|
||
|
|
4 1 4 5 4 1 4 5 4 1 4 5
|
||
|
|
4 1 4 5 4 2 5 1 4 2 5 1
|
||
|
|
4 1 4 5 4 3 1 2 4 3 1 2
|
||
|
|
4 1 4 5 4 4 4 4 4 4 4 4
|
||
|
|
4 2 5 1 1 1 1 1 4 1 4 5
|
||
|
|
4 2 5 1 1 2 5 1 4 2 5 1
|
||
|
|
4 2 5 1 1 3 1 2 4 3 1 2
|
||
|
|
4 2 5 1 1 4 2 3 4 4 4 4
|
||
|
|
4 2 5 1 2 1 3 4 4 1 4 5
|
||
|
|
4 2 5 1 2 2 2 2 4 2 5 1
|
||
|
|
4 2 5 1 2 3 4 5 4 3 1 2
|
||
|
|
4 2 5 1 2 4 5 1 4 4 4 4
|
||
|
|
4 2 5 1 3 1 1 2 4 1 4 5
|
||
|
|
4 2 5 1 3 2 2 3 4 2 5 1
|
||
|
|
4 2 5 1 3 3 3 3 4 3 1 2
|
||
|
|
4 2 5 1 3 4 3 4 4 4 4 4
|
||
|
|
4 2 5 1 4 1 4 5 4 1 4 5
|
||
|
|
4 2 5 1 4 2 5 1 4 2 5 1
|
||
|
|
4 2 5 1 4 3 1 2 4 3 1 2
|
||
|
|
4 2 5 1 4 4 4 4 4 4 4 4
|
||
|
|
4 3 1 2 1 1 1 1 4 1 4 5
|
||
|
|
4 3 1 2 1 2 5 1 4 2 5 1
|
||
|
|
4 3 1 2 1 3 1 2 4 3 1 2
|
||
|
|
4 3 1 2 1 4 2 3 4 4 4 4
|
||
|
|
4 3 1 2 2 1 3 4 4 1 4 5
|
||
|
|
4 3 1 2 2 2 2 2 4 2 5 1
|
||
|
|
4 3 1 2 2 3 4 5 4 3 1 2
|
||
|
|
4 3 1 2 2 4 5 1 4 4 4 4
|
||
|
|
4 3 1 2 3 1 1 2 4 1 4 5
|
||
|
|
4 3 1 2 3 2 2 3 4 2 5 1
|
||
|
|
4 3 1 2 3 3 3 3 4 3 1 2
|
||
|
|
4 3 1 2 3 4 3 4 4 4 4 4
|
||
|
|
4 3 1 2 4 1 4 5 4 1 4 5
|
||
|
|
4 3 1 2 4 2 5 1 4 2 5 1
|
||
|
|
4 3 1 2 4 3 1 2 4 3 1 2
|
||
|
|
4 3 1 2 4 4 4 4 4 4 4 4
|
||
|
|
4 4 4 4 1 1 1 1 4 1 4 5
|
||
|
|
4 4 4 4 1 2 5 1 4 2 5 1
|
||
|
|
4 4 4 4 1 3 1 2 4 3 1 2
|
||
|
|
4 4 4 4 1 4 2 3 4 4 4 4
|
||
|
|
4 4 4 4 2 1 3 4 4 1 4 5
|
||
|
|
4 4 4 4 2 2 2 2 4 2 5 1
|
||
|
|
4 4 4 4 2 3 4 5 4 3 1 2
|
||
|
|
4 4 4 4 2 4 5 1 4 4 4 4
|
||
|
|
4 4 4 4 3 1 1 2 4 1 4 5
|
||
|
|
4 4 4 4 3 2 2 3 4 2 5 1
|
||
|
|
4 4 4 4 3 3 3 3 4 3 1 2
|
||
|
|
4 4 4 4 3 4 3 4 4 4 4 4
|
||
|
|
4 4 4 4 4 1 4 5 4 1 4 5
|
||
|
|
4 4 4 4 4 2 5 1 4 2 5 1
|
||
|
|
4 4 4 4 4 3 1 2 4 3 1 2
|
||
|
|
4 4 4 4 4 4 4 4 4 4 4 4
|
||
|
|
explain extended
|
||
|
|
select *
|
||
|
|
from t1
|
||
|
|
straight_join t1 as t2 on t2.a = t1.b+0 and t2.b = t1.c
|
||
|
|
straight_join t1 as t3 on t3.a = t1.b and t3.b = t2.b;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 16 100.00 Parent of 2 pushed join@1
|
||
|
|
1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 func,test.t1.c 1 100.00 Using where
|
||
|
|
1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.b,test.t1.c 1 100.00 Child of 't1' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 Can't push table 't2' as child, column 'a' does neither 'ref' a column nor a constant
|
||
|
|
Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t1`.`d` AS `d`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t3`.`c` AS `c`,`test`.`t3`.`d` AS `d` from `test`.`t1` straight_join `test`.`t1` `t2` straight_join `test`.`t1` `t3` where ((`test`.`t2`.`b` = `test`.`t1`.`c`) and (`test`.`t3`.`b` = `test`.`t1`.`c`) and (`test`.`t3`.`a` = `test`.`t1`.`b`) and (`test`.`t2`.`a` = (`test`.`t1`.`b` + 0)))
|
||
|
|
select *
|
||
|
|
from t1
|
||
|
|
straight_join t1 as t2 on t2.a = t1.b+0 and t2.b = t1.c
|
||
|
|
straight_join t1 as t3 on t3.a = t1.b and t3.b = t2.b;
|
||
|
|
a b c d a b c d a b c d
|
||
|
|
1 1 1 1 1 1 1 1 1 1 1 1
|
||
|
|
1 3 1 2 3 1 1 2 3 1 1 2
|
||
|
|
1 4 2 3 4 2 5 1 4 2 5 1
|
||
|
|
2 1 3 4 1 3 1 2 1 3 1 2
|
||
|
|
2 2 2 2 2 2 2 2 2 2 2 2
|
||
|
|
2 3 4 5 3 4 3 4 3 4 3 4
|
||
|
|
3 1 1 2 1 1 1 1 1 1 1 1
|
||
|
|
3 2 2 3 2 2 2 2 2 2 2 2
|
||
|
|
3 3 3 3 3 3 3 3 3 3 3 3
|
||
|
|
3 4 3 4 4 3 1 2 4 3 1 2
|
||
|
|
4 1 4 5 1 4 2 3 1 4 2 3
|
||
|
|
4 3 1 2 3 1 1 2 3 1 1 2
|
||
|
|
4 4 4 4 4 4 4 4 4 4 4 4
|
||
|
|
explain extended
|
||
|
|
select *
|
||
|
|
from t1
|
||
|
|
straight_join t1 as t2 on t2.a = t1.b+0 and t2.b = t1.c
|
||
|
|
straight_join t1 as t3 on t3.a = t1.b and t3.b = t2.b
|
||
|
|
where t1.a=1 and t1.d=1;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 const # # Parent of 2 pushed join@1; Using where with pushed condition (`test`.`t1`.`d` = 1)
|
||
|
|
1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 func,test.t1.c # # Using where
|
||
|
|
1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.b,test.t1.c # # Child of 't1' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 Can't push table 't2' as child, column 'a' does neither 'ref' a column nor a constant
|
||
|
|
Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t1`.`d` AS `d`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t3`.`c` AS `c`,`test`.`t3`.`d` AS `d` from `test`.`t1` straight_join `test`.`t1` `t2` straight_join `test`.`t1` `t3` where ((`test`.`t2`.`b` = `test`.`t1`.`c`) and (`test`.`t3`.`b` = `test`.`t1`.`c`) and (`test`.`t3`.`a` = `test`.`t1`.`b`) and (`test`.`t1`.`d` = 1) and (`test`.`t1`.`a` = 1) and (`test`.`t2`.`a` = (`test`.`t1`.`b` + 0)))
|
||
|
|
select *
|
||
|
|
from t1
|
||
|
|
straight_join t1 as t2 on t2.a = t1.b+0 and t2.b = t1.c
|
||
|
|
straight_join t1 as t3 on t3.a = t1.b and t3.b = t2.b
|
||
|
|
where t1.a=1 and t1.d=1;
|
||
|
|
a b c d a b c d a b c d
|
||
|
|
1 1 1 1 1 1 1 1 1 1 1 1
|
||
|
|
explain extended
|
||
|
|
select *
|
||
|
|
from t1
|
||
|
|
straight_join t1 as t2 on t2.a = t1.b+0
|
||
|
|
straight_join t1 as t3 on t3.a = t1.b and t3.b = t2.b;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 16 100.00 NULL
|
||
|
|
1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 func 1 100.00 Parent of 2 pushed join@1; Using where
|
||
|
|
1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.b,test.t2.b 1 100.00 Child of 't2' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 Can't push table 't2' as child, column 'a' does neither 'ref' a column nor a constant
|
||
|
|
Note 1003 Can't push table 't3' as child of 't1', column 't2.b' is outside scope of pushable join
|
||
|
|
Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t1`.`d` AS `d`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t3`.`c` AS `c`,`test`.`t3`.`d` AS `d` from `test`.`t1` straight_join `test`.`t1` `t2` straight_join `test`.`t1` `t3` where ((`test`.`t3`.`b` = `test`.`t2`.`b`) and (`test`.`t3`.`a` = `test`.`t1`.`b`) and (`test`.`t2`.`a` = (`test`.`t1`.`b` + 0)))
|
||
|
|
select *
|
||
|
|
from t1
|
||
|
|
straight_join t1 as t2 on t2.a = t1.b+0
|
||
|
|
straight_join t1 as t3 on t3.a = t1.b and t3.b = t2.b;
|
||
|
|
a b c d a b c d a b c d
|
||
|
|
1 1 1 1 1 1 1 1 1 1 1 1
|
||
|
|
1 1 1 1 1 2 5 1 1 2 5 1
|
||
|
|
1 1 1 1 1 3 1 2 1 3 1 2
|
||
|
|
1 1 1 1 1 4 2 3 1 4 2 3
|
||
|
|
1 2 5 1 2 1 3 4 2 1 3 4
|
||
|
|
1 2 5 1 2 2 2 2 2 2 2 2
|
||
|
|
1 2 5 1 2 3 4 5 2 3 4 5
|
||
|
|
1 2 5 1 2 4 5 1 2 4 5 1
|
||
|
|
1 3 1 2 3 1 1 2 3 1 1 2
|
||
|
|
1 3 1 2 3 2 2 3 3 2 2 3
|
||
|
|
1 3 1 2 3 3 3 3 3 3 3 3
|
||
|
|
1 3 1 2 3 4 3 4 3 4 3 4
|
||
|
|
1 4 2 3 4 1 4 5 4 1 4 5
|
||
|
|
1 4 2 3 4 2 5 1 4 2 5 1
|
||
|
|
1 4 2 3 4 3 1 2 4 3 1 2
|
||
|
|
1 4 2 3 4 4 4 4 4 4 4 4
|
||
|
|
2 1 3 4 1 1 1 1 1 1 1 1
|
||
|
|
2 1 3 4 1 2 5 1 1 2 5 1
|
||
|
|
2 1 3 4 1 3 1 2 1 3 1 2
|
||
|
|
2 1 3 4 1 4 2 3 1 4 2 3
|
||
|
|
2 2 2 2 2 1 3 4 2 1 3 4
|
||
|
|
2 2 2 2 2 2 2 2 2 2 2 2
|
||
|
|
2 2 2 2 2 3 4 5 2 3 4 5
|
||
|
|
2 2 2 2 2 4 5 1 2 4 5 1
|
||
|
|
2 3 4 5 3 1 1 2 3 1 1 2
|
||
|
|
2 3 4 5 3 2 2 3 3 2 2 3
|
||
|
|
2 3 4 5 3 3 3 3 3 3 3 3
|
||
|
|
2 3 4 5 3 4 3 4 3 4 3 4
|
||
|
|
2 4 5 1 4 1 4 5 4 1 4 5
|
||
|
|
2 4 5 1 4 2 5 1 4 2 5 1
|
||
|
|
2 4 5 1 4 3 1 2 4 3 1 2
|
||
|
|
2 4 5 1 4 4 4 4 4 4 4 4
|
||
|
|
3 1 1 2 1 1 1 1 1 1 1 1
|
||
|
|
3 1 1 2 1 2 5 1 1 2 5 1
|
||
|
|
3 1 1 2 1 3 1 2 1 3 1 2
|
||
|
|
3 1 1 2 1 4 2 3 1 4 2 3
|
||
|
|
3 2 2 3 2 1 3 4 2 1 3 4
|
||
|
|
3 2 2 3 2 2 2 2 2 2 2 2
|
||
|
|
3 2 2 3 2 3 4 5 2 3 4 5
|
||
|
|
3 2 2 3 2 4 5 1 2 4 5 1
|
||
|
|
3 3 3 3 3 1 1 2 3 1 1 2
|
||
|
|
3 3 3 3 3 2 2 3 3 2 2 3
|
||
|
|
3 3 3 3 3 3 3 3 3 3 3 3
|
||
|
|
3 3 3 3 3 4 3 4 3 4 3 4
|
||
|
|
3 4 3 4 4 1 4 5 4 1 4 5
|
||
|
|
3 4 3 4 4 2 5 1 4 2 5 1
|
||
|
|
3 4 3 4 4 3 1 2 4 3 1 2
|
||
|
|
3 4 3 4 4 4 4 4 4 4 4 4
|
||
|
|
4 1 4 5 1 1 1 1 1 1 1 1
|
||
|
|
4 1 4 5 1 2 5 1 1 2 5 1
|
||
|
|
4 1 4 5 1 3 1 2 1 3 1 2
|
||
|
|
4 1 4 5 1 4 2 3 1 4 2 3
|
||
|
|
4 2 5 1 2 1 3 4 2 1 3 4
|
||
|
|
4 2 5 1 2 2 2 2 2 2 2 2
|
||
|
|
4 2 5 1 2 3 4 5 2 3 4 5
|
||
|
|
4 2 5 1 2 4 5 1 2 4 5 1
|
||
|
|
4 3 1 2 3 1 1 2 3 1 1 2
|
||
|
|
4 3 1 2 3 2 2 3 3 2 2 3
|
||
|
|
4 3 1 2 3 3 3 3 3 3 3 3
|
||
|
|
4 3 1 2 3 4 3 4 3 4 3 4
|
||
|
|
4 4 4 4 4 1 4 5 4 1 4 5
|
||
|
|
4 4 4 4 4 2 5 1 4 2 5 1
|
||
|
|
4 4 4 4 4 3 1 2 4 3 1 2
|
||
|
|
4 4 4 4 4 4 4 4 4 4 4 4
|
||
|
|
create table t1_myisam (
|
||
|
|
a int not null,
|
||
|
|
b int not null,
|
||
|
|
c int not null,
|
||
|
|
d int not null,
|
||
|
|
primary key (`a`,`b`)
|
||
|
|
) engine=myisam;
|
||
|
|
insert into t1_myisam values
|
||
|
|
(1,1,1,1), (2,2,1,1), (3,3,1,1), (4,4,1,1);
|
||
|
|
set ndb_join_pushdown=true;
|
||
|
|
explain extended
|
||
|
|
select *
|
||
|
|
from t1_myisam as t1
|
||
|
|
join t1 as t2 on t2.a = t1.c and t2.b = t1.d
|
||
|
|
join t1 as t3 on t3.a = t2.a and t3.b = t2.b
|
||
|
|
where t1.a=2 and t1.b=2;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE t1 NULL const PRIMARY PRIMARY 8 const,const 1 100.00 NULL
|
||
|
|
1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 const,const 1 100.00 Parent of 2 pushed join@1
|
||
|
|
1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 const,test.t2.b 1 100.00 Child of 't2' in pushed join@1; Using where
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select '2' AS `a`,'2' AS `b`,'1' AS `c`,'1' AS `d`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t3`.`c` AS `c`,`test`.`t3`.`d` AS `d` from `test`.`t1_myisam` `t1` join `test`.`t1` `t2` join `test`.`t1` `t3` where ((`test`.`t2`.`b` = '1') and (`test`.`t3`.`b` = '1') and (`test`.`t2`.`a` = '1') and (`test`.`t3`.`a` = '1'))
|
||
|
|
select *
|
||
|
|
from t1_myisam as t1
|
||
|
|
join t1 as t2 on t2.a = t1.c and t2.b = t1.d
|
||
|
|
join t1 as t3 on t3.a = t2.a and t3.b = t2.b
|
||
|
|
where t1.a=2 and t1.b=2;
|
||
|
|
a b c d a b c d a b c d
|
||
|
|
2 2 1 1 1 1 1 1 1 1 1 1
|
||
|
|
drop table t1_myisam;
|
||
|
|
set ndb_join_pushdown=true;
|
||
|
|
explain extended select *
|
||
|
|
from t1
|
||
|
|
join t1 as t2 on t2.a = t1.c and t2.b = t1.d
|
||
|
|
where t1.d = 3;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL # # Parent of 2 pushed join@1; Using where with pushed condition (`test`.`t1`.`d` = 3)
|
||
|
|
1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.c,const # # Child of 't1' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t1`.`d` AS `d`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d` from `test`.`t1` join `test`.`t1` `t2` where ((`test`.`t2`.`a` = `test`.`t1`.`c`) and (`test`.`t1`.`d` = 3) and (`test`.`t2`.`b` = 3))
|
||
|
|
select *
|
||
|
|
from t1
|
||
|
|
join t1 as t2 on t2.a = t1.c and t2.b = t1.d
|
||
|
|
where t1.d = 3;
|
||
|
|
a b c d a b c d
|
||
|
|
1 4 2 3 2 3 4 5
|
||
|
|
3 2 2 3 2 3 4 5
|
||
|
|
3 3 3 3 3 3 3 3
|
||
|
|
explain extended select *
|
||
|
|
from t1
|
||
|
|
join t1 as t2 on t2.a = t1.c and t2.b = t1.d
|
||
|
|
where t1.a > 2 and t1.d = 3;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 range PRIMARY PRIMARY 4 NULL # # Parent of 2 pushed join@1; Using where with pushed condition ((`test`.`t1`.`d` = 3) and (`test`.`t1`.`a` > 2)); Using MRR
|
||
|
|
1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.c,const # # Child of 't1' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t1`.`d` AS `d`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d` from `test`.`t1` join `test`.`t1` `t2` where ((`test`.`t2`.`a` = `test`.`t1`.`c`) and (`test`.`t1`.`d` = 3) and (`test`.`t2`.`b` = 3) and (`test`.`t1`.`a` > 2))
|
||
|
|
select *
|
||
|
|
from t1
|
||
|
|
join t1 as t2 on t2.a = t1.c and t2.b = t1.d
|
||
|
|
where t1.a > 2 and t1.d = 3;
|
||
|
|
a b c d a b c d
|
||
|
|
3 2 2 3 2 3 4 5
|
||
|
|
3 3 3 3 3 3 3 3
|
||
|
|
explain extended select *
|
||
|
|
from t1 join t1 as t2 on t2.a = t1.c and t2.b = t1.d
|
||
|
|
where t1.d = 3
|
||
|
|
order by t1.a;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 index NULL PRIMARY 8 NULL # # Parent of 2 pushed join@1; Using where with pushed condition (`test`.`t1`.`d` = 3)
|
||
|
|
1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.c,const # # Child of 't1' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t1`.`d` AS `d`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d` from `test`.`t1` join `test`.`t1` `t2` where ((`test`.`t2`.`a` = `test`.`t1`.`c`) and (`test`.`t1`.`d` = 3) and (`test`.`t2`.`b` = 3)) order by `test`.`t1`.`a`
|
||
|
|
select *
|
||
|
|
from t1 join t1 as t2 on t2.a = t1.c and t2.b = t1.d
|
||
|
|
where t1.d = 3
|
||
|
|
order by t1.a;
|
||
|
|
a b c d a b c d
|
||
|
|
1 4 2 3 2 3 4 5
|
||
|
|
3 2 2 3 2 3 4 5
|
||
|
|
3 3 3 3 3 3 3 3
|
||
|
|
set ndb_join_pushdown=true;
|
||
|
|
explain extended
|
||
|
|
select *
|
||
|
|
from t1
|
||
|
|
join t1 as t2 on t2.a = t1.c
|
||
|
|
join t1 as t3 on t3.a = t2.c and t3.b = t2.d
|
||
|
|
where t1.a = 1 and t1.b = 1;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE t1 p7 eq_ref PRIMARY PRIMARY 8 const,const 1 100.00 NULL
|
||
|
|
1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.t1.c 1 100.00 Parent of 2 pushed join@1
|
||
|
|
1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t2.c,test.t2.d 1 100.00 Child of 't2' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 Push of table 't2' as scan-child with lookup-root 't1' not implemented
|
||
|
|
Note 1003 Can't push table 't3' as child of 't1', column 't2.c' is outside scope of pushable join
|
||
|
|
Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t1`.`d` AS `d`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t3`.`c` AS `c`,`test`.`t3`.`d` AS `d` from `test`.`t1` join `test`.`t1` `t2` join `test`.`t1` `t3` where ((`test`.`t2`.`a` = `test`.`t1`.`c`) and (`test`.`t3`.`b` = `test`.`t2`.`d`) and (`test`.`t3`.`a` = `test`.`t2`.`c`) and (`test`.`t1`.`b` = 1) and (`test`.`t1`.`a` = 1))
|
||
|
|
select *
|
||
|
|
from t1
|
||
|
|
join t1 as t2 on t2.a = t1.c
|
||
|
|
join t1 as t3 on t3.a = t2.c and t3.b = t2.d
|
||
|
|
where t1.a = 1 and t1.b = 1;
|
||
|
|
a b c d a b c d a b c d
|
||
|
|
1 1 1 1 1 1 1 1 1 1 1 1
|
||
|
|
1 1 1 1 1 3 1 2 1 2 5 1
|
||
|
|
1 1 1 1 1 4 2 3 2 3 4 5
|
||
|
|
explain extended
|
||
|
|
select *
|
||
|
|
from t1
|
||
|
|
left join t1 as t2 on t2.a = t1.c
|
||
|
|
left join t1 as t3 on t3.a = t2.c and t3.b = t2.d
|
||
|
|
where t1.a = 1 and t1.b = 1;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE t1 p7 eq_ref PRIMARY PRIMARY 8 const,const 1 100.00 NULL
|
||
|
|
1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.t1.c 1 100.00 Parent of 2 pushed join@1
|
||
|
|
1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t2.c,test.t2.d 1 100.00 Child of 't2' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 Push of table 't2' as scan-child with lookup-root 't1' not implemented
|
||
|
|
Note 1003 Can't push table 't3' as child of 't1', column 't2.c' is outside scope of pushable join
|
||
|
|
Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t1`.`d` AS `d`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t3`.`c` AS `c`,`test`.`t3`.`d` AS `d` from `test`.`t1` left join `test`.`t1` `t2` on((`test`.`t2`.`a` = `test`.`t1`.`c`)) left join `test`.`t1` `t3` on(((`test`.`t3`.`b` = `test`.`t2`.`d`) and (`test`.`t3`.`a` = `test`.`t2`.`c`))) where ((`test`.`t1`.`b` = 1) and (`test`.`t1`.`a` = 1))
|
||
|
|
select *
|
||
|
|
from t1
|
||
|
|
left join t1 as t2 on t2.a = t1.c
|
||
|
|
left join t1 as t3 on t3.a = t2.c and t3.b = t2.d
|
||
|
|
where t1.a = 1 and t1.b = 1;
|
||
|
|
a b c d a b c d a b c d
|
||
|
|
1 1 1 1 1 1 1 1 1 1 1 1
|
||
|
|
1 1 1 1 1 2 5 1 NULL NULL NULL NULL
|
||
|
|
1 1 1 1 1 3 1 2 1 2 5 1
|
||
|
|
1 1 1 1 1 4 2 3 2 3 4 5
|
||
|
|
set ndb_join_pushdown=false;
|
||
|
|
explain extended
|
||
|
|
select *
|
||
|
|
from t1
|
||
|
|
join t1 as t2 on t2.a = t1.c
|
||
|
|
join t1 as t3 on t3.a = t2.c and t3.b = t2.d
|
||
|
|
where t1.a = 1 and t1.b = 1;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE t1 p7 const PRIMARY PRIMARY 8 const,const 1 100.00 NULL
|
||
|
|
1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 const 3 100.00 NULL
|
||
|
|
1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t2.c,test.t2.d 1 100.00 NULL
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select '1' AS `a`,'1' AS `b`,'1' AS `c`,'1' AS `d`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t3`.`c` AS `c`,`test`.`t3`.`d` AS `d` from `test`.`t1` join `test`.`t1` `t2` join `test`.`t1` `t3` where ((`test`.`t2`.`a` = '1') and (`test`.`t3`.`b` = `test`.`t2`.`d`) and (`test`.`t3`.`a` = `test`.`t2`.`c`))
|
||
|
|
select *
|
||
|
|
from t1
|
||
|
|
join t1 as t2 on t2.a = t1.c
|
||
|
|
join t1 as t3 on t3.a = t2.c and t3.b = t2.d
|
||
|
|
where t1.a = 1 and t1.b = 1;
|
||
|
|
a b c d a b c d a b c d
|
||
|
|
1 1 1 1 1 1 1 1 1 1 1 1
|
||
|
|
1 1 1 1 1 3 1 2 1 2 5 1
|
||
|
|
1 1 1 1 1 4 2 3 2 3 4 5
|
||
|
|
explain extended
|
||
|
|
select *
|
||
|
|
from t1
|
||
|
|
left join t1 as t2 on t2.a = t1.c
|
||
|
|
left join t1 as t3 on t3.a = t2.c and t3.b = t2.d
|
||
|
|
where t1.a = 1 and t1.b = 1;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE t1 p7 const PRIMARY PRIMARY 8 const,const 1 100.00 NULL
|
||
|
|
1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 const 3 100.00 NULL
|
||
|
|
1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t2.c,test.t2.d 1 100.00 NULL
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select '1' AS `a`,'1' AS `b`,'1' AS `c`,'1' AS `d`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t3`.`c` AS `c`,`test`.`t3`.`d` AS `d` from `test`.`t1` left join `test`.`t1` `t2` on((`test`.`t2`.`a` = '1')) left join `test`.`t1` `t3` on(((`test`.`t3`.`b` = `test`.`t2`.`d`) and (`test`.`t3`.`a` = `test`.`t2`.`c`))) where 1
|
||
|
|
select *
|
||
|
|
from t1
|
||
|
|
left join t1 as t2 on t2.a = t1.c
|
||
|
|
left join t1 as t3 on t3.a = t2.c and t3.b = t2.d
|
||
|
|
where t1.a = 1 and t1.b = 1;
|
||
|
|
a b c d a b c d a b c d
|
||
|
|
1 1 1 1 1 1 1 1 1 1 1 1
|
||
|
|
1 1 1 1 1 2 5 1 NULL NULL NULL NULL
|
||
|
|
1 1 1 1 1 3 1 2 1 2 5 1
|
||
|
|
1 1 1 1 1 4 2 3 2 3 4 5
|
||
|
|
set ndb_join_pushdown=true;
|
||
|
|
explain extended
|
||
|
|
select *
|
||
|
|
from t1 as t2
|
||
|
|
join t1 as t3 on t3.a = t2.c and t3.b = t2.d
|
||
|
|
where t2.a = 1;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 const 3 100.00 Parent of 2 pushed join@1
|
||
|
|
1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t2.c,test.t2.d 1 100.00 Child of 't2' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t3`.`c` AS `c`,`test`.`t3`.`d` AS `d` from `test`.`t1` `t2` join `test`.`t1` `t3` where ((`test`.`t3`.`b` = `test`.`t2`.`d`) and (`test`.`t3`.`a` = `test`.`t2`.`c`) and (`test`.`t2`.`a` = 1))
|
||
|
|
select *
|
||
|
|
from t1 as t2
|
||
|
|
join t1 as t3 on t3.a = t2.c and t3.b = t2.d
|
||
|
|
where t2.a = 1;
|
||
|
|
a b c d a b c d
|
||
|
|
1 1 1 1 1 1 1 1
|
||
|
|
1 3 1 2 1 2 5 1
|
||
|
|
1 4 2 3 2 3 4 5
|
||
|
|
set ndb_join_pushdown=true;
|
||
|
|
explain extended
|
||
|
|
select straight_join *
|
||
|
|
from t1
|
||
|
|
join t1 as t2 on t2.a = t1.a and t2.b = t1.b
|
||
|
|
join t1 as t3 on t3.a = t2.c and t3.b = t1.c;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL PRIMARY NULL NULL NULL 16 100.00 Parent of 3 pushed join@1
|
||
|
|
1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.a,test.t1.b 1 100.00 Child of 't1' in pushed join@1
|
||
|
|
1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t2.c,test.t1.c 1 100.00 Child of 't2' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select straight_join `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t1`.`d` AS `d`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t3`.`c` AS `c`,`test`.`t3`.`d` AS `d` from `test`.`t1` join `test`.`t1` `t2` join `test`.`t1` `t3` where ((`test`.`t2`.`b` = `test`.`t1`.`b`) and (`test`.`t2`.`a` = `test`.`t1`.`a`) and (`test`.`t3`.`b` = `test`.`t1`.`c`) and (`test`.`t3`.`a` = `test`.`t2`.`c`))
|
||
|
|
select straight_join *
|
||
|
|
from t1
|
||
|
|
join t1 as t2 on t2.a = t1.a and t2.b = t1.b
|
||
|
|
join t1 as t3 on t3.a = t2.c and t3.b = t1.c;
|
||
|
|
a b c d a b c d a b c d
|
||
|
|
1 1 1 1 1 1 1 1 1 1 1 1
|
||
|
|
1 3 1 2 1 3 1 2 1 1 1 1
|
||
|
|
1 4 2 3 1 4 2 3 2 2 2 2
|
||
|
|
2 1 3 4 2 1 3 4 3 3 3 3
|
||
|
|
2 2 2 2 2 2 2 2 2 2 2 2
|
||
|
|
2 3 4 5 2 3 4 5 4 4 4 4
|
||
|
|
3 1 1 2 3 1 1 2 1 1 1 1
|
||
|
|
3 2 2 3 3 2 2 3 2 2 2 2
|
||
|
|
3 3 3 3 3 3 3 3 3 3 3 3
|
||
|
|
3 4 3 4 3 4 3 4 3 3 3 3
|
||
|
|
4 1 4 5 4 1 4 5 4 4 4 4
|
||
|
|
4 3 1 2 4 3 1 2 1 1 1 1
|
||
|
|
4 4 4 4 4 4 4 4 4 4 4 4
|
||
|
|
explain extended
|
||
|
|
select straight_join *
|
||
|
|
from t1
|
||
|
|
join t1 as t2 on t2.a = t1.a and t2.b = t1.b
|
||
|
|
join t1 as t3 on t3.a = t1.c and t3.b = t1.d
|
||
|
|
join t1 as t4 on t4.a = t3.c and t4.b = t2.c;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL PRIMARY NULL NULL NULL 16 100.00 Parent of 4 pushed join@1
|
||
|
|
1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.a,test.t1.b 1 100.00 Child of 't1' in pushed join@1
|
||
|
|
1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.c,test.t1.d 1 100.00 Child of 't2' in pushed join@1
|
||
|
|
1 SIMPLE t4 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t3.c,test.t2.c 1 100.00 Child of 't3' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select straight_join `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t1`.`d` AS `d`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t3`.`c` AS `c`,`test`.`t3`.`d` AS `d`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t4`.`c` AS `c`,`test`.`t4`.`d` AS `d` from `test`.`t1` join `test`.`t1` `t2` join `test`.`t1` `t3` join `test`.`t1` `t4` where ((`test`.`t2`.`b` = `test`.`t1`.`b`) and (`test`.`t2`.`a` = `test`.`t1`.`a`) and (`test`.`t3`.`b` = `test`.`t1`.`d`) and (`test`.`t3`.`a` = `test`.`t1`.`c`) and (`test`.`t4`.`b` = `test`.`t2`.`c`) and (`test`.`t4`.`a` = `test`.`t3`.`c`))
|
||
|
|
select straight_join *
|
||
|
|
from t1
|
||
|
|
join t1 as t2 on t2.a = t1.a and t2.b = t1.b
|
||
|
|
join t1 as t3 on t3.a = t1.c and t3.b = t1.d
|
||
|
|
join t1 as t4 on t4.a = t3.c and t4.b = t2.c;
|
||
|
|
a b c d a b c d a b c d a b c d
|
||
|
|
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
|
||
|
|
1 4 2 3 1 4 2 3 2 3 4 5 4 2 5 1
|
||
|
|
2 1 3 4 2 1 3 4 3 4 3 4 3 3 3 3
|
||
|
|
2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
|
||
|
|
3 2 2 3 3 2 2 3 2 3 4 5 4 2 5 1
|
||
|
|
3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3
|
||
|
|
3 4 3 4 3 4 3 4 3 4 3 4 3 3 3 3
|
||
|
|
4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
|
||
|
|
explain extended
|
||
|
|
select straight_join *
|
||
|
|
from t1
|
||
|
|
join t1 as t2 on t2.a = t1.a and t2.b = t1.b
|
||
|
|
join t1 as t3 on t3.a = t1.c and t3.b = t2.d
|
||
|
|
join t1 as t4 on t4.a = t3.c and t4.b = t2.c;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL PRIMARY NULL NULL NULL 16 100.00 Parent of 4 pushed join@1
|
||
|
|
1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.a,test.t1.b 1 100.00 Child of 't1' in pushed join@1
|
||
|
|
1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.c,test.t2.d 1 100.00 Child of 't2' in pushed join@1
|
||
|
|
1 SIMPLE t4 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t3.c,test.t2.c 1 100.00 Child of 't3' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select straight_join `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t1`.`d` AS `d`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t3`.`c` AS `c`,`test`.`t3`.`d` AS `d`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t4`.`c` AS `c`,`test`.`t4`.`d` AS `d` from `test`.`t1` join `test`.`t1` `t2` join `test`.`t1` `t3` join `test`.`t1` `t4` where ((`test`.`t2`.`b` = `test`.`t1`.`b`) and (`test`.`t2`.`a` = `test`.`t1`.`a`) and (`test`.`t3`.`b` = `test`.`t2`.`d`) and (`test`.`t3`.`a` = `test`.`t1`.`c`) and (`test`.`t4`.`b` = `test`.`t2`.`c`) and (`test`.`t4`.`a` = `test`.`t3`.`c`))
|
||
|
|
select straight_join *
|
||
|
|
from t1
|
||
|
|
join t1 as t2 on t2.a = t1.a and t2.b = t1.b
|
||
|
|
join t1 as t3 on t3.a = t1.c and t3.b = t2.d
|
||
|
|
join t1 as t4 on t4.a = t3.c and t4.b = t2.c;
|
||
|
|
a b c d a b c d a b c d a b c d
|
||
|
|
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
|
||
|
|
1 4 2 3 1 4 2 3 2 3 4 5 4 2 5 1
|
||
|
|
2 1 3 4 2 1 3 4 3 4 3 4 3 3 3 3
|
||
|
|
2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
|
||
|
|
3 2 2 3 3 2 2 3 2 3 4 5 4 2 5 1
|
||
|
|
3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3
|
||
|
|
3 4 3 4 3 4 3 4 3 4 3 4 3 3 3 3
|
||
|
|
4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
|
||
|
|
explain extended
|
||
|
|
select straight_join *
|
||
|
|
from t1
|
||
|
|
join t1 as t2 on t2.a = t1.a and t2.b = t1.b
|
||
|
|
join t1 as t3 on t3.a = t1.c and t3.b = t2.d
|
||
|
|
join t1 as t4 on t4.a = t3.c and t4.b = t1.d;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL PRIMARY NULL NULL NULL 16 100.00 Parent of 4 pushed join@1
|
||
|
|
1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.a,test.t1.b 1 100.00 Child of 't1' in pushed join@1
|
||
|
|
1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.c,test.t2.d 1 100.00 Child of 't2' in pushed join@1
|
||
|
|
1 SIMPLE t4 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t3.c,test.t1.d 1 100.00 Child of 't3' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select straight_join `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t1`.`d` AS `d`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t3`.`c` AS `c`,`test`.`t3`.`d` AS `d`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t4`.`c` AS `c`,`test`.`t4`.`d` AS `d` from `test`.`t1` join `test`.`t1` `t2` join `test`.`t1` `t3` join `test`.`t1` `t4` where ((`test`.`t2`.`b` = `test`.`t1`.`b`) and (`test`.`t2`.`a` = `test`.`t1`.`a`) and (`test`.`t3`.`b` = `test`.`t2`.`d`) and (`test`.`t3`.`a` = `test`.`t1`.`c`) and (`test`.`t4`.`b` = `test`.`t1`.`d`) and (`test`.`t4`.`a` = `test`.`t3`.`c`))
|
||
|
|
select straight_join *
|
||
|
|
from t1
|
||
|
|
join t1 as t2 on t2.a = t1.a and t2.b = t1.b
|
||
|
|
join t1 as t3 on t3.a = t1.c and t3.b = t2.d
|
||
|
|
join t1 as t4 on t4.a = t3.c and t4.b = t1.d;
|
||
|
|
a b c d a b c d a b c d a b c d
|
||
|
|
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
|
||
|
|
1 4 2 3 1 4 2 3 2 3 4 5 4 3 1 2
|
||
|
|
2 1 3 4 2 1 3 4 3 4 3 4 3 4 3 4
|
||
|
|
2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
|
||
|
|
3 2 2 3 3 2 2 3 2 3 4 5 4 3 1 2
|
||
|
|
3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3
|
||
|
|
3 4 3 4 3 4 3 4 3 4 3 4 3 4 3 4
|
||
|
|
4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
|
||
|
|
explain extended
|
||
|
|
select straight_join *
|
||
|
|
from t1
|
||
|
|
join t1 as t2 on t2.a = t1.a and t2.b = t1.b
|
||
|
|
join t1 as t3 on t3.a = t1.c and t3.b = t1.d
|
||
|
|
join t1 as t4 on t4.a = t3.a and t4.b = t2.c;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL PRIMARY NULL NULL NULL 16 100.00 Parent of 4 pushed join@1
|
||
|
|
1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.a,test.t1.b 1 100.00 Child of 't1' in pushed join@1
|
||
|
|
1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.c,test.t1.d 1 100.00 Child of 't2' in pushed join@1
|
||
|
|
1 SIMPLE t4 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.c,test.t2.c 1 100.00 Child of 't3' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select straight_join `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t1`.`d` AS `d`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t3`.`c` AS `c`,`test`.`t3`.`d` AS `d`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t4`.`c` AS `c`,`test`.`t4`.`d` AS `d` from `test`.`t1` join `test`.`t1` `t2` join `test`.`t1` `t3` join `test`.`t1` `t4` where ((`test`.`t2`.`b` = `test`.`t1`.`b`) and (`test`.`t2`.`a` = `test`.`t1`.`a`) and (`test`.`t3`.`b` = `test`.`t1`.`d`) and (`test`.`t4`.`b` = `test`.`t2`.`c`) and (`test`.`t3`.`a` = `test`.`t1`.`c`) and (`test`.`t4`.`a` = `test`.`t1`.`c`))
|
||
|
|
select straight_join *
|
||
|
|
from t1
|
||
|
|
join t1 as t2 on t2.a = t1.a and t2.b = t1.b
|
||
|
|
join t1 as t3 on t3.a = t1.c and t3.b = t1.d
|
||
|
|
join t1 as t4 on t4.a = t3.a and t4.b = t2.c;
|
||
|
|
a b c d a b c d a b c d a b c d
|
||
|
|
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
|
||
|
|
1 3 1 2 1 3 1 2 1 2 5 1 1 1 1 1
|
||
|
|
1 4 2 3 1 4 2 3 2 3 4 5 2 2 2 2
|
||
|
|
2 1 3 4 2 1 3 4 3 4 3 4 3 3 3 3
|
||
|
|
2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
|
||
|
|
3 1 1 2 3 1 1 2 1 2 5 1 1 1 1 1
|
||
|
|
3 2 2 3 3 2 2 3 2 3 4 5 2 2 2 2
|
||
|
|
3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3
|
||
|
|
3 4 3 4 3 4 3 4 3 4 3 4 3 3 3 3
|
||
|
|
4 3 1 2 4 3 1 2 1 2 5 1 1 1 1 1
|
||
|
|
4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
|
||
|
|
explain extended
|
||
|
|
select straight_join *
|
||
|
|
from t1
|
||
|
|
join t1 as t2 on t2.a = t1.a and t2.b = t1.b
|
||
|
|
join t1 as t3 on t3.a = t1.c and t3.b = t1.d
|
||
|
|
join t1 as t4 on t4.a = t3.b and t4.b = t2.c;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL PRIMARY NULL NULL NULL 16 100.00 Parent of 4 pushed join@1
|
||
|
|
1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.a,test.t1.b 1 100.00 Child of 't1' in pushed join@1
|
||
|
|
1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.c,test.t1.d 1 100.00 Child of 't2' in pushed join@1
|
||
|
|
1 SIMPLE t4 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.d,test.t2.c 1 100.00 Child of 't3' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select straight_join `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t1`.`d` AS `d`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t3`.`c` AS `c`,`test`.`t3`.`d` AS `d`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t4`.`c` AS `c`,`test`.`t4`.`d` AS `d` from `test`.`t1` join `test`.`t1` `t2` join `test`.`t1` `t3` join `test`.`t1` `t4` where ((`test`.`t2`.`b` = `test`.`t1`.`b`) and (`test`.`t2`.`a` = `test`.`t1`.`a`) and (`test`.`t3`.`a` = `test`.`t1`.`c`) and (`test`.`t4`.`b` = `test`.`t2`.`c`) and (`test`.`t3`.`b` = `test`.`t1`.`d`) and (`test`.`t4`.`a` = `test`.`t1`.`d`))
|
||
|
|
select straight_join *
|
||
|
|
from t1
|
||
|
|
join t1 as t2 on t2.a = t1.a and t2.b = t1.b
|
||
|
|
join t1 as t3 on t3.a = t1.c and t3.b = t1.d
|
||
|
|
join t1 as t4 on t4.a = t3.b and t4.b = t2.c;
|
||
|
|
a b c d a b c d a b c d a b c d
|
||
|
|
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
|
||
|
|
1 3 1 2 1 3 1 2 1 2 5 1 2 1 3 4
|
||
|
|
1 4 2 3 1 4 2 3 2 3 4 5 3 2 2 3
|
||
|
|
2 1 3 4 2 1 3 4 3 4 3 4 4 3 1 2
|
||
|
|
2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
|
||
|
|
3 1 1 2 3 1 1 2 1 2 5 1 2 1 3 4
|
||
|
|
3 2 2 3 3 2 2 3 2 3 4 5 3 2 2 3
|
||
|
|
3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3
|
||
|
|
3 4 3 4 3 4 3 4 3 4 3 4 4 3 1 2
|
||
|
|
4 3 1 2 4 3 1 2 1 2 5 1 2 1 3 4
|
||
|
|
4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
|
||
|
|
explain extended
|
||
|
|
select straight_join *
|
||
|
|
from t1
|
||
|
|
join t1 as t2 on t2.a = t1.a and t2.b = t1.b
|
||
|
|
join t1 as t3 on t3.a = t1.c and t3.b = t1.d
|
||
|
|
join t1 as t4 on t4.a = t3.c and t4.b = t2.a;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL PRIMARY NULL NULL NULL 16 100.00 Parent of 4 pushed join@1
|
||
|
|
1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.a,test.t1.b 1 100.00 Child of 't1' in pushed join@1
|
||
|
|
1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.c,test.t1.d 1 100.00 Child of 't1' in pushed join@1
|
||
|
|
1 SIMPLE t4 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t3.c,test.t1.a 1 100.00 Child of 't3' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select straight_join `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t1`.`d` AS `d`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t3`.`c` AS `c`,`test`.`t3`.`d` AS `d`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t4`.`c` AS `c`,`test`.`t4`.`d` AS `d` from `test`.`t1` join `test`.`t1` `t2` join `test`.`t1` `t3` join `test`.`t1` `t4` where ((`test`.`t2`.`b` = `test`.`t1`.`b`) and (`test`.`t3`.`b` = `test`.`t1`.`d`) and (`test`.`t3`.`a` = `test`.`t1`.`c`) and (`test`.`t2`.`a` = `test`.`t1`.`a`) and (`test`.`t4`.`b` = `test`.`t1`.`a`) and (`test`.`t4`.`a` = `test`.`t3`.`c`))
|
||
|
|
select straight_join *
|
||
|
|
from t1
|
||
|
|
join t1 as t2 on t2.a = t1.a and t2.b = t1.b
|
||
|
|
join t1 as t3 on t3.a = t1.c and t3.b = t1.d
|
||
|
|
join t1 as t4 on t4.a = t3.c and t4.b = t2.a;
|
||
|
|
a b c d a b c d a b c d a b c d
|
||
|
|
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
|
||
|
|
1 4 2 3 1 4 2 3 2 3 4 5 4 1 4 5
|
||
|
|
2 1 3 4 2 1 3 4 3 4 3 4 3 2 2 3
|
||
|
|
2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
|
||
|
|
3 2 2 3 3 2 2 3 2 3 4 5 4 3 1 2
|
||
|
|
3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3
|
||
|
|
3 4 3 4 3 4 3 4 3 4 3 4 3 3 3 3
|
||
|
|
4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
|
||
|
|
explain extended
|
||
|
|
select straight_join *
|
||
|
|
from t1
|
||
|
|
join t1 as t2 on t2.a = t1.a and t2.b = t1.b
|
||
|
|
join t1 as t3 on t3.a = t1.c and t3.b = t1.d
|
||
|
|
join t1 as t4 on t4.a = t3.c and t4.b = t2.b;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL PRIMARY NULL NULL NULL 16 100.00 Parent of 4 pushed join@1
|
||
|
|
1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.a,test.t1.b 1 100.00 Child of 't1' in pushed join@1
|
||
|
|
1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.c,test.t1.d 1 100.00 Child of 't1' in pushed join@1
|
||
|
|
1 SIMPLE t4 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t3.c,test.t1.b 1 100.00 Child of 't3' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select straight_join `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t1`.`d` AS `d`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t3`.`c` AS `c`,`test`.`t3`.`d` AS `d`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t4`.`c` AS `c`,`test`.`t4`.`d` AS `d` from `test`.`t1` join `test`.`t1` `t2` join `test`.`t1` `t3` join `test`.`t1` `t4` where ((`test`.`t2`.`a` = `test`.`t1`.`a`) and (`test`.`t3`.`b` = `test`.`t1`.`d`) and (`test`.`t3`.`a` = `test`.`t1`.`c`) and (`test`.`t2`.`b` = `test`.`t1`.`b`) and (`test`.`t4`.`b` = `test`.`t1`.`b`) and (`test`.`t4`.`a` = `test`.`t3`.`c`))
|
||
|
|
select straight_join *
|
||
|
|
from t1
|
||
|
|
join t1 as t2 on t2.a = t1.a and t2.b = t1.b
|
||
|
|
join t1 as t3 on t3.a = t1.c and t3.b = t1.d
|
||
|
|
join t1 as t4 on t4.a = t3.c and t4.b = t2.b;
|
||
|
|
a b c d a b c d a b c d a b c d
|
||
|
|
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
|
||
|
|
1 4 2 3 1 4 2 3 2 3 4 5 4 4 4 4
|
||
|
|
2 1 3 4 2 1 3 4 3 4 3 4 3 1 1 2
|
||
|
|
2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
|
||
|
|
3 2 2 3 3 2 2 3 2 3 4 5 4 2 5 1
|
||
|
|
3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3
|
||
|
|
3 4 3 4 3 4 3 4 3 4 3 4 3 4 3 4
|
||
|
|
4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
|
||
|
|
explain extended
|
||
|
|
select straight_join *
|
||
|
|
from t1
|
||
|
|
join t1 as t2 on t2.a = t1.a and t2.b = t1.b
|
||
|
|
join t1 as t3 on t3.a = t1.c and t3.b = t1.d
|
||
|
|
join t1 as t4 on t4.a = t1.c and t4.b = t2.c;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL PRIMARY NULL NULL NULL 16 100.00 Parent of 4 pushed join@1
|
||
|
|
1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.a,test.t1.b 1 100.00 Child of 't1' in pushed join@1
|
||
|
|
1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.c,test.t1.d 1 100.00 Child of 't2' in pushed join@1
|
||
|
|
1 SIMPLE t4 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.c,test.t2.c 1 100.00 Child of 't3' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select straight_join `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t1`.`d` AS `d`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t3`.`c` AS `c`,`test`.`t3`.`d` AS `d`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t4`.`c` AS `c`,`test`.`t4`.`d` AS `d` from `test`.`t1` join `test`.`t1` `t2` join `test`.`t1` `t3` join `test`.`t1` `t4` where ((`test`.`t2`.`b` = `test`.`t1`.`b`) and (`test`.`t2`.`a` = `test`.`t1`.`a`) and (`test`.`t3`.`b` = `test`.`t1`.`d`) and (`test`.`t4`.`b` = `test`.`t2`.`c`) and (`test`.`t3`.`a` = `test`.`t1`.`c`) and (`test`.`t4`.`a` = `test`.`t1`.`c`))
|
||
|
|
select straight_join *
|
||
|
|
from t1
|
||
|
|
join t1 as t2 on t2.a = t1.a and t2.b = t1.b
|
||
|
|
join t1 as t3 on t3.a = t1.c and t3.b = t1.d
|
||
|
|
join t1 as t4 on t4.a = t1.c and t4.b = t2.c;
|
||
|
|
a b c d a b c d a b c d a b c d
|
||
|
|
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
|
||
|
|
1 3 1 2 1 3 1 2 1 2 5 1 1 1 1 1
|
||
|
|
1 4 2 3 1 4 2 3 2 3 4 5 2 2 2 2
|
||
|
|
2 1 3 4 2 1 3 4 3 4 3 4 3 3 3 3
|
||
|
|
2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
|
||
|
|
3 1 1 2 3 1 1 2 1 2 5 1 1 1 1 1
|
||
|
|
3 2 2 3 3 2 2 3 2 3 4 5 2 2 2 2
|
||
|
|
3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3
|
||
|
|
3 4 3 4 3 4 3 4 3 4 3 4 3 3 3 3
|
||
|
|
4 3 1 2 4 3 1 2 1 2 5 1 1 1 1 1
|
||
|
|
4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
|
||
|
|
explain extended
|
||
|
|
select straight_join *
|
||
|
|
from t1
|
||
|
|
join t1 as t2 on t2.a = t1.a and t2.b = t1.b
|
||
|
|
join t1 as t3 on t3.a = t1.c and t3.b = t1.d
|
||
|
|
join t1 as t4 on t4.a = t3.c and t4.b = t1.b;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL PRIMARY NULL NULL NULL 16 100.00 Parent of 4 pushed join@1
|
||
|
|
1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.a,test.t1.b 1 100.00 Child of 't1' in pushed join@1
|
||
|
|
1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.c,test.t1.d 1 100.00 Child of 't1' in pushed join@1
|
||
|
|
1 SIMPLE t4 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t3.c,test.t1.b 1 100.00 Child of 't3' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select straight_join `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t1`.`d` AS `d`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t3`.`c` AS `c`,`test`.`t3`.`d` AS `d`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t4`.`c` AS `c`,`test`.`t4`.`d` AS `d` from `test`.`t1` join `test`.`t1` `t2` join `test`.`t1` `t3` join `test`.`t1` `t4` where ((`test`.`t2`.`a` = `test`.`t1`.`a`) and (`test`.`t3`.`b` = `test`.`t1`.`d`) and (`test`.`t3`.`a` = `test`.`t1`.`c`) and (`test`.`t2`.`b` = `test`.`t1`.`b`) and (`test`.`t4`.`b` = `test`.`t1`.`b`) and (`test`.`t4`.`a` = `test`.`t3`.`c`))
|
||
|
|
select straight_join *
|
||
|
|
from t1
|
||
|
|
join t1 as t2 on t2.a = t1.a and t2.b = t1.b
|
||
|
|
join t1 as t3 on t3.a = t1.c and t3.b = t1.d
|
||
|
|
join t1 as t4 on t4.a = t3.c and t4.b = t1.b;
|
||
|
|
a b c d a b c d a b c d a b c d
|
||
|
|
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
|
||
|
|
1 4 2 3 1 4 2 3 2 3 4 5 4 4 4 4
|
||
|
|
2 1 3 4 2 1 3 4 3 4 3 4 3 1 1 2
|
||
|
|
2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
|
||
|
|
3 2 2 3 3 2 2 3 2 3 4 5 4 2 5 1
|
||
|
|
3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3
|
||
|
|
3 4 3 4 3 4 3 4 3 4 3 4 3 4 3 4
|
||
|
|
4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
|
||
|
|
explain extended
|
||
|
|
select straight_join *
|
||
|
|
from t1
|
||
|
|
join t1 as t2 on t2.a = t1.a and t2.b = t1.b
|
||
|
|
join t1 as t2x on t2x.a = t2.c and t2x.b = t2.d
|
||
|
|
join t1 as t3x on t3x.a = t1.c and t3x.b = t1.d
|
||
|
|
join t1 as t4 on t4.a = t3x.c and t4.b = t2x.c;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL PRIMARY NULL NULL NULL 16 100.00 Parent of 5 pushed join@1
|
||
|
|
1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.a,test.t1.b 1 100.00 Child of 't1' in pushed join@1
|
||
|
|
1 SIMPLE t2x p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t2.c,test.t2.d 1 100.00 Child of 't2' in pushed join@1
|
||
|
|
1 SIMPLE t3x p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.c,test.t1.d 1 100.00 Child of 't2x' in pushed join@1
|
||
|
|
1 SIMPLE t4 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t3x.c,test.t2x.c 1 100.00 Child of 't3x' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select straight_join `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t1`.`d` AS `d`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d`,`test`.`t2x`.`a` AS `a`,`test`.`t2x`.`b` AS `b`,`test`.`t2x`.`c` AS `c`,`test`.`t2x`.`d` AS `d`,`test`.`t3x`.`a` AS `a`,`test`.`t3x`.`b` AS `b`,`test`.`t3x`.`c` AS `c`,`test`.`t3x`.`d` AS `d`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t4`.`c` AS `c`,`test`.`t4`.`d` AS `d` from `test`.`t1` join `test`.`t1` `t2` join `test`.`t1` `t2x` join `test`.`t1` `t3x` join `test`.`t1` `t4` where ((`test`.`t2`.`b` = `test`.`t1`.`b`) and (`test`.`t2`.`a` = `test`.`t1`.`a`) and (`test`.`t2x`.`b` = `test`.`t2`.`d`) and (`test`.`t2x`.`a` = `test`.`t2`.`c`) and (`test`.`t3x`.`b` = `test`.`t1`.`d`) and (`test`.`t3x`.`a` = `test`.`t1`.`c`) and (`test`.`t4`.`b` = `test`.`t2x`.`c`) and (`test`.`t4`.`a` = `test`.`t3x`.`c`))
|
||
|
|
explain extended
|
||
|
|
select straight_join *
|
||
|
|
from t1
|
||
|
|
join t1 as t2 on t2.a = t1.a and t2.b = t1.b
|
||
|
|
join t1 as t2x on t2x.a = t2.c and t2x.b = t2.d
|
||
|
|
join t1 as t3 on t3.a = t1.c and t3.b = t1.d
|
||
|
|
join t1 as t3x on t3x.a = t3.c and t3x.b = t3.d
|
||
|
|
join t1 as t4 on t4.a = t3x.c and t4.b = t2x.c;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL PRIMARY NULL NULL NULL 16 100.00 Parent of 6 pushed join@1
|
||
|
|
1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.a,test.t1.b 1 100.00 Child of 't1' in pushed join@1
|
||
|
|
1 SIMPLE t2x p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t2.c,test.t2.d 1 100.00 Child of 't2' in pushed join@1
|
||
|
|
1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.c,test.t1.d 1 100.00 Child of 't2x' in pushed join@1
|
||
|
|
1 SIMPLE t3x p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t3.c,test.t3.d 1 100.00 Child of 't3' in pushed join@1
|
||
|
|
1 SIMPLE t4 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t3x.c,test.t2x.c 1 100.00 Child of 't3x' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select straight_join `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t1`.`d` AS `d`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d`,`test`.`t2x`.`a` AS `a`,`test`.`t2x`.`b` AS `b`,`test`.`t2x`.`c` AS `c`,`test`.`t2x`.`d` AS `d`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t3`.`c` AS `c`,`test`.`t3`.`d` AS `d`,`test`.`t3x`.`a` AS `a`,`test`.`t3x`.`b` AS `b`,`test`.`t3x`.`c` AS `c`,`test`.`t3x`.`d` AS `d`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t4`.`c` AS `c`,`test`.`t4`.`d` AS `d` from `test`.`t1` join `test`.`t1` `t2` join `test`.`t1` `t2x` join `test`.`t1` `t3` join `test`.`t1` `t3x` join `test`.`t1` `t4` where ((`test`.`t2`.`b` = `test`.`t1`.`b`) and (`test`.`t2`.`a` = `test`.`t1`.`a`) and (`test`.`t2x`.`b` = `test`.`t2`.`d`) and (`test`.`t2x`.`a` = `test`.`t2`.`c`) and (`test`.`t3`.`b` = `test`.`t1`.`d`) and (`test`.`t3`.`a` = `test`.`t1`.`c`) and (`test`.`t3x`.`b` = `test`.`t3`.`d`) and (`test`.`t3x`.`a` = `test`.`t3`.`c`) and (`test`.`t4`.`b` = `test`.`t2x`.`c`) and (`test`.`t4`.`a` = `test`.`t3x`.`c`))
|
||
|
|
explain extended
|
||
|
|
select straight_join *
|
||
|
|
from t1
|
||
|
|
join t1 as t2 on t2.a = t1.a and t2.b = t1.b
|
||
|
|
join t1 as t3 on t3.a = t1.c and t3.b = t1.d
|
||
|
|
join t1 as t2x on t2x.a = t2.c and t2x.b = t2.d
|
||
|
|
join t1 as t3x on t3x.a = t3.c and t3x.b = t3.d
|
||
|
|
join t1 as t4 on t4.a = t3x.c and t4.b = t2x.c;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL PRIMARY NULL NULL NULL 16 100.00 Parent of 6 pushed join@1
|
||
|
|
1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.a,test.t1.b 1 100.00 Child of 't1' in pushed join@1
|
||
|
|
1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.c,test.t1.d 1 100.00 Child of 't2' in pushed join@1
|
||
|
|
1 SIMPLE t2x p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t2.c,test.t2.d 1 100.00 Child of 't3' in pushed join@1
|
||
|
|
1 SIMPLE t3x p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t3.c,test.t3.d 1 100.00 Child of 't2x' in pushed join@1
|
||
|
|
1 SIMPLE t4 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t3x.c,test.t2x.c 1 100.00 Child of 't3x' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select straight_join `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t1`.`d` AS `d`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t3`.`c` AS `c`,`test`.`t3`.`d` AS `d`,`test`.`t2x`.`a` AS `a`,`test`.`t2x`.`b` AS `b`,`test`.`t2x`.`c` AS `c`,`test`.`t2x`.`d` AS `d`,`test`.`t3x`.`a` AS `a`,`test`.`t3x`.`b` AS `b`,`test`.`t3x`.`c` AS `c`,`test`.`t3x`.`d` AS `d`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t4`.`c` AS `c`,`test`.`t4`.`d` AS `d` from `test`.`t1` join `test`.`t1` `t2` join `test`.`t1` `t3` join `test`.`t1` `t2x` join `test`.`t1` `t3x` join `test`.`t1` `t4` where ((`test`.`t2`.`b` = `test`.`t1`.`b`) and (`test`.`t2`.`a` = `test`.`t1`.`a`) and (`test`.`t3`.`b` = `test`.`t1`.`d`) and (`test`.`t3`.`a` = `test`.`t1`.`c`) and (`test`.`t2x`.`b` = `test`.`t2`.`d`) and (`test`.`t2x`.`a` = `test`.`t2`.`c`) and (`test`.`t3x`.`b` = `test`.`t3`.`d`) and (`test`.`t3x`.`a` = `test`.`t3`.`c`) and (`test`.`t4`.`b` = `test`.`t2x`.`c`) and (`test`.`t4`.`a` = `test`.`t3x`.`c`))
|
||
|
|
explain extended
|
||
|
|
select straight_join *
|
||
|
|
from t1
|
||
|
|
join t1 as t2 on t2.a = t1.a and t2.b = t1.b
|
||
|
|
join t1 as t2x on t2x.a = t2.c and t2x.b = t2.d
|
||
|
|
join t1 as t3 on t3.a = t1.c and t3.b = t1.d
|
||
|
|
join t1 as t3x on t3x.a = t1.c and t3x.b = t1.d
|
||
|
|
join t1 as t4 on t4.a = t3x.c and t4.b = t2x.c;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL PRIMARY NULL NULL NULL 16 100.00 Parent of 6 pushed join@1
|
||
|
|
1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.a,test.t1.b 1 100.00 Child of 't1' in pushed join@1
|
||
|
|
1 SIMPLE t2x p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t2.c,test.t2.d 1 100.00 Child of 't2' in pushed join@1
|
||
|
|
1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.c,test.t1.d 1 100.00 Child of 't2x' in pushed join@1
|
||
|
|
1 SIMPLE t3x p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.c,test.t1.d 1 100.00 Child of 't3' in pushed join@1
|
||
|
|
1 SIMPLE t4 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t3x.c,test.t2x.c 1 100.00 Child of 't3x' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select straight_join `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t1`.`d` AS `d`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d`,`test`.`t2x`.`a` AS `a`,`test`.`t2x`.`b` AS `b`,`test`.`t2x`.`c` AS `c`,`test`.`t2x`.`d` AS `d`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t3`.`c` AS `c`,`test`.`t3`.`d` AS `d`,`test`.`t3x`.`a` AS `a`,`test`.`t3x`.`b` AS `b`,`test`.`t3x`.`c` AS `c`,`test`.`t3x`.`d` AS `d`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t4`.`c` AS `c`,`test`.`t4`.`d` AS `d` from `test`.`t1` join `test`.`t1` `t2` join `test`.`t1` `t2x` join `test`.`t1` `t3` join `test`.`t1` `t3x` join `test`.`t1` `t4` where ((`test`.`t2`.`b` = `test`.`t1`.`b`) and (`test`.`t2`.`a` = `test`.`t1`.`a`) and (`test`.`t2x`.`b` = `test`.`t2`.`d`) and (`test`.`t2x`.`a` = `test`.`t2`.`c`) and (`test`.`t3`.`b` = `test`.`t1`.`d`) and (`test`.`t3x`.`b` = `test`.`t1`.`d`) and (`test`.`t3`.`a` = `test`.`t1`.`c`) and (`test`.`t3x`.`a` = `test`.`t1`.`c`) and (`test`.`t4`.`b` = `test`.`t2x`.`c`) and (`test`.`t4`.`a` = `test`.`t3x`.`c`))
|
||
|
|
explain extended
|
||
|
|
select straight_join *
|
||
|
|
from t1
|
||
|
|
join t1 as t2 on t2.a = t1.a and t2.b = t1.b
|
||
|
|
join t1 as t2x on t2x.a = t2.c and t2x.b = t2.d
|
||
|
|
join t1 as t3 on t3.a = t1.c and t3.b = t1.b
|
||
|
|
join t1 as t3x on t3x.a = t1.c and t3x.b = t1.d
|
||
|
|
join t1 as t4 on t4.a = t3x.c and t4.b = t2x.c;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL PRIMARY NULL NULL NULL 16 100.00 Parent of 6 pushed join@1
|
||
|
|
1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.a,test.t1.b 1 100.00 Child of 't1' in pushed join@1
|
||
|
|
1 SIMPLE t2x p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t2.c,test.t2.d 1 100.00 Child of 't2' in pushed join@1
|
||
|
|
1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.c,test.t1.b 1 100.00 Child of 't2x' in pushed join@1
|
||
|
|
1 SIMPLE t3x p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.c,test.t1.d 1 100.00 Child of 't3' in pushed join@1
|
||
|
|
1 SIMPLE t4 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t3x.c,test.t2x.c 1 100.00 Child of 't3x' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select straight_join `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t1`.`d` AS `d`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d`,`test`.`t2x`.`a` AS `a`,`test`.`t2x`.`b` AS `b`,`test`.`t2x`.`c` AS `c`,`test`.`t2x`.`d` AS `d`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t3`.`c` AS `c`,`test`.`t3`.`d` AS `d`,`test`.`t3x`.`a` AS `a`,`test`.`t3x`.`b` AS `b`,`test`.`t3x`.`c` AS `c`,`test`.`t3x`.`d` AS `d`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t4`.`c` AS `c`,`test`.`t4`.`d` AS `d` from `test`.`t1` join `test`.`t1` `t2` join `test`.`t1` `t2x` join `test`.`t1` `t3` join `test`.`t1` `t3x` join `test`.`t1` `t4` where ((`test`.`t2`.`a` = `test`.`t1`.`a`) and (`test`.`t2x`.`b` = `test`.`t2`.`d`) and (`test`.`t2x`.`a` = `test`.`t2`.`c`) and (`test`.`t2`.`b` = `test`.`t1`.`b`) and (`test`.`t3`.`b` = `test`.`t1`.`b`) and (`test`.`t3x`.`b` = `test`.`t1`.`d`) and (`test`.`t3`.`a` = `test`.`t1`.`c`) and (`test`.`t3x`.`a` = `test`.`t1`.`c`) and (`test`.`t4`.`b` = `test`.`t2x`.`c`) and (`test`.`t4`.`a` = `test`.`t3x`.`c`))
|
||
|
|
explain extended
|
||
|
|
select straight_join *
|
||
|
|
from t1
|
||
|
|
left join t1 as t2 on t2.a = t1.a and t2.b = t1.b
|
||
|
|
join t1 as t3 on t3.a = t1.c and t3.b = t1.d
|
||
|
|
left join t1 as t4 on t4.a = t3.c and t4.b = t2.c;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 16 100.00 Parent of 3 pushed join@1
|
||
|
|
1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.a,test.t1.b 1 100.00 Child of 't1' in pushed join@1
|
||
|
|
1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.c,test.t1.d 1 100.00 Child of 't1' in pushed join@1
|
||
|
|
1 SIMPLE t4 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t3.c,test.t2.c 1 100.00 NULL
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 Can't push table 't4' as child of 't1', as it would introduce a dependency on outer joined grandparent 't2'
|
||
|
|
Note 1003 /* select#1 */ select straight_join `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t1`.`d` AS `d`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t3`.`c` AS `c`,`test`.`t3`.`d` AS `d`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t4`.`c` AS `c`,`test`.`t4`.`d` AS `d` from `test`.`t1` left join `test`.`t1` `t2` on(((`test`.`t2`.`b` = `test`.`t1`.`b`) and (`test`.`t2`.`a` = `test`.`t1`.`a`))) join `test`.`t1` `t3` left join `test`.`t1` `t4` on(((`test`.`t4`.`b` = `test`.`t2`.`c`) and (`test`.`t4`.`a` = `test`.`t3`.`c`))) where ((`test`.`t3`.`b` = `test`.`t1`.`d`) and (`test`.`t3`.`a` = `test`.`t1`.`c`))
|
||
|
|
explain extended
|
||
|
|
select straight_join *
|
||
|
|
from t1
|
||
|
|
join t1 as t2 on t2.a = t1.a and t2.b = t1.b
|
||
|
|
left join t1 as t3 on t3.a = t1.c and t3.b = t1.d
|
||
|
|
left join t1 as t4 on t4.a = t3.c and t4.b = t2.c;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL PRIMARY NULL NULL NULL 16 100.00 Parent of 4 pushed join@1
|
||
|
|
1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.a,test.t1.b 1 100.00 Child of 't1' in pushed join@1
|
||
|
|
1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.c,test.t1.d 1 100.00 Child of 't2' in pushed join@1
|
||
|
|
1 SIMPLE t4 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t3.c,test.t2.c 1 100.00 Child of 't3' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select straight_join `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t1`.`d` AS `d`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t3`.`c` AS `c`,`test`.`t3`.`d` AS `d`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t4`.`c` AS `c`,`test`.`t4`.`d` AS `d` from `test`.`t1` join `test`.`t1` `t2` left join `test`.`t1` `t3` on(((`test`.`t3`.`b` = `test`.`t1`.`d`) and (`test`.`t3`.`a` = `test`.`t1`.`c`))) left join `test`.`t1` `t4` on(((`test`.`t4`.`b` = `test`.`t2`.`c`) and (`test`.`t4`.`a` = `test`.`t3`.`c`))) where ((`test`.`t2`.`b` = `test`.`t1`.`b`) and (`test`.`t2`.`a` = `test`.`t1`.`a`))
|
||
|
|
explain extended
|
||
|
|
select straight_join *
|
||
|
|
from t1
|
||
|
|
left join t1 as t2 on t2.a = t1.a and t2.b = t1.b
|
||
|
|
join t1 as t3 on t3.a = t1.a
|
||
|
|
left join t1 as t4 on t4.a = t3.c and t4.b = t2.c;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL PRIMARY NULL NULL NULL 16 100.00 Parent of 3 pushed join@1
|
||
|
|
1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.a,test.t1.b 1 100.00 Child of 't1' in pushed join@1
|
||
|
|
1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.t1.a 1 100.00 Child of 't1' in pushed join@1
|
||
|
|
1 SIMPLE t4 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t3.c,test.t2.c 1 100.00 NULL
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 Can't push table 't4' as child of 't1', as it would introduce a dependency on outer joined grandparent 't2'
|
||
|
|
Note 1003 /* select#1 */ select straight_join `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t1`.`d` AS `d`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t3`.`c` AS `c`,`test`.`t3`.`d` AS `d`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t4`.`c` AS `c`,`test`.`t4`.`d` AS `d` from `test`.`t1` left join `test`.`t1` `t2` on(((`test`.`t2`.`b` = `test`.`t1`.`b`) and (`test`.`t2`.`a` = `test`.`t1`.`a`))) join `test`.`t1` `t3` left join `test`.`t1` `t4` on(((`test`.`t4`.`b` = `test`.`t2`.`c`) and (`test`.`t4`.`a` = `test`.`t3`.`c`))) where (`test`.`t3`.`a` = `test`.`t1`.`a`)
|
||
|
|
explain extended
|
||
|
|
select straight_join *
|
||
|
|
from t1
|
||
|
|
join t1 as t2 on t2.a = t1.a and t2.b = t1.b
|
||
|
|
left join t1 as t3 on t3.a = t1.a
|
||
|
|
left join t1 as t4 on t4.a = t3.c and t4.b = t2.c;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL PRIMARY NULL NULL NULL 16 100.00 Parent of 2 pushed join@1
|
||
|
|
1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.a,test.t1.b 1 100.00 Child of 't1' in pushed join@1
|
||
|
|
1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.t1.a 1 100.00 Parent of 2 pushed join@2
|
||
|
|
1 SIMPLE t4 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t3.c,test.t2.c 1 100.00 Child of 't3' in pushed join@2
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 Can't push table 't3' as child of 't1', outer join of scan-child not implemented
|
||
|
|
Note 1003 Can't push table 't4' as child of 't1', column 't3.c' is outside scope of pushable join
|
||
|
|
Note 1003 /* select#1 */ select straight_join `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t1`.`d` AS `d`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t3`.`c` AS `c`,`test`.`t3`.`d` AS `d`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t4`.`c` AS `c`,`test`.`t4`.`d` AS `d` from `test`.`t1` join `test`.`t1` `t2` left join `test`.`t1` `t3` on((`test`.`t3`.`a` = `test`.`t1`.`a`)) left join `test`.`t1` `t4` on(((`test`.`t4`.`b` = `test`.`t2`.`c`) and (`test`.`t4`.`a` = `test`.`t3`.`c`))) where ((`test`.`t2`.`b` = `test`.`t1`.`b`) and (`test`.`t2`.`a` = `test`.`t1`.`a`))
|
||
|
|
explain extended
|
||
|
|
select straight_join *
|
||
|
|
from t1
|
||
|
|
left join t1 as t2 on t2.a = t1.a and t2.b = t1.b
|
||
|
|
join t1 as t3 on t3.a = t1.a
|
||
|
|
left join t1 as t4 on t4.a = t3.c;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL PRIMARY NULL NULL NULL 16 100.00 Parent of 3 pushed join@1
|
||
|
|
1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.a,test.t1.b 1 100.00 Child of 't1' in pushed join@1
|
||
|
|
1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.t1.a 1 100.00 Child of 't1' in pushed join@1
|
||
|
|
1 SIMPLE t4 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.t3.c 1 100.00 NULL
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 Can't push table 't4' as child of 't1', outer join of scan-child not implemented
|
||
|
|
Note 1003 /* select#1 */ select straight_join `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t1`.`d` AS `d`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t3`.`c` AS `c`,`test`.`t3`.`d` AS `d`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t4`.`c` AS `c`,`test`.`t4`.`d` AS `d` from `test`.`t1` left join `test`.`t1` `t2` on(((`test`.`t2`.`b` = `test`.`t1`.`b`) and (`test`.`t2`.`a` = `test`.`t1`.`a`))) join `test`.`t1` `t3` left join `test`.`t1` `t4` on((`test`.`t4`.`a` = `test`.`t3`.`c`)) where (`test`.`t3`.`a` = `test`.`t1`.`a`)
|
||
|
|
explain extended
|
||
|
|
select straight_join *
|
||
|
|
from t1
|
||
|
|
join t1 as t2 on t2.a = t1.a and t2.b = t1.b
|
||
|
|
left join t1 as t3 on t3.a = t1.a
|
||
|
|
left join t1 as t4 on t4.a = t3.c;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL PRIMARY NULL NULL NULL 16 100.00 Parent of 2 pushed join@1
|
||
|
|
1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.a,test.t1.b 1 100.00 Child of 't1' in pushed join@1
|
||
|
|
1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.t1.a 1 100.00 NULL
|
||
|
|
1 SIMPLE t4 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.t3.c 1 100.00 NULL
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 Can't push table 't3' as child of 't1', outer join of scan-child not implemented
|
||
|
|
Note 1003 Can't push table 't4' as child of 't1', column 't3.c' is outside scope of pushable join
|
||
|
|
Note 1003 Can't push table 't4' as child of 't3', outer join of scan-child not implemented
|
||
|
|
Note 1003 /* select#1 */ select straight_join `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t1`.`d` AS `d`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t3`.`c` AS `c`,`test`.`t3`.`d` AS `d`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t4`.`c` AS `c`,`test`.`t4`.`d` AS `d` from `test`.`t1` join `test`.`t1` `t2` left join `test`.`t1` `t3` on((`test`.`t3`.`a` = `test`.`t1`.`a`)) left join `test`.`t1` `t4` on((`test`.`t4`.`a` = `test`.`t3`.`c`)) where ((`test`.`t2`.`b` = `test`.`t1`.`b`) and (`test`.`t2`.`a` = `test`.`t1`.`a`))
|
||
|
|
explain extended
|
||
|
|
select straight_join *
|
||
|
|
from
|
||
|
|
( t1 as t0 left join t1 as t1 on t1.a = t0.a and t1.b = t0.b
|
||
|
|
)
|
||
|
|
left join
|
||
|
|
( t1 as t2 join t1 as t3 on t3.a = t2.c and t3.b = t2.d
|
||
|
|
join t1 as t4 on t4.a = t3.c and t4.b = t2.c
|
||
|
|
)
|
||
|
|
on t2.a = t1.a and t2.b = t1.b;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE t0 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 16 100.00 Parent of 5 pushed join@1
|
||
|
|
1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t0.a,test.t0.b 1 100.00 Child of 't0' in pushed join@1
|
||
|
|
1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.a,test.t1.b 1 100.00 Child of 't1' in pushed join@1
|
||
|
|
1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t2.c,test.t2.d 1 100.00 Child of 't2' in pushed join@1
|
||
|
|
1 SIMPLE t4 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t3.c,test.t2.c 1 100.00 Child of 't3' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select straight_join `test`.`t0`.`a` AS `a`,`test`.`t0`.`b` AS `b`,`test`.`t0`.`c` AS `c`,`test`.`t0`.`d` AS `d`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t1`.`d` AS `d`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t3`.`c` AS `c`,`test`.`t3`.`d` AS `d`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t4`.`c` AS `c`,`test`.`t4`.`d` AS `d` from `test`.`t1` `t0` left join `test`.`t1` on(((`test`.`t1`.`a` = `test`.`t0`.`a`) and (`test`.`t1`.`b` = `test`.`t0`.`b`))) left join (`test`.`t1` `t2` join `test`.`t1` `t3` join `test`.`t1` `t4`) on(((`test`.`t2`.`a` = `test`.`t1`.`a`) and (`test`.`t2`.`b` = `test`.`t1`.`b`) and (`test`.`t4`.`a` = `test`.`t3`.`c`) and (`test`.`t4`.`b` = `test`.`t2`.`c`) and (`test`.`t3`.`a` = `test`.`t2`.`c`) and (`test`.`t3`.`b` = `test`.`t2`.`d`))) where 1
|
||
|
|
explain extended
|
||
|
|
select straight_join *
|
||
|
|
from
|
||
|
|
t1 as x1
|
||
|
|
left join
|
||
|
|
( t1 as x2 join t1 as x3 on x3.a=x2.c
|
||
|
|
join t1 as x4 on x4.a=x2.d
|
||
|
|
join t1 as x5 on x5.a=x3.d and x5.b=x4.d
|
||
|
|
)
|
||
|
|
on x2.a=x1.c and x2.b=x1.c and
|
||
|
|
x3.b=x1.d and
|
||
|
|
x4.b=x1.d;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE x1 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 16 100.00 Parent of 5 pushed join@1
|
||
|
|
1 SIMPLE x2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.x1.c,test.x1.c 1 100.00 Child of 'x1' in pushed join@1
|
||
|
|
1 SIMPLE x3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.x2.c,test.x1.d 1 100.00 Child of 'x2' in pushed join@1
|
||
|
|
1 SIMPLE x4 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.x2.d,test.x1.d 1 100.00 Child of 'x3' in pushed join@1
|
||
|
|
1 SIMPLE x5 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.x3.d,test.x4.d 1 100.00 Child of 'x4' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select straight_join `test`.`x1`.`a` AS `a`,`test`.`x1`.`b` AS `b`,`test`.`x1`.`c` AS `c`,`test`.`x1`.`d` AS `d`,`test`.`x2`.`a` AS `a`,`test`.`x2`.`b` AS `b`,`test`.`x2`.`c` AS `c`,`test`.`x2`.`d` AS `d`,`test`.`x3`.`a` AS `a`,`test`.`x3`.`b` AS `b`,`test`.`x3`.`c` AS `c`,`test`.`x3`.`d` AS `d`,`test`.`x4`.`a` AS `a`,`test`.`x4`.`b` AS `b`,`test`.`x4`.`c` AS `c`,`test`.`x4`.`d` AS `d`,`test`.`x5`.`a` AS `a`,`test`.`x5`.`b` AS `b`,`test`.`x5`.`c` AS `c`,`test`.`x5`.`d` AS `d` from `test`.`t1` `x1` left join (`test`.`t1` `x2` join `test`.`t1` `x3` join `test`.`t1` `x4` join `test`.`t1` `x5`) on(((`test`.`x2`.`a` = `test`.`x1`.`c`) and (`test`.`x2`.`b` = `test`.`x1`.`c`) and (`test`.`x3`.`b` = `test`.`x1`.`d`) and (`test`.`x4`.`b` = `test`.`x1`.`d`) and (`test`.`x5`.`a` = `test`.`x3`.`d`) and (`test`.`x5`.`b` = `test`.`x4`.`d`) and (`test`.`x4`.`a` = `test`.`x2`.`d`) and (`test`.`x3`.`a` = `test`.`x2`.`c`))) where 1
|
||
|
|
explain extended
|
||
|
|
select straight_join * from
|
||
|
|
(t1 left join t1 as t2 on t2.a = t1.c and t2.b = t1.d)
|
||
|
|
inner join t1 as t3 on t3.a = t1.b and t3.b = t1.c
|
||
|
|
left join t1 as t4 on t4.a = t2.c and t4.b = t1.c;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 16 100.00 Parent of 4 pushed join@1
|
||
|
|
1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.c,test.t1.d 1 100.00 Child of 't1' in pushed join@1
|
||
|
|
1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.b,test.t1.c 1 100.00 Child of 't1' in pushed join@1
|
||
|
|
1 SIMPLE t4 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t2.c,test.t1.c 1 100.00 Child of 't2' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select straight_join `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t1`.`d` AS `d`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t3`.`c` AS `c`,`test`.`t3`.`d` AS `d`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t4`.`c` AS `c`,`test`.`t4`.`d` AS `d` from `test`.`t1` left join `test`.`t1` `t2` on(((`test`.`t2`.`b` = `test`.`t1`.`d`) and (`test`.`t2`.`a` = `test`.`t1`.`c`))) join `test`.`t1` `t3` left join `test`.`t1` `t4` on(((`test`.`t4`.`b` = `test`.`t1`.`c`) and (`test`.`t4`.`a` = `test`.`t2`.`c`))) where ((`test`.`t3`.`b` = `test`.`t1`.`c`) and (`test`.`t3`.`a` = `test`.`t1`.`b`))
|
||
|
|
select straight_join * from
|
||
|
|
(t1 left join t1 as t2 on t2.a = t1.c and t2.b = t1.d)
|
||
|
|
inner join t1 as t3 on t3.a = t1.b and t3.b = t1.c
|
||
|
|
left join t1 as t4 on t4.a = t2.c and t4.b = t1.c;
|
||
|
|
a b c d a b c d a b c d a b c d
|
||
|
|
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
|
||
|
|
1 3 1 2 1 2 5 1 3 1 1 2 NULL NULL NULL NULL
|
||
|
|
1 4 2 3 2 3 4 5 4 2 5 1 4 2 5 1
|
||
|
|
2 1 3 4 3 4 3 4 1 3 1 2 3 3 3 3
|
||
|
|
2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
|
||
|
|
2 3 4 5 NULL NULL NULL NULL 3 4 3 4 NULL NULL NULL NULL
|
||
|
|
3 1 1 2 1 2 5 1 1 1 1 1 NULL NULL NULL NULL
|
||
|
|
3 2 2 3 2 3 4 5 2 2 2 2 4 2 5 1
|
||
|
|
3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3
|
||
|
|
3 4 3 4 3 4 3 4 4 3 1 2 3 3 3 3
|
||
|
|
4 1 4 5 NULL NULL NULL NULL 1 4 2 3 NULL NULL NULL NULL
|
||
|
|
4 3 1 2 1 2 5 1 3 1 1 2 NULL NULL NULL NULL
|
||
|
|
4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
|
||
|
|
explain extended
|
||
|
|
select straight_join * from
|
||
|
|
(t1 left join t1 as t2 on t2.a = t1.c and t2.b = t1.d)
|
||
|
|
inner join t1 as t3 on t3.a = t2.b and t3.b = t1.c
|
||
|
|
left join t1 as t4 on t4.a = t2.c and t4.b = t1.c;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 16 100.00 Parent of 4 pushed join@1; Using where with pushed condition ((`test`.`t1`.`d` is not null) and (`test`.`t1`.`c` is not null))
|
||
|
|
1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.c,test.t1.d 1 100.00 Child of 't1' in pushed join@1
|
||
|
|
1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.d,test.t1.c 1 100.00 Child of 't2' in pushed join@1
|
||
|
|
1 SIMPLE t4 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t2.c,test.t1.c 1 100.00 Child of 't2' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select straight_join `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t1`.`d` AS `d`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t3`.`c` AS `c`,`test`.`t3`.`d` AS `d`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t4`.`c` AS `c`,`test`.`t4`.`d` AS `d` from `test`.`t1` join `test`.`t1` `t2` join `test`.`t1` `t3` left join `test`.`t1` `t4` on(((`test`.`t4`.`b` = `test`.`t1`.`c`) and (`test`.`t4`.`a` = `test`.`t2`.`c`))) where ((`test`.`t2`.`a` = `test`.`t1`.`c`) and (`test`.`t3`.`b` = `test`.`t1`.`c`) and (`test`.`t2`.`b` = `test`.`t1`.`d`) and (`test`.`t3`.`a` = `test`.`t1`.`d`))
|
||
|
|
select straight_join * from
|
||
|
|
(t1 left join t1 as t2 on t2.a = t1.c and t2.b = t1.d)
|
||
|
|
inner join t1 as t3 on t3.a = t2.b and t3.b = t1.c
|
||
|
|
left join t1 as t4 on t4.a = t2.c and t4.b = t1.c;
|
||
|
|
a b c d a b c d a b c d a b c d
|
||
|
|
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
|
||
|
|
1 3 1 2 1 2 5 1 2 1 3 4 NULL NULL NULL NULL
|
||
|
|
1 4 2 3 2 3 4 5 3 2 2 3 4 2 5 1
|
||
|
|
2 1 3 4 3 4 3 4 4 3 1 2 3 3 3 3
|
||
|
|
2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
|
||
|
|
3 1 1 2 1 2 5 1 2 1 3 4 NULL NULL NULL NULL
|
||
|
|
3 2 2 3 2 3 4 5 3 2 2 3 4 2 5 1
|
||
|
|
3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3
|
||
|
|
3 4 3 4 3 4 3 4 4 3 1 2 3 3 3 3
|
||
|
|
4 3 1 2 1 2 5 1 2 1 3 4 NULL NULL NULL NULL
|
||
|
|
4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
|
||
|
|
set ndb_join_pushdown=true;
|
||
|
|
explain extended
|
||
|
|
select * from t1 x, t1 y, t1 z, t1 where
|
||
|
|
y.a=x.d and y.b=x.b and
|
||
|
|
z.a=y.d and
|
||
|
|
t1.a = z.d and t1.b=z.b;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 16 100.00 Parent of 4 pushed join@1
|
||
|
|
1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.x.d,test.x.b 1 100.00 Child of 'x' in pushed join@1
|
||
|
|
1 SIMPLE z p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.y.d 1 100.00 Child of 'y' in pushed join@1
|
||
|
|
1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.z.d,test.z.b 1 100.00 Child of 'z' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select `test`.`x`.`a` AS `a`,`test`.`x`.`b` AS `b`,`test`.`x`.`c` AS `c`,`test`.`x`.`d` AS `d`,`test`.`y`.`a` AS `a`,`test`.`y`.`b` AS `b`,`test`.`y`.`c` AS `c`,`test`.`y`.`d` AS `d`,`test`.`z`.`a` AS `a`,`test`.`z`.`b` AS `b`,`test`.`z`.`c` AS `c`,`test`.`z`.`d` AS `d`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t1`.`d` AS `d` from `test`.`t1` `x` join `test`.`t1` `y` join `test`.`t1` `z` join `test`.`t1` where ((`test`.`t1`.`b` = `test`.`z`.`b`) and (`test`.`t1`.`a` = `test`.`z`.`d`) and (`test`.`z`.`a` = `test`.`y`.`d`) and (`test`.`y`.`b` = `test`.`x`.`b`) and (`test`.`y`.`a` = `test`.`x`.`d`))
|
||
|
|
select * from t1 x, t1 y, t1 z, t1 where
|
||
|
|
y.a=x.d and y.b=x.b and
|
||
|
|
z.a=y.d and
|
||
|
|
t1.a = z.d and t1.b=z.b;
|
||
|
|
a b c d a b c d a b c d a b c d
|
||
|
|
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
|
||
|
|
1 1 1 1 1 1 1 1 1 2 5 1 1 2 5 1
|
||
|
|
1 1 1 1 1 1 1 1 1 3 1 2 2 3 4 5
|
||
|
|
1 1 1 1 1 1 1 1 1 4 2 3 3 4 3 4
|
||
|
|
1 2 5 1 1 2 5 1 1 1 1 1 1 1 1 1
|
||
|
|
1 2 5 1 1 2 5 1 1 2 5 1 1 2 5 1
|
||
|
|
1 2 5 1 1 2 5 1 1 3 1 2 2 3 4 5
|
||
|
|
1 2 5 1 1 2 5 1 1 4 2 3 3 4 3 4
|
||
|
|
1 4 2 3 3 4 3 4 4 2 5 1 1 2 5 1
|
||
|
|
1 4 2 3 3 4 3 4 4 3 1 2 2 3 4 5
|
||
|
|
1 4 2 3 3 4 3 4 4 4 4 4 4 4 4 4
|
||
|
|
2 2 2 2 2 2 2 2 2 1 3 4 4 1 4 5
|
||
|
|
2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
|
||
|
|
2 2 2 2 2 2 2 2 2 4 5 1 1 4 2 3
|
||
|
|
2 4 5 1 1 4 2 3 3 1 1 2 2 1 3 4
|
||
|
|
2 4 5 1 1 4 2 3 3 2 2 3 3 2 2 3
|
||
|
|
2 4 5 1 1 4 2 3 3 3 3 3 3 3 3 3
|
||
|
|
2 4 5 1 1 4 2 3 3 4 3 4 4 4 4 4
|
||
|
|
3 1 1 2 2 1 3 4 4 2 5 1 1 2 5 1
|
||
|
|
3 1 1 2 2 1 3 4 4 3 1 2 2 3 4 5
|
||
|
|
3 1 1 2 2 1 3 4 4 4 4 4 4 4 4 4
|
||
|
|
3 2 2 3 3 2 2 3 3 1 1 2 2 1 3 4
|
||
|
|
3 2 2 3 3 2 2 3 3 2 2 3 3 2 2 3
|
||
|
|
3 2 2 3 3 2 2 3 3 3 3 3 3 3 3 3
|
||
|
|
3 2 2 3 3 2 2 3 3 4 3 4 4 4 4 4
|
||
|
|
3 3 3 3 3 3 3 3 3 1 1 2 2 1 3 4
|
||
|
|
3 3 3 3 3 3 3 3 3 2 2 3 3 2 2 3
|
||
|
|
3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3
|
||
|
|
3 3 3 3 3 3 3 3 3 4 3 4 4 4 4 4
|
||
|
|
3 4 3 4 4 4 4 4 4 2 5 1 1 2 5 1
|
||
|
|
3 4 3 4 4 4 4 4 4 3 1 2 2 3 4 5
|
||
|
|
3 4 3 4 4 4 4 4 4 4 4 4 4 4 4 4
|
||
|
|
4 2 5 1 1 2 5 1 1 1 1 1 1 1 1 1
|
||
|
|
4 2 5 1 1 2 5 1 1 2 5 1 1 2 5 1
|
||
|
|
4 2 5 1 1 2 5 1 1 3 1 2 2 3 4 5
|
||
|
|
4 2 5 1 1 2 5 1 1 4 2 3 3 4 3 4
|
||
|
|
4 4 4 4 4 4 4 4 4 2 5 1 1 2 5 1
|
||
|
|
4 4 4 4 4 4 4 4 4 3 1 2 2 3 4 5
|
||
|
|
4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
|
||
|
|
explain extended
|
||
|
|
select * from t1 x, t1 y where
|
||
|
|
x.a <= 2 and
|
||
|
|
y.a=x.d and y.b=x.b;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 range PRIMARY PRIMARY 4 NULL 3 100.00 Parent of 2 pushed join@1; Using where with pushed condition (`test`.`x`.`a` <= 2); Using MRR
|
||
|
|
1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.x.d,test.x.b 1 100.00 Child of 'x' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select `test`.`x`.`a` AS `a`,`test`.`x`.`b` AS `b`,`test`.`x`.`c` AS `c`,`test`.`x`.`d` AS `d`,`test`.`y`.`a` AS `a`,`test`.`y`.`b` AS `b`,`test`.`y`.`c` AS `c`,`test`.`y`.`d` AS `d` from `test`.`t1` `x` join `test`.`t1` `y` where ((`test`.`y`.`b` = `test`.`x`.`b`) and (`test`.`y`.`a` = `test`.`x`.`d`) and (`test`.`x`.`a` <= 2))
|
||
|
|
select * from t1 x, t1 y where
|
||
|
|
x.a <= 2 and
|
||
|
|
y.a=x.d and y.b=x.b;
|
||
|
|
a b c d a b c d
|
||
|
|
1 1 1 1 1 1 1 1
|
||
|
|
1 2 5 1 1 2 5 1
|
||
|
|
1 3 1 2 2 3 4 5
|
||
|
|
1 4 2 3 3 4 3 4
|
||
|
|
2 1 3 4 4 1 4 5
|
||
|
|
2 2 2 2 2 2 2 2
|
||
|
|
2 4 5 1 1 4 2 3
|
||
|
|
explain extended
|
||
|
|
select * from t1 x, t1 y where
|
||
|
|
(x.a <= 2 or x.a > 3) and
|
||
|
|
y.a=x.d and y.b=x.b;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 range PRIMARY PRIMARY 4 NULL 6 100.00 Parent of 2 pushed join@1; Using where with pushed condition ((`test`.`x`.`a` <= 2) or (`test`.`x`.`a` > 3)); Using MRR
|
||
|
|
1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.x.d,test.x.b 1 100.00 Child of 'x' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select `test`.`x`.`a` AS `a`,`test`.`x`.`b` AS `b`,`test`.`x`.`c` AS `c`,`test`.`x`.`d` AS `d`,`test`.`y`.`a` AS `a`,`test`.`y`.`b` AS `b`,`test`.`y`.`c` AS `c`,`test`.`y`.`d` AS `d` from `test`.`t1` `x` join `test`.`t1` `y` where ((`test`.`y`.`b` = `test`.`x`.`b`) and (`test`.`y`.`a` = `test`.`x`.`d`) and ((`test`.`x`.`a` <= 2) or (`test`.`x`.`a` > 3)))
|
||
|
|
select * from t1 x, t1 y where
|
||
|
|
(x.a <= 2 or x.a > 3) and
|
||
|
|
y.a=x.d and y.b=x.b;
|
||
|
|
a b c d a b c d
|
||
|
|
1 1 1 1 1 1 1 1
|
||
|
|
1 2 5 1 1 2 5 1
|
||
|
|
1 3 1 2 2 3 4 5
|
||
|
|
1 4 2 3 3 4 3 4
|
||
|
|
2 1 3 4 4 1 4 5
|
||
|
|
2 2 2 2 2 2 2 2
|
||
|
|
2 4 5 1 1 4 2 3
|
||
|
|
4 2 5 1 1 2 5 1
|
||
|
|
4 3 1 2 2 3 4 5
|
||
|
|
4 4 4 4 4 4 4 4
|
||
|
|
explain extended
|
||
|
|
select * from t1 x, t1 y where
|
||
|
|
(x.a >= 2 or x.a < 3) and
|
||
|
|
y.a=x.d and y.b=x.b;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 ALL PRIMARY NULL NULL NULL # # Parent of 2 pushed join@1; Using where with pushed condition ((`test`.`x`.`a` >= 2) or (`test`.`x`.`a` < 3))
|
||
|
|
1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.x.d,test.x.b # # Child of 'x' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select `test`.`x`.`a` AS `a`,`test`.`x`.`b` AS `b`,`test`.`x`.`c` AS `c`,`test`.`x`.`d` AS `d`,`test`.`y`.`a` AS `a`,`test`.`y`.`b` AS `b`,`test`.`y`.`c` AS `c`,`test`.`y`.`d` AS `d` from `test`.`t1` `x` join `test`.`t1` `y` where ((`test`.`y`.`b` = `test`.`x`.`b`) and (`test`.`y`.`a` = `test`.`x`.`d`) and ((`test`.`x`.`a` >= 2) or (`test`.`x`.`a` < 3)))
|
||
|
|
select * from t1 x, t1 y where
|
||
|
|
(x.a >= 2 or x.a < 3) and
|
||
|
|
y.a=x.d and y.b=x.b;
|
||
|
|
a b c d a b c d
|
||
|
|
1 1 1 1 1 1 1 1
|
||
|
|
1 2 5 1 1 2 5 1
|
||
|
|
1 3 1 2 2 3 4 5
|
||
|
|
1 4 2 3 3 4 3 4
|
||
|
|
2 1 3 4 4 1 4 5
|
||
|
|
2 2 2 2 2 2 2 2
|
||
|
|
2 4 5 1 1 4 2 3
|
||
|
|
3 1 1 2 2 1 3 4
|
||
|
|
3 2 2 3 3 2 2 3
|
||
|
|
3 3 3 3 3 3 3 3
|
||
|
|
3 4 3 4 4 4 4 4
|
||
|
|
4 2 5 1 1 2 5 1
|
||
|
|
4 3 1 2 2 3 4 5
|
||
|
|
4 4 4 4 4 4 4 4
|
||
|
|
explain extended
|
||
|
|
select * from t1 x, t1 y where
|
||
|
|
(x.a <= 2 or x.a in (0,5,4)) and
|
||
|
|
y.a=x.d and y.b=x.b;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 range PRIMARY PRIMARY 4 NULL 9 100.00 Parent of 2 pushed join@1; Using where with pushed condition ((`test`.`x`.`a` <= 2) or (`test`.`x`.`a` in (0,5,4))); Using MRR
|
||
|
|
1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.x.d,test.x.b 1 100.00 Child of 'x' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select `test`.`x`.`a` AS `a`,`test`.`x`.`b` AS `b`,`test`.`x`.`c` AS `c`,`test`.`x`.`d` AS `d`,`test`.`y`.`a` AS `a`,`test`.`y`.`b` AS `b`,`test`.`y`.`c` AS `c`,`test`.`y`.`d` AS `d` from `test`.`t1` `x` join `test`.`t1` `y` where ((`test`.`y`.`b` = `test`.`x`.`b`) and (`test`.`y`.`a` = `test`.`x`.`d`) and ((`test`.`x`.`a` <= 2) or (`test`.`x`.`a` in (0,5,4))))
|
||
|
|
select * from t1 x, t1 y where
|
||
|
|
(x.a <= 2 or x.a in (0,5,4)) and
|
||
|
|
y.a=x.d and y.b=x.b;
|
||
|
|
a b c d a b c d
|
||
|
|
1 1 1 1 1 1 1 1
|
||
|
|
1 2 5 1 1 2 5 1
|
||
|
|
1 3 1 2 2 3 4 5
|
||
|
|
1 4 2 3 3 4 3 4
|
||
|
|
2 1 3 4 4 1 4 5
|
||
|
|
2 2 2 2 2 2 2 2
|
||
|
|
2 4 5 1 1 4 2 3
|
||
|
|
4 2 5 1 1 2 5 1
|
||
|
|
4 3 1 2 2 3 4 5
|
||
|
|
4 4 4 4 4 4 4 4
|
||
|
|
explain extended
|
||
|
|
select * from t1 x, t1 y where
|
||
|
|
(x.a <= 2 or (x.a,x.b) in ((0,0),(5,0),(4,3))) and
|
||
|
|
y.a=x.d and y.b=x.b;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 range PRIMARY PRIMARY 8 NULL 5 100.00 Parent of 2 pushed join@1; Using where; Using MRR
|
||
|
|
1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.x.d,test.x.b 1 100.00 Child of 'x' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select `test`.`x`.`a` AS `a`,`test`.`x`.`b` AS `b`,`test`.`x`.`c` AS `c`,`test`.`x`.`d` AS `d`,`test`.`y`.`a` AS `a`,`test`.`y`.`b` AS `b`,`test`.`y`.`c` AS `c`,`test`.`y`.`d` AS `d` from `test`.`t1` `x` join `test`.`t1` `y` where ((`test`.`y`.`b` = `test`.`x`.`b`) and (`test`.`y`.`a` = `test`.`x`.`d`) and ((`test`.`x`.`a` <= 2) or ((`test`.`x`.`a`,`test`.`x`.`b`) in (<cache>((0,0)),<cache>((5,0)),<cache>((4,3))))))
|
||
|
|
select * from t1 x, t1 y where
|
||
|
|
(x.a <= 2 or (x.a,x.b) in ((0,0),(5,0),(4,3))) and
|
||
|
|
y.a=x.d and y.b=x.b;
|
||
|
|
a b c d a b c d
|
||
|
|
1 1 1 1 1 1 1 1
|
||
|
|
1 2 5 1 1 2 5 1
|
||
|
|
1 3 1 2 2 3 4 5
|
||
|
|
1 4 2 3 3 4 3 4
|
||
|
|
2 1 3 4 4 1 4 5
|
||
|
|
2 2 2 2 2 2 2 2
|
||
|
|
2 4 5 1 1 4 2 3
|
||
|
|
4 3 1 2 2 3 4 5
|
||
|
|
explain extended
|
||
|
|
select *
|
||
|
|
from t1
|
||
|
|
join t1 as t2 on t2.a = t1.b and t2.b = t1.c
|
||
|
|
join t1 as t3 on t3.a = t2.a and t3.b = t2.b
|
||
|
|
order by t1.c,t1.d,
|
||
|
|
t1.a, t1.b;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 16 100.00 Using filesort
|
||
|
|
1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.b,test.t1.c 1 100.00 NULL
|
||
|
|
1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.b,test.t1.c 1 100.00 NULL
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 Table 't1' is not pushable, need filesort before joining child tables
|
||
|
|
Note 1003 Can't push table 't3' as child of 't2', their dependency is 'const'
|
||
|
|
Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t1`.`d` AS `d`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t3`.`c` AS `c`,`test`.`t3`.`d` AS `d` from `test`.`t1` join `test`.`t1` `t2` join `test`.`t1` `t3` where ((`test`.`t2`.`b` = `test`.`t1`.`c`) and (`test`.`t3`.`b` = `test`.`t1`.`c`) and (`test`.`t2`.`a` = `test`.`t1`.`b`) and (`test`.`t3`.`a` = `test`.`t1`.`b`)) order by `test`.`t1`.`c`,`test`.`t1`.`d`,`test`.`t1`.`a`,`test`.`t1`.`b`
|
||
|
|
select *
|
||
|
|
from t1
|
||
|
|
join t1 as t2 on t2.a = t1.b and t2.b = t1.c
|
||
|
|
join t1 as t3 on t3.a = t2.a and t3.b = t2.b
|
||
|
|
order by t1.c,t1.d,
|
||
|
|
t1.a, t1.b;
|
||
|
|
a b c d a b c d a b c d
|
||
|
|
1 1 1 1 1 1 1 1 1 1 1 1
|
||
|
|
1 3 1 2 3 1 1 2 3 1 1 2
|
||
|
|
3 1 1 2 1 1 1 1 1 1 1 1
|
||
|
|
4 3 1 2 3 1 1 2 3 1 1 2
|
||
|
|
2 2 2 2 2 2 2 2 2 2 2 2
|
||
|
|
1 4 2 3 4 2 5 1 4 2 5 1
|
||
|
|
3 2 2 3 2 2 2 2 2 2 2 2
|
||
|
|
3 3 3 3 3 3 3 3 3 3 3 3
|
||
|
|
2 1 3 4 1 3 1 2 1 3 1 2
|
||
|
|
3 4 3 4 4 3 1 2 4 3 1 2
|
||
|
|
4 4 4 4 4 4 4 4 4 4 4 4
|
||
|
|
2 3 4 5 3 4 3 4 3 4 3 4
|
||
|
|
4 1 4 5 1 4 2 3 1 4 2 3
|
||
|
|
explain extended
|
||
|
|
select *
|
||
|
|
from t1
|
||
|
|
join t1 as t2 on t2.a = t1.b and t2.b = t1.c
|
||
|
|
join t1 as t3 on t3.a = t2.a and t3.b = t2.b
|
||
|
|
order by t1.c,t2.d,
|
||
|
|
t1.a, t1.b;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 16 100.00 Parent of 3 pushed join@1; Using temporary; Using filesort
|
||
|
|
1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.b,test.t1.c 1 100.00 Child of 't1' in pushed join@1
|
||
|
|
1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.b,test.t1.c 1 100.00 Child of 't2' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t1`.`d` AS `d`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t3`.`c` AS `c`,`test`.`t3`.`d` AS `d` from `test`.`t1` join `test`.`t1` `t2` join `test`.`t1` `t3` where ((`test`.`t2`.`b` = `test`.`t1`.`c`) and (`test`.`t3`.`b` = `test`.`t1`.`c`) and (`test`.`t2`.`a` = `test`.`t1`.`b`) and (`test`.`t3`.`a` = `test`.`t1`.`b`)) order by `test`.`t1`.`c`,`test`.`t2`.`d`,`test`.`t1`.`a`,`test`.`t1`.`b`
|
||
|
|
select *
|
||
|
|
from t1
|
||
|
|
join t1 as t2 on t2.a = t1.b and t2.b = t1.c
|
||
|
|
join t1 as t3 on t3.a = t2.a and t3.b = t2.b
|
||
|
|
order by t1.c,t2.d,
|
||
|
|
t1.a, t1.b;
|
||
|
|
a b c d a b c d a b c d
|
||
|
|
1 1 1 1 1 1 1 1 1 1 1 1
|
||
|
|
3 1 1 2 1 1 1 1 1 1 1 1
|
||
|
|
1 3 1 2 3 1 1 2 3 1 1 2
|
||
|
|
4 3 1 2 3 1 1 2 3 1 1 2
|
||
|
|
1 4 2 3 4 2 5 1 4 2 5 1
|
||
|
|
2 2 2 2 2 2 2 2 2 2 2 2
|
||
|
|
3 2 2 3 2 2 2 2 2 2 2 2
|
||
|
|
2 1 3 4 1 3 1 2 1 3 1 2
|
||
|
|
3 4 3 4 4 3 1 2 4 3 1 2
|
||
|
|
3 3 3 3 3 3 3 3 3 3 3 3
|
||
|
|
4 1 4 5 1 4 2 3 1 4 2 3
|
||
|
|
2 3 4 5 3 4 3 4 3 4 3 4
|
||
|
|
4 4 4 4 4 4 4 4 4 4 4 4
|
||
|
|
explain extended
|
||
|
|
select *
|
||
|
|
from t1
|
||
|
|
join t1 as t2 on t2.a = t1.b and t2.b = t1.c
|
||
|
|
join t1 as t3 on t3.a = t2.a and t3.b = t2.b
|
||
|
|
order by t1.a,t1.b;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 index NULL PRIMARY 8 NULL 16 100.00 Parent of 3 pushed join@1
|
||
|
|
1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.b,test.t1.c 1 100.00 Child of 't1' in pushed join@1
|
||
|
|
1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.b,test.t1.c 1 100.00 Child of 't2' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t1`.`d` AS `d`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t3`.`c` AS `c`,`test`.`t3`.`d` AS `d` from `test`.`t1` join `test`.`t1` `t2` join `test`.`t1` `t3` where ((`test`.`t2`.`b` = `test`.`t1`.`c`) and (`test`.`t3`.`b` = `test`.`t1`.`c`) and (`test`.`t2`.`a` = `test`.`t1`.`b`) and (`test`.`t3`.`a` = `test`.`t1`.`b`)) order by `test`.`t1`.`a`,`test`.`t1`.`b`
|
||
|
|
select *
|
||
|
|
from t1
|
||
|
|
join t1 as t2 on t2.a = t1.b and t2.b = t1.c
|
||
|
|
join t1 as t3 on t3.a = t2.a and t3.b = t2.b
|
||
|
|
order by t1.a,t1.b;
|
||
|
|
a b c d a b c d a b c d
|
||
|
|
1 1 1 1 1 1 1 1 1 1 1 1
|
||
|
|
1 3 1 2 3 1 1 2 3 1 1 2
|
||
|
|
1 4 2 3 4 2 5 1 4 2 5 1
|
||
|
|
2 1 3 4 1 3 1 2 1 3 1 2
|
||
|
|
2 2 2 2 2 2 2 2 2 2 2 2
|
||
|
|
2 3 4 5 3 4 3 4 3 4 3 4
|
||
|
|
3 1 1 2 1 1 1 1 1 1 1 1
|
||
|
|
3 2 2 3 2 2 2 2 2 2 2 2
|
||
|
|
3 3 3 3 3 3 3 3 3 3 3 3
|
||
|
|
3 4 3 4 4 3 1 2 4 3 1 2
|
||
|
|
4 1 4 5 1 4 2 3 1 4 2 3
|
||
|
|
4 3 1 2 3 1 1 2 3 1 1 2
|
||
|
|
4 4 4 4 4 4 4 4 4 4 4 4
|
||
|
|
explain extended
|
||
|
|
select *
|
||
|
|
from t1
|
||
|
|
join t1 as t2 on t2.a = t1.b and t2.b = t1.c
|
||
|
|
join t1 as t3 on t3.a = t2.a and t3.b = t2.b
|
||
|
|
order by t1.a,t2.b,
|
||
|
|
t1.a, t1.b;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 16 100.00 Parent of 3 pushed join@1; Using temporary; Using filesort
|
||
|
|
1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.b,test.t1.c 1 100.00 Child of 't1' in pushed join@1
|
||
|
|
1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.b,test.t1.c 1 100.00 Child of 't2' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t1`.`d` AS `d`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t3`.`c` AS `c`,`test`.`t3`.`d` AS `d` from `test`.`t1` join `test`.`t1` `t2` join `test`.`t1` `t3` where ((`test`.`t2`.`b` = `test`.`t1`.`c`) and (`test`.`t3`.`b` = `test`.`t1`.`c`) and (`test`.`t2`.`a` = `test`.`t1`.`b`) and (`test`.`t3`.`a` = `test`.`t1`.`b`)) order by `test`.`t1`.`a`,`test`.`t2`.`b`,`test`.`t1`.`b`
|
||
|
|
select *
|
||
|
|
from t1
|
||
|
|
join t1 as t2 on t2.a = t1.b and t2.b = t1.c
|
||
|
|
join t1 as t3 on t3.a = t2.a and t3.b = t2.b
|
||
|
|
order by t1.a,t2.b,
|
||
|
|
t1.a, t1.b;
|
||
|
|
a b c d a b c d a b c d
|
||
|
|
1 1 1 1 1 1 1 1 1 1 1 1
|
||
|
|
1 3 1 2 3 1 1 2 3 1 1 2
|
||
|
|
1 4 2 3 4 2 5 1 4 2 5 1
|
||
|
|
2 2 2 2 2 2 2 2 2 2 2 2
|
||
|
|
2 1 3 4 1 3 1 2 1 3 1 2
|
||
|
|
2 3 4 5 3 4 3 4 3 4 3 4
|
||
|
|
3 1 1 2 1 1 1 1 1 1 1 1
|
||
|
|
3 2 2 3 2 2 2 2 2 2 2 2
|
||
|
|
3 3 3 3 3 3 3 3 3 3 3 3
|
||
|
|
3 4 3 4 4 3 1 2 4 3 1 2
|
||
|
|
4 3 1 2 3 1 1 2 3 1 1 2
|
||
|
|
4 1 4 5 1 4 2 3 1 4 2 3
|
||
|
|
4 4 4 4 4 4 4 4 4 4 4 4
|
||
|
|
explain extended
|
||
|
|
select *
|
||
|
|
from t1
|
||
|
|
join t1 as t2 on t2.a = t1.b and t2.b = t1.c
|
||
|
|
join t1 as t3 on t3.a = t2.a and t3.b = t2.b
|
||
|
|
order by t1.a desc,t1.b desc;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 index NULL PRIMARY 8 NULL 16 100.00 Parent of 3 pushed join@1
|
||
|
|
1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.b,test.t1.c 1 100.00 Child of 't1' in pushed join@1
|
||
|
|
1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.b,test.t1.c 1 100.00 Child of 't2' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t1`.`d` AS `d`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t3`.`c` AS `c`,`test`.`t3`.`d` AS `d` from `test`.`t1` join `test`.`t1` `t2` join `test`.`t1` `t3` where ((`test`.`t2`.`b` = `test`.`t1`.`c`) and (`test`.`t3`.`b` = `test`.`t1`.`c`) and (`test`.`t2`.`a` = `test`.`t1`.`b`) and (`test`.`t3`.`a` = `test`.`t1`.`b`)) order by `test`.`t1`.`a` desc,`test`.`t1`.`b` desc
|
||
|
|
select *
|
||
|
|
from t1
|
||
|
|
join t1 as t2 on t2.a = t1.b and t2.b = t1.c
|
||
|
|
join t1 as t3 on t3.a = t2.a and t3.b = t2.b
|
||
|
|
order by t1.a desc,t1.b desc;
|
||
|
|
a b c d a b c d a b c d
|
||
|
|
4 4 4 4 4 4 4 4 4 4 4 4
|
||
|
|
4 3 1 2 3 1 1 2 3 1 1 2
|
||
|
|
4 1 4 5 1 4 2 3 1 4 2 3
|
||
|
|
3 4 3 4 4 3 1 2 4 3 1 2
|
||
|
|
3 3 3 3 3 3 3 3 3 3 3 3
|
||
|
|
3 2 2 3 2 2 2 2 2 2 2 2
|
||
|
|
3 1 1 2 1 1 1 1 1 1 1 1
|
||
|
|
2 3 4 5 3 4 3 4 3 4 3 4
|
||
|
|
2 2 2 2 2 2 2 2 2 2 2 2
|
||
|
|
2 1 3 4 1 3 1 2 1 3 1 2
|
||
|
|
1 4 2 3 4 2 5 1 4 2 5 1
|
||
|
|
1 3 1 2 3 1 1 2 3 1 1 2
|
||
|
|
1 1 1 1 1 1 1 1 1 1 1 1
|
||
|
|
explain extended
|
||
|
|
select *
|
||
|
|
from t1
|
||
|
|
join t1 as t2 on t2.a = t1.b and t2.b = t1.c
|
||
|
|
join t1 as t3 on t3.a = t2.a and t3.b = t2.b
|
||
|
|
order by t1.b,t1.a;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 16 100.00 Using filesort
|
||
|
|
1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.b,test.t1.c 1 100.00 NULL
|
||
|
|
1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.b,test.t1.c 1 100.00 NULL
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 Table 't1' is not pushable, need filesort before joining child tables
|
||
|
|
Note 1003 Can't push table 't3' as child of 't2', their dependency is 'const'
|
||
|
|
Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t1`.`d` AS `d`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t3`.`c` AS `c`,`test`.`t3`.`d` AS `d` from `test`.`t1` join `test`.`t1` `t2` join `test`.`t1` `t3` where ((`test`.`t2`.`b` = `test`.`t1`.`c`) and (`test`.`t3`.`b` = `test`.`t1`.`c`) and (`test`.`t2`.`a` = `test`.`t1`.`b`) and (`test`.`t3`.`a` = `test`.`t1`.`b`)) order by `test`.`t1`.`b`,`test`.`t1`.`a`
|
||
|
|
select *
|
||
|
|
from t1
|
||
|
|
join t1 as t2 on t2.a = t1.b and t2.b = t1.c
|
||
|
|
join t1 as t3 on t3.a = t2.a and t3.b = t2.b
|
||
|
|
order by t1.b,t1.a;
|
||
|
|
a b c d a b c d a b c d
|
||
|
|
1 1 1 1 1 1 1 1 1 1 1 1
|
||
|
|
2 1 3 4 1 3 1 2 1 3 1 2
|
||
|
|
3 1 1 2 1 1 1 1 1 1 1 1
|
||
|
|
4 1 4 5 1 4 2 3 1 4 2 3
|
||
|
|
2 2 2 2 2 2 2 2 2 2 2 2
|
||
|
|
3 2 2 3 2 2 2 2 2 2 2 2
|
||
|
|
1 3 1 2 3 1 1 2 3 1 1 2
|
||
|
|
2 3 4 5 3 4 3 4 3 4 3 4
|
||
|
|
3 3 3 3 3 3 3 3 3 3 3 3
|
||
|
|
4 3 1 2 3 1 1 2 3 1 1 2
|
||
|
|
1 4 2 3 4 2 5 1 4 2 5 1
|
||
|
|
3 4 3 4 4 3 1 2 4 3 1 2
|
||
|
|
4 4 4 4 4 4 4 4 4 4 4 4
|
||
|
|
explain extended
|
||
|
|
select *
|
||
|
|
from t1
|
||
|
|
join t1 as t2 on t2.a = t1.b and t2.b = t1.c
|
||
|
|
join t1 as t3 on t3.a = t2.a and t3.b = t2.b
|
||
|
|
order by t1.a;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 index NULL PRIMARY 8 NULL 16 100.00 Parent of 3 pushed join@1
|
||
|
|
1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.b,test.t1.c 1 100.00 Child of 't1' in pushed join@1
|
||
|
|
1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.b,test.t1.c 1 100.00 Child of 't2' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t1`.`d` AS `d`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t3`.`c` AS `c`,`test`.`t3`.`d` AS `d` from `test`.`t1` join `test`.`t1` `t2` join `test`.`t1` `t3` where ((`test`.`t2`.`b` = `test`.`t1`.`c`) and (`test`.`t3`.`b` = `test`.`t1`.`c`) and (`test`.`t2`.`a` = `test`.`t1`.`b`) and (`test`.`t3`.`a` = `test`.`t1`.`b`)) order by `test`.`t1`.`a`
|
||
|
|
explain extended
|
||
|
|
select *
|
||
|
|
from t1
|
||
|
|
join t1 as t2 on t2.a = t1.b and t2.b = t1.c
|
||
|
|
join t1 as t3 on t3.a = t2.a and t3.b = t2.b
|
||
|
|
order by t1.b;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 16 100.00 Using filesort
|
||
|
|
1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.b,test.t1.c 1 100.00 NULL
|
||
|
|
1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.b,test.t1.c 1 100.00 NULL
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 Table 't1' is not pushable, need filesort before joining child tables
|
||
|
|
Note 1003 Can't push table 't3' as child of 't2', their dependency is 'const'
|
||
|
|
Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t1`.`d` AS `d`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t3`.`c` AS `c`,`test`.`t3`.`d` AS `d` from `test`.`t1` join `test`.`t1` `t2` join `test`.`t1` `t3` where ((`test`.`t2`.`b` = `test`.`t1`.`c`) and (`test`.`t3`.`b` = `test`.`t1`.`c`) and (`test`.`t2`.`a` = `test`.`t1`.`b`) and (`test`.`t3`.`a` = `test`.`t1`.`b`)) order by `test`.`t1`.`b`
|
||
|
|
explain extended
|
||
|
|
select t1.a, t1.b, count(*)
|
||
|
|
from t1
|
||
|
|
join t1 as t2 on t2.a = t1.b and t2.b = t1.c
|
||
|
|
join t1 as t3 on t3.a = t2.a and t3.b = t2.b
|
||
|
|
group by t1.a, t1.b;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 index NULL PRIMARY 8 NULL 16 100.00 Parent of 3 pushed join@1
|
||
|
|
1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.b,test.t1.c 1 100.00 Child of 't1' in pushed join@1
|
||
|
|
1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.b,test.t1.c 1 100.00 Child of 't2' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,count(0) AS `count(*)` from `test`.`t1` join `test`.`t1` `t2` join `test`.`t1` `t3` where ((`test`.`t2`.`b` = `test`.`t1`.`c`) and (`test`.`t3`.`b` = `test`.`t1`.`c`) and (`test`.`t2`.`a` = `test`.`t1`.`b`) and (`test`.`t3`.`a` = `test`.`t1`.`b`)) group by `test`.`t1`.`a`,`test`.`t1`.`b`
|
||
|
|
select t1.a, t1.b, count(*)
|
||
|
|
from t1
|
||
|
|
join t1 as t2 on t2.a = t1.b and t2.b = t1.c
|
||
|
|
join t1 as t3 on t3.a = t2.a and t3.b = t2.b
|
||
|
|
group by t1.a, t1.b;
|
||
|
|
a b count(*)
|
||
|
|
1 1 1
|
||
|
|
1 3 1
|
||
|
|
1 4 1
|
||
|
|
2 1 1
|
||
|
|
2 2 1
|
||
|
|
2 3 1
|
||
|
|
3 1 1
|
||
|
|
3 2 1
|
||
|
|
3 3 1
|
||
|
|
3 4 1
|
||
|
|
4 1 1
|
||
|
|
4 3 1
|
||
|
|
4 4 1
|
||
|
|
explain extended
|
||
|
|
select t1.a, count(*)
|
||
|
|
from t1
|
||
|
|
join t1 as t2 on t2.a = t1.b and t2.b = t1.c
|
||
|
|
join t1 as t3 on t3.a = t2.a and t3.b = t2.b
|
||
|
|
group by t1.a;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 index NULL PRIMARY 8 NULL 16 100.00 Parent of 3 pushed join@1
|
||
|
|
1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.b,test.t1.c 1 100.00 Child of 't1' in pushed join@1
|
||
|
|
1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.b,test.t1.c 1 100.00 Child of 't2' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,count(0) AS `count(*)` from `test`.`t1` join `test`.`t1` `t2` join `test`.`t1` `t3` where ((`test`.`t2`.`b` = `test`.`t1`.`c`) and (`test`.`t3`.`b` = `test`.`t1`.`c`) and (`test`.`t2`.`a` = `test`.`t1`.`b`) and (`test`.`t3`.`a` = `test`.`t1`.`b`)) group by `test`.`t1`.`a`
|
||
|
|
select t1.a, count(*)
|
||
|
|
from t1
|
||
|
|
join t1 as t2 on t2.a = t1.b and t2.b = t1.c
|
||
|
|
join t1 as t3 on t3.a = t2.a and t3.b = t2.b
|
||
|
|
group by t1.a;
|
||
|
|
a count(*)
|
||
|
|
1 3
|
||
|
|
2 3
|
||
|
|
3 4
|
||
|
|
4 3
|
||
|
|
explain extended
|
||
|
|
select t1.b, count(*)
|
||
|
|
from t1
|
||
|
|
join t1 as t2 on t2.a = t1.b and t2.b = t1.c
|
||
|
|
join t1 as t3 on t3.a = t2.a and t3.b = t2.b
|
||
|
|
group by t1.b;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 16 100.00 Parent of 3 pushed join@1; Using temporary; Using filesort
|
||
|
|
1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.b,test.t1.c 1 100.00 Child of 't1' in pushed join@1
|
||
|
|
1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.b,test.t1.c 1 100.00 Child of 't2' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select `test`.`t1`.`b` AS `b`,count(0) AS `count(*)` from `test`.`t1` join `test`.`t1` `t2` join `test`.`t1` `t3` where ((`test`.`t2`.`b` = `test`.`t1`.`c`) and (`test`.`t3`.`b` = `test`.`t1`.`c`) and (`test`.`t2`.`a` = `test`.`t1`.`b`) and (`test`.`t3`.`a` = `test`.`t1`.`b`)) group by `test`.`t1`.`b`
|
||
|
|
select t1.b, count(*)
|
||
|
|
from t1
|
||
|
|
join t1 as t2 on t2.a = t1.b and t2.b = t1.c
|
||
|
|
join t1 as t3 on t3.a = t2.a and t3.b = t2.b
|
||
|
|
group by t1.b;
|
||
|
|
b count(*)
|
||
|
|
1 4
|
||
|
|
2 2
|
||
|
|
3 4
|
||
|
|
4 3
|
||
|
|
explain extended
|
||
|
|
select t2.c, count(distinct t2.a)
|
||
|
|
from t1
|
||
|
|
join t1 as t2 on t1.a = t2.c and t1.b = t2.d
|
||
|
|
where t2.a = 4 and t2.b=4
|
||
|
|
group by t2.c;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE t2 p2 eq_ref PRIMARY PRIMARY 8 const,const 1 100.00 Using where
|
||
|
|
1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t2.c,test.t2.d 1 100.00 NULL
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 Table 't2' is not pushable: GROUP BY cannot be done using index on grouped columns.
|
||
|
|
Note 1003 Table 't1' is not pushable: GROUP BY cannot be done using index on grouped columns.
|
||
|
|
Note 1003 /* select#1 */ select `test`.`t2`.`c` AS `c`,count(distinct `test`.`t2`.`a`) AS `count(distinct t2.a)` from `test`.`t1` join `test`.`t1` `t2` where ((`test`.`t1`.`b` = `test`.`t2`.`d`) and (`test`.`t1`.`a` = `test`.`t2`.`c`) and (`test`.`t2`.`b` = 4) and (`test`.`t2`.`a` = 4)) group by `test`.`t2`.`c`
|
||
|
|
select t2.c, count(distinct t2.a)
|
||
|
|
from t1
|
||
|
|
join t1 as t2 on t1.a = t2.c and t1.b = t2.d
|
||
|
|
where t2.a = 4 and t2.b=4
|
||
|
|
group by t2.c;
|
||
|
|
c count(distinct t2.a)
|
||
|
|
4 1
|
||
|
|
explain extended
|
||
|
|
select t2.c, count(distinct t2.a)
|
||
|
|
from t1
|
||
|
|
join t1 as t2 on t1.a = t2.c and t1.b = t2.d
|
||
|
|
where t2.a = 4
|
||
|
|
group by t2.c;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 const 3 100.00 Using where; Using filesort
|
||
|
|
1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t2.c,test.t2.d 1 100.00 NULL
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 Table 't2' is not pushable: GROUP BY cannot be done using index on grouped columns.
|
||
|
|
Note 1003 Table 't1' is not pushable: GROUP BY cannot be done using index on grouped columns.
|
||
|
|
Note 1003 /* select#1 */ select `test`.`t2`.`c` AS `c`,count(distinct `test`.`t2`.`a`) AS `count(distinct t2.a)` from `test`.`t1` join `test`.`t1` `t2` where ((`test`.`t1`.`b` = `test`.`t2`.`d`) and (`test`.`t1`.`a` = `test`.`t2`.`c`) and (`test`.`t2`.`a` = 4)) group by `test`.`t2`.`c`
|
||
|
|
select t2.c, count(distinct t2.a)
|
||
|
|
from t1
|
||
|
|
join t1 as t2 on t1.a = t2.c and t1.b = t2.d
|
||
|
|
where t2.a = 4
|
||
|
|
group by t2.c;
|
||
|
|
c count(distinct t2.a)
|
||
|
|
1 1
|
||
|
|
4 1
|
||
|
|
explain extended
|
||
|
|
select t2.c, count(distinct t2.a)
|
||
|
|
from t1
|
||
|
|
join t1 as t2 on t1.a = t2.c and t1.b = t2.d
|
||
|
|
where t2.a = 4 and t2.b=4
|
||
|
|
group by t2.c order by t2.c;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE t2 p2 eq_ref PRIMARY PRIMARY 8 const,const 1 100.00 Using where
|
||
|
|
1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t2.c,test.t2.d 1 100.00 NULL
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 Table 't2' is not pushable: GROUP BY cannot be done using index on grouped columns.
|
||
|
|
Note 1003 Table 't1' is not pushable: GROUP BY cannot be done using index on grouped columns.
|
||
|
|
Note 1003 /* select#1 */ select `test`.`t2`.`c` AS `c`,count(distinct `test`.`t2`.`a`) AS `count(distinct t2.a)` from `test`.`t1` join `test`.`t1` `t2` where ((`test`.`t1`.`b` = `test`.`t2`.`d`) and (`test`.`t1`.`a` = `test`.`t2`.`c`) and (`test`.`t2`.`b` = 4) and (`test`.`t2`.`a` = 4)) group by `test`.`t2`.`c` order by `test`.`t2`.`c`
|
||
|
|
select t2.c, count(distinct t2.a)
|
||
|
|
from t1
|
||
|
|
join t1 as t2 on t1.a = t2.c and t1.b = t2.d
|
||
|
|
where t2.a = 4 and t2.b=4
|
||
|
|
group by t2.c order by t2.c;
|
||
|
|
c count(distinct t2.a)
|
||
|
|
4 1
|
||
|
|
create table tx like t1;
|
||
|
|
insert into tx
|
||
|
|
select x1.a+x2.a*16, x1.b+x2.b*16, x1.c+x2.c*16, x1.d+x2.d*16
|
||
|
|
from t1 as x1 cross join t1 as x2;
|
||
|
|
explain select count(*) from tx as x1
|
||
|
|
left join tx as x2 on x1.c=x2.a and x1.d=x2.d;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE x1 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 256 100.00 NULL
|
||
|
|
1 SIMPLE x2 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.x1.c 2 100.00 Using where
|
||
|
|
Warnings:
|
||
|
|
Note 1003 Can't push table 'x2' as child of 'x1', outer join of scan-child not implemented
|
||
|
|
Note 1003 /* select#1 */ select count(0) AS `count(*)` from `test`.`tx` `x1` left join `test`.`tx` `x2` on(((`test`.`x1`.`c` = `test`.`x2`.`a`) and (`test`.`x1`.`d` = `test`.`x2`.`d`))) where 1
|
||
|
|
select count(*) from tx as x1
|
||
|
|
left join tx as x2 on x1.c=x2.a and x1.d=x2.d;
|
||
|
|
count(*)
|
||
|
|
304
|
||
|
|
drop table tx;
|
||
|
|
alter table t1 partition by key(a);
|
||
|
|
explain select count(*) from t1
|
||
|
|
join t1 as t2 on t2.a = t1.c
|
||
|
|
join t1 as t3 on t3.a = t1.d;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 16 100.00 Parent of 3 pushed join@1
|
||
|
|
1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.t1.c 1 100.00 Child of 't1' in pushed join@1
|
||
|
|
1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.t1.d 1 100.00 Child of 't1' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Note 1003 /* select#1 */ select count(0) AS `count(*)` from `test`.`t1` join `test`.`t1` `t2` join `test`.`t1` `t3` where ((`test`.`t2`.`a` = `test`.`t1`.`c`) and (`test`.`t3`.`a` = `test`.`t1`.`d`))
|
||
|
|
select count(*) from t1
|
||
|
|
join t1 as t2 on t2.a = t1.c
|
||
|
|
join t1 as t3 on t3.a = t1.d;
|
||
|
|
count(*)
|
||
|
|
176
|
||
|
|
CREATE TABLE tx (
|
||
|
|
a int NOT NULL,
|
||
|
|
PRIMARY KEY (`a`)
|
||
|
|
);
|
||
|
|
delete from t1;
|
||
|
|
insert into tx values (0), (1), (2), (3), (4), (5), (6), (7), (8), (9);
|
||
|
|
insert into t1 select 1, x1.a * 10+x2.a, 1, 1 from tx as x1 cross join tx as x2;
|
||
|
|
set global debug='+d,max_64rows_in_spj_batches';
|
||
|
|
explain select count(*) from t1 as x1
|
||
|
|
join t1 as x2 on x2.a = x1.c and x1.b < 2
|
||
|
|
join t1 as x3 on x3.a = x1.d;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE x1 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL # # Parent of 3 pushed join@1; Using where with pushed condition (`test`.`x1`.`b` < 2)
|
||
|
|
1 SIMPLE x2 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.x1.c # # Child of 'x1' in pushed join@1
|
||
|
|
1 SIMPLE x3 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.x1.d # # Child of 'x1' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Note 1003 /* select#1 */ select count(0) AS `count(*)` from `test`.`t1` `x1` join `test`.`t1` `x2` join `test`.`t1` `x3` where ((`test`.`x2`.`a` = `test`.`x1`.`c`) and (`test`.`x3`.`a` = `test`.`x1`.`d`) and (`test`.`x1`.`b` < 2))
|
||
|
|
select count(*) from t1 as x1
|
||
|
|
join t1 as x2 on x2.a = x1.c and x1.b < 2
|
||
|
|
join t1 as x3 on x3.a = x1.d;
|
||
|
|
count(*)
|
||
|
|
20000
|
||
|
|
set global debug=@save_debug;
|
||
|
|
drop table t1;
|
||
|
|
drop table tx;
|
||
|
|
create table t1 (
|
||
|
|
a int not null,
|
||
|
|
b int not null,
|
||
|
|
c int not null,
|
||
|
|
d int not null,
|
||
|
|
primary key (`a`,`b`)
|
||
|
|
) engine=ndbcluster partition by key(a);
|
||
|
|
insert into t1 values
|
||
|
|
(1,1,1,1), (2,2,2,2), (3,3,3,3), (4,4,4,4),
|
||
|
|
(1,2,5,1), (1,3,1,2), (1,4,2,3),
|
||
|
|
(2,1,3,4), (2,3,4,5), (2,4,5,1),
|
||
|
|
(3,1,1,2), (3,2,2,3), (3,4,3,4),
|
||
|
|
(4,1,4,5), (4,2,5,1), (4,3,1,2);
|
||
|
|
explain extended
|
||
|
|
select *
|
||
|
|
from t1
|
||
|
|
join t1 as t2 on t2.a = t1.b and t2.b = t1.c;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 16 100.00 Parent of 2 pushed join@1
|
||
|
|
1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.b,test.t1.c 1 100.00 Child of 't1' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t1`.`d` AS `d`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d` from `test`.`t1` join `test`.`t1` `t2` where ((`test`.`t2`.`b` = `test`.`t1`.`c`) and (`test`.`t2`.`a` = `test`.`t1`.`b`))
|
||
|
|
set new=on;
|
||
|
|
alter table t1 partition by hash(a);
|
||
|
|
explain extended
|
||
|
|
select *
|
||
|
|
from t1
|
||
|
|
join t1 as t2 on t2.a = t1.b and t2.b = t1.c;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 16 100.00 NULL
|
||
|
|
1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.b,test.t1.c 1 100.00 NULL
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 Table 't1' is not pushable: has user defined partioning
|
||
|
|
Note 1003 Table 't2' is not pushable: has user defined partioning
|
||
|
|
Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t1`.`d` AS `d`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d` from `test`.`t1` join `test`.`t1` `t2` where ((`test`.`t2`.`b` = `test`.`t1`.`c`) and (`test`.`t2`.`a` = `test`.`t1`.`b`))
|
||
|
|
alter table t1 partition by list(a) (
|
||
|
|
partition p1 values in (1),
|
||
|
|
partition p2 values in (2),
|
||
|
|
partition p3 values in (3),
|
||
|
|
partition p4 values in (4)
|
||
|
|
);
|
||
|
|
explain extended
|
||
|
|
select *
|
||
|
|
from t1
|
||
|
|
join t1 as t2 on t2.a = t1.b and t2.b = t1.c;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE t1 p1,p2,p3,p4 ALL NULL NULL NULL NULL 16 100.00 NULL
|
||
|
|
1 SIMPLE t2 p1,p2,p3,p4 eq_ref PRIMARY PRIMARY 8 test.t1.b,test.t1.c 1 100.00 NULL
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 Table 't1' is not pushable: has user defined partioning
|
||
|
|
Note 1003 Table 't2' is not pushable: has user defined partioning
|
||
|
|
Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t1`.`d` AS `d`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d` from `test`.`t1` join `test`.`t1` `t2` where ((`test`.`t2`.`b` = `test`.`t1`.`c`) and (`test`.`t2`.`a` = `test`.`t1`.`b`))
|
||
|
|
alter table t1 partition by range(a) partitions 4 (
|
||
|
|
partition p1 values less than (0),
|
||
|
|
partition p2 values less than (2),
|
||
|
|
partition p3 values less than (4),
|
||
|
|
partition p4 values less than (99999)
|
||
|
|
);
|
||
|
|
explain extended
|
||
|
|
select *
|
||
|
|
from t1
|
||
|
|
join t1 as t2 on t2.a = t1.b and t2.b = t1.c;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE t1 p1,p2,p3,p4 ALL NULL NULL NULL NULL 16 100.00 NULL
|
||
|
|
1 SIMPLE t2 p1,p2,p3,p4 eq_ref PRIMARY PRIMARY 8 test.t1.b,test.t1.c 1 100.00 NULL
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 Table 't1' is not pushable: has user defined partioning
|
||
|
|
Note 1003 Table 't2' is not pushable: has user defined partioning
|
||
|
|
Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t1`.`d` AS `d`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d` from `test`.`t1` join `test`.`t1` `t2` where ((`test`.`t2`.`b` = `test`.`t1`.`c`) and (`test`.`t2`.`a` = `test`.`t1`.`b`))
|
||
|
|
drop table t1;
|
||
|
|
set new=default;
|
||
|
|
create table t1 (a int, b int, primary key(a) using hash) engine = ndb;
|
||
|
|
insert into t1 values (1, 2);
|
||
|
|
insert into t1 values (2, 3);
|
||
|
|
insert into t1 values (3, 1);
|
||
|
|
set ndb_join_pushdown=true;
|
||
|
|
set autocommit=off;
|
||
|
|
explain extended
|
||
|
|
select *
|
||
|
|
from t1, t1 as t2
|
||
|
|
where t1.a in (1,3,5)
|
||
|
|
and t2.a = t1.b;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 range PRIMARY PRIMARY 4 NULL 3 100.00 Parent of 2 pushed join@1; Using where with pushed condition ((`test`.`t1`.`a` in (1,3,5)) and (`test`.`t1`.`b` is not null)); Using MRR
|
||
|
|
1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.t1.b 1 100.00 Child of 't1' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t1` join `test`.`t1` `t2` where ((`test`.`t2`.`a` = `test`.`t1`.`b`) and (`test`.`t1`.`a` in (1,3,5)))
|
||
|
|
select *
|
||
|
|
from t1, t1 as t2
|
||
|
|
where t1.a in (1,3,5)
|
||
|
|
and t2.a = t1.b;
|
||
|
|
a b a b
|
||
|
|
1 2 2 3
|
||
|
|
3 1 1 2
|
||
|
|
@ndb_execute_count:=VARIABLE_VALUE-@ndb_init_execute_count
|
||
|
|
3
|
||
|
|
This should yield 3 executes (for now...buh)
|
||
|
|
set autocommit=on;
|
||
|
|
drop table t1;
|
||
|
|
create table t1 (a int, b int, primary key(a)) engine = ndb;
|
||
|
|
insert into t1 values (1, 2);
|
||
|
|
insert into t1 values (2, 3);
|
||
|
|
insert into t1 values (3, 1);
|
||
|
|
set ndb_join_pushdown=true;
|
||
|
|
set autocommit=off;
|
||
|
|
explain extended
|
||
|
|
select *
|
||
|
|
from t1, t1 as t2
|
||
|
|
where t1.a in (1,3,5)
|
||
|
|
and t2.a = t1.b;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 range PRIMARY PRIMARY 4 NULL 3 100.00 Parent of 2 pushed join@1; Using where with pushed condition ((`test`.`t1`.`a` in (1,3,5)) and (`test`.`t1`.`b` is not null)); Using MRR
|
||
|
|
1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.t1.b 1 100.00 Child of 't1' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t1` join `test`.`t1` `t2` where ((`test`.`t2`.`a` = `test`.`t1`.`b`) and (`test`.`t1`.`a` in (1,3,5)))
|
||
|
|
select *
|
||
|
|
from t1, t1 as t2
|
||
|
|
where t1.a in (1,3,5)
|
||
|
|
and t2.a = t1.b;
|
||
|
|
a b a b
|
||
|
|
1 2 2 3
|
||
|
|
3 1 1 2
|
||
|
|
@ndb_execute_count:=VARIABLE_VALUE-@ndb_init_execute_count
|
||
|
|
1
|
||
|
|
This should yield 1 execute (but inefficient since it's based on scan)
|
||
|
|
set autocommit=on;
|
||
|
|
explain extended
|
||
|
|
select *
|
||
|
|
from t1, t1 as t2
|
||
|
|
where t1.a in (1,3,5)
|
||
|
|
and t2.a = t1.b
|
||
|
|
order by t1.a desc;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 range PRIMARY PRIMARY 4 NULL 3 100.00 Parent of 2 pushed join@1; Using where with pushed condition ((`test`.`t1`.`a` in (1,3,5)) and (`test`.`t1`.`b` is not null))
|
||
|
|
1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.t1.b 1 100.00 Child of 't1' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t1` join `test`.`t1` `t2` where ((`test`.`t2`.`a` = `test`.`t1`.`b`) and (`test`.`t1`.`a` in (1,3,5))) order by `test`.`t1`.`a` desc
|
||
|
|
select *
|
||
|
|
from t1, t1 as t2
|
||
|
|
where t1.a in (1,3,5)
|
||
|
|
and t2.a = t1.b
|
||
|
|
order by t1.a desc;
|
||
|
|
a b a b
|
||
|
|
3 1 1 2
|
||
|
|
1 2 2 3
|
||
|
|
drop table t1;
|
||
|
|
set ndb_join_pushdown=true;
|
||
|
|
create table t1 (a int, b int, primary key(a)) engine = ndb;
|
||
|
|
create table t2 (c int, d int, primary key(c)) engine = ndb;
|
||
|
|
create table t3 (a3 int, b3 int, c3 int not null, d3 int not null,
|
||
|
|
primary key(a3, b3)) engine = ndb;
|
||
|
|
create table t3_hash (a3 int, b3 int, c3 int not null, d3 int not null,
|
||
|
|
primary key(a3, b3) using hash) engine = ndb;
|
||
|
|
insert into t1 values (0x1f, 0x2f);
|
||
|
|
insert into t1 values (0x2f, 0x3f);
|
||
|
|
insert into t1 values (0x3f, 0x1f);
|
||
|
|
insert into t2 values (0x1f, 0x2f);
|
||
|
|
insert into t2 values (0x2f, 0x3f);
|
||
|
|
insert into t2 values (0x3f, 0x1f);
|
||
|
|
insert into t3 values (0x1f, 0x2f, 1, 0x1f);
|
||
|
|
insert into t3 values (0x2f, 0x3f, 2, 0x2f);
|
||
|
|
insert into t3 values (0x3f, 0x1f, 3, 0x3f);
|
||
|
|
insert into t3_hash values (0x1f, 0x2f, 1, 0x1f);
|
||
|
|
insert into t3_hash values (0x2f, 0x3f, 2, 0x2f);
|
||
|
|
insert into t3_hash values (0x3f, 0x1f, 3, 0x3f);
|
||
|
|
explain extended
|
||
|
|
select * from t3 x, t3 y, t1 where y.a3=x.d3 and y.b3=x.b3 and t1.a = y.d3;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 3 100.00 Parent of 3 pushed join@1
|
||
|
|
1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.x.d3,test.x.b3 1 100.00 Child of 'x' in pushed join@1
|
||
|
|
1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.y.d3 1 100.00 Child of 'y' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select `test`.`x`.`a3` AS `a3`,`test`.`x`.`b3` AS `b3`,`test`.`x`.`c3` AS `c3`,`test`.`x`.`d3` AS `d3`,`test`.`y`.`a3` AS `a3`,`test`.`y`.`b3` AS `b3`,`test`.`y`.`c3` AS `c3`,`test`.`y`.`d3` AS `d3`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t3` `x` join `test`.`t3` `y` join `test`.`t1` where ((`test`.`t1`.`a` = `test`.`y`.`d3`) and (`test`.`y`.`b3` = `test`.`x`.`b3`) and (`test`.`y`.`a3` = `test`.`x`.`d3`))
|
||
|
|
select * from t3 x, t3 y, t1 where y.a3=x.d3 and y.b3=x.b3 and t1.a = y.d3;
|
||
|
|
a3 b3 c3 d3 a3 b3 c3 d3 a b
|
||
|
|
31 47 1 31 31 47 1 31 31 47
|
||
|
|
47 63 2 47 47 63 2 47 47 63
|
||
|
|
63 31 3 63 63 31 3 63 63 31
|
||
|
|
explain extended
|
||
|
|
select *
|
||
|
|
from t3 x, t3 y, t3 z, t3 z2, t1
|
||
|
|
where y.a3=x.d3 and y.b3=x.b3 and
|
||
|
|
z.a3=y.d3 and z.b3=y.b3 and
|
||
|
|
z2.a3=z.d3 and z2.b3=z.b3 and
|
||
|
|
t1.a = z2.d3;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 3 100.00 Parent of 5 pushed join@1
|
||
|
|
1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.x.d3,test.x.b3 1 100.00 Child of 'x' in pushed join@1
|
||
|
|
1 SIMPLE z p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.y.d3,test.x.b3 1 100.00 Child of 'y' in pushed join@1
|
||
|
|
1 SIMPLE z2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.z.d3,test.x.b3 1 100.00 Child of 'z' in pushed join@1
|
||
|
|
1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.z2.d3 1 100.00 Child of 'z2' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select `test`.`x`.`a3` AS `a3`,`test`.`x`.`b3` AS `b3`,`test`.`x`.`c3` AS `c3`,`test`.`x`.`d3` AS `d3`,`test`.`y`.`a3` AS `a3`,`test`.`y`.`b3` AS `b3`,`test`.`y`.`c3` AS `c3`,`test`.`y`.`d3` AS `d3`,`test`.`z`.`a3` AS `a3`,`test`.`z`.`b3` AS `b3`,`test`.`z`.`c3` AS `c3`,`test`.`z`.`d3` AS `d3`,`test`.`z2`.`a3` AS `a3`,`test`.`z2`.`b3` AS `b3`,`test`.`z2`.`c3` AS `c3`,`test`.`z2`.`d3` AS `d3`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t3` `x` join `test`.`t3` `y` join `test`.`t3` `z` join `test`.`t3` `z2` join `test`.`t1` where ((`test`.`t1`.`a` = `test`.`z2`.`d3`) and (`test`.`z2`.`a3` = `test`.`z`.`d3`) and (`test`.`z`.`a3` = `test`.`y`.`d3`) and (`test`.`y`.`b3` = `test`.`x`.`b3`) and (`test`.`z`.`b3` = `test`.`x`.`b3`) and (`test`.`z2`.`b3` = `test`.`x`.`b3`) and (`test`.`y`.`a3` = `test`.`x`.`d3`))
|
||
|
|
select *
|
||
|
|
from t3 x, t3 y, t3 z, t3 z2, t1
|
||
|
|
where y.a3=x.d3 and y.b3=x.b3 and
|
||
|
|
z.a3=y.d3 and z.b3=y.b3 and
|
||
|
|
z2.a3=z.d3 and z2.b3=z.b3 and
|
||
|
|
t1.a = z2.d3;
|
||
|
|
a3 b3 c3 d3 a3 b3 c3 d3 a3 b3 c3 d3 a3 b3 c3 d3 a b
|
||
|
|
31 47 1 31 31 47 1 31 31 47 1 31 31 47 1 31 31 47
|
||
|
|
47 63 2 47 47 63 2 47 47 63 2 47 47 63 2 47 47 63
|
||
|
|
63 31 3 63 63 31 3 63 63 31 3 63 63 31 3 63 63 31
|
||
|
|
explain extended
|
||
|
|
select straight_join * from t1 x, t1 y where y.a=0x1f and x.b = 0x1f;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL # # Using where with pushed condition (`test`.`x`.`b` = 0x1f)
|
||
|
|
1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 const # # NULL
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 Can't push table 'y' as child of 'x', their dependency is 'const'
|
||
|
|
Note 1003 /* select#1 */ select straight_join `test`.`x`.`a` AS `a`,`test`.`x`.`b` AS `b`,`test`.`y`.`a` AS `a`,`test`.`y`.`b` AS `b` from `test`.`t1` `x` join `test`.`t1` `y` where ((`test`.`y`.`a` = 0x1f) and (`test`.`x`.`b` = 0x1f))
|
||
|
|
select straight_join * from t1 x, t1 y where y.a=0x1f and x.b = 0x1f;
|
||
|
|
a b a b
|
||
|
|
63 31 31 47
|
||
|
|
explain extended
|
||
|
|
select straight_join * from t1 x, t1 y where y.a=x.b and x.b = 0x1f;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL # # Using where with pushed condition (`test`.`x`.`b` = 0x1f)
|
||
|
|
1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 const # # Using where
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 Can't push table 'y' as child of 'x', their dependency is 'const'
|
||
|
|
Note 1003 /* select#1 */ select straight_join `test`.`x`.`a` AS `a`,`test`.`x`.`b` AS `b`,`test`.`y`.`a` AS `a`,`test`.`y`.`b` AS `b` from `test`.`t1` `x` join `test`.`t1` `y` where ((`test`.`y`.`a` = `test`.`x`.`b`) and (`test`.`x`.`b` = 0x1f))
|
||
|
|
select straight_join * from t1 x, t1 y where y.a=x.b and x.b = 0x1f;
|
||
|
|
a b a b
|
||
|
|
63 31 31 47
|
||
|
|
create unique index t3_d3 on t3(d3);
|
||
|
|
create unique index t3_d3 on t3_hash(d3);
|
||
|
|
commit;
|
||
|
|
explain extended
|
||
|
|
select * from t3 x, t3 y where x.d3=31 and y.a3=x.d3 and y.b3=x.b3;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 eq_ref t3_d3 t3_d3 4 const 1 100.00 Parent of 2 pushed join@1
|
||
|
|
1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 const,test.x.b3 1 100.00 Child of 'x' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select `test`.`x`.`a3` AS `a3`,`test`.`x`.`b3` AS `b3`,`test`.`x`.`c3` AS `c3`,`test`.`x`.`d3` AS `d3`,`test`.`y`.`a3` AS `a3`,`test`.`y`.`b3` AS `b3`,`test`.`y`.`c3` AS `c3`,`test`.`y`.`d3` AS `d3` from `test`.`t3` `x` join `test`.`t3` `y` where ((`test`.`y`.`b3` = `test`.`x`.`b3`) and (`test`.`x`.`d3` = 31) and (`test`.`y`.`a3` = 31))
|
||
|
|
select * from t3 x, t3 y where x.d3=31 and y.a3=x.d3 and y.b3=x.b3;
|
||
|
|
a3 b3 c3 d3 a3 b3 c3 d3
|
||
|
|
31 47 1 31 31 47 1 31
|
||
|
|
explain extended
|
||
|
|
select * from t3 x, t3 y where x.d3=0 and y.a3=x.d3 and y.b3=x.b3;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 eq_ref t3_d3 t3_d3 4 const 1 100.00 Parent of 2 pushed join@1
|
||
|
|
1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 const,test.x.b3 1 100.00 Child of 'x' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select `test`.`x`.`a3` AS `a3`,`test`.`x`.`b3` AS `b3`,`test`.`x`.`c3` AS `c3`,`test`.`x`.`d3` AS `d3`,`test`.`y`.`a3` AS `a3`,`test`.`y`.`b3` AS `b3`,`test`.`y`.`c3` AS `c3`,`test`.`y`.`d3` AS `d3` from `test`.`t3` `x` join `test`.`t3` `y` where ((`test`.`y`.`b3` = `test`.`x`.`b3`) and (`test`.`x`.`d3` = 0) and (`test`.`y`.`a3` = 0))
|
||
|
|
select * from t3 x, t3 y where x.d3=0 and y.a3=x.d3 and y.b3=x.b3;
|
||
|
|
a3 b3 c3 d3 a3 b3 c3 d3
|
||
|
|
explain extended
|
||
|
|
select * from t1 x, t3 y where y.d3=x.b;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 3 100.00 Parent of 2 pushed join@1; Using where with pushed condition (`test`.`x`.`b` is not null)
|
||
|
|
1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref t3_d3 t3_d3 4 test.x.b 1 100.00 Child of 'x' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select `test`.`x`.`a` AS `a`,`test`.`x`.`b` AS `b`,`test`.`y`.`a3` AS `a3`,`test`.`y`.`b3` AS `b3`,`test`.`y`.`c3` AS `c3`,`test`.`y`.`d3` AS `d3` from `test`.`t1` `x` join `test`.`t3` `y` where (`test`.`y`.`d3` = `test`.`x`.`b`)
|
||
|
|
select * from t1 x, t3 y where y.d3=x.b;
|
||
|
|
a b a3 b3 c3 d3
|
||
|
|
31 47 47 63 2 47
|
||
|
|
47 63 63 31 3 63
|
||
|
|
63 31 31 47 1 31
|
||
|
|
explain extended
|
||
|
|
select * from t3 x, t3 y where x.d3=31 and y.d3=x.b3;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 eq_ref t3_d3 t3_d3 4 const 1 100.00 Parent of 2 pushed join@1
|
||
|
|
1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref t3_d3 t3_d3 4 test.x.b3 1 100.00 Child of 'x' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select `test`.`x`.`a3` AS `a3`,`test`.`x`.`b3` AS `b3`,`test`.`x`.`c3` AS `c3`,`test`.`x`.`d3` AS `d3`,`test`.`y`.`a3` AS `a3`,`test`.`y`.`b3` AS `b3`,`test`.`y`.`c3` AS `c3`,`test`.`y`.`d3` AS `d3` from `test`.`t3` `x` join `test`.`t3` `y` where ((`test`.`y`.`d3` = `test`.`x`.`b3`) and (`test`.`x`.`d3` = 31))
|
||
|
|
select * from t3 x, t3 y where x.d3=31 and y.d3=x.b3;
|
||
|
|
a3 b3 c3 d3 a3 b3 c3 d3
|
||
|
|
31 47 1 31 47 63 2 47
|
||
|
|
explain extended
|
||
|
|
select * from t3 x, t3 y where x.d3=31 and y.d3=x.c3;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 eq_ref t3_d3 t3_d3 4 const 1 100.00 Parent of 2 pushed join@1
|
||
|
|
1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref t3_d3 t3_d3 4 test.x.c3 1 100.00 Child of 'x' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select `test`.`x`.`a3` AS `a3`,`test`.`x`.`b3` AS `b3`,`test`.`x`.`c3` AS `c3`,`test`.`x`.`d3` AS `d3`,`test`.`y`.`a3` AS `a3`,`test`.`y`.`b3` AS `b3`,`test`.`y`.`c3` AS `c3`,`test`.`y`.`d3` AS `d3` from `test`.`t3` `x` join `test`.`t3` `y` where ((`test`.`y`.`d3` = `test`.`x`.`c3`) and (`test`.`x`.`d3` = 31))
|
||
|
|
select * from t3 x, t3 y where x.d3=31 and y.d3=x.c3;
|
||
|
|
a3 b3 c3 d3 a3 b3 c3 d3
|
||
|
|
explain extended
|
||
|
|
select * from t3 x, t3 y
|
||
|
|
where ((x.a3=0x2f and x.b3=0x3f) or x.d3=0x1f)
|
||
|
|
and (y.a3=x.d3 and y.b3=x.b3);
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 index_merge PRIMARY,t3_d3 t3_d3,PRIMARY 4,8 NULL 2 100.00 Parent of 2 pushed join@1; Using sort_union(t3_d3,PRIMARY); Using where with pushed condition (((`test`.`x`.`a3` = 0x2f) and (`test`.`x`.`b3` = 0x3f)) or (`test`.`x`.`d3` = 0x1f))
|
||
|
|
1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.x.d3,test.x.b3 1 100.00 Child of 'x' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select `test`.`x`.`a3` AS `a3`,`test`.`x`.`b3` AS `b3`,`test`.`x`.`c3` AS `c3`,`test`.`x`.`d3` AS `d3`,`test`.`y`.`a3` AS `a3`,`test`.`y`.`b3` AS `b3`,`test`.`y`.`c3` AS `c3`,`test`.`y`.`d3` AS `d3` from `test`.`t3` `x` join `test`.`t3` `y` where ((`test`.`y`.`b3` = `test`.`x`.`b3`) and (`test`.`y`.`a3` = `test`.`x`.`d3`) and (((`test`.`x`.`a3` = 0x2f) and (`test`.`x`.`b3` = 0x3f)) or (`test`.`x`.`d3` = 0x1f)))
|
||
|
|
select * from t3 x, t3 y
|
||
|
|
where ((x.a3=0x2f and x.b3=0x3f) or x.d3=0x1f)
|
||
|
|
and (y.a3=x.d3 and y.b3=x.b3);
|
||
|
|
a3 b3 c3 d3 a3 b3 c3 d3
|
||
|
|
31 47 1 31 31 47 1 31
|
||
|
|
47 63 2 47 47 63 2 47
|
||
|
|
explain extended
|
||
|
|
select * from t3_hash x, t3_hash y
|
||
|
|
where ((x.a3=0x2f and x.b3=0x3f) or x.d3=0x1f)
|
||
|
|
and (y.a3=x.d3 and y.b3=x.b3);
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 index_merge PRIMARY,t3_d3 PRIMARY,t3_d3 8,4 NULL 2 100.00 Parent of 2 pushed join@1; Using sort_union(PRIMARY,t3_d3); Using where with pushed condition (((`test`.`x`.`a3` = 0x2f) and (`test`.`x`.`b3` = 0x3f)) or (`test`.`x`.`d3` = 0x1f))
|
||
|
|
1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.x.d3,test.x.b3 1 100.00 Child of 'x' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select `test`.`x`.`a3` AS `a3`,`test`.`x`.`b3` AS `b3`,`test`.`x`.`c3` AS `c3`,`test`.`x`.`d3` AS `d3`,`test`.`y`.`a3` AS `a3`,`test`.`y`.`b3` AS `b3`,`test`.`y`.`c3` AS `c3`,`test`.`y`.`d3` AS `d3` from `test`.`t3_hash` `x` join `test`.`t3_hash` `y` where ((`test`.`y`.`b3` = `test`.`x`.`b3`) and (`test`.`y`.`a3` = `test`.`x`.`d3`) and (((`test`.`x`.`a3` = 0x2f) and (`test`.`x`.`b3` = 0x3f)) or (`test`.`x`.`d3` = 0x1f)))
|
||
|
|
select * from t3_hash x, t3_hash y
|
||
|
|
where ((x.a3=0x2f and x.b3=0x3f) or x.d3=0x1f)
|
||
|
|
and (y.a3=x.d3 and y.b3=x.b3);
|
||
|
|
a3 b3 c3 d3 a3 b3 c3 d3
|
||
|
|
31 47 1 31 31 47 1 31
|
||
|
|
47 63 2 47 47 63 2 47
|
||
|
|
explain extended
|
||
|
|
select * from t3 x, t3 y where x.d3>=31 and y.d3=x.b3;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 range t3_d3 t3_d3 4 NULL 3 100.00 Parent of 2 pushed join@1; Using where with pushed condition (`test`.`x`.`d3` >= 31); Using MRR
|
||
|
|
1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref t3_d3 t3_d3 4 test.x.b3 1 100.00 Child of 'x' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select `test`.`x`.`a3` AS `a3`,`test`.`x`.`b3` AS `b3`,`test`.`x`.`c3` AS `c3`,`test`.`x`.`d3` AS `d3`,`test`.`y`.`a3` AS `a3`,`test`.`y`.`b3` AS `b3`,`test`.`y`.`c3` AS `c3`,`test`.`y`.`d3` AS `d3` from `test`.`t3` `x` join `test`.`t3` `y` where ((`test`.`y`.`d3` = `test`.`x`.`b3`) and (`test`.`x`.`d3` >= 31))
|
||
|
|
select * from t3 x, t3 y where x.d3>=31 and y.d3=x.b3;
|
||
|
|
a3 b3 c3 d3 a3 b3 c3 d3
|
||
|
|
31 47 1 31 47 63 2 47
|
||
|
|
47 63 2 47 63 31 3 63
|
||
|
|
63 31 3 63 31 47 1 31
|
||
|
|
insert into t1 values (0x4f, null);
|
||
|
|
select * from t1 left join t1 as t2 on t2.a = t1.b;
|
||
|
|
a b a b
|
||
|
|
31 47 47 63
|
||
|
|
47 63 63 31
|
||
|
|
63 31 31 47
|
||
|
|
79 NULL NULL NULL
|
||
|
|
insert into t3 values (8,8,8,8);
|
||
|
|
explain extended select count(*) from t3 as x0
|
||
|
|
join t3 as x1 on x0.b3=x1.d3 and x0.d3=8
|
||
|
|
join t3 as x2 on x1.b3=x2.d3
|
||
|
|
join t3 as x3 on x2.b3=x3.d3
|
||
|
|
join t3 as x4 on x3.b3=x4.d3
|
||
|
|
join t3 as x5 on x4.b3=x5.d3
|
||
|
|
join t3 as x6 on x5.b3=x6.d3
|
||
|
|
join t3 as x7 on x6.b3=x7.d3
|
||
|
|
join t3 as x8 on x7.b3=x8.d3
|
||
|
|
join t3 as x9 on x8.b3=x9.d3
|
||
|
|
join t3 as x10 on x9.b3=x10.d3
|
||
|
|
join t3 as x11 on x10.b3=x11.d3
|
||
|
|
join t3 as x12 on x11.b3=x12.d3
|
||
|
|
join t3 as x13 on x12.b3=x13.d3
|
||
|
|
join t3 as x14 on x13.b3=x14.d3
|
||
|
|
join t3 as x15 on x14.b3=x15.d3
|
||
|
|
join t3 as x16 on x15.b3=x16.d3
|
||
|
|
join t3 as x17 on x16.b3=x17.d3;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE x0 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref t3_d3 t3_d3 4 const 1 100.00 Parent of 16 pushed join@1
|
||
|
|
1 SIMPLE x1 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref t3_d3 t3_d3 4 test.x0.b3 1 100.00 Child of 'x0' in pushed join@1
|
||
|
|
1 SIMPLE x2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref t3_d3 t3_d3 4 test.x1.b3 1 100.00 Child of 'x1' in pushed join@1
|
||
|
|
1 SIMPLE x3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref t3_d3 t3_d3 4 test.x2.b3 1 100.00 Child of 'x2' in pushed join@1
|
||
|
|
1 SIMPLE x4 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref t3_d3 t3_d3 4 test.x3.b3 1 100.00 Child of 'x3' in pushed join@1
|
||
|
|
1 SIMPLE x5 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref t3_d3 t3_d3 4 test.x4.b3 1 100.00 Child of 'x4' in pushed join@1
|
||
|
|
1 SIMPLE x6 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref t3_d3 t3_d3 4 test.x5.b3 1 100.00 Child of 'x5' in pushed join@1
|
||
|
|
1 SIMPLE x7 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref t3_d3 t3_d3 4 test.x6.b3 1 100.00 Child of 'x6' in pushed join@1
|
||
|
|
1 SIMPLE x8 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref t3_d3 t3_d3 4 test.x7.b3 1 100.00 Child of 'x7' in pushed join@1
|
||
|
|
1 SIMPLE x9 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref t3_d3 t3_d3 4 test.x8.b3 1 100.00 Child of 'x8' in pushed join@1
|
||
|
|
1 SIMPLE x10 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref t3_d3 t3_d3 4 test.x9.b3 1 100.00 Child of 'x9' in pushed join@1
|
||
|
|
1 SIMPLE x11 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref t3_d3 t3_d3 4 test.x10.b3 1 100.00 Child of 'x10' in pushed join@1
|
||
|
|
1 SIMPLE x12 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref t3_d3 t3_d3 4 test.x11.b3 1 100.00 Child of 'x11' in pushed join@1
|
||
|
|
1 SIMPLE x13 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref t3_d3 t3_d3 4 test.x12.b3 1 100.00 Child of 'x12' in pushed join@1
|
||
|
|
1 SIMPLE x14 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref t3_d3 t3_d3 4 test.x13.b3 1 100.00 Child of 'x13' in pushed join@1
|
||
|
|
1 SIMPLE x15 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref t3_d3 t3_d3 4 test.x14.b3 1 100.00 Child of 'x14' in pushed join@1
|
||
|
|
1 SIMPLE x16 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref t3_d3 t3_d3 4 test.x15.b3 1 100.00 Parent of 2 pushed join@2
|
||
|
|
1 SIMPLE x17 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref t3_d3 t3_d3 4 test.x16.b3 1 100.00 Child of 'x16' in pushed join@2
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 Cannot push table 'x16' as child of 'x0'. Max number of pushable tables exceeded.
|
||
|
|
Note 1003 Cannot push table 'x17' as child of 'x0'. Max number of pushable tables exceeded.
|
||
|
|
Note 1003 /* select#1 */ select count(0) AS `count(*)` from `test`.`t3` `x0` join `test`.`t3` `x1` join `test`.`t3` `x2` join `test`.`t3` `x3` join `test`.`t3` `x4` join `test`.`t3` `x5` join `test`.`t3` `x6` join `test`.`t3` `x7` join `test`.`t3` `x8` join `test`.`t3` `x9` join `test`.`t3` `x10` join `test`.`t3` `x11` join `test`.`t3` `x12` join `test`.`t3` `x13` join `test`.`t3` `x14` join `test`.`t3` `x15` join `test`.`t3` `x16` join `test`.`t3` `x17` where ((`test`.`x0`.`d3` = 8) and (`test`.`x1`.`d3` = `test`.`x0`.`b3`) and (`test`.`x2`.`d3` = `test`.`x1`.`b3`) and (`test`.`x3`.`d3` = `test`.`x2`.`b3`) and (`test`.`x4`.`d3` = `test`.`x3`.`b3`) and (`test`.`x5`.`d3` = `test`.`x4`.`b3`) and (`test`.`x6`.`d3` = `test`.`x5`.`b3`) and (`test`.`x7`.`d3` = `test`.`x6`.`b3`) and (`test`.`x8`.`d3` = `test`.`x7`.`b3`) and (`test`.`x9`.`d3` = `test`.`x8`.`b3`) and (`test`.`x10`.`d3` = `test`.`x9`.`b3`) and (`test`.`x11`.`d3` = `test`.`x10`.`b3`) and (`test`.`x12`.`d3` = `test`.`x11`.`b3`) and (`test`.`x13`.`d3` = `test`.`x12`.`b3`) and (`test`.`x14`.`d3` = `test`.`x13`.`b3`) and (`test`.`x15`.`d3` = `test`.`x14`.`b3`) and (`test`.`x16`.`d3` = `test`.`x15`.`b3`) and (`test`.`x17`.`d3` = `test`.`x16`.`b3`))
|
||
|
|
select count(*) from t3 as x0
|
||
|
|
join t3 as x1 on x0.b3=x1.d3 and x0.d3=8
|
||
|
|
join t3 as x2 on x1.b3=x2.d3
|
||
|
|
join t3 as x3 on x2.b3=x3.d3
|
||
|
|
join t3 as x4 on x3.b3=x4.d3
|
||
|
|
join t3 as x5 on x4.b3=x5.d3
|
||
|
|
join t3 as x6 on x5.b3=x6.d3
|
||
|
|
join t3 as x7 on x6.b3=x7.d3
|
||
|
|
join t3 as x8 on x7.b3=x8.d3
|
||
|
|
join t3 as x9 on x8.b3=x9.d3
|
||
|
|
join t3 as x10 on x9.b3=x10.d3
|
||
|
|
join t3 as x11 on x10.b3=x11.d3
|
||
|
|
join t3 as x12 on x11.b3=x12.d3
|
||
|
|
join t3 as x13 on x12.b3=x13.d3
|
||
|
|
join t3 as x14 on x13.b3=x14.d3
|
||
|
|
join t3 as x15 on x14.b3=x15.d3
|
||
|
|
join t3 as x16 on x15.b3=x16.d3
|
||
|
|
join t3 as x17 on x16.b3=x17.d3;
|
||
|
|
count(*)
|
||
|
|
1
|
||
|
|
explain extended select count(*) from t3 as x0
|
||
|
|
join t3 as x1 on x0.c3=x1.a3
|
||
|
|
join t3 as x2 on x1.c3=x2.a3
|
||
|
|
join t3 as x3 on x2.c3=x3.a3
|
||
|
|
join t3 as x4 on x3.c3=x4.a3
|
||
|
|
join t3 as x5 on x4.c3=x5.a3
|
||
|
|
join t3 as x6 on x5.c3=x6.a3
|
||
|
|
join t3 as x7 on x6.c3=x7.a3
|
||
|
|
join t3 as x8 on x7.c3=x8.a3
|
||
|
|
join t3 as x9 on x8.c3=x9.a3
|
||
|
|
join t3 as x10 on x9.c3=x10.a3
|
||
|
|
join t3 as x11 on x10.c3=x11.a3
|
||
|
|
join t3 as x12 on x11.c3=x12.a3
|
||
|
|
join t3 as x13 on x12.c3=x13.a3
|
||
|
|
join t3 as x14 on x13.c3=x14.a3
|
||
|
|
join t3 as x15 on x14.c3=x15.a3
|
||
|
|
join t3 as x16 on x15.c3=x16.a3
|
||
|
|
join t3 as x17 on x16.c3=x17.a3
|
||
|
|
join t3 as x18 on x17.c3=x18.a3
|
||
|
|
join t3 as x19 on x18.c3=x19.a3
|
||
|
|
join t3 as x20 on x19.c3=x20.a3
|
||
|
|
join t3 as x21 on x20.c3=x21.a3
|
||
|
|
join t3 as x22 on x21.c3=x22.a3
|
||
|
|
join t3 as x23 on x22.c3=x23.a3
|
||
|
|
join t3 as x24 on x23.c3=x24.a3
|
||
|
|
join t3 as x25 on x24.c3=x25.a3
|
||
|
|
join t3 as x26 on x25.c3=x26.a3
|
||
|
|
join t3 as x27 on x26.c3=x27.a3
|
||
|
|
join t3 as x28 on x27.c3=x28.a3
|
||
|
|
join t3 as x29 on x28.c3=x29.a3
|
||
|
|
join t3 as x30 on x29.c3=x30.a3
|
||
|
|
join t3 as x31 on x30.c3=x31.a3
|
||
|
|
join t3 as x32 on x31.c3=x32.a3
|
||
|
|
join t3 as x33 on x32.c3=x33.a3;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE x0 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 4 100.00 Parent of 32 pushed join@1
|
||
|
|
1 SIMPLE x1 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.x0.c3 1 100.00 Child of 'x0' in pushed join@1
|
||
|
|
1 SIMPLE x2 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.x1.c3 1 100.00 Child of 'x1' in pushed join@1
|
||
|
|
1 SIMPLE x3 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.x2.c3 1 100.00 Child of 'x2' in pushed join@1
|
||
|
|
1 SIMPLE x4 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.x3.c3 1 100.00 Child of 'x3' in pushed join@1
|
||
|
|
1 SIMPLE x5 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.x4.c3 1 100.00 Child of 'x4' in pushed join@1
|
||
|
|
1 SIMPLE x6 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.x5.c3 1 100.00 Child of 'x5' in pushed join@1
|
||
|
|
1 SIMPLE x7 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.x6.c3 1 100.00 Child of 'x6' in pushed join@1
|
||
|
|
1 SIMPLE x8 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.x7.c3 1 100.00 Child of 'x7' in pushed join@1
|
||
|
|
1 SIMPLE x9 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.x8.c3 1 100.00 Child of 'x8' in pushed join@1
|
||
|
|
1 SIMPLE x10 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.x9.c3 1 100.00 Child of 'x9' in pushed join@1
|
||
|
|
1 SIMPLE x11 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.x10.c3 1 100.00 Child of 'x10' in pushed join@1
|
||
|
|
1 SIMPLE x12 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.x11.c3 1 100.00 Child of 'x11' in pushed join@1
|
||
|
|
1 SIMPLE x13 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.x12.c3 1 100.00 Child of 'x12' in pushed join@1
|
||
|
|
1 SIMPLE x14 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.x13.c3 1 100.00 Child of 'x13' in pushed join@1
|
||
|
|
1 SIMPLE x15 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.x14.c3 1 100.00 Child of 'x14' in pushed join@1
|
||
|
|
1 SIMPLE x16 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.x15.c3 1 100.00 Child of 'x15' in pushed join@1
|
||
|
|
1 SIMPLE x17 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.x16.c3 1 100.00 Child of 'x16' in pushed join@1
|
||
|
|
1 SIMPLE x18 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.x17.c3 1 100.00 Child of 'x17' in pushed join@1
|
||
|
|
1 SIMPLE x19 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.x18.c3 1 100.00 Child of 'x18' in pushed join@1
|
||
|
|
1 SIMPLE x20 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.x19.c3 1 100.00 Child of 'x19' in pushed join@1
|
||
|
|
1 SIMPLE x21 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.x20.c3 1 100.00 Child of 'x20' in pushed join@1
|
||
|
|
1 SIMPLE x22 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.x21.c3 1 100.00 Child of 'x21' in pushed join@1
|
||
|
|
1 SIMPLE x23 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.x22.c3 1 100.00 Child of 'x22' in pushed join@1
|
||
|
|
1 SIMPLE x24 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.x23.c3 1 100.00 Child of 'x23' in pushed join@1
|
||
|
|
1 SIMPLE x25 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.x24.c3 1 100.00 Child of 'x24' in pushed join@1
|
||
|
|
1 SIMPLE x26 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.x25.c3 1 100.00 Child of 'x25' in pushed join@1
|
||
|
|
1 SIMPLE x27 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.x26.c3 1 100.00 Child of 'x26' in pushed join@1
|
||
|
|
1 SIMPLE x28 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.x27.c3 1 100.00 Child of 'x27' in pushed join@1
|
||
|
|
1 SIMPLE x29 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.x28.c3 1 100.00 Child of 'x28' in pushed join@1
|
||
|
|
1 SIMPLE x30 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.x29.c3 1 100.00 Child of 'x29' in pushed join@1
|
||
|
|
1 SIMPLE x31 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.x30.c3 1 100.00 Child of 'x30' in pushed join@1
|
||
|
|
1 SIMPLE x32 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.x31.c3 1 100.00 Parent of 2 pushed join@2
|
||
|
|
1 SIMPLE x33 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.x32.c3 1 100.00 Child of 'x32' in pushed join@2
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 Cannot push table 'x32' as child of 'x0'. Max number of pushable tables exceeded.
|
||
|
|
Note 1003 Cannot push table 'x33' as child of 'x0'. Max number of pushable tables exceeded.
|
||
|
|
Note 1003 /* select#1 */ select count(0) AS `count(*)` from `test`.`t3` `x0` join `test`.`t3` `x1` join `test`.`t3` `x2` join `test`.`t3` `x3` join `test`.`t3` `x4` join `test`.`t3` `x5` join `test`.`t3` `x6` join `test`.`t3` `x7` join `test`.`t3` `x8` join `test`.`t3` `x9` join `test`.`t3` `x10` join `test`.`t3` `x11` join `test`.`t3` `x12` join `test`.`t3` `x13` join `test`.`t3` `x14` join `test`.`t3` `x15` join `test`.`t3` `x16` join `test`.`t3` `x17` join `test`.`t3` `x18` join `test`.`t3` `x19` join `test`.`t3` `x20` join `test`.`t3` `x21` join `test`.`t3` `x22` join `test`.`t3` `x23` join `test`.`t3` `x24` join `test`.`t3` `x25` join `test`.`t3` `x26` join `test`.`t3` `x27` join `test`.`t3` `x28` join `test`.`t3` `x29` join `test`.`t3` `x30` join `test`.`t3` `x31` join `test`.`t3` `x32` join `test`.`t3` `x33` where ((`test`.`x1`.`a3` = `test`.`x0`.`c3`) and (`test`.`x2`.`a3` = `test`.`x1`.`c3`) and (`test`.`x3`.`a3` = `test`.`x2`.`c3`) and (`test`.`x4`.`a3` = `test`.`x3`.`c3`) and (`test`.`x5`.`a3` = `test`.`x4`.`c3`) and (`test`.`x6`.`a3` = `test`.`x5`.`c3`) and (`test`.`x7`.`a3` = `test`.`x6`.`c3`) and (`test`.`x8`.`a3` = `test`.`x7`.`c3`) and (`test`.`x9`.`a3` = `test`.`x8`.`c3`) and (`test`.`x10`.`a3` = `test`.`x9`.`c3`) and (`test`.`x11`.`a3` = `test`.`x10`.`c3`) and (`test`.`x12`.`a3` = `test`.`x11`.`c3`) and (`test`.`x13`.`a3` = `test`.`x12`.`c3`) and (`test`.`x14`.`a3` = `test`.`x13`.`c3`) and (`test`.`x15`.`a3` = `test`.`x14`.`c3`) and (`test`.`x16`.`a3` = `test`.`x15`.`c3`) and (`test`.`x17`.`a3` = `test`.`x16`.`c3`) and (`test`.`x18`.`a3` = `test`.`x17`.`c3`) and (`test`.`x19`.`a3` = `test`.`x18`.`c3`) and (`test`.`x20`.`a3` = `test`.`x19`.`c3`) and (`test`.`x21`.`a3` = `test`.`x20`.`c3`) and (`test`.`x22`.`a3` = `test`.`x21`.`c3`) and (`test`.`x23`.`a3` = `test`.`x22`.`c3`) and (`test`.`x24`.`a3` = `test`.`x23`.`c3`) and (`test`.`x25`.`a3` = `test`.`x24`.`c3`) and (`test`.`x26`.`a3` = `test`.`x25`.`c3`) and (`test`.`x27`.`a3` = `test`.`x26`.`c3`) and (`test`.`x28`.`a3` = `test`.`x27`.`c3`) and (`test`.`x29`.`a3` = `test`.`x28`.`c3`) and (`test`.`x30`.`a3` = `test`.`x29`.`c3`) and (`test`.`x31`.`a3` = `test`.`x30`.`c3`) and (`test`.`x32`.`a3` = `test`.`x31`.`c3`) and (`test`.`x33`.`a3` = `test`.`x32`.`c3`))
|
||
|
|
select count(*) from t3 as x0
|
||
|
|
join t3 as x1 on x0.c3=x1.a3
|
||
|
|
join t3 as x2 on x1.c3=x2.a3
|
||
|
|
join t3 as x3 on x2.c3=x3.a3
|
||
|
|
join t3 as x4 on x3.c3=x4.a3
|
||
|
|
join t3 as x5 on x4.c3=x5.a3
|
||
|
|
join t3 as x6 on x5.c3=x6.a3
|
||
|
|
join t3 as x7 on x6.c3=x7.a3
|
||
|
|
join t3 as x8 on x7.c3=x8.a3
|
||
|
|
join t3 as x9 on x8.c3=x9.a3
|
||
|
|
join t3 as x10 on x9.c3=x10.a3
|
||
|
|
join t3 as x11 on x10.c3=x11.a3
|
||
|
|
join t3 as x12 on x11.c3=x12.a3
|
||
|
|
join t3 as x13 on x12.c3=x13.a3
|
||
|
|
join t3 as x14 on x13.c3=x14.a3
|
||
|
|
join t3 as x15 on x14.c3=x15.a3
|
||
|
|
join t3 as x16 on x15.c3=x16.a3
|
||
|
|
join t3 as x17 on x16.c3=x17.a3
|
||
|
|
join t3 as x18 on x17.c3=x18.a3
|
||
|
|
join t3 as x19 on x18.c3=x19.a3
|
||
|
|
join t3 as x20 on x19.c3=x20.a3
|
||
|
|
join t3 as x21 on x20.c3=x21.a3
|
||
|
|
join t3 as x22 on x21.c3=x22.a3
|
||
|
|
join t3 as x23 on x22.c3=x23.a3
|
||
|
|
join t3 as x24 on x23.c3=x24.a3
|
||
|
|
join t3 as x25 on x24.c3=x25.a3
|
||
|
|
join t3 as x26 on x25.c3=x26.a3
|
||
|
|
join t3 as x27 on x26.c3=x27.a3
|
||
|
|
join t3 as x28 on x27.c3=x28.a3
|
||
|
|
join t3 as x29 on x28.c3=x29.a3
|
||
|
|
join t3 as x30 on x29.c3=x30.a3
|
||
|
|
join t3 as x31 on x30.c3=x31.a3
|
||
|
|
join t3 as x32 on x31.c3=x32.a3
|
||
|
|
join t3 as x33 on x32.c3=x33.a3;
|
||
|
|
count(*)
|
||
|
|
1
|
||
|
|
explain extended select count(*) from t3 as x0
|
||
|
|
join t3 as x1 on x0.b3=x1.d3
|
||
|
|
join t3 as x2 on x1.b3=x2.d3
|
||
|
|
join t3 as x3 on x2.b3=x3.d3
|
||
|
|
join t3 as x4 on x3.b3=x4.d3
|
||
|
|
join t3 as x5 on x4.b3=x5.d3
|
||
|
|
join t3 as x6 on x5.b3=x6.d3
|
||
|
|
join t3 as x7 on x6.b3=x7.d3
|
||
|
|
join t3 as x8 on x7.b3=x8.d3
|
||
|
|
join t3 as x9 on x8.b3=x9.d3
|
||
|
|
join t3 as x10 on x9.b3=x10.d3
|
||
|
|
join t3 as x11 on x10.b3=x11.d3
|
||
|
|
join t3 as x12 on x11.b3=x12.d3
|
||
|
|
join t3 as x13 on x12.b3=x13.d3
|
||
|
|
join t3 as x14 on x13.b3=x14.d3
|
||
|
|
join t3 as x15 on x14.b3=x15.d3
|
||
|
|
join t3 as x16 on x15.b3=x16.d3
|
||
|
|
join t3 as x17 on x15.b3=x17.a3
|
||
|
|
join t3 as x18 on x16.b3=x18.d3;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE x0 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 4 100.00 Parent of 17 pushed join@1
|
||
|
|
1 SIMPLE x1 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref t3_d3 t3_d3 4 test.x0.b3 1 100.00 Child of 'x0' in pushed join@1
|
||
|
|
1 SIMPLE x2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref t3_d3 t3_d3 4 test.x1.b3 1 100.00 Child of 'x1' in pushed join@1
|
||
|
|
1 SIMPLE x3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref t3_d3 t3_d3 4 test.x2.b3 1 100.00 Child of 'x2' in pushed join@1
|
||
|
|
1 SIMPLE x4 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref t3_d3 t3_d3 4 test.x3.b3 1 100.00 Child of 'x3' in pushed join@1
|
||
|
|
1 SIMPLE x5 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref t3_d3 t3_d3 4 test.x4.b3 1 100.00 Child of 'x4' in pushed join@1
|
||
|
|
1 SIMPLE x6 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref t3_d3 t3_d3 4 test.x5.b3 1 100.00 Child of 'x5' in pushed join@1
|
||
|
|
1 SIMPLE x7 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref t3_d3 t3_d3 4 test.x6.b3 1 100.00 Child of 'x6' in pushed join@1
|
||
|
|
1 SIMPLE x8 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref t3_d3 t3_d3 4 test.x7.b3 1 100.00 Child of 'x7' in pushed join@1
|
||
|
|
1 SIMPLE x9 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref t3_d3 t3_d3 4 test.x8.b3 1 100.00 Child of 'x8' in pushed join@1
|
||
|
|
1 SIMPLE x10 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref t3_d3 t3_d3 4 test.x9.b3 1 100.00 Child of 'x9' in pushed join@1
|
||
|
|
1 SIMPLE x11 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref t3_d3 t3_d3 4 test.x10.b3 1 100.00 Child of 'x10' in pushed join@1
|
||
|
|
1 SIMPLE x12 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref t3_d3 t3_d3 4 test.x11.b3 1 100.00 Child of 'x11' in pushed join@1
|
||
|
|
1 SIMPLE x13 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref t3_d3 t3_d3 4 test.x12.b3 1 100.00 Child of 'x12' in pushed join@1
|
||
|
|
1 SIMPLE x14 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref t3_d3 t3_d3 4 test.x13.b3 1 100.00 Child of 'x13' in pushed join@1
|
||
|
|
1 SIMPLE x15 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref t3_d3 t3_d3 4 test.x14.b3 1 100.00 Child of 'x14' in pushed join@1
|
||
|
|
1 SIMPLE x16 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref t3_d3 t3_d3 4 test.x15.b3 1 100.00 Parent of 2 pushed join@2
|
||
|
|
1 SIMPLE x18 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref t3_d3 t3_d3 4 test.x16.b3 1 100.00 Child of 'x16' in pushed join@2
|
||
|
|
1 SIMPLE x17 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.x15.b3 1 100.00 Child of 'x15' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 Cannot push table 'x16' as child of 'x0'. Max number of pushable tables exceeded.
|
||
|
|
Note 1003 Cannot push table 'x18' as child of 'x0'. Max number of pushable tables exceeded.
|
||
|
|
Note 1003 /* select#1 */ select count(0) AS `count(*)` from `test`.`t3` `x0` join `test`.`t3` `x1` join `test`.`t3` `x2` join `test`.`t3` `x3` join `test`.`t3` `x4` join `test`.`t3` `x5` join `test`.`t3` `x6` join `test`.`t3` `x7` join `test`.`t3` `x8` join `test`.`t3` `x9` join `test`.`t3` `x10` join `test`.`t3` `x11` join `test`.`t3` `x12` join `test`.`t3` `x13` join `test`.`t3` `x14` join `test`.`t3` `x15` join `test`.`t3` `x16` join `test`.`t3` `x17` join `test`.`t3` `x18` where ((`test`.`x1`.`d3` = `test`.`x0`.`b3`) and (`test`.`x2`.`d3` = `test`.`x1`.`b3`) and (`test`.`x3`.`d3` = `test`.`x2`.`b3`) and (`test`.`x4`.`d3` = `test`.`x3`.`b3`) and (`test`.`x5`.`d3` = `test`.`x4`.`b3`) and (`test`.`x6`.`d3` = `test`.`x5`.`b3`) and (`test`.`x7`.`d3` = `test`.`x6`.`b3`) and (`test`.`x8`.`d3` = `test`.`x7`.`b3`) and (`test`.`x9`.`d3` = `test`.`x8`.`b3`) and (`test`.`x10`.`d3` = `test`.`x9`.`b3`) and (`test`.`x11`.`d3` = `test`.`x10`.`b3`) and (`test`.`x12`.`d3` = `test`.`x11`.`b3`) and (`test`.`x13`.`d3` = `test`.`x12`.`b3`) and (`test`.`x14`.`d3` = `test`.`x13`.`b3`) and (`test`.`x15`.`d3` = `test`.`x14`.`b3`) and (`test`.`x16`.`d3` = `test`.`x15`.`b3`) and (`test`.`x17`.`a3` = `test`.`x15`.`b3`) and (`test`.`x18`.`d3` = `test`.`x16`.`b3`))
|
||
|
|
select count(*) from t3 as x0
|
||
|
|
join t3 as x1 on x0.b3=x1.d3
|
||
|
|
join t3 as x2 on x1.b3=x2.d3
|
||
|
|
join t3 as x3 on x2.b3=x3.d3
|
||
|
|
join t3 as x4 on x3.b3=x4.d3
|
||
|
|
join t3 as x5 on x4.b3=x5.d3
|
||
|
|
join t3 as x6 on x5.b3=x6.d3
|
||
|
|
join t3 as x7 on x6.b3=x7.d3
|
||
|
|
join t3 as x8 on x7.b3=x8.d3
|
||
|
|
join t3 as x9 on x8.b3=x9.d3
|
||
|
|
join t3 as x10 on x9.b3=x10.d3
|
||
|
|
join t3 as x11 on x10.b3=x11.d3
|
||
|
|
join t3 as x12 on x11.b3=x12.d3
|
||
|
|
join t3 as x13 on x12.b3=x13.d3
|
||
|
|
join t3 as x14 on x13.b3=x14.d3
|
||
|
|
join t3 as x15 on x14.b3=x15.d3
|
||
|
|
join t3 as x16 on x15.b3=x16.d3
|
||
|
|
join t3 as x17 on x15.b3=x17.a3
|
||
|
|
join t3 as x18 on x16.b3=x18.d3;
|
||
|
|
count(*)
|
||
|
|
4
|
||
|
|
drop table t1,t2,t3, t3_hash;
|
||
|
|
create table t3 (a3 int, b3 int, c3 int, d3 int,
|
||
|
|
primary key(b3, a3)) engine = ndb;
|
||
|
|
create table t3_hash (a3 int, b3 int, c3 int, d3 int,
|
||
|
|
primary key(b3,a3) using hash) engine = ndb;
|
||
|
|
create table t3_unq (pk int, a3 int not null, b3 int not null, c3 int, d3 int,
|
||
|
|
primary key(pk) using hash, unique key(b3,a3) using hash) engine = ndb;
|
||
|
|
insert into t3 values (0x1f, 0x2f, 1, 0x1f);
|
||
|
|
insert into t3 values (0x2f, 0x3f, 2, 0x2f);
|
||
|
|
insert into t3 values (0x3f, 0x1f, 3, 0x3f);
|
||
|
|
insert into t3_hash values (0x1f, 0x2f, 1, 0x1f);
|
||
|
|
insert into t3_hash values (0x2f, 0x3f, 2, 0x2f);
|
||
|
|
insert into t3_hash values (0x3f, 0x1f, 3, 0x3f);
|
||
|
|
insert into t3_unq values (1001, 0x1f, 0x2f, 1, 0x1f);
|
||
|
|
insert into t3_unq values (1002, 0x2f, 0x3f, 2, 0x2f);
|
||
|
|
insert into t3_unq values (1003, 0x3f, 0x1f, 3, 0x3f);
|
||
|
|
explain extended
|
||
|
|
select * from t3 x, t3 y where y.a3=x.d3 and y.b3=x.b3;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 ALL PRIMARY NULL NULL NULL 3 100.00 Parent of 2 pushed join@1; Using where with pushed condition (`test`.`x`.`d3` is not null)
|
||
|
|
1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.x.b3,test.x.d3 1 100.00 Child of 'x' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select `test`.`x`.`a3` AS `a3`,`test`.`x`.`b3` AS `b3`,`test`.`x`.`c3` AS `c3`,`test`.`x`.`d3` AS `d3`,`test`.`y`.`a3` AS `a3`,`test`.`y`.`b3` AS `b3`,`test`.`y`.`c3` AS `c3`,`test`.`y`.`d3` AS `d3` from `test`.`t3` `x` join `test`.`t3` `y` where ((`test`.`y`.`b3` = `test`.`x`.`b3`) and (`test`.`y`.`a3` = `test`.`x`.`d3`))
|
||
|
|
select * from t3 x, t3 y where y.a3=x.d3 and y.b3=x.b3;
|
||
|
|
a3 b3 c3 d3 a3 b3 c3 d3
|
||
|
|
31 47 1 31 31 47 1 31
|
||
|
|
47 63 2 47 47 63 2 47
|
||
|
|
63 31 3 63 63 31 3 63
|
||
|
|
explain extended
|
||
|
|
select * from t3_hash x, t3_hash y where y.a3=x.d3 and y.b3=x.b3;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 ALL PRIMARY NULL NULL NULL 3 100.00 Parent of 2 pushed join@1; Using where with pushed condition (`test`.`x`.`d3` is not null)
|
||
|
|
1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.x.b3,test.x.d3 1 100.00 Child of 'x' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select `test`.`x`.`a3` AS `a3`,`test`.`x`.`b3` AS `b3`,`test`.`x`.`c3` AS `c3`,`test`.`x`.`d3` AS `d3`,`test`.`y`.`a3` AS `a3`,`test`.`y`.`b3` AS `b3`,`test`.`y`.`c3` AS `c3`,`test`.`y`.`d3` AS `d3` from `test`.`t3_hash` `x` join `test`.`t3_hash` `y` where ((`test`.`y`.`b3` = `test`.`x`.`b3`) and (`test`.`y`.`a3` = `test`.`x`.`d3`))
|
||
|
|
select * from t3_hash x, t3_hash y where y.a3=x.d3 and y.b3=x.b3;
|
||
|
|
a3 b3 c3 d3 a3 b3 c3 d3
|
||
|
|
31 47 1 31 31 47 1 31
|
||
|
|
47 63 2 47 47 63 2 47
|
||
|
|
63 31 3 63 63 31 3 63
|
||
|
|
explain extended
|
||
|
|
select * from t3_unq x, t3_unq y where y.a3=x.d3 and y.b3=x.b3;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 ALL b3 NULL NULL NULL 3 100.00 Parent of 2 pushed join@1; Using where with pushed condition (`test`.`x`.`d3` is not null)
|
||
|
|
1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref b3 b3 8 test.x.b3,test.x.d3 1 100.00 Child of 'x' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select `test`.`x`.`pk` AS `pk`,`test`.`x`.`a3` AS `a3`,`test`.`x`.`b3` AS `b3`,`test`.`x`.`c3` AS `c3`,`test`.`x`.`d3` AS `d3`,`test`.`y`.`pk` AS `pk`,`test`.`y`.`a3` AS `a3`,`test`.`y`.`b3` AS `b3`,`test`.`y`.`c3` AS `c3`,`test`.`y`.`d3` AS `d3` from `test`.`t3_unq` `x` join `test`.`t3_unq` `y` where ((`test`.`y`.`b3` = `test`.`x`.`b3`) and (`test`.`y`.`a3` = `test`.`x`.`d3`))
|
||
|
|
select * from t3_unq x, t3_unq y where y.a3=x.d3 and y.b3=x.b3;
|
||
|
|
pk a3 b3 c3 d3 pk a3 b3 c3 d3
|
||
|
|
1001 31 47 1 31 1001 31 47 1 31
|
||
|
|
1002 47 63 2 47 1002 47 63 2 47
|
||
|
|
1003 63 31 3 63 1003 63 31 3 63
|
||
|
|
explain extended
|
||
|
|
select * from t3 x, t3 y where y.a3=x.d3 and y.b3=x.b3
|
||
|
|
and x.a3=0x2f and x.b3=0x3f;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 const,const 1 100.00 Parent of 2 pushed join@1; Using where with pushed condition (`test`.`x`.`d3` is not null)
|
||
|
|
1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 const,test.x.d3 1 100.00 Child of 'x' in pushed join@1; Using where
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select `test`.`x`.`a3` AS `a3`,`test`.`x`.`b3` AS `b3`,`test`.`x`.`c3` AS `c3`,`test`.`x`.`d3` AS `d3`,`test`.`y`.`a3` AS `a3`,`test`.`y`.`b3` AS `b3`,`test`.`y`.`c3` AS `c3`,`test`.`y`.`d3` AS `d3` from `test`.`t3` `x` join `test`.`t3` `y` where ((`test`.`y`.`b3` = `test`.`x`.`b3`) and (`test`.`y`.`a3` = `test`.`x`.`d3`) and (`test`.`x`.`a3` = 0x2f) and (`test`.`x`.`b3` = 0x3f))
|
||
|
|
select * from t3 x, t3 y where y.a3=x.d3 and y.b3=x.b3
|
||
|
|
and x.a3=0x2f and x.b3=0x3f;
|
||
|
|
a3 b3 c3 d3 a3 b3 c3 d3
|
||
|
|
47 63 2 47 47 63 2 47
|
||
|
|
explain extended
|
||
|
|
select * from t3_hash x, t3_hash y where y.a3=x.d3 and y.b3=x.b3
|
||
|
|
and x.a3=0x2f and x.b3=0x3f;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 const,const 1 100.00 Parent of 2 pushed join@1; Using where with pushed condition (`test`.`x`.`d3` is not null)
|
||
|
|
1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 const,test.x.d3 1 100.00 Child of 'x' in pushed join@1; Using where
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select `test`.`x`.`a3` AS `a3`,`test`.`x`.`b3` AS `b3`,`test`.`x`.`c3` AS `c3`,`test`.`x`.`d3` AS `d3`,`test`.`y`.`a3` AS `a3`,`test`.`y`.`b3` AS `b3`,`test`.`y`.`c3` AS `c3`,`test`.`y`.`d3` AS `d3` from `test`.`t3_hash` `x` join `test`.`t3_hash` `y` where ((`test`.`y`.`b3` = `test`.`x`.`b3`) and (`test`.`y`.`a3` = `test`.`x`.`d3`) and (`test`.`x`.`a3` = 0x2f) and (`test`.`x`.`b3` = 0x3f))
|
||
|
|
select * from t3_hash x, t3_hash y where y.a3=x.d3 and y.b3=x.b3
|
||
|
|
and x.a3=0x2f and x.b3=0x3f;
|
||
|
|
a3 b3 c3 d3 a3 b3 c3 d3
|
||
|
|
47 63 2 47 47 63 2 47
|
||
|
|
explain extended
|
||
|
|
select * from t3_unq x, t3_unq y where y.a3=x.d3 and y.b3=x.b3
|
||
|
|
and x.a3=0x2f and x.b3=0x3f;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 eq_ref b3 b3 8 const,const 1 100.00 Parent of 2 pushed join@1; Using where with pushed condition (`test`.`x`.`d3` is not null)
|
||
|
|
1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref b3 b3 8 const,test.x.d3 1 100.00 Child of 'x' in pushed join@1; Using where
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select `test`.`x`.`pk` AS `pk`,`test`.`x`.`a3` AS `a3`,`test`.`x`.`b3` AS `b3`,`test`.`x`.`c3` AS `c3`,`test`.`x`.`d3` AS `d3`,`test`.`y`.`pk` AS `pk`,`test`.`y`.`a3` AS `a3`,`test`.`y`.`b3` AS `b3`,`test`.`y`.`c3` AS `c3`,`test`.`y`.`d3` AS `d3` from `test`.`t3_unq` `x` join `test`.`t3_unq` `y` where ((`test`.`y`.`b3` = `test`.`x`.`b3`) and (`test`.`y`.`a3` = `test`.`x`.`d3`) and (`test`.`x`.`a3` = 0x2f) and (`test`.`x`.`b3` = 0x3f))
|
||
|
|
select * from t3_unq x, t3_unq y where y.a3=x.d3 and y.b3=x.b3
|
||
|
|
and x.a3=0x2f and x.b3=0x3f;
|
||
|
|
pk a3 b3 c3 d3 pk a3 b3 c3 d3
|
||
|
|
1002 47 63 2 47 1002 47 63 2 47
|
||
|
|
drop table t3, t3_hash, t3_unq;
|
||
|
|
create table t3 (a3 int, b3 int, c3 int, d3 int,
|
||
|
|
primary key(a3), unique key(d3)) engine = ndb;
|
||
|
|
insert into t3 values (0x1f, 0x2f, 1, 0x1f);
|
||
|
|
insert into t3 values (0x2f, 0x3f, 2, 0x2f);
|
||
|
|
insert into t3 values (0x3f, 0x1f, 3, 0x3f);
|
||
|
|
insert into t3 values (0x4f, 0, null, null);
|
||
|
|
explain extended
|
||
|
|
select * from t3 as t1
|
||
|
|
left outer join t3 as t2 on t2.d3 = t1.d3
|
||
|
|
left outer join t3 as t3 on t3.a3 = t2.d3;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 4 100.00 Parent of 3 pushed join@1
|
||
|
|
1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 ref d3 d3 5 test.t1.d3 1 100.00 Child of 't1' in pushed join@1
|
||
|
|
1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.t2.d3 1 100.00 Child of 't2' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select `test`.`t1`.`a3` AS `a3`,`test`.`t1`.`b3` AS `b3`,`test`.`t1`.`c3` AS `c3`,`test`.`t1`.`d3` AS `d3`,`test`.`t2`.`a3` AS `a3`,`test`.`t2`.`b3` AS `b3`,`test`.`t2`.`c3` AS `c3`,`test`.`t2`.`d3` AS `d3`,`test`.`t3`.`a3` AS `a3`,`test`.`t3`.`b3` AS `b3`,`test`.`t3`.`c3` AS `c3`,`test`.`t3`.`d3` AS `d3` from `test`.`t3` `t1` left join `test`.`t3` `t2` on((`test`.`t2`.`d3` = `test`.`t1`.`d3`)) left join `test`.`t3` on((`test`.`t3`.`a3` = `test`.`t2`.`d3`)) where 1
|
||
|
|
select * from t3 as t1
|
||
|
|
left outer join t3 as t2 on t2.d3 = t1.d3
|
||
|
|
left outer join t3 as t3 on t3.a3 = t2.d3;
|
||
|
|
a3 b3 c3 d3 a3 b3 c3 d3 a3 b3 c3 d3
|
||
|
|
31 47 1 31 31 47 1 31 31 47 1 31
|
||
|
|
47 63 2 47 47 63 2 47 47 63 2 47
|
||
|
|
63 31 3 63 63 31 3 63 63 31 3 63
|
||
|
|
79 0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
|
||
|
|
explain extended
|
||
|
|
select * from t3 as t1
|
||
|
|
left outer join t3 as t2 on t2.d3 = t1.a3
|
||
|
|
left outer join t3 as t3 on t3.a3 = t2.d3
|
||
|
|
where t1.d3 = 47;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ref d3 d3 5 const 1 100.00 Parent of 3 pushed join@1
|
||
|
|
1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 ref d3 d3 5 test.t1.a3 1 100.00 Child of 't1' in pushed join@1
|
||
|
|
1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.t2.d3 1 100.00 Child of 't2' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select `test`.`t1`.`a3` AS `a3`,`test`.`t1`.`b3` AS `b3`,`test`.`t1`.`c3` AS `c3`,`test`.`t1`.`d3` AS `d3`,`test`.`t2`.`a3` AS `a3`,`test`.`t2`.`b3` AS `b3`,`test`.`t2`.`c3` AS `c3`,`test`.`t2`.`d3` AS `d3`,`test`.`t3`.`a3` AS `a3`,`test`.`t3`.`b3` AS `b3`,`test`.`t3`.`c3` AS `c3`,`test`.`t3`.`d3` AS `d3` from `test`.`t3` `t1` left join `test`.`t3` `t2` on((`test`.`t2`.`d3` = `test`.`t1`.`a3`)) left join `test`.`t3` on((`test`.`t3`.`a3` = `test`.`t2`.`d3`)) where (`test`.`t1`.`d3` = 47)
|
||
|
|
select * from t3 as t1
|
||
|
|
left outer join t3 as t2 on t2.d3 = t1.a3
|
||
|
|
left outer join t3 as t3 on t3.a3 = t2.d3
|
||
|
|
where t1.d3 = 47;
|
||
|
|
a3 b3 c3 d3 a3 b3 c3 d3 a3 b3 c3 d3
|
||
|
|
47 63 2 47 47 63 2 47 47 63 2 47
|
||
|
|
explain extended
|
||
|
|
select * from t3 as t1
|
||
|
|
left outer join t3 as t2 on t2.d3 = t1.a3
|
||
|
|
left outer join t3 as t3 on t3.a3 = t2.d3
|
||
|
|
where t1.d3 >= 47;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 range d3 d3 5 NULL 3 100.00 Parent of 3 pushed join@1; Using where with pushed condition (`test`.`t1`.`d3` >= 47); Using MRR
|
||
|
|
1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 ref d3 d3 5 test.t1.a3 1 100.00 Child of 't1' in pushed join@1
|
||
|
|
1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.t2.d3 1 100.00 Child of 't2' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select `test`.`t1`.`a3` AS `a3`,`test`.`t1`.`b3` AS `b3`,`test`.`t1`.`c3` AS `c3`,`test`.`t1`.`d3` AS `d3`,`test`.`t2`.`a3` AS `a3`,`test`.`t2`.`b3` AS `b3`,`test`.`t2`.`c3` AS `c3`,`test`.`t2`.`d3` AS `d3`,`test`.`t3`.`a3` AS `a3`,`test`.`t3`.`b3` AS `b3`,`test`.`t3`.`c3` AS `c3`,`test`.`t3`.`d3` AS `d3` from `test`.`t3` `t1` left join `test`.`t3` `t2` on((`test`.`t2`.`d3` = `test`.`t1`.`a3`)) left join `test`.`t3` on((`test`.`t3`.`a3` = `test`.`t2`.`d3`)) where (`test`.`t1`.`d3` >= 47)
|
||
|
|
select * from t3 as t1
|
||
|
|
left outer join t3 as t2 on t2.d3 = t1.a3
|
||
|
|
left outer join t3 as t3 on t3.a3 = t2.d3
|
||
|
|
where t1.d3 >= 47;
|
||
|
|
a3 b3 c3 d3 a3 b3 c3 d3 a3 b3 c3 d3
|
||
|
|
47 63 2 47 47 63 2 47 47 63 2 47
|
||
|
|
63 31 3 63 63 31 3 63 63 31 3 63
|
||
|
|
explain extended
|
||
|
|
select * from t3 as t1
|
||
|
|
left outer join t3 as t2 on t2.d3 = t1.a3
|
||
|
|
left outer join t3 as t3 on t3.a3 = t2.d3
|
||
|
|
where t1.d3 is null;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ref d3 d3 5 const 1 100.00 Parent of 3 pushed join@1; Using where with pushed condition isnull(`test`.`t1`.`d3`)
|
||
|
|
1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 ref d3 d3 5 test.t1.a3 1 100.00 Child of 't1' in pushed join@1
|
||
|
|
1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.t2.d3 1 100.00 Child of 't2' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select `test`.`t1`.`a3` AS `a3`,`test`.`t1`.`b3` AS `b3`,`test`.`t1`.`c3` AS `c3`,`test`.`t1`.`d3` AS `d3`,`test`.`t2`.`a3` AS `a3`,`test`.`t2`.`b3` AS `b3`,`test`.`t2`.`c3` AS `c3`,`test`.`t2`.`d3` AS `d3`,`test`.`t3`.`a3` AS `a3`,`test`.`t3`.`b3` AS `b3`,`test`.`t3`.`c3` AS `c3`,`test`.`t3`.`d3` AS `d3` from `test`.`t3` `t1` left join `test`.`t3` `t2` on((`test`.`t2`.`d3` = `test`.`t1`.`a3`)) left join `test`.`t3` on((`test`.`t3`.`a3` = `test`.`t2`.`d3`)) where isnull(`test`.`t1`.`d3`)
|
||
|
|
select * from t3 as t1
|
||
|
|
left outer join t3 as t2 on t2.d3 = t1.a3
|
||
|
|
left outer join t3 as t3 on t3.a3 = t2.d3
|
||
|
|
where t1.d3 is null;
|
||
|
|
a3 b3 c3 d3 a3 b3 c3 d3 a3 b3 c3 d3
|
||
|
|
79 0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
|
||
|
|
explain extended
|
||
|
|
select * from t3 as t1
|
||
|
|
left outer join t3 as t2 on t2.d3 = t1.a3
|
||
|
|
left outer join t3 as t3 on t3.a3 = t2.d3
|
||
|
|
where t1.d3 is not null;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 range d3 d3 5 NULL 3 100.00 Parent of 3 pushed join@1; Using where with pushed condition (`test`.`t1`.`d3` is not null); Using MRR
|
||
|
|
1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 ref d3 d3 5 test.t1.a3 1 100.00 Child of 't1' in pushed join@1
|
||
|
|
1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.t2.d3 1 100.00 Child of 't2' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select `test`.`t1`.`a3` AS `a3`,`test`.`t1`.`b3` AS `b3`,`test`.`t1`.`c3` AS `c3`,`test`.`t1`.`d3` AS `d3`,`test`.`t2`.`a3` AS `a3`,`test`.`t2`.`b3` AS `b3`,`test`.`t2`.`c3` AS `c3`,`test`.`t2`.`d3` AS `d3`,`test`.`t3`.`a3` AS `a3`,`test`.`t3`.`b3` AS `b3`,`test`.`t3`.`c3` AS `c3`,`test`.`t3`.`d3` AS `d3` from `test`.`t3` `t1` left join `test`.`t3` `t2` on((`test`.`t2`.`d3` = `test`.`t1`.`a3`)) left join `test`.`t3` on((`test`.`t3`.`a3` = `test`.`t2`.`d3`)) where (`test`.`t1`.`d3` is not null)
|
||
|
|
select * from t3 as t1
|
||
|
|
left outer join t3 as t2 on t2.d3 = t1.a3
|
||
|
|
left outer join t3 as t3 on t3.a3 = t2.d3
|
||
|
|
where t1.d3 is not null;
|
||
|
|
a3 b3 c3 d3 a3 b3 c3 d3 a3 b3 c3 d3
|
||
|
|
31 47 1 31 31 47 1 31 31 47 1 31
|
||
|
|
47 63 2 47 47 63 2 47 47 63 2 47
|
||
|
|
63 31 3 63 63 31 3 63 63 31 3 63
|
||
|
|
drop table t3;
|
||
|
|
create table t3 (a3 int not null, b3 int not null, c3 int, d3 int,
|
||
|
|
primary key(a3), unique key(b3,d3), unique key(c3,b3), unique key(c3,d3)) engine = ndb;
|
||
|
|
insert into t3 values (0x1f, 0x2f, 1, 0x1f);
|
||
|
|
insert into t3 values (0x2f, 0x3f, 2, 0x2f);
|
||
|
|
insert into t3 values (0x3f, 0x1f, 3, 0x3f);
|
||
|
|
insert into t3 values (0x40, 0, null, null);
|
||
|
|
insert into t3 values (0x41, 0, null, null);
|
||
|
|
insert into t3 values (0x42, 0, 4, null);
|
||
|
|
insert into t3 values (0x43, 0, null, 0x43);
|
||
|
|
explain extended
|
||
|
|
select straight_join *
|
||
|
|
from t3 as x join t3 as y on x.b3 = y.b3;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 ALL b3 NULL NULL NULL 7 100.00 Parent of 2 pushed join@1
|
||
|
|
1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 ref b3 b3 4 test.x.b3 1 100.00 Child of 'x' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select straight_join `test`.`x`.`a3` AS `a3`,`test`.`x`.`b3` AS `b3`,`test`.`x`.`c3` AS `c3`,`test`.`x`.`d3` AS `d3`,`test`.`y`.`a3` AS `a3`,`test`.`y`.`b3` AS `b3`,`test`.`y`.`c3` AS `c3`,`test`.`y`.`d3` AS `d3` from `test`.`t3` `x` join `test`.`t3` `y` where (`test`.`y`.`b3` = `test`.`x`.`b3`)
|
||
|
|
select straight_join *
|
||
|
|
from t3 as x join t3 as y on x.b3 = y.b3;
|
||
|
|
a3 b3 c3 d3 a3 b3 c3 d3
|
||
|
|
31 47 1 31 31 47 1 31
|
||
|
|
47 63 2 47 47 63 2 47
|
||
|
|
63 31 3 63 63 31 3 63
|
||
|
|
64 0 NULL NULL 64 0 NULL NULL
|
||
|
|
64 0 NULL NULL 65 0 NULL NULL
|
||
|
|
64 0 NULL NULL 66 0 4 NULL
|
||
|
|
64 0 NULL NULL 67 0 NULL 67
|
||
|
|
65 0 NULL NULL 64 0 NULL NULL
|
||
|
|
65 0 NULL NULL 65 0 NULL NULL
|
||
|
|
65 0 NULL NULL 66 0 4 NULL
|
||
|
|
65 0 NULL NULL 67 0 NULL 67
|
||
|
|
66 0 4 NULL 64 0 NULL NULL
|
||
|
|
66 0 4 NULL 65 0 NULL NULL
|
||
|
|
66 0 4 NULL 66 0 4 NULL
|
||
|
|
66 0 4 NULL 67 0 NULL 67
|
||
|
|
67 0 NULL 67 64 0 NULL NULL
|
||
|
|
67 0 NULL 67 65 0 NULL NULL
|
||
|
|
67 0 NULL 67 66 0 4 NULL
|
||
|
|
67 0 NULL 67 67 0 NULL 67
|
||
|
|
explain extended
|
||
|
|
select straight_join *
|
||
|
|
from t3 as x join t3 as y on x.b3 = y.b3
|
||
|
|
where y.d3 = 0x2f;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 ALL b3 NULL NULL NULL 7 100.00 Parent of 2 pushed join@1
|
||
|
|
1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 ref b3 b3 9 test.x.b3,const 1 100.00 Child of 'x' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select straight_join `test`.`x`.`a3` AS `a3`,`test`.`x`.`b3` AS `b3`,`test`.`x`.`c3` AS `c3`,`test`.`x`.`d3` AS `d3`,`test`.`y`.`a3` AS `a3`,`test`.`y`.`b3` AS `b3`,`test`.`y`.`c3` AS `c3`,`test`.`y`.`d3` AS `d3` from `test`.`t3` `x` join `test`.`t3` `y` where ((`test`.`y`.`b3` = `test`.`x`.`b3`) and (`test`.`y`.`d3` = 0x2f))
|
||
|
|
select straight_join *
|
||
|
|
from t3 as x join t3 as y on x.b3 = y.b3
|
||
|
|
where y.d3 = 0x2f;
|
||
|
|
a3 b3 c3 d3 a3 b3 c3 d3
|
||
|
|
47 63 2 47 47 63 2 47
|
||
|
|
explain extended
|
||
|
|
select straight_join *
|
||
|
|
from t3 as x join t3 as y on x.c3 = y.c3
|
||
|
|
where y.d3 = 0x2f;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 ALL c3,c3_2 NULL NULL NULL # # Parent of 2 pushed join@1; Using where with pushed condition (`test`.`x`.`c3` is not null)
|
||
|
|
1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 ref c3,c3_2 c3 5 test.x.c3 # # Child of 'x' in pushed join@1; Using where with pushed condition (`test`.`y`.`d3` = 0x2f)
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select straight_join `test`.`x`.`a3` AS `a3`,`test`.`x`.`b3` AS `b3`,`test`.`x`.`c3` AS `c3`,`test`.`x`.`d3` AS `d3`,`test`.`y`.`a3` AS `a3`,`test`.`y`.`b3` AS `b3`,`test`.`y`.`c3` AS `c3`,`test`.`y`.`d3` AS `d3` from `test`.`t3` `x` join `test`.`t3` `y` where ((`test`.`y`.`c3` = `test`.`x`.`c3`) and (`test`.`y`.`d3` = 0x2f))
|
||
|
|
select straight_join *
|
||
|
|
from t3 as x join t3 as y on x.c3 = y.c3
|
||
|
|
where y.d3 = 0x2f;
|
||
|
|
a3 b3 c3 d3 a3 b3 c3 d3
|
||
|
|
47 63 2 47 47 63 2 47
|
||
|
|
explain extended
|
||
|
|
select straight_join *
|
||
|
|
from t3 as x join t3 as y on x.d3 = y.d3
|
||
|
|
where y.b3 = 0x2f;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 7 100.00 Parent of 2 pushed join@1; Using where with pushed condition (`test`.`x`.`d3` is not null)
|
||
|
|
1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 ref b3 b3 9 const,test.x.d3 1 100.00 Child of 'x' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select straight_join `test`.`x`.`a3` AS `a3`,`test`.`x`.`b3` AS `b3`,`test`.`x`.`c3` AS `c3`,`test`.`x`.`d3` AS `d3`,`test`.`y`.`a3` AS `a3`,`test`.`y`.`b3` AS `b3`,`test`.`y`.`c3` AS `c3`,`test`.`y`.`d3` AS `d3` from `test`.`t3` `x` join `test`.`t3` `y` where ((`test`.`y`.`d3` = `test`.`x`.`d3`) and (`test`.`y`.`b3` = 0x2f))
|
||
|
|
select straight_join *
|
||
|
|
from t3 as x join t3 as y on x.d3 = y.d3
|
||
|
|
where y.b3 = 0x2f;
|
||
|
|
a3 b3 c3 d3 a3 b3 c3 d3
|
||
|
|
31 47 1 31 31 47 1 31
|
||
|
|
explain extended
|
||
|
|
select straight_join *
|
||
|
|
from t3 as x join t3 as y on x.d3 = y.d3
|
||
|
|
where y.b3 = 0x20+0x2f;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 7 100.00 Parent of 2 pushed join@1; Using where with pushed condition (`test`.`x`.`d3` is not null)
|
||
|
|
1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 ref b3 b3 9 const,test.x.d3 1 100.00 Child of 'x' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select straight_join `test`.`x`.`a3` AS `a3`,`test`.`x`.`b3` AS `b3`,`test`.`x`.`c3` AS `c3`,`test`.`x`.`d3` AS `d3`,`test`.`y`.`a3` AS `a3`,`test`.`y`.`b3` AS `b3`,`test`.`y`.`c3` AS `c3`,`test`.`y`.`d3` AS `d3` from `test`.`t3` `x` join `test`.`t3` `y` where ((`test`.`y`.`d3` = `test`.`x`.`d3`) and (`test`.`y`.`b3` = (0x20 + 0x2f)))
|
||
|
|
select straight_join *
|
||
|
|
from t3 as x join t3 as y on x.d3 = y.d3
|
||
|
|
where y.b3 = 0x20+0x2f;
|
||
|
|
a3 b3 c3 d3 a3 b3 c3 d3
|
||
|
|
explain extended
|
||
|
|
select straight_join *
|
||
|
|
from t3 as x join t3 as y on x.b3 = y.b3
|
||
|
|
where y.d3 is not null;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 ALL b3 NULL NULL NULL # # Parent of 2 pushed join@1
|
||
|
|
1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 ref b3 b3 4 test.x.b3 # # Child of 'x' in pushed join@1; Using where with pushed condition (`test`.`y`.`d3` is not null)
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select straight_join `test`.`x`.`a3` AS `a3`,`test`.`x`.`b3` AS `b3`,`test`.`x`.`c3` AS `c3`,`test`.`x`.`d3` AS `d3`,`test`.`y`.`a3` AS `a3`,`test`.`y`.`b3` AS `b3`,`test`.`y`.`c3` AS `c3`,`test`.`y`.`d3` AS `d3` from `test`.`t3` `x` join `test`.`t3` `y` where ((`test`.`y`.`b3` = `test`.`x`.`b3`) and (`test`.`y`.`d3` is not null))
|
||
|
|
select straight_join *
|
||
|
|
from t3 as x join t3 as y on x.b3 = y.b3
|
||
|
|
where y.d3 is not null;
|
||
|
|
a3 b3 c3 d3 a3 b3 c3 d3
|
||
|
|
31 47 1 31 31 47 1 31
|
||
|
|
47 63 2 47 47 63 2 47
|
||
|
|
63 31 3 63 63 31 3 63
|
||
|
|
64 0 NULL NULL 67 0 NULL 67
|
||
|
|
65 0 NULL NULL 67 0 NULL 67
|
||
|
|
66 0 4 NULL 67 0 NULL 67
|
||
|
|
67 0 NULL 67 67 0 NULL 67
|
||
|
|
explain extended
|
||
|
|
select straight_join *
|
||
|
|
from t3 as x join t3 as y on x.b3 = y.b3
|
||
|
|
where y.d3 is null;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 ALL b3 NULL NULL NULL 7 100.00 NULL
|
||
|
|
1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 ref b3 b3 9 test.x.b3,const 1 100.00 Using where with pushed condition isnull(`test`.`y`.`d3`)
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select straight_join `test`.`x`.`a3` AS `a3`,`test`.`x`.`b3` AS `b3`,`test`.`x`.`c3` AS `c3`,`test`.`x`.`d3` AS `d3`,`test`.`y`.`a3` AS `a3`,`test`.`y`.`b3` AS `b3`,`test`.`y`.`c3` AS `c3`,`test`.`y`.`d3` AS `d3` from `test`.`t3` `x` join `test`.`t3` `y` where ((`test`.`y`.`b3` = `test`.`x`.`b3`) and isnull(`test`.`y`.`d3`))
|
||
|
|
select straight_join *
|
||
|
|
from t3 as x join t3 as y on x.b3 = y.b3
|
||
|
|
where y.d3 is null;
|
||
|
|
a3 b3 c3 d3 a3 b3 c3 d3
|
||
|
|
64 0 NULL NULL 64 0 NULL NULL
|
||
|
|
64 0 NULL NULL 65 0 NULL NULL
|
||
|
|
64 0 NULL NULL 66 0 4 NULL
|
||
|
|
65 0 NULL NULL 64 0 NULL NULL
|
||
|
|
65 0 NULL NULL 65 0 NULL NULL
|
||
|
|
65 0 NULL NULL 66 0 4 NULL
|
||
|
|
66 0 4 NULL 64 0 NULL NULL
|
||
|
|
66 0 4 NULL 65 0 NULL NULL
|
||
|
|
66 0 4 NULL 66 0 4 NULL
|
||
|
|
67 0 NULL 67 64 0 NULL NULL
|
||
|
|
67 0 NULL 67 65 0 NULL NULL
|
||
|
|
67 0 NULL 67 66 0 4 NULL
|
||
|
|
explain extended
|
||
|
|
select straight_join *
|
||
|
|
from t3 as x join t3 as y on x.c3 = y.c3
|
||
|
|
where y.b3 = 0;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 ALL c3,c3_2 NULL NULL NULL 7 100.00 Parent of 2 pushed join@1; Using where with pushed condition (`test`.`x`.`c3` is not null)
|
||
|
|
1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 ref b3,c3,c3_2 c3 9 test.x.c3,const 1 100.00 Child of 'x' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select straight_join `test`.`x`.`a3` AS `a3`,`test`.`x`.`b3` AS `b3`,`test`.`x`.`c3` AS `c3`,`test`.`x`.`d3` AS `d3`,`test`.`y`.`a3` AS `a3`,`test`.`y`.`b3` AS `b3`,`test`.`y`.`c3` AS `c3`,`test`.`y`.`d3` AS `d3` from `test`.`t3` `x` join `test`.`t3` `y` where ((`test`.`y`.`c3` = `test`.`x`.`c3`) and (`test`.`y`.`b3` = 0))
|
||
|
|
select straight_join *
|
||
|
|
from t3 as x join t3 as y on x.c3 = y.c3
|
||
|
|
where y.b3 = 0;
|
||
|
|
a3 b3 c3 d3 a3 b3 c3 d3
|
||
|
|
66 0 4 NULL 66 0 4 NULL
|
||
|
|
explain extended
|
||
|
|
select straight_join *
|
||
|
|
from t3 as x join t3 as y on x.c3 = y.c3
|
||
|
|
where y.b3 is null;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select straight_join `test`.`x`.`a3` AS `a3`,`test`.`x`.`b3` AS `b3`,`test`.`x`.`c3` AS `c3`,`test`.`x`.`d3` AS `d3`,`test`.`y`.`a3` AS `a3`,`test`.`y`.`b3` AS `b3`,`test`.`y`.`c3` AS `c3`,`test`.`y`.`d3` AS `d3` from `test`.`t3` `x` join `test`.`t3` `y` where 0
|
||
|
|
select straight_join *
|
||
|
|
from t3 as x join t3 as y on x.c3 = y.c3
|
||
|
|
where y.b3 is null;
|
||
|
|
a3 b3 c3 d3 a3 b3 c3 d3
|
||
|
|
explain extended
|
||
|
|
select straight_join * from
|
||
|
|
t3 as x1
|
||
|
|
join t3 as y1 on y1.b3 = x1.b3 and y1.d3 = x1.d3
|
||
|
|
join t3 as x2 on x2.b3 = y1.b3+0
|
||
|
|
join t3 as y2 on y2.b3 = x2.c3 and y2.d3 = x1.c3;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE x1 p0,p1,p2,p3,p4,p5,p6,p7 ALL b3,c3,c3_2 NULL NULL NULL 7 100.00 Parent of 2 pushed join@1; Using where with pushed condition ((`test`.`x1`.`d3` is not null) and (`test`.`x1`.`c3` is not null))
|
||
|
|
1 SIMPLE y1 p0,p1,p2,p3,p4,p5,p6,p7 ref b3 b3 9 test.x1.b3,test.x1.d3 1 100.00 Child of 'x1' in pushed join@1
|
||
|
|
1 SIMPLE x2 p0,p1,p2,p3,p4,p5,p6,p7 ref b3,c3,c3_2 b3 4 func 1 100.00 Parent of 2 pushed join@2; Using where with pushed condition (`test`.`x2`.`c3` is not null)
|
||
|
|
1 SIMPLE y2 p0,p1,p2,p3,p4,p5,p6,p7 ref b3 b3 9 test.x2.c3,test.x1.c3 1 100.00 Child of 'x2' in pushed join@2
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 Can't push table 'x2' as child, column 'b3' does neither 'ref' a column nor a constant
|
||
|
|
Note 1003 Can't push table 'y2' as child of 'x1', column 'x2.c3' is outside scope of pushable join
|
||
|
|
Note 1003 /* select#1 */ select straight_join `test`.`x1`.`a3` AS `a3`,`test`.`x1`.`b3` AS `b3`,`test`.`x1`.`c3` AS `c3`,`test`.`x1`.`d3` AS `d3`,`test`.`y1`.`a3` AS `a3`,`test`.`y1`.`b3` AS `b3`,`test`.`y1`.`c3` AS `c3`,`test`.`y1`.`d3` AS `d3`,`test`.`x2`.`a3` AS `a3`,`test`.`x2`.`b3` AS `b3`,`test`.`x2`.`c3` AS `c3`,`test`.`x2`.`d3` AS `d3`,`test`.`y2`.`a3` AS `a3`,`test`.`y2`.`b3` AS `b3`,`test`.`y2`.`c3` AS `c3`,`test`.`y2`.`d3` AS `d3` from `test`.`t3` `x1` join `test`.`t3` `y1` join `test`.`t3` `x2` join `test`.`t3` `y2` where ((`test`.`y1`.`d3` = `test`.`x1`.`d3`) and (`test`.`y1`.`b3` = `test`.`x1`.`b3`) and (`test`.`y2`.`d3` = `test`.`x1`.`c3`) and (`test`.`y2`.`b3` = `test`.`x2`.`c3`) and (`test`.`x2`.`b3` = (`test`.`x1`.`b3` + 0)))
|
||
|
|
select straight_join * from
|
||
|
|
t3 as x1
|
||
|
|
join t3 as y1 on y1.b3 = x1.b3 and y1.d3 = x1.d3
|
||
|
|
join t3 as x2 on x2.b3 = y1.b3+0
|
||
|
|
join t3 as y2 on y2.b3 = x2.c3 and y2.d3 = x1.c3;
|
||
|
|
a3 b3 c3 d3 a3 b3 c3 d3 a3 b3 c3 d3 a3 b3 c3 d3
|
||
|
|
prepare stmt1 from
|
||
|
|
'select straight_join *
|
||
|
|
from t3 as x join t3 as y on x.b3 = y.b3
|
||
|
|
where y.d3 = 0x2f';
|
||
|
|
execute stmt1;
|
||
|
|
a3 b3 c3 d3 a3 b3 c3 d3
|
||
|
|
47 63 2 47 47 63 2 47
|
||
|
|
execute stmt1;
|
||
|
|
a3 b3 c3 d3 a3 b3 c3 d3
|
||
|
|
47 63 2 47 47 63 2 47
|
||
|
|
drop prepare stmt1;
|
||
|
|
execute stmt1;
|
||
|
|
ERROR HY000: Unknown prepared statement handler (stmt1) given to EXECUTE
|
||
|
|
prepare stmt1 from
|
||
|
|
'select straight_join *
|
||
|
|
from t3 as x join t3 as y on x.b3 = y.b3
|
||
|
|
where y.d3 = 0x2f';
|
||
|
|
prepare stmt1 from
|
||
|
|
'select straight_join *
|
||
|
|
from t3 as x join t3 as y on x.b3 = y.b3
|
||
|
|
where y.d3 = 0x2f';
|
||
|
|
drop prepare stmt1;
|
||
|
|
prepare stmt1 from
|
||
|
|
'explain select straight_join *
|
||
|
|
from t3 as x join t3 as y on x.b3 = y.b3
|
||
|
|
where y.d3 = 0x2f';
|
||
|
|
execute stmt1;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 ALL b3 NULL NULL NULL 7 100.00 Parent of 2 pushed join@1
|
||
|
|
1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 ref b3 b3 9 test.x.b3,const 1 100.00 Child of 'x' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Note 1003 /* select#1 */ select straight_join `test`.`x`.`a3` AS `a3`,`test`.`x`.`b3` AS `b3`,`test`.`x`.`c3` AS `c3`,`test`.`x`.`d3` AS `d3`,`test`.`y`.`a3` AS `a3`,`test`.`y`.`b3` AS `b3`,`test`.`y`.`c3` AS `c3`,`test`.`y`.`d3` AS `d3` from `test`.`t3` `x` join `test`.`t3` `y` where ((`test`.`y`.`b3` = `test`.`x`.`b3`) and (`test`.`y`.`d3` = 0x2f))
|
||
|
|
execute stmt1;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 ALL b3 NULL NULL NULL 7 100.00 Parent of 2 pushed join@1
|
||
|
|
1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 ref b3 b3 9 test.x.b3,const 1 100.00 Child of 'x' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Note 1003 /* select#1 */ select straight_join `test`.`x`.`a3` AS `a3`,`test`.`x`.`b3` AS `b3`,`test`.`x`.`c3` AS `c3`,`test`.`x`.`d3` AS `d3`,`test`.`y`.`a3` AS `a3`,`test`.`y`.`b3` AS `b3`,`test`.`y`.`c3` AS `c3`,`test`.`y`.`d3` AS `d3` from `test`.`t3` `x` join `test`.`t3` `y` where ((`test`.`y`.`b3` = `test`.`x`.`b3`) and (`test`.`y`.`d3` = 0x2f))
|
||
|
|
commit;
|
||
|
|
execute stmt1;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 ALL b3 NULL NULL NULL 7 100.00 Parent of 2 pushed join@1
|
||
|
|
1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 ref b3 b3 9 test.x.b3,const 1 100.00 Child of 'x' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Note 1003 /* select#1 */ select straight_join `test`.`x`.`a3` AS `a3`,`test`.`x`.`b3` AS `b3`,`test`.`x`.`c3` AS `c3`,`test`.`x`.`d3` AS `d3`,`test`.`y`.`a3` AS `a3`,`test`.`y`.`b3` AS `b3`,`test`.`y`.`c3` AS `c3`,`test`.`y`.`d3` AS `d3` from `test`.`t3` `x` join `test`.`t3` `y` where ((`test`.`y`.`b3` = `test`.`x`.`b3`) and (`test`.`y`.`d3` = 0x2f))
|
||
|
|
drop index b3 on t3;
|
||
|
|
execute stmt1;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL # # NULL
|
||
|
|
1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL # # Using where with pushed condition (`test`.`y`.`d3` = 0x2f); Using join buffer (Block Nested Loop)
|
||
|
|
Warnings:
|
||
|
|
Note 1003 Can't push table 'y' as child, 'type' must be a 'ref' access
|
||
|
|
Note 1003 /* select#1 */ select straight_join `test`.`x`.`a3` AS `a3`,`test`.`x`.`b3` AS `b3`,`test`.`x`.`c3` AS `c3`,`test`.`x`.`d3` AS `d3`,`test`.`y`.`a3` AS `a3`,`test`.`y`.`b3` AS `b3`,`test`.`y`.`c3` AS `c3`,`test`.`y`.`d3` AS `d3` from `test`.`t3` `x` join `test`.`t3` `y` where ((`test`.`y`.`b3` = `test`.`x`.`b3`) and (`test`.`y`.`d3` = 0x2f))
|
||
|
|
create unique index b3 on t3(b3,d3);
|
||
|
|
execute stmt1;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 ALL b3 NULL NULL NULL 7 100.00 Parent of 2 pushed join@1
|
||
|
|
1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 ref b3 b3 9 test.x.b3,const 1 100.00 Child of 'x' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Note 1003 /* select#1 */ select straight_join `test`.`x`.`a3` AS `a3`,`test`.`x`.`b3` AS `b3`,`test`.`x`.`c3` AS `c3`,`test`.`x`.`d3` AS `d3`,`test`.`y`.`a3` AS `a3`,`test`.`y`.`b3` AS `b3`,`test`.`y`.`c3` AS `c3`,`test`.`y`.`d3` AS `d3` from `test`.`t3` `x` join `test`.`t3` `y` where ((`test`.`y`.`b3` = `test`.`x`.`b3`) and (`test`.`y`.`d3` = 0x2f))
|
||
|
|
drop prepare stmt1;
|
||
|
|
prepare stmt1 from
|
||
|
|
'explain select straight_join *
|
||
|
|
from t3 as x join t3 as y on x.b3 = y.b3
|
||
|
|
where y.d3 = ?';
|
||
|
|
set @a=47;
|
||
|
|
execute stmt1 using @a;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 ALL b3 NULL NULL NULL 7 100.00 Parent of 2 pushed join@1
|
||
|
|
1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 ref b3 b3 9 test.x.b3,const 1 100.00 Child of 'x' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Note 1003 /* select#1 */ select straight_join `test`.`x`.`a3` AS `a3`,`test`.`x`.`b3` AS `b3`,`test`.`x`.`c3` AS `c3`,`test`.`x`.`d3` AS `d3`,`test`.`y`.`a3` AS `a3`,`test`.`y`.`b3` AS `b3`,`test`.`y`.`c3` AS `c3`,`test`.`y`.`d3` AS `d3` from `test`.`t3` `x` join `test`.`t3` `y` where ((`test`.`y`.`b3` = `test`.`x`.`b3`) and (`test`.`y`.`d3` = 47))
|
||
|
|
set @a=0;
|
||
|
|
execute stmt1 using @a;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 ALL b3 NULL NULL NULL 7 100.00 Parent of 2 pushed join@1
|
||
|
|
1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 ref b3 b3 9 test.x.b3,const 1 100.00 Child of 'x' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Note 1003 /* select#1 */ select straight_join `test`.`x`.`a3` AS `a3`,`test`.`x`.`b3` AS `b3`,`test`.`x`.`c3` AS `c3`,`test`.`x`.`d3` AS `d3`,`test`.`y`.`a3` AS `a3`,`test`.`y`.`b3` AS `b3`,`test`.`y`.`c3` AS `c3`,`test`.`y`.`d3` AS `d3` from `test`.`t3` `x` join `test`.`t3` `y` where ((`test`.`y`.`b3` = `test`.`x`.`b3`) and (`test`.`y`.`d3` = 0))
|
||
|
|
set @a=null;
|
||
|
|
execute stmt1 using @a;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 ALL b3 NULL NULL NULL 7 100.00 NULL
|
||
|
|
1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 ref b3 b3 9 test.x.b3,const 1 100.00 Using where
|
||
|
|
Warnings:
|
||
|
|
Note 1003 /* select#1 */ select straight_join `test`.`x`.`a3` AS `a3`,`test`.`x`.`b3` AS `b3`,`test`.`x`.`c3` AS `c3`,`test`.`x`.`d3` AS `d3`,`test`.`y`.`a3` AS `a3`,`test`.`y`.`b3` AS `b3`,`test`.`y`.`c3` AS `c3`,`test`.`y`.`d3` AS `d3` from `test`.`t3` `x` join `test`.`t3` `y` where ((`test`.`y`.`b3` = `test`.`x`.`b3`) and (`test`.`y`.`d3` = NULL))
|
||
|
|
prepare stmt1 from
|
||
|
|
'select straight_join *
|
||
|
|
from t3 as x join t3 as y on x.b3 = y.b3
|
||
|
|
where y.d3 = ?';
|
||
|
|
set @a=47;
|
||
|
|
execute stmt1 using @a;
|
||
|
|
a3 b3 c3 d3 a3 b3 c3 d3
|
||
|
|
47 63 2 47 47 63 2 47
|
||
|
|
set @a=0;
|
||
|
|
execute stmt1 using @a;
|
||
|
|
a3 b3 c3 d3 a3 b3 c3 d3
|
||
|
|
set @a=null;
|
||
|
|
execute stmt1 using @a;
|
||
|
|
a3 b3 c3 d3 a3 b3 c3 d3
|
||
|
|
prepare stmt1 from
|
||
|
|
'explain select straight_join *
|
||
|
|
from t3 as x join t3 as y on x.b3 = y.b3 and x.d3 = y.d3
|
||
|
|
where x.a3 = ?';
|
||
|
|
set @a=47;
|
||
|
|
execute stmt1 using @a;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY,b3 PRIMARY 4 const 1 100.00 Parent of 2 pushed join@1; Using where with pushed condition (`test`.`x`.`d3` is not null)
|
||
|
|
1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 ref b3 b3 9 test.x.b3,test.x.d3 1 100.00 Child of 'x' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Note 1003 /* select#1 */ select straight_join `test`.`x`.`a3` AS `a3`,`test`.`x`.`b3` AS `b3`,`test`.`x`.`c3` AS `c3`,`test`.`x`.`d3` AS `d3`,`test`.`y`.`a3` AS `a3`,`test`.`y`.`b3` AS `b3`,`test`.`y`.`c3` AS `c3`,`test`.`y`.`d3` AS `d3` from `test`.`t3` `x` join `test`.`t3` `y` where ((`test`.`y`.`d3` = `test`.`x`.`d3`) and (`test`.`y`.`b3` = `test`.`x`.`b3`) and (`test`.`x`.`a3` = 47))
|
||
|
|
set @a=0;
|
||
|
|
execute stmt1 using @a;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY,b3 PRIMARY 4 const 1 100.00 Parent of 2 pushed join@1; Using where with pushed condition (`test`.`x`.`d3` is not null)
|
||
|
|
1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 ref b3 b3 9 test.x.b3,test.x.d3 1 100.00 Child of 'x' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Note 1003 /* select#1 */ select straight_join `test`.`x`.`a3` AS `a3`,`test`.`x`.`b3` AS `b3`,`test`.`x`.`c3` AS `c3`,`test`.`x`.`d3` AS `d3`,`test`.`y`.`a3` AS `a3`,`test`.`y`.`b3` AS `b3`,`test`.`y`.`c3` AS `c3`,`test`.`y`.`d3` AS `d3` from `test`.`t3` `x` join `test`.`t3` `y` where ((`test`.`y`.`d3` = `test`.`x`.`d3`) and (`test`.`y`.`b3` = `test`.`x`.`b3`) and (`test`.`x`.`a3` = 0))
|
||
|
|
set @a=null;
|
||
|
|
execute stmt1 using @a;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table
|
||
|
|
Warnings:
|
||
|
|
Note 1003 /* select#1 */ select straight_join `test`.`x`.`a3` AS `a3`,`test`.`x`.`b3` AS `b3`,`test`.`x`.`c3` AS `c3`,`test`.`x`.`d3` AS `d3`,`test`.`y`.`a3` AS `a3`,`test`.`y`.`b3` AS `b3`,`test`.`y`.`c3` AS `c3`,`test`.`y`.`d3` AS `d3` from `test`.`t3` `x` join `test`.`t3` `y` where ((`test`.`x`.`a3` = NULL) and multiple equal(`test`.`x`.`b3`, `test`.`y`.`b3`) and multiple equal(`test`.`x`.`d3`, `test`.`y`.`d3`))
|
||
|
|
prepare stmt1 from
|
||
|
|
'select straight_join *
|
||
|
|
from t3 as x join t3 as y on x.b3 = y.b3 and x.d3 = y.d3
|
||
|
|
where x.a3 = ?';
|
||
|
|
set @a=47;
|
||
|
|
execute stmt1 using @a;
|
||
|
|
a3 b3 c3 d3 a3 b3 c3 d3
|
||
|
|
47 63 2 47 47 63 2 47
|
||
|
|
set @a=0;
|
||
|
|
execute stmt1 using @a;
|
||
|
|
a3 b3 c3 d3 a3 b3 c3 d3
|
||
|
|
set @a=null;
|
||
|
|
execute stmt1 using @a;
|
||
|
|
a3 b3 c3 d3 a3 b3 c3 d3
|
||
|
|
drop table t3;
|
||
|
|
set @a=47;
|
||
|
|
execute stmt1 using @a;
|
||
|
|
ERROR 42S02: Table 'test.t3' doesn't exist
|
||
|
|
create table t1 (a int primary key, b int, c int, index(b,c)) engine = ndb;
|
||
|
|
insert into t1 values (1,null, 2);
|
||
|
|
insert into t1 values (2,1, null);
|
||
|
|
insert into t1 values (3,2,2);
|
||
|
|
insert into t1 values (4,null, 2);
|
||
|
|
insert into t1 values (5,1, null);
|
||
|
|
insert into t1 values (6,2,2);
|
||
|
|
set ndb_join_pushdown=false;
|
||
|
|
select *
|
||
|
|
from t1
|
||
|
|
join t1 as t2 on (t2.b = t1.b or t2.b = t1.a)
|
||
|
|
join t1 as t3 on t3.a = t2.a
|
||
|
|
join t1 as t4 on t4.a = t3.b /* index scan disguised as JT_ALL, pushdown=off */;
|
||
|
|
a b c a b c a b c a b c
|
||
|
|
1 NULL 2 2 1 NULL 2 1 NULL 1 NULL 2
|
||
|
|
1 NULL 2 5 1 NULL 5 1 NULL 1 NULL 2
|
||
|
|
2 1 NULL 2 1 NULL 2 1 NULL 1 NULL 2
|
||
|
|
2 1 NULL 3 2 2 3 2 2 2 1 NULL
|
||
|
|
2 1 NULL 5 1 NULL 5 1 NULL 1 NULL 2
|
||
|
|
2 1 NULL 6 2 2 6 2 2 2 1 NULL
|
||
|
|
3 2 2 3 2 2 3 2 2 2 1 NULL
|
||
|
|
3 2 2 6 2 2 6 2 2 2 1 NULL
|
||
|
|
5 1 NULL 2 1 NULL 2 1 NULL 1 NULL 2
|
||
|
|
5 1 NULL 5 1 NULL 5 1 NULL 1 NULL 2
|
||
|
|
6 2 2 3 2 2 3 2 2 2 1 NULL
|
||
|
|
6 2 2 6 2 2 6 2 2 2 1 NULL
|
||
|
|
set ndb_join_pushdown=true;
|
||
|
|
explain extended
|
||
|
|
select *
|
||
|
|
from t1
|
||
|
|
join t1 as t2 on (t2.b = t1.b or t2.b = t1.a)
|
||
|
|
join t1 as t3 on t3.a = t2.a
|
||
|
|
join t1 as t4 on t4.a = t3.b /* index scan disguised as JT_ALL, pushdown=on */;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL PRIMARY,b NULL NULL NULL 6 100.00 NULL
|
||
|
|
1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 ALL PRIMARY,b NULL NULL NULL 6 30.56 Range checked for each record (index map: 0x3)
|
||
|
|
1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY,b PRIMARY 4 test.t2.a 1 100.00 Parent of 2 pushed join@1; Using where with pushed condition (`test`.`t3`.`b` is not null)
|
||
|
|
1 SIMPLE t4 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.t3.b 1 100.00 Child of 't3' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 Table 't2' is not pushable: Access type was not chosen at 'prepare' time
|
||
|
|
Note 1003 Can't push table 't3' as child of 't1', column 't2.a' is outside scope of pushable join
|
||
|
|
Note 1003 Can't push table 't4' as child of 't1', column 't3.b' is outside scope of pushable join
|
||
|
|
Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t3`.`c` AS `c`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t4`.`c` AS `c` from `test`.`t1` join `test`.`t1` `t2` join `test`.`t1` `t3` join `test`.`t1` `t4` where ((`test`.`t3`.`a` = `test`.`t2`.`a`) and (`test`.`t4`.`a` = `test`.`t3`.`b`) and ((`test`.`t2`.`b` = `test`.`t1`.`b`) or (`test`.`t2`.`b` = `test`.`t1`.`a`)))
|
||
|
|
select *
|
||
|
|
from t1
|
||
|
|
join t1 as t2 on (t2.b = t1.b or t2.b = t1.a)
|
||
|
|
join t1 as t3 on t3.a = t2.a
|
||
|
|
join t1 as t4 on t4.a = t3.b /* index scan disguised as JT_ALL, pushdown=on */;
|
||
|
|
a b c a b c a b c a b c
|
||
|
|
1 NULL 2 2 1 NULL 2 1 NULL 1 NULL 2
|
||
|
|
1 NULL 2 5 1 NULL 5 1 NULL 1 NULL 2
|
||
|
|
2 1 NULL 2 1 NULL 2 1 NULL 1 NULL 2
|
||
|
|
2 1 NULL 3 2 2 3 2 2 2 1 NULL
|
||
|
|
2 1 NULL 5 1 NULL 5 1 NULL 1 NULL 2
|
||
|
|
2 1 NULL 6 2 2 6 2 2 2 1 NULL
|
||
|
|
3 2 2 3 2 2 3 2 2 2 1 NULL
|
||
|
|
3 2 2 6 2 2 6 2 2 2 1 NULL
|
||
|
|
5 1 NULL 2 1 NULL 2 1 NULL 1 NULL 2
|
||
|
|
5 1 NULL 5 1 NULL 5 1 NULL 1 NULL 2
|
||
|
|
6 2 2 3 2 2 3 2 2 2 1 NULL
|
||
|
|
6 2 2 6 2 2 6 2 2 2 1 NULL
|
||
|
|
explain extended
|
||
|
|
select *
|
||
|
|
from t1 where b in
|
||
|
|
(select x.a from t1 as x join t1 as y on (y.a = x.b))
|
||
|
|
xor c > 5;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 PRIMARY t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 6 100.00 Using where
|
||
|
|
2 DEPENDENT SUBQUERY x p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY,b PRIMARY 4 func 1 100.00 Parent of 2 pushed join@1; Using where with pushed condition (`test`.`x`.`b` is not null); Full scan on NULL key
|
||
|
|
2 DEPENDENT SUBQUERY y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.x.b 1 100.00 Child of 'x' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c` from `test`.`t1` where (<in_optimizer>(`test`.`t1`.`b`,<exists>(/* select#2 */ select 1 from `test`.`t1` `x` join `test`.`t1` `y` where ((`test`.`y`.`a` = `test`.`x`.`b`) and <if>(outer_field_is_not_null, (<cache>(`test`.`t1`.`b`) = `test`.`x`.`a`), true)))) xor (`test`.`t1`.`c` > 5))
|
||
|
|
select *
|
||
|
|
from t1 where b in
|
||
|
|
(select x.a from t1 as x join t1 as y on (y.a = x.b))
|
||
|
|
xor c > 5;
|
||
|
|
a b c
|
||
|
|
3 2 2
|
||
|
|
6 2 2
|
||
|
|
explain extended
|
||
|
|
select t1.a, (select straight_join x.a from t1 as x join t1 as y on x.a=y.b where y.a = t1.b) from t1;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 PRIMARY t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL # # NULL
|
||
|
|
2 DEPENDENT SUBQUERY x p0,p1,p2,p3,p4,p5,p6,p7 ALL PRIMARY NULL NULL NULL # # NULL
|
||
|
|
2 DEPENDENT SUBQUERY y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY,b PRIMARY 4 test.t1.b # # Using where
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1276 Field or reference 'test.t1.b' of SELECT #2 was resolved in SELECT #1
|
||
|
|
Note 1003 Can't push table 'y' as child of 'x', column 't1.b' is outside scope of pushable join
|
||
|
|
Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,(/* select#2 */ select straight_join `test`.`x`.`a` from `test`.`t1` `x` join `test`.`t1` `y` where ((`test`.`y`.`b` = `test`.`x`.`a`) and (`test`.`y`.`a` = `test`.`t1`.`b`))) AS `(select straight_join x.a from t1 as x join t1 as y on x.a=y.b where y.a = t1.b)` from `test`.`t1`
|
||
|
|
select t1.a, (select straight_join x.a from t1 as x join t1 as y on x.a=y.b where y.a = t1.b) from t1;
|
||
|
|
a (select straight_join x.a from t1 as x join t1 as y on x.a=y.b where y.a = t1.b)
|
||
|
|
1 NULL
|
||
|
|
2 NULL
|
||
|
|
3 1
|
||
|
|
4 NULL
|
||
|
|
5 NULL
|
||
|
|
6 1
|
||
|
|
drop table t1;
|
||
|
|
create table t1 (a int primary key, b int) engine = ndb;
|
||
|
|
create table t2 (a int primary key, b int) engine = myisam;
|
||
|
|
insert into t1 values(1,1), (2,2), (3,3), (4,4);
|
||
|
|
insert into t2 values(1,1), (2,2), (3,3), (4,4);
|
||
|
|
explain extended
|
||
|
|
select * from t1, t2, t1 as t3
|
||
|
|
where t2.a = t1.b
|
||
|
|
and t3.a = t2.b /* mixed engines */;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 4 100.00 Using where with pushed condition (`test`.`t1`.`b` is not null)
|
||
|
|
1 SIMPLE t2 NULL eq_ref PRIMARY PRIMARY 4 test.t1.b 1 100.00 Using where
|
||
|
|
1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.t2.b 1 100.00 NULL
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 Can't push table 't3' as child of 't1', column 't2.b' is outside scope of pushable join
|
||
|
|
Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b` from `test`.`t1` join `test`.`t2` join `test`.`t1` `t3` where ((`test`.`t3`.`a` = `test`.`t2`.`b`) and (`test`.`t2`.`a` = `test`.`t1`.`b`))
|
||
|
|
select * from t1, t2, t1 as t3
|
||
|
|
where t2.a = t1.b
|
||
|
|
and t3.a = t2.b /* mixed engines */;
|
||
|
|
a b a b a b
|
||
|
|
1 1 1 1 1 1
|
||
|
|
2 2 2 2 2 2
|
||
|
|
3 3 3 3 3 3
|
||
|
|
4 4 4 4 4 4
|
||
|
|
drop table t1, t2;
|
||
|
|
create table t1 (a int primary key, b int, c blob) engine = ndb;
|
||
|
|
create table t2 (a int primary key, b int) engine = ndb;
|
||
|
|
insert into t1 values (1,1, 'kalle');
|
||
|
|
insert into t1 values (2,1, 'kalle');
|
||
|
|
insert into t1 values (3,3, 'kalle');
|
||
|
|
insert into t1 values (4,1, 'kalle');
|
||
|
|
insert into t2 values (1,1);
|
||
|
|
insert into t2 values (2,1);
|
||
|
|
insert into t2 values (3,3);
|
||
|
|
insert into t2 values (4,1);
|
||
|
|
set ndb_join_pushdown=true;
|
||
|
|
explain extended
|
||
|
|
select t1.a, t1.b, t2.a, t2.b
|
||
|
|
from t1, t2
|
||
|
|
where t2.a = t1.b;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 4 100.00 Parent of 2 pushed join@1; Using where with pushed condition (`test`.`t1`.`b` is not null)
|
||
|
|
1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.t1.b 1 100.00 Child of 't1' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t1` join `test`.`t2` where (`test`.`t2`.`a` = `test`.`t1`.`b`)
|
||
|
|
select t1.a, t1.b, t2.a, t2.b
|
||
|
|
from t1, t2
|
||
|
|
where t2.a = t1.b;
|
||
|
|
a b a b
|
||
|
|
1 1 1 1
|
||
|
|
2 1 1 1
|
||
|
|
3 3 3 3
|
||
|
|
4 1 1 1
|
||
|
|
explain extended
|
||
|
|
select t1.a, t1.b, t2.a, t2.b
|
||
|
|
from t1, t2
|
||
|
|
where t2.a = t1.b
|
||
|
|
and t1.a = 2;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 const 1 100.00 Parent of 2 pushed join@1; Using where with pushed condition (`test`.`t1`.`b` is not null)
|
||
|
|
1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.t1.b 1 100.00 Child of 't1' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t1` join `test`.`t2` where ((`test`.`t1`.`a` = 2) and (`test`.`t2`.`a` = `test`.`t1`.`b`))
|
||
|
|
select t1.a, t1.b, t2.a, t2.b
|
||
|
|
from t1, t2
|
||
|
|
where t2.a = t1.b
|
||
|
|
and t1.a = 2;
|
||
|
|
a b a b
|
||
|
|
2 1 1 1
|
||
|
|
explain extended
|
||
|
|
select t1.a, t1.b, t2.a, t2.b
|
||
|
|
from t1, t2
|
||
|
|
where t1.a = t2.b;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 4 100.00 Parent of 2 pushed join@1; Using where with pushed condition (`test`.`t2`.`b` is not null)
|
||
|
|
1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.t2.b 1 100.00 Child of 't2' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t1` join `test`.`t2` where (`test`.`t1`.`a` = `test`.`t2`.`b`)
|
||
|
|
select t1.a, t1.b, t2.a, t2.b
|
||
|
|
from t1, t2
|
||
|
|
where t2.a = t1.b;
|
||
|
|
a b a b
|
||
|
|
1 1 1 1
|
||
|
|
2 1 1 1
|
||
|
|
3 3 3 3
|
||
|
|
4 1 1 1
|
||
|
|
explain extended
|
||
|
|
select t1.a, t1.b, t2.a, t2.b
|
||
|
|
from t1, t2
|
||
|
|
where t1.a = t2.b
|
||
|
|
and t2.a = 3;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 const 1 100.00 Parent of 2 pushed join@1; Using where with pushed condition (`test`.`t2`.`b` is not null)
|
||
|
|
1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.t2.b 1 100.00 Child of 't2' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t1` join `test`.`t2` where ((`test`.`t2`.`a` = 3) and (`test`.`t1`.`a` = `test`.`t2`.`b`))
|
||
|
|
select t1.a, t1.b, t2.a, t2.b
|
||
|
|
from t1, t2
|
||
|
|
where t1.a = t2.b
|
||
|
|
and t2.a = 3;
|
||
|
|
a b a b
|
||
|
|
3 3 3 3
|
||
|
|
explain extended
|
||
|
|
select *
|
||
|
|
from t1, t2
|
||
|
|
where t2.a = t1.b;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 4 100.00 Using where with pushed condition (`test`.`t1`.`b` is not null)
|
||
|
|
1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.t1.b 1 100.00 NULL
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 Table 't1' is not pushable: select list can't contain BLOB columns
|
||
|
|
Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t1` join `test`.`t2` where (`test`.`t2`.`a` = `test`.`t1`.`b`)
|
||
|
|
select *
|
||
|
|
from t1, t2
|
||
|
|
where t2.a = t1.b;
|
||
|
|
a b c a b
|
||
|
|
1 1 kalle 1 1
|
||
|
|
2 1 kalle 1 1
|
||
|
|
3 3 kalle 3 3
|
||
|
|
4 1 kalle 1 1
|
||
|
|
explain extended
|
||
|
|
select *
|
||
|
|
from t1, t2
|
||
|
|
where t2.a = t1.b
|
||
|
|
and t1.a = 2;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 const 1 100.00 Using where with pushed condition (`test`.`t1`.`b` is not null)
|
||
|
|
1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.t1.b 1 100.00 NULL
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 Table 't1' is not pushable: select list can't contain BLOB columns
|
||
|
|
Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t1` join `test`.`t2` where ((`test`.`t1`.`a` = 2) and (`test`.`t2`.`a` = `test`.`t1`.`b`))
|
||
|
|
select *
|
||
|
|
from t1, t2
|
||
|
|
where t2.a = t1.b
|
||
|
|
and t1.a = 2;
|
||
|
|
a b c a b
|
||
|
|
2 1 kalle 1 1
|
||
|
|
explain extended
|
||
|
|
select *
|
||
|
|
from t1, t2
|
||
|
|
where t1.a = t2.b;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 4 100.00 Using where with pushed condition (`test`.`t2`.`b` is not null)
|
||
|
|
1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.t2.b 1 100.00 NULL
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 Table 't1' is not pushable: select list can't contain BLOB columns
|
||
|
|
Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t1` join `test`.`t2` where (`test`.`t1`.`a` = `test`.`t2`.`b`)
|
||
|
|
select *
|
||
|
|
from t1, t2
|
||
|
|
where t2.a = t1.b;
|
||
|
|
a b c a b
|
||
|
|
1 1 kalle 1 1
|
||
|
|
2 1 kalle 1 1
|
||
|
|
3 3 kalle 3 3
|
||
|
|
4 1 kalle 1 1
|
||
|
|
explain extended
|
||
|
|
select *
|
||
|
|
from t1, t2
|
||
|
|
where t1.a = t2.b
|
||
|
|
and t2.a = 3;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 const 1 100.00 Using where with pushed condition (`test`.`t2`.`b` is not null)
|
||
|
|
1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.t2.b 1 100.00 NULL
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 Table 't1' is not pushable: select list can't contain BLOB columns
|
||
|
|
Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t1` join `test`.`t2` where ((`test`.`t2`.`a` = 3) and (`test`.`t1`.`a` = `test`.`t2`.`b`))
|
||
|
|
select *
|
||
|
|
from t1, t2
|
||
|
|
where t1.a = t2.b
|
||
|
|
and t2.a = 3;
|
||
|
|
a b c a b
|
||
|
|
3 3 kalle 3 3
|
||
|
|
drop table t1, t2;
|
||
|
|
create table t3 (a3 int, b3 tinyint, c3 int not null, d3 int not null,
|
||
|
|
primary key(a3,b3)) engine = ndb;
|
||
|
|
insert into t3 values (0x1f, 0x2f, 1, 0x1f);
|
||
|
|
insert into t3 values (0x2f, 0x3f, 2, 0x2f);
|
||
|
|
insert into t3 values (0x3f, 0x1f, 3, 0x3f);
|
||
|
|
explain extended
|
||
|
|
select * from t3 x, t3 y where x.a3=0x2f and y.a3=x.d3 and y.b3="63";
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 const 3 100.00 Parent of 2 pushed join@1
|
||
|
|
1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 5 test.x.d3,const 1 100.00 Child of 'x' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select `test`.`x`.`a3` AS `a3`,`test`.`x`.`b3` AS `b3`,`test`.`x`.`c3` AS `c3`,`test`.`x`.`d3` AS `d3`,`test`.`y`.`a3` AS `a3`,`test`.`y`.`b3` AS `b3`,`test`.`y`.`c3` AS `c3`,`test`.`y`.`d3` AS `d3` from `test`.`t3` `x` join `test`.`t3` `y` where ((`test`.`y`.`a3` = `test`.`x`.`d3`) and (`test`.`x`.`a3` = 0x2f) and (`test`.`y`.`b3` = '63'))
|
||
|
|
select * from t3 x, t3 y where x.a3=0x2f and y.a3=x.d3 and y.b3="63";
|
||
|
|
a3 b3 c3 d3 a3 b3 c3 d3
|
||
|
|
47 63 2 47 47 63 2 47
|
||
|
|
drop table t3;
|
||
|
|
create table t3 (a3 int, b3 tinyint unsigned, c3 int not null, d3 int not null,
|
||
|
|
primary key(a3,b3)) engine = ndb;
|
||
|
|
insert into t3 values (0x1f, 0x2f, 1, 0x1f);
|
||
|
|
insert into t3 values (0x2f, 0x3f, 2, 0x2f);
|
||
|
|
insert into t3 values (0x3f, 0x1f, 3, 0x3f);
|
||
|
|
explain extended
|
||
|
|
select * from t3 x, t3 y where x.a3=0x2f and y.a3=x.d3 and y.b3=(60+3);
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 const 3 100.00 Parent of 2 pushed join@1
|
||
|
|
1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 5 test.x.d3,const 1 100.00 Child of 'x' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select `test`.`x`.`a3` AS `a3`,`test`.`x`.`b3` AS `b3`,`test`.`x`.`c3` AS `c3`,`test`.`x`.`d3` AS `d3`,`test`.`y`.`a3` AS `a3`,`test`.`y`.`b3` AS `b3`,`test`.`y`.`c3` AS `c3`,`test`.`y`.`d3` AS `d3` from `test`.`t3` `x` join `test`.`t3` `y` where ((`test`.`y`.`b3` = (60 + 3)) and (`test`.`y`.`a3` = `test`.`x`.`d3`) and (`test`.`x`.`a3` = 0x2f))
|
||
|
|
select * from t3 x, t3 y where x.a3=0x2f and y.a3=x.d3 and y.b3=(60+3);
|
||
|
|
a3 b3 c3 d3 a3 b3 c3 d3
|
||
|
|
47 63 2 47 47 63 2 47
|
||
|
|
drop table t3;
|
||
|
|
create table t3 (a3 int, b3 smallint, c3 int not null, d3 int not null,
|
||
|
|
primary key(a3,b3)) engine = ndb;
|
||
|
|
insert into t3 values (0x1f, 0x2f, 1, 0x1f);
|
||
|
|
insert into t3 values (0x2f, 0x3f, 2, 0x2f);
|
||
|
|
insert into t3 values (0x3f, 0x1f, 3, 0x3f);
|
||
|
|
explain extended
|
||
|
|
select * from t3 x, t3 y where x.a3=0x2f and y.a3=x.d3 and y.b3=(60+3);
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 const 3 100.00 Parent of 2 pushed join@1
|
||
|
|
1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 6 test.x.d3,const 1 100.00 Child of 'x' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select `test`.`x`.`a3` AS `a3`,`test`.`x`.`b3` AS `b3`,`test`.`x`.`c3` AS `c3`,`test`.`x`.`d3` AS `d3`,`test`.`y`.`a3` AS `a3`,`test`.`y`.`b3` AS `b3`,`test`.`y`.`c3` AS `c3`,`test`.`y`.`d3` AS `d3` from `test`.`t3` `x` join `test`.`t3` `y` where ((`test`.`y`.`b3` = (60 + 3)) and (`test`.`y`.`a3` = `test`.`x`.`d3`) and (`test`.`x`.`a3` = 0x2f))
|
||
|
|
select * from t3 x, t3 y where x.a3=0x2f and y.a3=x.d3 and y.b3=(60+3);
|
||
|
|
a3 b3 c3 d3 a3 b3 c3 d3
|
||
|
|
47 63 2 47 47 63 2 47
|
||
|
|
drop table t3;
|
||
|
|
create table t3 (a3 int, b3 smallint unsigned, c3 int not null, d3 int not null,
|
||
|
|
primary key(a3,b3)) engine = ndb;
|
||
|
|
insert into t3 values (0x1f, 0x2f, 1, 0x1f);
|
||
|
|
insert into t3 values (0x2f, 0x3f, 2, 0x2f);
|
||
|
|
insert into t3 values (0x3f, 0x1f, 3, 0x3f);
|
||
|
|
explain extended
|
||
|
|
select * from t3 x, t3 y where x.a3=0x2f and y.a3=x.d3 and y.b3=(60+3);
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 const 3 100.00 Parent of 2 pushed join@1
|
||
|
|
1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 6 test.x.d3,const 1 100.00 Child of 'x' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select `test`.`x`.`a3` AS `a3`,`test`.`x`.`b3` AS `b3`,`test`.`x`.`c3` AS `c3`,`test`.`x`.`d3` AS `d3`,`test`.`y`.`a3` AS `a3`,`test`.`y`.`b3` AS `b3`,`test`.`y`.`c3` AS `c3`,`test`.`y`.`d3` AS `d3` from `test`.`t3` `x` join `test`.`t3` `y` where ((`test`.`y`.`b3` = (60 + 3)) and (`test`.`y`.`a3` = `test`.`x`.`d3`) and (`test`.`x`.`a3` = 0x2f))
|
||
|
|
select * from t3 x, t3 y where x.a3=0x2f and y.a3=x.d3 and y.b3=(60+3);
|
||
|
|
a3 b3 c3 d3 a3 b3 c3 d3
|
||
|
|
47 63 2 47 47 63 2 47
|
||
|
|
drop table t3;
|
||
|
|
create table t3 (a3 int, b3 mediumint, c3 int not null, d3 int not null,
|
||
|
|
primary key(a3,b3)) engine = ndb;
|
||
|
|
insert into t3 values (0x1f, 0x2f, 1, 0x1f);
|
||
|
|
insert into t3 values (0x2f, 0x3f, 2, 0x2f);
|
||
|
|
insert into t3 values (0x3f, 0x1f, 3, 0x3f);
|
||
|
|
explain extended
|
||
|
|
select * from t3 x, t3 y where x.a3=0x2f and y.a3=x.d3 and y.b3=(60+3);
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 const 3 100.00 Parent of 2 pushed join@1
|
||
|
|
1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 7 test.x.d3,const 1 100.00 Child of 'x' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select `test`.`x`.`a3` AS `a3`,`test`.`x`.`b3` AS `b3`,`test`.`x`.`c3` AS `c3`,`test`.`x`.`d3` AS `d3`,`test`.`y`.`a3` AS `a3`,`test`.`y`.`b3` AS `b3`,`test`.`y`.`c3` AS `c3`,`test`.`y`.`d3` AS `d3` from `test`.`t3` `x` join `test`.`t3` `y` where ((`test`.`y`.`b3` = (60 + 3)) and (`test`.`y`.`a3` = `test`.`x`.`d3`) and (`test`.`x`.`a3` = 0x2f))
|
||
|
|
select * from t3 x, t3 y where x.a3=0x2f and y.a3=x.d3 and y.b3=(60+3);
|
||
|
|
a3 b3 c3 d3 a3 b3 c3 d3
|
||
|
|
47 63 2 47 47 63 2 47
|
||
|
|
drop table t3;
|
||
|
|
create table t3 (a3 int, b3 mediumint unsigned, c3 int not null, d3 int not null,
|
||
|
|
primary key(a3,b3)) engine = ndb;
|
||
|
|
insert into t3 values (0x1f, 0x2f, 1, 0x1f);
|
||
|
|
insert into t3 values (0x2f, 0x3f, 2, 0x2f);
|
||
|
|
insert into t3 values (0x3f, 0x1f, 3, 0x3f);
|
||
|
|
explain extended
|
||
|
|
select * from t3 x, t3 y where x.a3=0x2f and y.a3=x.d3 and y.b3=(60+3);
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 const 3 100.00 Parent of 2 pushed join@1
|
||
|
|
1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 7 test.x.d3,const 1 100.00 Child of 'x' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select `test`.`x`.`a3` AS `a3`,`test`.`x`.`b3` AS `b3`,`test`.`x`.`c3` AS `c3`,`test`.`x`.`d3` AS `d3`,`test`.`y`.`a3` AS `a3`,`test`.`y`.`b3` AS `b3`,`test`.`y`.`c3` AS `c3`,`test`.`y`.`d3` AS `d3` from `test`.`t3` `x` join `test`.`t3` `y` where ((`test`.`y`.`b3` = (60 + 3)) and (`test`.`y`.`a3` = `test`.`x`.`d3`) and (`test`.`x`.`a3` = 0x2f))
|
||
|
|
select * from t3 x, t3 y where x.a3=0x2f and y.a3=x.d3 and y.b3=(60+3);
|
||
|
|
a3 b3 c3 d3 a3 b3 c3 d3
|
||
|
|
47 63 2 47 47 63 2 47
|
||
|
|
drop table t3;
|
||
|
|
create table t3 (a3 int, b3 int, c3 int not null, d3 int not null,
|
||
|
|
primary key(a3,b3)) engine = ndb;
|
||
|
|
insert into t3 values (0x1f, 0x2f, 1, 0x1f);
|
||
|
|
insert into t3 values (0x2f, 0x3f, 2, 0x2f);
|
||
|
|
insert into t3 values (0x3f, 0x1f, 3, 0x3f);
|
||
|
|
explain extended
|
||
|
|
select * from t3 x, t3 y where x.a3=0x2f and y.a3=x.d3 and y.b3=(60+3);
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 const 3 100.00 Parent of 2 pushed join@1
|
||
|
|
1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.x.d3,const 1 100.00 Child of 'x' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select `test`.`x`.`a3` AS `a3`,`test`.`x`.`b3` AS `b3`,`test`.`x`.`c3` AS `c3`,`test`.`x`.`d3` AS `d3`,`test`.`y`.`a3` AS `a3`,`test`.`y`.`b3` AS `b3`,`test`.`y`.`c3` AS `c3`,`test`.`y`.`d3` AS `d3` from `test`.`t3` `x` join `test`.`t3` `y` where ((`test`.`y`.`b3` = (60 + 3)) and (`test`.`y`.`a3` = `test`.`x`.`d3`) and (`test`.`x`.`a3` = 0x2f))
|
||
|
|
select * from t3 x, t3 y where x.a3=0x2f and y.a3=x.d3 and y.b3=(60+3);
|
||
|
|
a3 b3 c3 d3 a3 b3 c3 d3
|
||
|
|
47 63 2 47 47 63 2 47
|
||
|
|
drop table t3;
|
||
|
|
create table t3 (a3 int, b3 int unsigned, c3 int not null, d3 int not null,
|
||
|
|
primary key(a3,b3)) engine = ndb;
|
||
|
|
insert into t3 values (0x1f, 0x2f, 1, 0x1f);
|
||
|
|
insert into t3 values (0x2f, 0x3f, 2, 0x2f);
|
||
|
|
insert into t3 values (0x3f, 0x1f, 3, 0x3f);
|
||
|
|
explain extended
|
||
|
|
select * from t3 x, t3 y where x.a3=0x2f and y.a3=x.d3 and y.b3=(60+3);
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 const 3 100.00 Parent of 2 pushed join@1
|
||
|
|
1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.x.d3,const 1 100.00 Child of 'x' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select `test`.`x`.`a3` AS `a3`,`test`.`x`.`b3` AS `b3`,`test`.`x`.`c3` AS `c3`,`test`.`x`.`d3` AS `d3`,`test`.`y`.`a3` AS `a3`,`test`.`y`.`b3` AS `b3`,`test`.`y`.`c3` AS `c3`,`test`.`y`.`d3` AS `d3` from `test`.`t3` `x` join `test`.`t3` `y` where ((`test`.`y`.`b3` = (60 + 3)) and (`test`.`y`.`a3` = `test`.`x`.`d3`) and (`test`.`x`.`a3` = 0x2f))
|
||
|
|
select * from t3 x, t3 y where x.a3=0x2f and y.a3=x.d3 and y.b3=(60+3);
|
||
|
|
a3 b3 c3 d3 a3 b3 c3 d3
|
||
|
|
47 63 2 47 47 63 2 47
|
||
|
|
drop table t3;
|
||
|
|
create table t3 (a3 int, b3 bigint, c3 int not null, d3 int not null,
|
||
|
|
primary key(a3,b3)) engine = ndb;
|
||
|
|
insert into t3 values (0x1f, 0x2f, 1, 0x1f);
|
||
|
|
insert into t3 values (0x2f, 0x3f, 2, 0x2f);
|
||
|
|
insert into t3 values (0x3f, 0x1f, 3, 0x3f);
|
||
|
|
explain extended
|
||
|
|
select * from t3 x, t3 y where x.a3=0x2f and y.a3=x.d3 and y.b3=(60+3);
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 const 3 100.00 Parent of 2 pushed join@1
|
||
|
|
1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 12 test.x.d3,const 1 100.00 Child of 'x' in pushed join@1; Using where with pushed condition (`test`.`y`.`b3` = 63)
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select `test`.`x`.`a3` AS `a3`,`test`.`x`.`b3` AS `b3`,`test`.`x`.`c3` AS `c3`,`test`.`x`.`d3` AS `d3`,`test`.`y`.`a3` AS `a3`,`test`.`y`.`b3` AS `b3`,`test`.`y`.`c3` AS `c3`,`test`.`y`.`d3` AS `d3` from `test`.`t3` `x` join `test`.`t3` `y` where ((`test`.`y`.`b3` = 63) and (`test`.`y`.`a3` = `test`.`x`.`d3`) and (`test`.`x`.`a3` = 0x2f))
|
||
|
|
select * from t3 x, t3 y where x.a3=0x2f and y.a3=x.d3 and y.b3=(60+3);
|
||
|
|
a3 b3 c3 d3 a3 b3 c3 d3
|
||
|
|
47 63 2 47 47 63 2 47
|
||
|
|
drop table t3;
|
||
|
|
create table t3 (a3 int, b3 bigint unsigned, c3 int not null, d3 int not null,
|
||
|
|
primary key(a3,b3)) engine = ndb;
|
||
|
|
insert into t3 values (0x1f, 0x2f, 1, 0x1f);
|
||
|
|
insert into t3 values (0x2f, 0x3f, 2, 0x2f);
|
||
|
|
insert into t3 values (0x3f, 0x1f, 3, 0x3f);
|
||
|
|
explain extended
|
||
|
|
select * from t3 x, t3 y where x.a3=0x2f and y.a3=x.d3 and y.b3=(60+3);
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 const 3 100.00 Parent of 2 pushed join@1
|
||
|
|
1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 12 test.x.d3,const 1 100.00 Child of 'x' in pushed join@1; Using where with pushed condition (`test`.`y`.`b3` = 63)
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select `test`.`x`.`a3` AS `a3`,`test`.`x`.`b3` AS `b3`,`test`.`x`.`c3` AS `c3`,`test`.`x`.`d3` AS `d3`,`test`.`y`.`a3` AS `a3`,`test`.`y`.`b3` AS `b3`,`test`.`y`.`c3` AS `c3`,`test`.`y`.`d3` AS `d3` from `test`.`t3` `x` join `test`.`t3` `y` where ((`test`.`y`.`b3` = 63) and (`test`.`y`.`a3` = `test`.`x`.`d3`) and (`test`.`x`.`a3` = 0x2f))
|
||
|
|
select * from t3 x, t3 y where x.a3=0x2f and y.a3=x.d3 and y.b3=(60+3);
|
||
|
|
a3 b3 c3 d3 a3 b3 c3 d3
|
||
|
|
47 63 2 47 47 63 2 47
|
||
|
|
drop table t3;
|
||
|
|
create table t3 (a3 int, b3 boolean, c3 int not null, d3 int not null,
|
||
|
|
primary key(a3,b3)) engine = ndb;
|
||
|
|
insert into t3 values (0x1f, 0, 1, 0x1f);
|
||
|
|
insert into t3 values (0x2f, 1, 2, 0x2f);
|
||
|
|
insert into t3 values (0x3f, 0, 3, 0x3f);
|
||
|
|
explain extended
|
||
|
|
select * from t3 x, t3 y where x.a3=0x2f and y.a3=x.d3 and y.b3=1;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 const 3 100.00 Parent of 2 pushed join@1
|
||
|
|
1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 5 test.x.d3,const 1 100.00 Child of 'x' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select `test`.`x`.`a3` AS `a3`,`test`.`x`.`b3` AS `b3`,`test`.`x`.`c3` AS `c3`,`test`.`x`.`d3` AS `d3`,`test`.`y`.`a3` AS `a3`,`test`.`y`.`b3` AS `b3`,`test`.`y`.`c3` AS `c3`,`test`.`y`.`d3` AS `d3` from `test`.`t3` `x` join `test`.`t3` `y` where ((`test`.`y`.`b3` = 1) and (`test`.`y`.`a3` = `test`.`x`.`d3`) and (`test`.`x`.`a3` = 0x2f))
|
||
|
|
select * from t3 x, t3 y where x.a3=0x2f and y.a3=x.d3 and y.b3=1;
|
||
|
|
a3 b3 c3 d3 a3 b3 c3 d3
|
||
|
|
47 1 2 47 47 1 2 47
|
||
|
|
drop table t3;
|
||
|
|
create table t3 (a3 int, b3 float, c3 int not null, d3 int not null,
|
||
|
|
primary key(a3,b3)) engine = ndb;
|
||
|
|
insert into t3 values (0x1f, 2.71, 1, 0x1f);
|
||
|
|
insert into t3 values (0x2f, 3.00, 2, 0x2f);
|
||
|
|
insert into t3 values (0x3f, 0.50, 3, 0x3f);
|
||
|
|
explain extended
|
||
|
|
select * from t3 x, t3 y where x.a3=0x2f and y.a3=x.d3 and y.b3=3.0;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 const 3 100.00 Parent of 2 pushed join@1
|
||
|
|
1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.x.d3,const 1 100.00 Child of 'x' in pushed join@1; Using where with pushed condition (`test`.`y`.`b3` = 3.0)
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select `test`.`x`.`a3` AS `a3`,`test`.`x`.`b3` AS `b3`,`test`.`x`.`c3` AS `c3`,`test`.`x`.`d3` AS `d3`,`test`.`y`.`a3` AS `a3`,`test`.`y`.`b3` AS `b3`,`test`.`y`.`c3` AS `c3`,`test`.`y`.`d3` AS `d3` from `test`.`t3` `x` join `test`.`t3` `y` where ((`test`.`y`.`a3` = `test`.`x`.`d3`) and (`test`.`x`.`a3` = 0x2f) and (`test`.`y`.`b3` = 3.0))
|
||
|
|
select * from t3 x, t3 y where x.a3=0x2f and y.a3=x.d3 and y.b3=3.0;
|
||
|
|
a3 b3 c3 d3 a3 b3 c3 d3
|
||
|
|
47 3 2 47 47 3 2 47
|
||
|
|
drop table t3;
|
||
|
|
create table t3 (a3 int, b3 float unsigned, c3 int not null, d3 int not null,
|
||
|
|
primary key(a3,b3)) engine = ndb;
|
||
|
|
insert into t3 values (0x1f, 2.71, 1, 0x1f);
|
||
|
|
insert into t3 values (0x2f, 3.00, 2, 0x2f);
|
||
|
|
insert into t3 values (0x3f, 0.50, 3, 0x3f);
|
||
|
|
explain extended
|
||
|
|
select * from t3 x, t3 y where x.a3=0x2f and y.a3=x.d3 and y.b3=3.0;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 const 3 100.00 Parent of 2 pushed join@1
|
||
|
|
1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.x.d3,const 1 100.00 Child of 'x' in pushed join@1; Using where with pushed condition (`test`.`y`.`b3` = 3.0)
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select `test`.`x`.`a3` AS `a3`,`test`.`x`.`b3` AS `b3`,`test`.`x`.`c3` AS `c3`,`test`.`x`.`d3` AS `d3`,`test`.`y`.`a3` AS `a3`,`test`.`y`.`b3` AS `b3`,`test`.`y`.`c3` AS `c3`,`test`.`y`.`d3` AS `d3` from `test`.`t3` `x` join `test`.`t3` `y` where ((`test`.`y`.`a3` = `test`.`x`.`d3`) and (`test`.`x`.`a3` = 0x2f) and (`test`.`y`.`b3` = 3.0))
|
||
|
|
select * from t3 x, t3 y where x.a3=0x2f and y.a3=x.d3 and y.b3=3.0;
|
||
|
|
a3 b3 c3 d3 a3 b3 c3 d3
|
||
|
|
47 3 2 47 47 3 2 47
|
||
|
|
drop table t3;
|
||
|
|
create table t3 (a3 int, b3 double, c3 int not null, d3 int not null,
|
||
|
|
primary key(a3,b3)) engine = ndb;
|
||
|
|
insert into t3 values (0x1f, 2.71, 1, 0x1f);
|
||
|
|
insert into t3 values (0x2f, 3.14, 2, 0x2f);
|
||
|
|
insert into t3 values (0x3f, 0.50, 3, 0x3f);
|
||
|
|
explain extended
|
||
|
|
select * from t3 x, t3 y where x.a3=0x2f and y.a3=x.d3 and y.b3=3.14;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 const 3 100.00 Parent of 2 pushed join@1
|
||
|
|
1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 12 test.x.d3,const 1 100.00 Child of 'x' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select `test`.`x`.`a3` AS `a3`,`test`.`x`.`b3` AS `b3`,`test`.`x`.`c3` AS `c3`,`test`.`x`.`d3` AS `d3`,`test`.`y`.`a3` AS `a3`,`test`.`y`.`b3` AS `b3`,`test`.`y`.`c3` AS `c3`,`test`.`y`.`d3` AS `d3` from `test`.`t3` `x` join `test`.`t3` `y` where ((`test`.`y`.`a3` = `test`.`x`.`d3`) and (`test`.`x`.`a3` = 0x2f) and (`test`.`y`.`b3` = 3.14))
|
||
|
|
select * from t3 x, t3 y where x.a3=0x2f and y.a3=x.d3 and y.b3=3.14;
|
||
|
|
a3 b3 c3 d3 a3 b3 c3 d3
|
||
|
|
47 3.14 2 47 47 3.14 2 47
|
||
|
|
drop table t3;
|
||
|
|
create table t3 (a3 int, b3 double unsigned, c3 int not null, d3 int not null,
|
||
|
|
primary key(a3,b3)) engine = ndb;
|
||
|
|
insert into t3 values (0x1f, 2.71, 1, 0x1f);
|
||
|
|
insert into t3 values (0x2f, 3.14, 2, 0x2f);
|
||
|
|
insert into t3 values (0x3f, 0.50, 3, 0x3f);
|
||
|
|
explain extended
|
||
|
|
select * from t3 x, t3 y where x.a3=0x2f and y.a3=x.d3 and y.b3=3.14;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 const 3 100.00 Parent of 2 pushed join@1
|
||
|
|
1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 12 test.x.d3,const 1 100.00 Child of 'x' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select `test`.`x`.`a3` AS `a3`,`test`.`x`.`b3` AS `b3`,`test`.`x`.`c3` AS `c3`,`test`.`x`.`d3` AS `d3`,`test`.`y`.`a3` AS `a3`,`test`.`y`.`b3` AS `b3`,`test`.`y`.`c3` AS `c3`,`test`.`y`.`d3` AS `d3` from `test`.`t3` `x` join `test`.`t3` `y` where ((`test`.`y`.`a3` = `test`.`x`.`d3`) and (`test`.`x`.`a3` = 0x2f) and (`test`.`y`.`b3` = 3.14))
|
||
|
|
select * from t3 x, t3 y where x.a3=0x2f and y.a3=x.d3 and y.b3=3.14;
|
||
|
|
a3 b3 c3 d3 a3 b3 c3 d3
|
||
|
|
47 3.14 2 47 47 3.14 2 47
|
||
|
|
drop table t3;
|
||
|
|
create table t3 (a3 int, b3 decimal, c3 int not null, d3 int not null,
|
||
|
|
primary key(a3,b3)) engine = ndb;
|
||
|
|
insert into t3 values (0x1f, 0x2f, 1, 0x1f);
|
||
|
|
insert into t3 values (0x2f, 0x3f, 2, 0x2f);
|
||
|
|
insert into t3 values (0x3f, 0x1f, 3, 0x3f);
|
||
|
|
explain extended
|
||
|
|
select * from t3 x, t3 y where x.a3=0x2f and y.a3=x.d3 and y.b3=63;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 const 3 100.00 Parent of 2 pushed join@1
|
||
|
|
1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 9 test.x.d3,const 1 100.00 Child of 'x' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select `test`.`x`.`a3` AS `a3`,`test`.`x`.`b3` AS `b3`,`test`.`x`.`c3` AS `c3`,`test`.`x`.`d3` AS `d3`,`test`.`y`.`a3` AS `a3`,`test`.`y`.`b3` AS `b3`,`test`.`y`.`c3` AS `c3`,`test`.`y`.`d3` AS `d3` from `test`.`t3` `x` join `test`.`t3` `y` where ((`test`.`y`.`a3` = `test`.`x`.`d3`) and (`test`.`x`.`a3` = 0x2f) and (`test`.`y`.`b3` = 63))
|
||
|
|
select * from t3 x, t3 y where x.a3=0x2f and y.a3=x.d3 and y.b3=63;
|
||
|
|
a3 b3 c3 d3 a3 b3 c3 d3
|
||
|
|
47 63 2 47 47 63 2 47
|
||
|
|
drop table t3;
|
||
|
|
create table t3 (a3 int, b3 decimal(12,4), c3 int not null, d3 int not null,
|
||
|
|
primary key(a3,b3)) engine = ndb;
|
||
|
|
insert into t3 values (0x1f, 2.71, 1, 0x1f);
|
||
|
|
insert into t3 values (0x2f, 3.14, 2, 0x2f);
|
||
|
|
insert into t3 values (0x3f, 0.50, 3, 0x3f);
|
||
|
|
explain extended
|
||
|
|
select * from t3 x, t3 y where x.a3=0x2f and y.a3=x.d3 and y.b3=3.14;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 const 3 100.00 Parent of 2 pushed join@1
|
||
|
|
1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 10 test.x.d3,const 1 100.00 Child of 'x' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select `test`.`x`.`a3` AS `a3`,`test`.`x`.`b3` AS `b3`,`test`.`x`.`c3` AS `c3`,`test`.`x`.`d3` AS `d3`,`test`.`y`.`a3` AS `a3`,`test`.`y`.`b3` AS `b3`,`test`.`y`.`c3` AS `c3`,`test`.`y`.`d3` AS `d3` from `test`.`t3` `x` join `test`.`t3` `y` where ((`test`.`y`.`b3` = 3.14) and (`test`.`y`.`a3` = `test`.`x`.`d3`) and (`test`.`x`.`a3` = 0x2f))
|
||
|
|
select * from t3 x, t3 y where x.a3=0x2f and y.a3=x.d3 and y.b3=3.14;
|
||
|
|
a3 b3 c3 d3 a3 b3 c3 d3
|
||
|
|
47 3.1400 2 47 47 3.1400 2 47
|
||
|
|
drop table t3;
|
||
|
|
create table t3 (a3 int, b3 date, c3 int not null, d3 int not null,
|
||
|
|
primary key(a3,b3)) engine = ndb;
|
||
|
|
insert into t3 values (0x1f, '1905-05-17', 1, 0x1f);
|
||
|
|
insert into t3 values (0x2f, '2000-02-28', 2, 0x2f);
|
||
|
|
insert into t3 values (0x3f, '2000-02-29', 3, 0x3f);
|
||
|
|
explain extended
|
||
|
|
select * from t3 x, t3 y where x.a3=0x2f and y.a3=x.d3 and y.b3='2000-02-28';
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 const 3 100.00 Parent of 2 pushed join@1
|
||
|
|
1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 7 test.x.d3,const 1 100.00 Child of 'x' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select `test`.`x`.`a3` AS `a3`,`test`.`x`.`b3` AS `b3`,`test`.`x`.`c3` AS `c3`,`test`.`x`.`d3` AS `d3`,`test`.`y`.`a3` AS `a3`,`test`.`y`.`b3` AS `b3`,`test`.`y`.`c3` AS `c3`,`test`.`y`.`d3` AS `d3` from `test`.`t3` `x` join `test`.`t3` `y` where ((`test`.`y`.`b3` = '2000-02-28') and (`test`.`y`.`a3` = `test`.`x`.`d3`) and (`test`.`x`.`a3` = 0x2f))
|
||
|
|
select * from t3 x, t3 y where x.a3=0x2f and y.a3=x.d3 and y.b3='2000-02-28';
|
||
|
|
a3 b3 c3 d3 a3 b3 c3 d3
|
||
|
|
47 2000-02-28 2 47 47 2000-02-28 2 47
|
||
|
|
drop table t3;
|
||
|
|
create table t3 (a3 int, b3 char(16), c3 int not null, d3 int not null,
|
||
|
|
primary key(a3,b3)) engine = ndb;
|
||
|
|
insert into t3 values (0x1f, 'Ole', 1, 0x1f);
|
||
|
|
insert into t3 values (0x2f, 'Dole', 2, 0x2f);
|
||
|
|
insert into t3 values (0x3f, 'Doffen', 2, 0x3f);
|
||
|
|
explain extended
|
||
|
|
select * from t3 x, t3 y where x.a3=0x2f and y.a3=x.d3 and y.b3='Dole';
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 const 3 100.00 Parent of 2 pushed join@1
|
||
|
|
1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 20 test.x.d3,const 1 100.00 Child of 'x' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select `test`.`x`.`a3` AS `a3`,`test`.`x`.`b3` AS `b3`,`test`.`x`.`c3` AS `c3`,`test`.`x`.`d3` AS `d3`,`test`.`y`.`a3` AS `a3`,`test`.`y`.`b3` AS `b3`,`test`.`y`.`c3` AS `c3`,`test`.`y`.`d3` AS `d3` from `test`.`t3` `x` join `test`.`t3` `y` where ((`test`.`y`.`b3` = 'Dole') and (`test`.`y`.`a3` = `test`.`x`.`d3`) and (`test`.`x`.`a3` = 0x2f))
|
||
|
|
select * from t3 x, t3 y where x.a3=0x2f and y.a3=x.d3 and y.b3='Dole';
|
||
|
|
a3 b3 c3 d3 a3 b3 c3 d3
|
||
|
|
47 Dole 2 47 47 Dole 2 47
|
||
|
|
drop table t3;
|
||
|
|
create table t3 (a3 int, b3 varchar(16), c3 int not null, d3 int not null,
|
||
|
|
primary key(a3,b3)) engine = ndb;
|
||
|
|
insert into t3 values (0x1f, 'Ole', 1, 0x1f);
|
||
|
|
insert into t3 values (0x2f, 'Dole', 2, 0x2f);
|
||
|
|
insert into t3 values (0x3f, 'Doffen', 2, 0x3f);
|
||
|
|
explain extended
|
||
|
|
select * from t3 x, t3 y where x.a3=0x2f and y.a3=x.d3 and y.b3='Dole';
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 const 3 100.00 Parent of 2 pushed join@1
|
||
|
|
1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 22 test.x.d3,const 1 100.00 Child of 'x' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select `test`.`x`.`a3` AS `a3`,`test`.`x`.`b3` AS `b3`,`test`.`x`.`c3` AS `c3`,`test`.`x`.`d3` AS `d3`,`test`.`y`.`a3` AS `a3`,`test`.`y`.`b3` AS `b3`,`test`.`y`.`c3` AS `c3`,`test`.`y`.`d3` AS `d3` from `test`.`t3` `x` join `test`.`t3` `y` where ((`test`.`y`.`b3` = 'Dole') and (`test`.`y`.`a3` = `test`.`x`.`d3`) and (`test`.`x`.`a3` = 0x2f))
|
||
|
|
select * from t3 x, t3 y where x.a3=0x2f and y.a3=x.d3 and y.b3='Dole';
|
||
|
|
a3 b3 c3 d3 a3 b3 c3 d3
|
||
|
|
47 Dole 2 47 47 Dole 2 47
|
||
|
|
drop table t3;
|
||
|
|
create table t3 (a3 int, b3 varchar(512), c3 int not null, d3 int not null,
|
||
|
|
primary key(a3,b3)) engine = ndb;
|
||
|
|
insert into t3 values (0x1f, 'Ole', 1, 0x1f);
|
||
|
|
insert into t3 values (0x2f, 'Dole', 2, 0x2f);
|
||
|
|
insert into t3 values (0x3f, 'Doffen', 2, 0x3f);
|
||
|
|
explain extended
|
||
|
|
select * from t3 x, t3 y where x.a3=0x2f and y.a3=x.d3 and y.b3='Dole';
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 const 3 100.00 Parent of 2 pushed join@1
|
||
|
|
1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 518 test.x.d3,const 1 100.00 Child of 'x' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select `test`.`x`.`a3` AS `a3`,`test`.`x`.`b3` AS `b3`,`test`.`x`.`c3` AS `c3`,`test`.`x`.`d3` AS `d3`,`test`.`y`.`a3` AS `a3`,`test`.`y`.`b3` AS `b3`,`test`.`y`.`c3` AS `c3`,`test`.`y`.`d3` AS `d3` from `test`.`t3` `x` join `test`.`t3` `y` where ((`test`.`y`.`b3` = 'Dole') and (`test`.`y`.`a3` = `test`.`x`.`d3`) and (`test`.`x`.`a3` = 0x2f))
|
||
|
|
select * from t3 x, t3 y where x.a3=0x2f and y.a3=x.d3 and y.b3='Dole';
|
||
|
|
a3 b3 c3 d3 a3 b3 c3 d3
|
||
|
|
47 Dole 2 47 47 Dole 2 47
|
||
|
|
drop table t3;
|
||
|
|
create table t3 (a3 int, b3 binary(16), c3 int not null, d3 int not null,
|
||
|
|
primary key(a3,b3)) engine = ndb;
|
||
|
|
insert into t3 values (0x1f, 'Ole', 1, 0x1f);
|
||
|
|
insert into t3 values (0x2f, 'Dole', 2, 0x2f);
|
||
|
|
insert into t3 values (0x3f, 'Doffen', 2, 0x3f);
|
||
|
|
explain extended
|
||
|
|
select * from t3 x, t3 y where x.a3=0x2f and y.a3=x.d3 and y.b3='Dole';
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 const 3 100.00 Parent of 2 pushed join@1
|
||
|
|
1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 20 test.x.d3,const 1 100.00 Child of 'x' in pushed join@1; Using where
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select `test`.`x`.`a3` AS `a3`,`test`.`x`.`b3` AS `b3`,`test`.`x`.`c3` AS `c3`,`test`.`x`.`d3` AS `d3`,`test`.`y`.`a3` AS `a3`,`test`.`y`.`b3` AS `b3`,`test`.`y`.`c3` AS `c3`,`test`.`y`.`d3` AS `d3` from `test`.`t3` `x` join `test`.`t3` `y` where ((`test`.`y`.`b3` = 'Dole') and (`test`.`y`.`a3` = `test`.`x`.`d3`) and (`test`.`x`.`a3` = 0x2f))
|
||
|
|
select * from t3 x, t3 y where x.a3=0x2f and y.a3=x.d3 and y.b3='Dole';
|
||
|
|
a3 b3 c3 d3 a3 b3 c3 d3
|
||
|
|
drop table t3;
|
||
|
|
create table t3 (a3 int, b3 varbinary(16), c3 int not null, d3 int not null,
|
||
|
|
primary key(a3,b3)) engine = ndb;
|
||
|
|
insert into t3 values (0x1f, 'Ole', 1, 0x1f);
|
||
|
|
insert into t3 values (0x2f, 'Dole', 2, 0x2f);
|
||
|
|
insert into t3 values (0x3f, 'Doffen', 2, 0x3f);
|
||
|
|
explain extended
|
||
|
|
select * from t3 x, t3 y where x.a3=0x2f and y.a3=x.d3 and y.b3='Dole';
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 const 3 100.00 Parent of 2 pushed join@1
|
||
|
|
1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 22 test.x.d3,const 1 100.00 Child of 'x' in pushed join@1; Using where
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select `test`.`x`.`a3` AS `a3`,`test`.`x`.`b3` AS `b3`,`test`.`x`.`c3` AS `c3`,`test`.`x`.`d3` AS `d3`,`test`.`y`.`a3` AS `a3`,`test`.`y`.`b3` AS `b3`,`test`.`y`.`c3` AS `c3`,`test`.`y`.`d3` AS `d3` from `test`.`t3` `x` join `test`.`t3` `y` where ((`test`.`y`.`b3` = 'Dole') and (`test`.`y`.`a3` = `test`.`x`.`d3`) and (`test`.`x`.`a3` = 0x2f))
|
||
|
|
select * from t3 x, t3 y where x.a3=0x2f and y.a3=x.d3 and y.b3='Dole';
|
||
|
|
a3 b3 c3 d3 a3 b3 c3 d3
|
||
|
|
47 Dole 2 47 47 Dole 2 47
|
||
|
|
drop table t3;
|
||
|
|
create table t3 (a3 int, b3 tinyint, c3 int not null, d3 int not null,
|
||
|
|
primary key(a3,b3)) engine = ndb;
|
||
|
|
insert into t3 values (0x1f, 0x2f, 1, 0x1f);
|
||
|
|
insert into t3 values (0x2f, 0x3f, 2, 0x2f);
|
||
|
|
insert into t3 values (0x3f, 0x1f, 3, 0x3f);
|
||
|
|
explain extended
|
||
|
|
select * from t3 x, t3 y where y.a3=x.b3 and y.b3="63";
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 3 100.00 NULL
|
||
|
|
1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 5 test.x.b3,const 1 100.00 Using where
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 Can't push table 'y' as child, column 'a3' does not have same datatype as ref'ed column 'x.b3'
|
||
|
|
Note 1003 /* select#1 */ select `test`.`x`.`a3` AS `a3`,`test`.`x`.`b3` AS `b3`,`test`.`x`.`c3` AS `c3`,`test`.`x`.`d3` AS `d3`,`test`.`y`.`a3` AS `a3`,`test`.`y`.`b3` AS `b3`,`test`.`y`.`c3` AS `c3`,`test`.`y`.`d3` AS `d3` from `test`.`t3` `x` join `test`.`t3` `y` where ((`test`.`y`.`a3` = `test`.`x`.`b3`) and (`test`.`y`.`b3` = '63'))
|
||
|
|
select * from t3 x, t3 y where y.a3=x.b3 and y.b3="63";
|
||
|
|
a3 b3 c3 d3 a3 b3 c3 d3
|
||
|
|
31 47 1 31 47 63 2 47
|
||
|
|
drop table t3;
|
||
|
|
create table t3 (a3 varchar(16), b3 int, c3 int not null, d3 int not null,
|
||
|
|
primary key(a3,b3)) engine = ndb;
|
||
|
|
insert into t3 values ('Ole', 0x1f, 1, 0x1f);
|
||
|
|
insert into t3 values ('Dole', 0x2f, 2, 0x2f);
|
||
|
|
insert into t3 values ('Doffen', 0x3f, 2, 0x3f);
|
||
|
|
explain extended
|
||
|
|
select * from t3 x, t3 y where x.a3='Dole' and x.b3=0x2f and y.a3=x.a3 and y.b3=x.d3;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 22 const,const 1 100.00 Parent of 2 pushed join@1
|
||
|
|
1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 22 const,test.x.d3 1 100.00 Child of 'x' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select `test`.`x`.`a3` AS `a3`,`test`.`x`.`b3` AS `b3`,`test`.`x`.`c3` AS `c3`,`test`.`x`.`d3` AS `d3`,`test`.`y`.`a3` AS `a3`,`test`.`y`.`b3` AS `b3`,`test`.`y`.`c3` AS `c3`,`test`.`y`.`d3` AS `d3` from `test`.`t3` `x` join `test`.`t3` `y` where ((`test`.`y`.`b3` = `test`.`x`.`d3`) and (`test`.`x`.`a3` = 'Dole') and (`test`.`y`.`a3` = 'Dole') and (`test`.`x`.`b3` = 0x2f))
|
||
|
|
select * from t3 x, t3 y where x.a3='Dole' and x.b3=0x2f and y.a3=x.a3 and y.b3=x.d3;
|
||
|
|
a3 b3 c3 d3 a3 b3 c3 d3
|
||
|
|
Dole 47 2 47 Dole 47 2 47
|
||
|
|
explain extended
|
||
|
|
select * from t3 x, t3 y where x.a3='Dole' and y.a3=x.a3 and y.b3=x.d3;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 18 const 3 100.00 Parent of 2 pushed join@1
|
||
|
|
1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 22 const,test.x.d3 1 100.00 Child of 'x' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select `test`.`x`.`a3` AS `a3`,`test`.`x`.`b3` AS `b3`,`test`.`x`.`c3` AS `c3`,`test`.`x`.`d3` AS `d3`,`test`.`y`.`a3` AS `a3`,`test`.`y`.`b3` AS `b3`,`test`.`y`.`c3` AS `c3`,`test`.`y`.`d3` AS `d3` from `test`.`t3` `x` join `test`.`t3` `y` where ((`test`.`y`.`b3` = `test`.`x`.`d3`) and (`test`.`x`.`a3` = 'Dole') and (`test`.`y`.`a3` = 'Dole'))
|
||
|
|
select * from t3 x, t3 y where x.a3='Dole' and y.a3=x.a3 and y.b3=x.d3;
|
||
|
|
a3 b3 c3 d3 a3 b3 c3 d3
|
||
|
|
Dole 47 2 47 Dole 47 2 47
|
||
|
|
drop table t3;
|
||
|
|
create table t1 (k int primary key, b int) engine = ndb;
|
||
|
|
insert into t1 values (1,1), (2,1), (3,1), (4,1);
|
||
|
|
explain extended
|
||
|
|
select *
|
||
|
|
from t1
|
||
|
|
straight_join t1 as t2 on t2.k = t1.b+0
|
||
|
|
straight_join t1 as t3 on t3.k = t2.b
|
||
|
|
straight_join t1 as t4 on t4.k = t1.b;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 4 100.00 Parent of 2 pushed join@1; Using where with pushed condition (`test`.`t1`.`b` is not null)
|
||
|
|
1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 func 1 100.00 Parent of 2 pushed join@2; Using where with pushed condition (`test`.`t2`.`b` is not null)
|
||
|
|
1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.t2.b 1 100.00 Child of 't2' in pushed join@2
|
||
|
|
1 SIMPLE t4 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.t1.b 1 100.00 Child of 't1' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 Can't push table 't2' as child, column 'k' does neither 'ref' a column nor a constant
|
||
|
|
Note 1003 Can't push table 't3' as child of 't1', column 't2.b' is outside scope of pushable join
|
||
|
|
Note 1003 /* select#1 */ select `test`.`t1`.`k` AS `k`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`k` AS `k`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`k` AS `k`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`k` AS `k`,`test`.`t4`.`b` AS `b` from `test`.`t1` straight_join `test`.`t1` `t2` straight_join `test`.`t1` `t3` straight_join `test`.`t1` `t4` where ((`test`.`t3`.`k` = `test`.`t2`.`b`) and (`test`.`t4`.`k` = `test`.`t1`.`b`) and (`test`.`t2`.`k` = (`test`.`t1`.`b` + 0)))
|
||
|
|
select *
|
||
|
|
from t1
|
||
|
|
straight_join t1 as t2 on t2.k = t1.b+0
|
||
|
|
straight_join t1 as t3 on t3.k = t2.b
|
||
|
|
straight_join t1 as t4 on t4.k = t1.b;
|
||
|
|
k b k b k b k b
|
||
|
|
1 1 1 1 1 1 1 1
|
||
|
|
2 1 1 1 1 1 1 1
|
||
|
|
3 1 1 1 1 1 1 1
|
||
|
|
4 1 1 1 1 1 1 1
|
||
|
|
explain extended
|
||
|
|
select *
|
||
|
|
from t1
|
||
|
|
straight_join t1 as t2 on t2.k = t1.b+0
|
||
|
|
straight_join t1 as t3 on t3.k = t2.b
|
||
|
|
straight_join t1 as t4 on t4.k = t1.b
|
||
|
|
where t2.k = 1;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 4 100.00 Parent of 2 pushed join@1; Using where
|
||
|
|
1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 const 1 100.00 Parent of 2 pushed join@2; Using where with pushed condition (`test`.`t2`.`b` is not null)
|
||
|
|
1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.t2.b 1 100.00 Child of 't2' in pushed join@2
|
||
|
|
1 SIMPLE t4 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.t1.b 1 100.00 Child of 't1' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 Can't push table 't2' as child of 't1', their dependency is 'const'
|
||
|
|
Note 1003 Can't push table 't3' as child of 't1', column 't2.b' is outside scope of pushable join
|
||
|
|
Note 1003 /* select#1 */ select `test`.`t1`.`k` AS `k`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`k` AS `k`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`k` AS `k`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`k` AS `k`,`test`.`t4`.`b` AS `b` from `test`.`t1` straight_join `test`.`t1` `t2` straight_join `test`.`t1` `t3` straight_join `test`.`t1` `t4` where ((`test`.`t3`.`k` = `test`.`t2`.`b`) and (`test`.`t4`.`k` = `test`.`t1`.`b`) and (`test`.`t2`.`k` = 1) and (1 = (`test`.`t1`.`b` + 0)))
|
||
|
|
select *
|
||
|
|
from t1
|
||
|
|
straight_join t1 as t2 on t2.k = t1.b+0
|
||
|
|
straight_join t1 as t3 on t3.k = t2.b
|
||
|
|
straight_join t1 as t4 on t4.k = t1.b
|
||
|
|
where t2.k = 1;
|
||
|
|
k b k b k b k b
|
||
|
|
1 1 1 1 1 1 1 1
|
||
|
|
2 1 1 1 1 1 1 1
|
||
|
|
3 1 1 1 1 1 1 1
|
||
|
|
4 1 1 1 1 1 1 1
|
||
|
|
drop table t1;
|
||
|
|
set global debug='+d,max_64rows_in_spj_batches';
|
||
|
|
create table t1 (
|
||
|
|
a int not null auto_increment,
|
||
|
|
b char(255) not null,
|
||
|
|
c int not null,
|
||
|
|
d char(255) not null,
|
||
|
|
primary key (`a`,`b`)
|
||
|
|
) engine=ndbcluster;
|
||
|
|
explain extended
|
||
|
|
select count(*)
|
||
|
|
from t1
|
||
|
|
join t1 as t2 on t2.a = t1.c and t2.b = t1.d
|
||
|
|
join t1 as t3 on t3.a = t2.c and t3.b = t2.d;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 3000 100.00 Parent of 3 pushed join@1
|
||
|
|
1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 259 test.t1.c,test.t1.d 1 100.00 Child of 't1' in pushed join@1
|
||
|
|
1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 259 test.t2.c,test.t2.d 1 100.00 Child of 't2' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select count(0) AS `count(*)` from `test`.`t1` join `test`.`t1` `t2` join `test`.`t1` `t3` where ((`test`.`t2`.`b` = `test`.`t1`.`d`) and (`test`.`t2`.`a` = `test`.`t1`.`c`) and (`test`.`t3`.`b` = `test`.`t2`.`d`) and (`test`.`t3`.`a` = `test`.`t2`.`c`))
|
||
|
|
select count(*)
|
||
|
|
from t1
|
||
|
|
join t1 as t2 on t2.a = t1.c and t2.b = t1.d
|
||
|
|
join t1 as t3 on t3.a = t2.c and t3.b = t2.d;
|
||
|
|
count(*)
|
||
|
|
2996
|
||
|
|
explain extended
|
||
|
|
select count(*)
|
||
|
|
from t1
|
||
|
|
join t1 as t2 on t2.a = t1.c
|
||
|
|
join t1 as t3 on t3.a = t2.c and t3.b = t2.d;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 3000 100.00 Parent of 3 pushed join@1
|
||
|
|
1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.t1.c 30 100.00 Child of 't1' in pushed join@1
|
||
|
|
1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 259 test.t2.c,test.t2.d 1 100.00 Child of 't2' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select count(0) AS `count(*)` from `test`.`t1` join `test`.`t1` `t2` join `test`.`t1` `t3` where ((`test`.`t2`.`a` = `test`.`t1`.`c`) and (`test`.`t3`.`b` = `test`.`t2`.`d`) and (`test`.`t3`.`a` = `test`.`t2`.`c`))
|
||
|
|
select count(*)
|
||
|
|
from t1
|
||
|
|
join t1 as t2 on t2.a = t1.c
|
||
|
|
join t1 as t3 on t3.a = t2.c and t3.b = t2.d;
|
||
|
|
count(*)
|
||
|
|
8990
|
||
|
|
explain extended
|
||
|
|
select count(*)
|
||
|
|
from t1
|
||
|
|
join t1 as t2 on t2.a = t1.c and t2.b = t1.d
|
||
|
|
join t1 as t3 on t3.a = t2.c;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 3000 100.00 Parent of 3 pushed join@1
|
||
|
|
1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 259 test.t1.c,test.t1.d 1 100.00 Child of 't1' in pushed join@1
|
||
|
|
1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.t2.c 30 100.00 Child of 't2' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select count(0) AS `count(*)` from `test`.`t1` join `test`.`t1` `t2` join `test`.`t1` `t3` where ((`test`.`t2`.`b` = `test`.`t1`.`d`) and (`test`.`t2`.`a` = `test`.`t1`.`c`) and (`test`.`t3`.`a` = `test`.`t2`.`c`))
|
||
|
|
select count(*)
|
||
|
|
from t1
|
||
|
|
join t1 as t2 on t2.a = t1.c and t2.b = t1.d
|
||
|
|
join t1 as t3 on t3.a = t2.c;
|
||
|
|
count(*)
|
||
|
|
8988
|
||
|
|
alter table t1 partition by key(a);
|
||
|
|
explain extended
|
||
|
|
select count(*)
|
||
|
|
from t1
|
||
|
|
join t1 as t2 on t2.a = t1.c
|
||
|
|
join t1 as t3 on t3.a = t2.c and t3.b = t2.d;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 3000 100.00 Parent of 3 pushed join@1
|
||
|
|
1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.t1.c 30 100.00 Child of 't1' in pushed join@1
|
||
|
|
1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 259 test.t2.c,test.t2.d 1 100.00 Child of 't2' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select count(0) AS `count(*)` from `test`.`t1` join `test`.`t1` `t2` join `test`.`t1` `t3` where ((`test`.`t2`.`a` = `test`.`t1`.`c`) and (`test`.`t3`.`b` = `test`.`t2`.`d`) and (`test`.`t3`.`a` = `test`.`t2`.`c`))
|
||
|
|
select count(*)
|
||
|
|
from t1
|
||
|
|
join t1 as t2 on t2.a = t1.c
|
||
|
|
join t1 as t3 on t3.a = t2.c and t3.b = t2.d;
|
||
|
|
count(*)
|
||
|
|
8990
|
||
|
|
drop table t1;
|
||
|
|
set global debug=@save_debug;
|
||
|
|
create logfile group lg1
|
||
|
|
add undofile 'undofile.dat'
|
||
|
|
initial_size 1m
|
||
|
|
undo_buffer_size = 1m
|
||
|
|
engine=ndb;
|
||
|
|
create tablespace ts1
|
||
|
|
add datafile 'datafile.dat'
|
||
|
|
use logfile group lg1
|
||
|
|
initial_size 6m
|
||
|
|
engine ndb;
|
||
|
|
create table t1 (a int not null,
|
||
|
|
b int not null storage disk,
|
||
|
|
c int not null storage memory,
|
||
|
|
primary key(a))
|
||
|
|
tablespace ts1 storage disk engine = ndb;
|
||
|
|
insert into t1 values (10, 11, 11);
|
||
|
|
insert into t1 values (11, 12, 12);
|
||
|
|
insert into t1 values (12, 13, 13);
|
||
|
|
create table t2 (a int not null,
|
||
|
|
b int not null, primary key(a)) engine = ndb;
|
||
|
|
insert into t2 values (10, 11);
|
||
|
|
insert into t2 values (11, 12);
|
||
|
|
insert into t2 values (12, 13);
|
||
|
|
explain extended select * from t1, t2 where t1.c = t2.a;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 3 100.00 Parent of 2 pushed join@1
|
||
|
|
1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.t1.c 1 100.00 Child of 't1' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t1` join `test`.`t2` where (`test`.`t2`.`a` = `test`.`t1`.`c`)
|
||
|
|
select * from t1, t2 where t1.c = t2.a;
|
||
|
|
a b c a b
|
||
|
|
10 11 11 11 12
|
||
|
|
11 12 12 12 13
|
||
|
|
explain extended select * from t1, t2 where t1.a=11 and t1.c = t2.a;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 const 1 100.00 Parent of 2 pushed join@1
|
||
|
|
1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.t1.c 1 100.00 Child of 't1' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t1` join `test`.`t2` where ((`test`.`t2`.`a` = `test`.`t1`.`c`) and (`test`.`t1`.`a` = 11))
|
||
|
|
select * from t1, t2 where t1.a=11 and t1.c = t2.a;
|
||
|
|
a b c a b
|
||
|
|
11 12 12 12 13
|
||
|
|
explain extended select * from t2, t1 where t2.b = t1.a;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 3 100.00 Parent of 2 pushed join@1
|
||
|
|
1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.t2.b 1 100.00 Child of 't2' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c` from `test`.`t2` join `test`.`t1` where (`test`.`t1`.`a` = `test`.`t2`.`b`)
|
||
|
|
select * from t2, t1 where t2.b = t1.a;
|
||
|
|
a b a b c
|
||
|
|
10 11 11 12 12
|
||
|
|
11 12 12 13 13
|
||
|
|
explain extended select * from t2, t1 where t2.a=11 and t2.b = t1.a;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 const 1 100.00 Parent of 2 pushed join@1
|
||
|
|
1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.t2.b 1 100.00 Child of 't2' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c` from `test`.`t2` join `test`.`t1` where ((`test`.`t1`.`a` = `test`.`t2`.`b`) and (`test`.`t2`.`a` = 11))
|
||
|
|
select * from t2, t1 where t2.a=11 and t2.b = t1.a;
|
||
|
|
a b a b c
|
||
|
|
11 12 12 13 13
|
||
|
|
explain extended select t1.a, t1.c, t2.a, t2.b from t1, t2 where t1.b = t2.a;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 3 100.00 Parent of 2 pushed join@1
|
||
|
|
1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.t1.b 1 100.00 Child of 't1' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`c` AS `c`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t1` join `test`.`t2` where (`test`.`t2`.`a` = `test`.`t1`.`b`)
|
||
|
|
select t1.a, t1.c, t2.a, t2.b from t1, t2 where t1.b = t2.a;
|
||
|
|
a c a b
|
||
|
|
10 11 11 12
|
||
|
|
11 12 12 13
|
||
|
|
explain extended select t1.a, t1.c, t2.a, t2.b from t1, t2 where t1.a=11 and t1.b = t2.a;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 const 1 100.00 Parent of 2 pushed join@1
|
||
|
|
1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.t1.b 1 100.00 Child of 't1' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`c` AS `c`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t1` join `test`.`t2` where ((`test`.`t2`.`a` = `test`.`t1`.`b`) and (`test`.`t1`.`a` = 11))
|
||
|
|
select t1.a, t1.c, t2.a, t2.b from t1, t2 where t1.a=11 and t1.b = t2.a;
|
||
|
|
a c a b
|
||
|
|
11 12 12 13
|
||
|
|
drop table t1;
|
||
|
|
drop table t2;
|
||
|
|
alter tablespace ts1
|
||
|
|
drop datafile 'datafile.dat'
|
||
|
|
engine ndb;
|
||
|
|
drop tablespace ts1
|
||
|
|
engine ndb;
|
||
|
|
drop logfile group lg1
|
||
|
|
engine ndb;
|
||
|
|
create temporary table old_count
|
||
|
|
select counter_name, sum(val) as val
|
||
|
|
from ndbinfo.counters
|
||
|
|
where block_name='DBSPJ'
|
||
|
|
group by counter_name;
|
||
|
|
create table t1 (a int not null,
|
||
|
|
b int not null,
|
||
|
|
c int not null,
|
||
|
|
primary key(a))
|
||
|
|
engine = ndb
|
||
|
|
partition by key() partitions 8;
|
||
|
|
insert into t1 values (1, 2, 2);
|
||
|
|
insert into t1 values (2, 3, 3);
|
||
|
|
insert into t1 values (3, 4, 4);
|
||
|
|
select * from t1 t1, t1 t2 where t1.a = 2 and t2.a = t1.b;
|
||
|
|
a b c a b c
|
||
|
|
2 3 3 3 4 4
|
||
|
|
select count(*) from t1 t1, t1 t2 where t2.a = t1.b;
|
||
|
|
count(*)
|
||
|
|
2
|
||
|
|
select count(*) from t1 t1, t1 t2 where t1.a >= 2 and t2.a = t1.b;
|
||
|
|
count(*)
|
||
|
|
1
|
||
|
|
create temporary table new_count
|
||
|
|
select counter_name, sum(val) as val
|
||
|
|
from ndbinfo.counters
|
||
|
|
where block_name='DBSPJ'
|
||
|
|
group by counter_name;
|
||
|
|
select new_count.counter_name, new_count.val - old_count.val
|
||
|
|
from new_count, old_count
|
||
|
|
where new_count.counter_name = old_count.counter_name
|
||
|
|
and new_count.counter_name <> 'LOCAL_READS_SENT'
|
||
|
|
and new_count.counter_name <> 'REMOTE_READS_SENT';
|
||
|
|
counter_name new_count.val - old_count.val
|
||
|
|
CONST_PRUNED_RANGE_SCANS_RECEIVED 0
|
||
|
|
LOCAL_RANGE_SCANS_SENT 8
|
||
|
|
LOCAL_TABLE_SCANS_SENT 8
|
||
|
|
PRUNED_RANGE_SCANS_RECEIVED 0
|
||
|
|
RANGE_SCANS_RECEIVED 8
|
||
|
|
READS_NOT_FOUND 2
|
||
|
|
READS_RECEIVED 1
|
||
|
|
REMOTE_RANGE_SCANS_SENT 0
|
||
|
|
SCAN_BATCHES_RETURNED 16
|
||
|
|
SCAN_ROWS_RETURNED 8
|
||
|
|
TABLE_SCANS_RECEIVED 8
|
||
|
|
select 'READS_SENT', sum(new_count.val - old_count.val)
|
||
|
|
from new_count, old_count
|
||
|
|
where new_count.counter_name = old_count.counter_name
|
||
|
|
and (new_count.counter_name = 'LOCAL_READS_SENT'
|
||
|
|
or new_count.counter_name = 'REMOTE_READS_SENT');
|
||
|
|
READS_SENT sum(new_count.val - old_count.val)
|
||
|
|
READS_SENT 7
|
||
|
|
drop table old_count;
|
||
|
|
drop table new_count;
|
||
|
|
drop table t1;
|
||
|
|
create table t1 (
|
||
|
|
a int primary key,
|
||
|
|
b int,
|
||
|
|
c int) engine = ndb;
|
||
|
|
insert into t1 values (1, 2, 3);
|
||
|
|
insert into t1 values (2, 3, 4);
|
||
|
|
insert into t1 values (3, 4, 5);
|
||
|
|
explain extended select * from t1 x, t1 y where x.b=y.a and x.c=4;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL # # Parent of 2 pushed join@1; Using where with pushed condition ((`test`.`x`.`c` = 4) and (`test`.`x`.`b` is not null))
|
||
|
|
1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.x.b # # Child of 'x' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select `test`.`x`.`a` AS `a`,`test`.`x`.`b` AS `b`,`test`.`x`.`c` AS `c`,`test`.`y`.`a` AS `a`,`test`.`y`.`b` AS `b`,`test`.`y`.`c` AS `c` from `test`.`t1` `x` join `test`.`t1` `y` where ((`test`.`x`.`c` = 4) and (`test`.`y`.`a` = `test`.`x`.`b`))
|
||
|
|
select * from t1 x, t1 y where x.b=y.a and x.c=4;
|
||
|
|
a b c a b c
|
||
|
|
2 3 4 3 4 5
|
||
|
|
lookups
|
||
|
|
1
|
||
|
|
explain extended select * from t1 x, t1 y, t1 z where x.b=y.a and y.c=4 and y.b=z.a;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL # # Parent of 3 pushed join@1; Using where with pushed condition (`test`.`x`.`b` is not null)
|
||
|
|
1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.x.b # # Child of 'x' in pushed join@1; Using where with pushed condition ((`test`.`y`.`c` = 4) and (`test`.`y`.`b` is not null))
|
||
|
|
1 SIMPLE z p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.y.b # # Child of 'y' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select `test`.`x`.`a` AS `a`,`test`.`x`.`b` AS `b`,`test`.`x`.`c` AS `c`,`test`.`y`.`a` AS `a`,`test`.`y`.`b` AS `b`,`test`.`y`.`c` AS `c`,`test`.`z`.`a` AS `a`,`test`.`z`.`b` AS `b`,`test`.`z`.`c` AS `c` from `test`.`t1` `x` join `test`.`t1` `y` join `test`.`t1` `z` where ((`test`.`z`.`a` = `test`.`y`.`b`) and (`test`.`y`.`c` = 4) and (`test`.`y`.`a` = `test`.`x`.`b`))
|
||
|
|
select * from t1 x, t1 y, t1 z where x.b=y.a and y.c=4 and y.b=z.a;
|
||
|
|
a b c a b c a b c
|
||
|
|
1 2 3 2 3 4 3 4 5
|
||
|
|
lookups
|
||
|
|
5
|
||
|
|
drop table t1;
|
||
|
|
create table t1(
|
||
|
|
a int not null,
|
||
|
|
b int not null,
|
||
|
|
c int not null,
|
||
|
|
primary key(a,b))
|
||
|
|
engine = ndb partition by key (a);
|
||
|
|
insert into t1 values (10, 10, 11);
|
||
|
|
insert into t1 values (11, 11, 12);
|
||
|
|
insert into t1 values (12, 12, 13);
|
||
|
|
select * from t1 t1, t1 t2
|
||
|
|
where t1.a = 10 and t1.b = 10 and
|
||
|
|
t2.a = t1.c and t2.b = t1.c;
|
||
|
|
a b c a b c
|
||
|
|
10 10 11 11 11 12
|
||
|
|
create temporary table server_counts
|
||
|
|
select * from information_schema.global_status
|
||
|
|
where variable_name in
|
||
|
|
('Ndb_scan_count',
|
||
|
|
'Ndb_pruned_scan_count',
|
||
|
|
'Ndb_sorted_scan_count',
|
||
|
|
'Ndb_pushed_queries_defined',
|
||
|
|
'Ndb_pushed_queries_dropped',
|
||
|
|
'Ndb_pushed_reads');
|
||
|
|
select * from t1 t1, t1 t2
|
||
|
|
where t1.a = 11 and t1.b = 11 and
|
||
|
|
t2.a = t1.c and t2.b = t1.c;
|
||
|
|
a b c a b c
|
||
|
|
11 11 12 12 12 13
|
||
|
|
select * from t1 t1, t1 t2
|
||
|
|
where t2.a = t1.c and t2.b = t1.c
|
||
|
|
order by t1.a;
|
||
|
|
a b c a b c
|
||
|
|
10 10 11 11 11 12
|
||
|
|
11 11 12 12 12 13
|
||
|
|
select count(*) from t1 t1, t1 t2
|
||
|
|
where t1.a = 11 and
|
||
|
|
t2.a = t1.c and t2.b = t1.c;
|
||
|
|
count(*)
|
||
|
|
1
|
||
|
|
select new.variable_name, new.variable_value - old.variable_value
|
||
|
|
from server_counts as old,
|
||
|
|
information_schema.global_status as new
|
||
|
|
where new.variable_name = old.variable_name
|
||
|
|
order by new.variable_name;
|
||
|
|
variable_name new.variable_value - old.variable_value
|
||
|
|
NDB_PRUNED_SCAN_COUNT 1
|
||
|
|
NDB_PUSHED_QUERIES_DEFINED 3
|
||
|
|
NDB_PUSHED_QUERIES_DROPPED 0
|
||
|
|
NDB_PUSHED_READS 4
|
||
|
|
NDB_SCAN_COUNT 2
|
||
|
|
NDB_SORTED_SCAN_COUNT 1
|
||
|
|
drop table server_counts;
|
||
|
|
drop table t1;
|
||
|
|
create table t1(
|
||
|
|
d int not null,
|
||
|
|
c int not null,
|
||
|
|
a int not null,
|
||
|
|
b int not null,
|
||
|
|
primary key using hash (a,b))
|
||
|
|
engine = ndb partition by key (a);
|
||
|
|
insert into t1(a,b,c,d) values (10, 10, 11, 11);
|
||
|
|
insert into t1(a,b,c,d) values (11, 11, 12, 12);
|
||
|
|
insert into t1(a,b,c,d) values (12, 12, 13, 13);
|
||
|
|
create index i1 on t1(c,a);
|
||
|
|
explain extended select count(*) from t1 t1, t1 t2 where t1.c = 12 and t1.a = 11 and t2.a = t1.d and t2.b = t1.d;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE t1 p3 ref PRIMARY,i1 i1 8 const,const 3 100.00 Parent of 2 pushed join@1
|
||
|
|
1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.t1.d,test.t1.d 1 100.00 Child of 't1' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select count(0) AS `count(*)` from `test`.`t1` join `test`.`t1` `t2` where ((`test`.`t2`.`a` = `test`.`t1`.`d`) and (`test`.`t2`.`b` = `test`.`t1`.`d`) and (`test`.`t1`.`a` = 11) and (`test`.`t1`.`c` = 12))
|
||
|
|
select count(*) from t1 t1, t1 t2 where t1.c = 12 and t1.a = 11 and t2.a = t1.d and t2.b = t1.d;
|
||
|
|
count(*)
|
||
|
|
1
|
||
|
|
drop index i1 on t1;
|
||
|
|
pruned_scan_count
|
||
|
|
1
|
||
|
|
create index i2 on t1(a,b);
|
||
|
|
explain extended select count(*) from t1 t1, t1 t2 where t1.a = 11 and t1.b<13 and t2.a = t1.c and t2.b = t1.c;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE t1 p3 range PRIMARY,i2 i2 8 NULL 3 100.00 Parent of 2 pushed join@1; Using where with pushed condition ((`test`.`t1`.`a` = 11) and (`test`.`t1`.`b` < 13)); Using MRR
|
||
|
|
1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY,i2 PRIMARY 8 test.t1.c,test.t1.c 1 100.00 Child of 't1' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select count(0) AS `count(*)` from `test`.`t1` join `test`.`t1` `t2` where ((`test`.`t2`.`a` = `test`.`t1`.`c`) and (`test`.`t2`.`b` = `test`.`t1`.`c`) and (`test`.`t1`.`a` = 11) and (`test`.`t1`.`b` < 13))
|
||
|
|
select count(*) from t1 t1, t1 t2 where t1.a = 11 and t1.b<13 and t2.a = t1.c and t2.b = t1.c;
|
||
|
|
count(*)
|
||
|
|
1
|
||
|
|
pruned_scan_count
|
||
|
|
1
|
||
|
|
explain extended select count(*) from t1 t1, t1 t2 where t1.a >= 12 and t1.a<=12 and t2.a = t1.c and t2.b = t1.c;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE t1 p3 range PRIMARY,i2 i2 4 NULL 3 100.00 Parent of 2 pushed join@1; Using where with pushed condition ((`test`.`t1`.`a` >= 12) and (`test`.`t1`.`a` <= 12)); Using MRR
|
||
|
|
1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY,i2 PRIMARY 8 test.t1.c,test.t1.c 1 100.00 Child of 't1' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select count(0) AS `count(*)` from `test`.`t1` join `test`.`t1` `t2` where ((`test`.`t2`.`a` = `test`.`t1`.`c`) and (`test`.`t2`.`b` = `test`.`t1`.`c`) and (`test`.`t1`.`a` >= 12) and (`test`.`t1`.`a` <= 12))
|
||
|
|
select count(*) from t1 t1, t1 t2 where t1.a >= 12 and t1.a<=12 and t2.a = t1.c and t2.b = t1.c;
|
||
|
|
count(*)
|
||
|
|
0
|
||
|
|
pruned_scan_count
|
||
|
|
1
|
||
|
|
explain extended select count(*) from t1 t1, t1 t2 where t1.a >= 11 and t1.a<=12 and t2.a = t1.c and t2.b = t1.c;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE t1 p3 range PRIMARY,i2 i2 4 NULL 3 100.00 Parent of 2 pushed join@1; Using where with pushed condition ((`test`.`t1`.`a` >= 11) and (`test`.`t1`.`a` <= 12)); Using MRR
|
||
|
|
1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY,i2 PRIMARY 8 test.t1.c,test.t1.c 1 100.00 Child of 't1' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select count(0) AS `count(*)` from `test`.`t1` join `test`.`t1` `t2` where ((`test`.`t2`.`a` = `test`.`t1`.`c`) and (`test`.`t2`.`b` = `test`.`t1`.`c`) and (`test`.`t1`.`a` >= 11) and (`test`.`t1`.`a` <= 12))
|
||
|
|
select count(*) from t1 t1, t1 t2 where t1.a >= 11 and t1.a<=12 and t2.a = t1.c and t2.b = t1.c;
|
||
|
|
count(*)
|
||
|
|
1
|
||
|
|
pruned_scan_count
|
||
|
|
0
|
||
|
|
explain extended select count(*) from t1 t1, t1 t2 where (t1.a = 10 or t1.a=12) and t1.b<13 and t2.a = t1.c and t2.b = t1.c;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE t1 p0,p3 range PRIMARY,i2 i2 8 NULL # # Parent of 2 pushed join@1; Using where with pushed condition (((`test`.`t1`.`a` = 10) or (`test`.`t1`.`a` = 12)) and (`test`.`t1`.`b` < 13)); Using MRR
|
||
|
|
1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY,i2 PRIMARY 8 test.t1.c,test.t1.c # # Child of 't1' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select count(0) AS `count(*)` from `test`.`t1` join `test`.`t1` `t2` where ((`test`.`t2`.`a` = `test`.`t1`.`c`) and (`test`.`t2`.`b` = `test`.`t1`.`c`) and ((`test`.`t1`.`a` = 10) or (`test`.`t1`.`a` = 12)) and (`test`.`t1`.`b` < 13))
|
||
|
|
select count(*) from t1 t1, t1 t2 where (t1.a = 10 or t1.a=12) and t1.b<13 and t2.a = t1.c and t2.b = t1.c;
|
||
|
|
count(*)
|
||
|
|
1
|
||
|
|
pruned_scan_count
|
||
|
|
0
|
||
|
|
explain extended select count(*) from t1 t1, t1 t2 where t1.a = 10 and (t1.b<11 or t1.b>11) and t2.a = t1.c and t2.b = t1.c;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE t1 p0 range PRIMARY,i2 i2 8 NULL 6 100.00 Parent of 2 pushed join@1; Using where with pushed condition ((`test`.`t1`.`a` = 10) and ((`test`.`t1`.`b` < 11) or (`test`.`t1`.`b` > 11))); Using MRR
|
||
|
|
1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY,i2 PRIMARY 8 test.t1.c,test.t1.c 1 100.00 Child of 't1' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select count(0) AS `count(*)` from `test`.`t1` join `test`.`t1` `t2` where ((`test`.`t2`.`a` = `test`.`t1`.`c`) and (`test`.`t2`.`b` = `test`.`t1`.`c`) and (`test`.`t1`.`a` = 10) and ((`test`.`t1`.`b` < 11) or (`test`.`t1`.`b` > 11)))
|
||
|
|
select count(*) from t1 t1, t1 t2 where t1.a = 10 and (t1.b<11 or t1.b>11) and t2.a = t1.c and t2.b = t1.c;
|
||
|
|
count(*)
|
||
|
|
1
|
||
|
|
pruned_scan_count
|
||
|
|
1
|
||
|
|
drop table t1;
|
||
|
|
create table t2(
|
||
|
|
d int not null,
|
||
|
|
e int not null,
|
||
|
|
f int not null,
|
||
|
|
a int not null,
|
||
|
|
b int not null,
|
||
|
|
c int not null,
|
||
|
|
primary key using hash (a,b,c))
|
||
|
|
engine = ndb partition by key (b,a);
|
||
|
|
insert into t2(a,b,c,d,e,f) values (1, 2, 3, 1, 2, 3);
|
||
|
|
insert into t2(a,b,c,d,e,f) values (1, 2, 4, 1, 2, 3);
|
||
|
|
insert into t2(a,b,c,d,e,f) values (2, 3, 4, 1, 2, 3);
|
||
|
|
insert into t2(a,b,c,d,e,f) values (3, 4, 5, 1, 2, 3);
|
||
|
|
insert into t2(a,b,c,d,e,f) values (4, 5, 6, 1, 2, 3);
|
||
|
|
insert into t2(a,b,c,d,e,f) values (5, 6, 7, 1, 2, 3);
|
||
|
|
insert into t2(a,b,c,d,e,f) values (6, 7, 8, 1, 2, 3);
|
||
|
|
insert into t2(a,b,c,d,e,f) values (7, 8, 9, 1, 2, 3);
|
||
|
|
create index i2_1 on t2(d, a, b, e);
|
||
|
|
explain extended select count(*) from t2 x, t2 y where x.d=1 and x.a=1 and x.b=2 and y.a=x.d and y.b=x.e and y.c=3;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE x p2 ref PRIMARY,i2_1 i2_1 12 const,const,const 3 100.00 Parent of 2 pushed join@1
|
||
|
|
1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 12 const,test.x.e,const 1 100.00 Child of 'x' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select count(0) AS `count(*)` from `test`.`t2` `x` join `test`.`t2` `y` where ((`test`.`y`.`c` = 3) and (`test`.`y`.`b` = `test`.`x`.`e`) and (`test`.`x`.`b` = 2) and (`test`.`x`.`a` = 1) and (`test`.`x`.`d` = 1) and (`test`.`y`.`a` = 1))
|
||
|
|
select count(*) from t2 x, t2 y where x.d=1 and x.a=1 and x.b=2 and y.a=x.d and y.b=x.e and y.c=3;
|
||
|
|
count(*)
|
||
|
|
2
|
||
|
|
pruned_scan_count
|
||
|
|
1
|
||
|
|
drop index i2_1 on t2;
|
||
|
|
create index i2_3 on t2(a, d, b, e);
|
||
|
|
set optimizer_switch='condition_fanout_filter=off';
|
||
|
|
explain extended select count(*) from t2 x, t2 y where x.d=1 and x.a=1 and x.b=2 and y.a=x.d and y.b=x.e and y.c=3;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE x p2 ref PRIMARY,i2_3 i2_3 12 const,const,const 3 100.00 Parent of 2 pushed join@1
|
||
|
|
1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY,i2_3 PRIMARY 12 const,test.x.e,const 1 100.00 Child of 'x' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select count(0) AS `count(*)` from `test`.`t2` `x` join `test`.`t2` `y` where ((`test`.`y`.`c` = 3) and (`test`.`y`.`b` = `test`.`x`.`e`) and (`test`.`x`.`b` = 2) and (`test`.`x`.`a` = 1) and (`test`.`x`.`d` = 1) and (`test`.`y`.`a` = 1))
|
||
|
|
select count(*) from t2 x, t2 y where x.d=1 and x.a=1 and x.b=2 and y.a=x.d and y.b=x.e and y.c=3;
|
||
|
|
count(*)
|
||
|
|
2
|
||
|
|
set optimizer_switch='condition_fanout_filter=default';
|
||
|
|
pruned_scan_count
|
||
|
|
1
|
||
|
|
drop table t2;
|
||
|
|
create table t1 (a binary(10) primary key, b binary(10) not null) engine = ndb;
|
||
|
|
insert into t1 values ('\0123456789', '1234567890');
|
||
|
|
insert into t1 values ('1234567890', '\0123456789');
|
||
|
|
explain extended
|
||
|
|
select count(*)
|
||
|
|
from t1 join t1 as t2 on t2.a = t1.b
|
||
|
|
where t1.a = '\0123456789';
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 10 const 1 100.00 Parent of 2 pushed join@1; Using where
|
||
|
|
1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 10 test.t1.b 1 100.00 Child of 't1' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select count(0) AS `count(*)` from `test`.`t1` join `test`.`t1` `t2` where ((`test`.`t2`.`a` = `test`.`t1`.`b`) and (`test`.`t1`.`a` = '\0123456789'))
|
||
|
|
select count(*)
|
||
|
|
from t1 join t1 as t2 on t2.a = t1.b
|
||
|
|
where t1.a = '\0123456789';
|
||
|
|
count(*)
|
||
|
|
1
|
||
|
|
drop table t1;
|
||
|
|
create table t1 (pk int primary key, a int unique key) engine = ndb;
|
||
|
|
insert into t1 values (1,10), (2,20), (3,30);
|
||
|
|
set ndb_join_pushdown = false;
|
||
|
|
explain extended
|
||
|
|
select * from t1 as x right join t1 as y
|
||
|
|
on x.pk = y.pk
|
||
|
|
and x.pk = y.a
|
||
|
|
and x.a = y.pk
|
||
|
|
where y.pk = 2;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 const PRIMARY PRIMARY 4 const 1 100.00 NULL
|
||
|
|
1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 const PRIMARY,a NULL NULL NULL 1 100.00 Impossible ON condition
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select `test`.`x`.`pk` AS `pk`,`test`.`x`.`a` AS `a`,'2' AS `pk`,'20' AS `a` from `test`.`t1` `y` left join `test`.`t1` `x` on((multiple equal(2, `test`.`x`.`pk`, `test`.`x`.`a`))) where 1
|
||
|
|
select * from t1 as x right join t1 as y
|
||
|
|
on x.pk = y.pk
|
||
|
|
and x.pk = y.a
|
||
|
|
and x.a = y.pk
|
||
|
|
where y.pk = 2;
|
||
|
|
pk a pk a
|
||
|
|
NULL NULL 2 20
|
||
|
|
set ndb_join_pushdown = true;
|
||
|
|
explain extended
|
||
|
|
select * from t1 as x right join t1 as y
|
||
|
|
on x.pk = y.pk
|
||
|
|
and x.pk = y.a
|
||
|
|
and x.a = y.pk
|
||
|
|
where y.pk = 2;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 const 1 100.00 NULL
|
||
|
|
1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY,a PRIMARY 4 const 1 100.00 Using where
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 Can't push table 'x' as child of 'y', their dependency is 'const'
|
||
|
|
Note 1003 /* select#1 */ select `test`.`x`.`pk` AS `pk`,`test`.`x`.`a` AS `a`,`test`.`y`.`pk` AS `pk`,`test`.`y`.`a` AS `a` from `test`.`t1` `y` left join `test`.`t1` `x` on(((`test`.`y`.`a` = 2) and (`test`.`x`.`pk` = 2) and (`test`.`x`.`a` = 2))) where (`test`.`y`.`pk` = 2)
|
||
|
|
select * from t1 as x right join t1 as y
|
||
|
|
on x.pk = y.pk
|
||
|
|
and x.pk = y.a
|
||
|
|
and x.a = y.pk
|
||
|
|
where y.pk = 2;
|
||
|
|
pk a pk a
|
||
|
|
NULL NULL 2 20
|
||
|
|
drop table t1;
|
||
|
|
create table t1 (pk int primary key, u int not null, a int, b int) engine=ndb;
|
||
|
|
create index ix1 on t1(b,a);
|
||
|
|
insert into t1 values (0,1,10,20);
|
||
|
|
insert into t1 values (1,2,20,30);
|
||
|
|
insert into t1 values (2,3,30,40);
|
||
|
|
explain extended select * from t1 as x join t1 as y join t1 as z on x.u=y.pk and y.a=z.b;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL # # Parent of 3 pushed join@1
|
||
|
|
1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.x.u # # Child of 'x' in pushed join@1; Using where with pushed condition (`test`.`y`.`a` is not null)
|
||
|
|
1 SIMPLE z p0,p1,p2,p3,p4,p5,p6,p7 ref ix1 ix1 5 test.y.a # # Child of 'y' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select `test`.`x`.`pk` AS `pk`,`test`.`x`.`u` AS `u`,`test`.`x`.`a` AS `a`,`test`.`x`.`b` AS `b`,`test`.`y`.`pk` AS `pk`,`test`.`y`.`u` AS `u`,`test`.`y`.`a` AS `a`,`test`.`y`.`b` AS `b`,`test`.`z`.`pk` AS `pk`,`test`.`z`.`u` AS `u`,`test`.`z`.`a` AS `a`,`test`.`z`.`b` AS `b` from `test`.`t1` `x` join `test`.`t1` `y` join `test`.`t1` `z` where ((`test`.`z`.`b` = `test`.`y`.`a`) and (`test`.`y`.`pk` = `test`.`x`.`u`))
|
||
|
|
select * from t1 as x join t1 as y join t1 as z on x.u=y.pk and y.a=z.b;
|
||
|
|
pk u a b pk u a b pk u a b
|
||
|
|
0 1 10 20 1 2 20 30 0 1 10 20
|
||
|
|
1 2 20 30 2 3 30 40 1 2 20 30
|
||
|
|
drop table t1;
|
||
|
|
create table t1 (pk int primary key, u int not null) engine=ndb;
|
||
|
|
insert into t1 values (0,-1), (1,-1), (2,-1), (3,-1), (4,-1), (5,-1), (6,-1),
|
||
|
|
(7,-1), (8,-1), (9,-1), (10,-1), (11,-1), (12,-1), (13,-1), (14,-1), (15,-1),
|
||
|
|
(16,-1), (17,-1), (18,-1), (19,-1), (20,-1), (21,-1), (22,-1), (23,-1),
|
||
|
|
(24,-1), (25,-1), (26,-1), (27,-1), (28,-1), (29,-1), (30,-1), (31,-1),
|
||
|
|
(32,-1), (33,-1), (34,-1), (35,-1), (36,-1), (37,-1), (38,-1), (39,-1),
|
||
|
|
(40,-1), (41,-1), (42,-1), (43,-1), (44,-1), (45,-1), (46,-1), (47,-1),
|
||
|
|
(48,-1), (49,-1), (50,-1), (51,-1), (52,-1), (53,-1), (54,-1), (55,-1),
|
||
|
|
(56,-1), (57,-1), (58,-1), (59,-1), (60,-1), (61,-1), (62,-1), (63,-1),
|
||
|
|
(64,-1), (65,-1), (66,-1), (67,-1), (68,-1), (69,-1), (70,-1), (71,-1),
|
||
|
|
(72,-1), (73,-1), (74,-1), (75,-1), (76,-1), (77,-1), (78,-1), (79,-1),
|
||
|
|
(80,-1), (81,-1), (82,-1), (83,-1), (84,-1), (85,-1), (86,-1), (87,-1),
|
||
|
|
(88,-1), (89,-1), (90,-1), (91,-1), (92,-1), (93,-1), (94,-1), (95,-1),
|
||
|
|
(96,-1), (97,-1), (98,-1), (99,-1), (100,-1), (101,-1), (102,-1), (103,-1),
|
||
|
|
(104,-1), (105,-1), (106,-1), (107,-1), (108,-1), (109,-1), (110,-1),
|
||
|
|
(111,-1), (112,-1), (113,-1), (114,-1), (115,-1), (116,-1), (117,-1),
|
||
|
|
(118,-1), (119,-1), (120,-1), (121,-1), (122,-1), (123,-1), (124,-1),
|
||
|
|
(125,-1), (126,-1), (127,-1), (128,-1), (129,-1), (130,-1), (131,-1),
|
||
|
|
(132,-1), (133,-1), (134,-1), (135,-1), (136,-1), (137,-1), (138,-1), (139,-1);
|
||
|
|
set global debug='+d,max_64rows_in_spj_batches';
|
||
|
|
explain extended select * from t1 as x join t1 as y on x.u=y.pk order by(x.pk);
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 index NULL PRIMARY 4 NULL 140 100.00 Parent of 2 pushed join@1
|
||
|
|
1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.x.u 1 100.00 Child of 'x' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select `test`.`x`.`pk` AS `pk`,`test`.`x`.`u` AS `u`,`test`.`y`.`pk` AS `pk`,`test`.`y`.`u` AS `u` from `test`.`t1` `x` join `test`.`t1` `y` where (`test`.`y`.`pk` = `test`.`x`.`u`) order by `test`.`x`.`pk`
|
||
|
|
select * from t1 as x join t1 as y on x.u=y.pk order by(x.pk);
|
||
|
|
pk u pk u
|
||
|
|
set global debug=@save_debug;
|
||
|
|
drop table t1;
|
||
|
|
create table t1 (pk int primary key, u int not null, a int, b int) engine=ndb;
|
||
|
|
create index ix1 on t1(b,a);
|
||
|
|
create unique index ix2 on t1(u);
|
||
|
|
insert into t1 values (0,0,10,10);
|
||
|
|
insert into t1 values (1,1,10,10);
|
||
|
|
insert into t1 values (2,2,10,10);
|
||
|
|
insert into t1 values (3,3,10,10);
|
||
|
|
insert into t1 values (4,4,10,10);
|
||
|
|
insert into t1 values (5,5,10,10);
|
||
|
|
insert into t1 values (6,6,10,10);
|
||
|
|
insert into t1 values (7,7,10,10);
|
||
|
|
insert into t1 values (8,8,10,10);
|
||
|
|
insert into t1 values (9,9,10,10);
|
||
|
|
insert into t1 values (10,10,10,10);
|
||
|
|
insert into t1 values (11,11,10,10);
|
||
|
|
explain extended select count(*) from t1 as x1 join t1 as x2 join t1 as x3
|
||
|
|
on x1.a=x2.u and x2.a = x3.b;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE x1 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 12 100.00 Parent of 3 pushed join@1; Using where with pushed condition (`test`.`x1`.`a` is not null)
|
||
|
|
1 SIMPLE x2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref ix2 ix2 4 test.x1.a 1 100.00 Child of 'x1' in pushed join@1; Using where with pushed condition (`test`.`x2`.`a` is not null)
|
||
|
|
1 SIMPLE x3 p0,p1,p2,p3,p4,p5,p6,p7 ref ix1 ix1 5 test.x2.a 2 100.00 Child of 'x2' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select count(0) AS `count(*)` from `test`.`t1` `x1` join `test`.`t1` `x2` join `test`.`t1` `x3` where ((`test`.`x3`.`b` = `test`.`x2`.`a`) and (`test`.`x2`.`u` = `test`.`x1`.`a`))
|
||
|
|
select count(*) from t1 as x1 join t1 as x2 join t1 as x3
|
||
|
|
on x1.a=x2.u and x2.a = x3.b;
|
||
|
|
count(*)
|
||
|
|
144
|
||
|
|
explain extended select count(*) from t1 as x1, t1 as x2, t1 as x3
|
||
|
|
where x1.u=x2.pk and x1.a=x3.b;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE x1 p0,p1,p2,p3,p4,p5,p6,p7 ALL ix2 NULL NULL NULL 12 100.00 Parent of 3 pushed join@1; Using where with pushed condition (`test`.`x1`.`a` is not null)
|
||
|
|
1 SIMPLE x2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.x1.u 1 100.00 Child of 'x1' in pushed join@1
|
||
|
|
1 SIMPLE x3 p0,p1,p2,p3,p4,p5,p6,p7 ref ix1 ix1 5 test.x1.a 2 100.00 Child of 'x1' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select count(0) AS `count(*)` from `test`.`t1` `x1` join `test`.`t1` `x2` join `test`.`t1` `x3` where ((`test`.`x3`.`b` = `test`.`x1`.`a`) and (`test`.`x2`.`pk` = `test`.`x1`.`u`))
|
||
|
|
select count(*) from t1 as x1, t1 as x2, t1 as x3
|
||
|
|
where x1.u=x2.pk and x1.a=x3.b;
|
||
|
|
count(*)
|
||
|
|
144
|
||
|
|
insert into t1 values (12,12,20,10);
|
||
|
|
explain extended select count(*) from t1 as x1 left join t1 as x2 on x1.a=x2.b;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE x1 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 13 100.00 NULL
|
||
|
|
1 SIMPLE x2 p0,p1,p2,p3,p4,p5,p6,p7 ref ix1 ix1 5 test.x1.a 2 100.00 NULL
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 Can't push table 'x2' as child of 'x1', outer join of scan-child not implemented
|
||
|
|
Note 1003 /* select#1 */ select count(0) AS `count(*)` from `test`.`t1` `x1` left join `test`.`t1` `x2` on((`test`.`x1`.`a` = `test`.`x2`.`b`)) where 1
|
||
|
|
select count(*) from t1 as x1 left join t1 as x2 on x1.a=x2.b;
|
||
|
|
count(*)
|
||
|
|
157
|
||
|
|
set ndb_join_pushdown=off;
|
||
|
|
select count(*) from t1 as x1 left join t1 as x2 on x1.a=x2.b;
|
||
|
|
count(*)
|
||
|
|
157
|
||
|
|
set ndb_join_pushdown=on;
|
||
|
|
explain extended select count(*) from t1 as x1
|
||
|
|
left join t1 as x2 on x1.u=x2.pk
|
||
|
|
left join t1 as x3 on x2.a=x3.b;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE x1 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 13 100.00 Parent of 2 pushed join@1
|
||
|
|
1 SIMPLE x2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.x1.u 1 100.00 Child of 'x1' in pushed join@1
|
||
|
|
1 SIMPLE x3 p0,p1,p2,p3,p4,p5,p6,p7 ref ix1 ix1 5 test.x2.a 2 100.00 NULL
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 Can't push table 'x3' as child of 'x1', outer join of scan-child not implemented
|
||
|
|
Note 1003 /* select#1 */ select count(0) AS `count(*)` from `test`.`t1` `x1` left join `test`.`t1` `x2` on((`test`.`x1`.`u` = `test`.`x2`.`pk`)) left join `test`.`t1` `x3` on((`test`.`x2`.`a` = `test`.`x3`.`b`)) where 1
|
||
|
|
select count(*) from t1 as x1
|
||
|
|
left join t1 as x2 on x1.u=x2.pk
|
||
|
|
left join t1 as x3 on x2.a=x3.b;
|
||
|
|
count(*)
|
||
|
|
157
|
||
|
|
set ndb_join_pushdown=off;
|
||
|
|
select count(*) from t1 as x1
|
||
|
|
left join t1 as x2 on x1.u=x2.pk
|
||
|
|
left join t1 as x3 on x2.a=x3.b;
|
||
|
|
count(*)
|
||
|
|
157
|
||
|
|
set ndb_join_pushdown=on;
|
||
|
|
explain extended select count(*) from t1 as x1
|
||
|
|
left join t1 as x2 on x1.u=x2.pk
|
||
|
|
left join t1 as x3 on x2.a=x3.b
|
||
|
|
left join t1 as x4 on x3.u=x4.pk
|
||
|
|
left join t1 as x5 on x4.a=x5.b;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE x1 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 13 100.00 Parent of 2 pushed join@1
|
||
|
|
1 SIMPLE x2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.x1.u 1 100.00 Child of 'x1' in pushed join@1
|
||
|
|
1 SIMPLE x3 p0,p1,p2,p3,p4,p5,p6,p7 ref ix1 ix1 5 test.x2.a 2 100.00 Parent of 2 pushed join@2
|
||
|
|
1 SIMPLE x4 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.x3.u 1 100.00 Child of 'x3' in pushed join@2
|
||
|
|
1 SIMPLE x5 p0,p1,p2,p3,p4,p5,p6,p7 ref ix1 ix1 5 test.x4.a 2 100.00 NULL
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 Can't push table 'x3' as child of 'x1', outer join of scan-child not implemented
|
||
|
|
Note 1003 Can't push table 'x4' as child of 'x1', column 'x3.u' is outside scope of pushable join
|
||
|
|
Note 1003 Can't push table 'x5' as child of 'x1', column 'x4.a' is outside scope of pushable join
|
||
|
|
Note 1003 Can't push table 'x5' as child of 'x3', outer join of scan-child not implemented
|
||
|
|
Note 1003 /* select#1 */ select count(0) AS `count(*)` from `test`.`t1` `x1` left join `test`.`t1` `x2` on((`test`.`x1`.`u` = `test`.`x2`.`pk`)) left join `test`.`t1` `x3` on((`test`.`x2`.`a` = `test`.`x3`.`b`)) left join `test`.`t1` `x4` on((`test`.`x3`.`u` = `test`.`x4`.`pk`)) left join `test`.`t1` `x5` on((`test`.`x4`.`a` = `test`.`x5`.`b`)) where 1
|
||
|
|
select count(*) from t1 as x1
|
||
|
|
left join t1 as x2 on x1.u=x2.pk
|
||
|
|
left join t1 as x3 on x2.a=x3.b
|
||
|
|
left join t1 as x4 on x3.u=x4.pk
|
||
|
|
left join t1 as x5 on x4.a=x5.b;
|
||
|
|
count(*)
|
||
|
|
1885
|
||
|
|
set ndb_join_pushdown=off;
|
||
|
|
select count(*) from t1 as x1
|
||
|
|
left join t1 as x2 on x1.u=x2.pk
|
||
|
|
left join t1 as x3 on x2.a=x3.b
|
||
|
|
left join t1 as x4 on x3.u=x4.pk
|
||
|
|
left join t1 as x5 on x4.a=x5.b;
|
||
|
|
count(*)
|
||
|
|
1885
|
||
|
|
set ndb_join_pushdown=on;
|
||
|
|
explain extended select count(*) from t1 as x1
|
||
|
|
join t1 as x2 on x1.a=x2.b
|
||
|
|
where x1.pk = 1 or x1.u=1;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE x1 p0,p1,p2,p3,p4,p5,p6,p7 index_merge PRIMARY,ix2 ix2,PRIMARY 4,4 NULL 2 100.00 Using sort_union(ix2,PRIMARY); Using where with pushed condition (((`test`.`x1`.`pk` = 1) or (`test`.`x1`.`u` = 1)) and (`test`.`x1`.`a` is not null))
|
||
|
|
1 SIMPLE x2 p0,p1,p2,p3,p4,p5,p6,p7 ref ix1 ix1 5 test.x1.a 2 100.00 NULL
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 Push of table 'x2' as scan-child with lookup-root 'x1' not implemented
|
||
|
|
Note 1003 /* select#1 */ select count(0) AS `count(*)` from `test`.`t1` `x1` join `test`.`t1` `x2` where ((`test`.`x2`.`b` = `test`.`x1`.`a`) and ((`test`.`x1`.`pk` = 1) or (`test`.`x1`.`u` = 1)))
|
||
|
|
select count(*) from t1 as x1
|
||
|
|
join t1 as x2 on x1.a=x2.b
|
||
|
|
where x1.pk = 1 or x1.u=1;
|
||
|
|
count(*)
|
||
|
|
13
|
||
|
|
set global debug='+d,max_4rows_in_spj_batches';
|
||
|
|
set ndb_join_pushdown=on;
|
||
|
|
explain extended
|
||
|
|
select straight_join * from t1 as table1
|
||
|
|
left join
|
||
|
|
(t1 as table2 join t1 as table3 on table2.pk = table3.b)
|
||
|
|
on table1.pk = table2.b;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE table1 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 13 100.00 NULL
|
||
|
|
1 SIMPLE table2 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY,ix1 ix1 5 test.table1.pk 2 100.00 Parent of 2 pushed join@1
|
||
|
|
1 SIMPLE table3 p0,p1,p2,p3,p4,p5,p6,p7 ref ix1 ix1 5 test.table2.pk 2 100.00 Child of 'table2' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 Can't push table 'table2' as child of 'table1', outer join of scan-child not implemented
|
||
|
|
Note 1003 Can't push table 'table3' as child of 'table1', column 'table2.pk' is outside scope of pushable join
|
||
|
|
Note 1003 /* select#1 */ select straight_join `test`.`table1`.`pk` AS `pk`,`test`.`table1`.`u` AS `u`,`test`.`table1`.`a` AS `a`,`test`.`table1`.`b` AS `b`,`test`.`table2`.`pk` AS `pk`,`test`.`table2`.`u` AS `u`,`test`.`table2`.`a` AS `a`,`test`.`table2`.`b` AS `b`,`test`.`table3`.`pk` AS `pk`,`test`.`table3`.`u` AS `u`,`test`.`table3`.`a` AS `a`,`test`.`table3`.`b` AS `b` from `test`.`t1` `table1` left join (`test`.`t1` `table2` join `test`.`t1` `table3`) on(((`test`.`table1`.`pk` = `test`.`table2`.`b`) and (`test`.`table2`.`pk` = `test`.`table3`.`b`))) where 1
|
||
|
|
select straight_join * from t1 as table1
|
||
|
|
left join
|
||
|
|
(t1 as table2 join t1 as table3 on table2.pk = table3.b)
|
||
|
|
on table1.pk = table2.b;
|
||
|
|
pk u a b pk u a b pk u a b
|
||
|
|
0 0 10 10 NULL NULL NULL NULL NULL NULL NULL NULL
|
||
|
|
1 1 10 10 NULL NULL NULL NULL NULL NULL NULL NULL
|
||
|
|
10 10 10 10 10 10 10 10 0 0 10 10
|
||
|
|
10 10 10 10 10 10 10 10 1 1 10 10
|
||
|
|
10 10 10 10 10 10 10 10 10 10 10 10
|
||
|
|
10 10 10 10 10 10 10 10 11 11 10 10
|
||
|
|
10 10 10 10 10 10 10 10 12 12 20 10
|
||
|
|
10 10 10 10 10 10 10 10 2 2 10 10
|
||
|
|
10 10 10 10 10 10 10 10 3 3 10 10
|
||
|
|
10 10 10 10 10 10 10 10 4 4 10 10
|
||
|
|
10 10 10 10 10 10 10 10 5 5 10 10
|
||
|
|
10 10 10 10 10 10 10 10 6 6 10 10
|
||
|
|
10 10 10 10 10 10 10 10 7 7 10 10
|
||
|
|
10 10 10 10 10 10 10 10 8 8 10 10
|
||
|
|
10 10 10 10 10 10 10 10 9 9 10 10
|
||
|
|
11 11 10 10 NULL NULL NULL NULL NULL NULL NULL NULL
|
||
|
|
12 12 20 10 NULL NULL NULL NULL NULL NULL NULL NULL
|
||
|
|
2 2 10 10 NULL NULL NULL NULL NULL NULL NULL NULL
|
||
|
|
3 3 10 10 NULL NULL NULL NULL NULL NULL NULL NULL
|
||
|
|
4 4 10 10 NULL NULL NULL NULL NULL NULL NULL NULL
|
||
|
|
5 5 10 10 NULL NULL NULL NULL NULL NULL NULL NULL
|
||
|
|
6 6 10 10 NULL NULL NULL NULL NULL NULL NULL NULL
|
||
|
|
7 7 10 10 NULL NULL NULL NULL NULL NULL NULL NULL
|
||
|
|
8 8 10 10 NULL NULL NULL NULL NULL NULL NULL NULL
|
||
|
|
9 9 10 10 NULL NULL NULL NULL NULL NULL NULL NULL
|
||
|
|
set global debug=@save_debug;
|
||
|
|
explain extended select straight_join * from t1 as x1
|
||
|
|
inner join t1 as x2 on x2.b = x1.a;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE x1 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 13 100.00 Parent of 2 pushed join@1; Using where with pushed condition (`test`.`x1`.`a` is not null)
|
||
|
|
1 SIMPLE x2 p0,p1,p2,p3,p4,p5,p6,p7 ref ix1 ix1 5 test.x1.a 2 100.00 Child of 'x1' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select straight_join `test`.`x1`.`pk` AS `pk`,`test`.`x1`.`u` AS `u`,`test`.`x1`.`a` AS `a`,`test`.`x1`.`b` AS `b`,`test`.`x2`.`pk` AS `pk`,`test`.`x2`.`u` AS `u`,`test`.`x2`.`a` AS `a`,`test`.`x2`.`b` AS `b` from `test`.`t1` `x1` join `test`.`t1` `x2` where (`test`.`x2`.`b` = `test`.`x1`.`a`)
|
||
|
|
explain extended select straight_join * from t1 as x1
|
||
|
|
left join t1 as x2 on x2.b = x1.a;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE x1 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 13 100.00 NULL
|
||
|
|
1 SIMPLE x2 p0,p1,p2,p3,p4,p5,p6,p7 ref ix1 ix1 5 test.x1.a 2 100.00 NULL
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 Can't push table 'x2' as child of 'x1', outer join of scan-child not implemented
|
||
|
|
Note 1003 /* select#1 */ select straight_join `test`.`x1`.`pk` AS `pk`,`test`.`x1`.`u` AS `u`,`test`.`x1`.`a` AS `a`,`test`.`x1`.`b` AS `b`,`test`.`x2`.`pk` AS `pk`,`test`.`x2`.`u` AS `u`,`test`.`x2`.`a` AS `a`,`test`.`x2`.`b` AS `b` from `test`.`t1` `x1` left join `test`.`t1` `x2` on((`test`.`x2`.`b` = `test`.`x1`.`a`)) where 1
|
||
|
|
explain extended select straight_join * from t1 as x1
|
||
|
|
right join t1 as x2 on x2.b = x1.a;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE x2 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 13 100.00 NULL
|
||
|
|
1 SIMPLE x1 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 13 100.00 Using where; Using join buffer (Block Nested Loop)
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 Can't push table 'x1' as child, 'type' must be a 'ref' access
|
||
|
|
Note 1003 /* select#1 */ select straight_join `test`.`x1`.`pk` AS `pk`,`test`.`x1`.`u` AS `u`,`test`.`x1`.`a` AS `a`,`test`.`x1`.`b` AS `b`,`test`.`x2`.`pk` AS `pk`,`test`.`x2`.`u` AS `u`,`test`.`x2`.`a` AS `a`,`test`.`x2`.`b` AS `b` from `test`.`t1` `x2` left join `test`.`t1` `x1` on((`test`.`x2`.`b` = `test`.`x1`.`a`)) where 1
|
||
|
|
explain extended select straight_join * from
|
||
|
|
t1 as x1 inner join
|
||
|
|
(t1 as x2 inner join t1 as x3 on x3.b = x2.a)
|
||
|
|
on x2.pk = x1.a;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE x1 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 13 100.00 Parent of 3 pushed join@1; Using where with pushed condition (`test`.`x1`.`a` is not null)
|
||
|
|
1 SIMPLE x2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.x1.a 1 100.00 Child of 'x1' in pushed join@1; Using where with pushed condition (`test`.`x2`.`a` is not null)
|
||
|
|
1 SIMPLE x3 p0,p1,p2,p3,p4,p5,p6,p7 ref ix1 ix1 5 test.x2.a 2 100.00 Child of 'x2' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select straight_join `test`.`x1`.`pk` AS `pk`,`test`.`x1`.`u` AS `u`,`test`.`x1`.`a` AS `a`,`test`.`x1`.`b` AS `b`,`test`.`x2`.`pk` AS `pk`,`test`.`x2`.`u` AS `u`,`test`.`x2`.`a` AS `a`,`test`.`x2`.`b` AS `b`,`test`.`x3`.`pk` AS `pk`,`test`.`x3`.`u` AS `u`,`test`.`x3`.`a` AS `a`,`test`.`x3`.`b` AS `b` from `test`.`t1` `x1` join `test`.`t1` `x2` join `test`.`t1` `x3` where ((`test`.`x3`.`b` = `test`.`x2`.`a`) and (`test`.`x2`.`pk` = `test`.`x1`.`a`))
|
||
|
|
explain extended select straight_join * from
|
||
|
|
t1 as x1 left join
|
||
|
|
(t1 as x2 inner join t1 as x3 on x3.b = x2.a)
|
||
|
|
on x2.pk = x1.a;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE x1 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 13 100.00 Parent of 2 pushed join@1
|
||
|
|
1 SIMPLE x2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.x1.a 1 100.00 Child of 'x1' in pushed join@1
|
||
|
|
1 SIMPLE x3 p0,p1,p2,p3,p4,p5,p6,p7 ref ix1 ix1 5 test.x2.a 2 100.00 NULL
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 Can't push table 'x3' as child of 'x1', outer join of scan-child not implemented
|
||
|
|
Note 1003 /* select#1 */ select straight_join `test`.`x1`.`pk` AS `pk`,`test`.`x1`.`u` AS `u`,`test`.`x1`.`a` AS `a`,`test`.`x1`.`b` AS `b`,`test`.`x2`.`pk` AS `pk`,`test`.`x2`.`u` AS `u`,`test`.`x2`.`a` AS `a`,`test`.`x2`.`b` AS `b`,`test`.`x3`.`pk` AS `pk`,`test`.`x3`.`u` AS `u`,`test`.`x3`.`a` AS `a`,`test`.`x3`.`b` AS `b` from `test`.`t1` `x1` left join (`test`.`t1` `x2` join `test`.`t1` `x3`) on(((`test`.`x2`.`pk` = `test`.`x1`.`a`) and (`test`.`x3`.`b` = `test`.`x2`.`a`))) where 1
|
||
|
|
explain extended select straight_join count(*) from t1 as x1
|
||
|
|
join t1 as x2 on x2.b = x1.a
|
||
|
|
join t1 as x3 on x3.b = x1.b;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE x1 p0,p1,p2,p3,p4,p5,p6,p7 ALL ix1 NULL NULL NULL 13 100.00 Parent of 3 pushed join@1; Using where with pushed condition ((`test`.`x1`.`a` is not null) and (`test`.`x1`.`b` is not null))
|
||
|
|
1 SIMPLE x2 p0,p1,p2,p3,p4,p5,p6,p7 ref ix1 ix1 5 test.x1.a 2 100.00 Child of 'x1' in pushed join@1
|
||
|
|
1 SIMPLE x3 p0,p1,p2,p3,p4,p5,p6,p7 ref ix1 ix1 5 test.x1.b 2 100.00 Child of 'x1' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select straight_join count(0) AS `count(*)` from `test`.`t1` `x1` join `test`.`t1` `x2` join `test`.`t1` `x3` where ((`test`.`x2`.`b` = `test`.`x1`.`a`) and (`test`.`x3`.`b` = `test`.`x1`.`b`))
|
||
|
|
set ndb_join_pushdown=off;
|
||
|
|
select straight_join count(*) from t1 as x1
|
||
|
|
join t1 as x2 on x2.b = x1.a
|
||
|
|
join t1 as x3 on x3.b = x1.b;
|
||
|
|
count(*)
|
||
|
|
2028
|
||
|
|
set ndb_join_pushdown=on;
|
||
|
|
select straight_join count(*) from t1 as x1
|
||
|
|
join t1 as x2 on x2.b = x1.a
|
||
|
|
join t1 as x3 on x3.b = x1.b;
|
||
|
|
count(*)
|
||
|
|
2028
|
||
|
|
explain extended select straight_join count(*) from t1 as x1
|
||
|
|
join t1 as x2 on x2.b = x1.a
|
||
|
|
join t1 as x3 on x3.b = x1.a
|
||
|
|
join t1 as x4 on x4.b = x1.a
|
||
|
|
join t1 as x5 on x5.b = x1.a
|
||
|
|
join t1 as x6 on x6.b = x1.a
|
||
|
|
join t1 as x7 on x7.b = x1.a
|
||
|
|
where x3.a < x2.pk and x4.a < x3.pk;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE x1 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL # # Parent of 7 pushed join@1; Using where with pushed condition ((`test`.`x1`.`a` is not null) and (`test`.`x1`.`a` is not null) and (`test`.`x1`.`a` is not null) and (`test`.`x1`.`a` is not null) and (`test`.`x1`.`a` is not null) and (`test`.`x1`.`a` is not null))
|
||
|
|
1 SIMPLE x2 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY,ix1 ix1 5 test.x1.a # # Child of 'x1' in pushed join@1
|
||
|
|
1 SIMPLE x3 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY,ix1 ix1 5 test.x1.a # # Child of 'x1' in pushed join@1; Using where
|
||
|
|
1 SIMPLE x4 p0,p1,p2,p3,p4,p5,p6,p7 ref ix1 ix1 5 test.x1.a # # Child of 'x1' in pushed join@1; Using where
|
||
|
|
1 SIMPLE x5 p0,p1,p2,p3,p4,p5,p6,p7 ref ix1 ix1 5 test.x1.a # # Child of 'x1' in pushed join@1
|
||
|
|
1 SIMPLE x6 p0,p1,p2,p3,p4,p5,p6,p7 ref ix1 ix1 5 test.x1.a # # Child of 'x1' in pushed join@1
|
||
|
|
1 SIMPLE x7 p0,p1,p2,p3,p4,p5,p6,p7 ref ix1 ix1 5 test.x1.a # # Child of 'x1' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select straight_join count(0) AS `count(*)` from `test`.`t1` `x1` join `test`.`t1` `x2` join `test`.`t1` `x3` join `test`.`t1` `x4` join `test`.`t1` `x5` join `test`.`t1` `x6` join `test`.`t1` `x7` where ((`test`.`x2`.`b` = `test`.`x1`.`a`) and (`test`.`x3`.`b` = `test`.`x1`.`a`) and (`test`.`x4`.`b` = `test`.`x1`.`a`) and (`test`.`x5`.`b` = `test`.`x1`.`a`) and (`test`.`x6`.`b` = `test`.`x1`.`a`) and (`test`.`x7`.`b` = `test`.`x1`.`a`) and (`test`.`x3`.`a` < `test`.`x2`.`pk`) and (`test`.`x4`.`a` < `test`.`x3`.`pk`))
|
||
|
|
set global debug='+d,max_64rows_in_spj_batches';
|
||
|
|
select straight_join count(*) from t1 as x1
|
||
|
|
join t1 as x2 on x2.b = x1.a
|
||
|
|
join t1 as x3 on x3.b = x1.a
|
||
|
|
join t1 as x4 on x4.b = x1.a
|
||
|
|
join t1 as x5 on x5.b = x1.a
|
||
|
|
join t1 as x6 on x6.b = x1.a
|
||
|
|
join t1 as x7 on x7.b = x1.a
|
||
|
|
where x3.a < x2.pk and x4.a < x3.pk;
|
||
|
|
count(*)
|
||
|
|
632736
|
||
|
|
set global debug=@save_debug;
|
||
|
|
explain extended select straight_join count(*) from t1 as x1
|
||
|
|
left join t1 as x2 on x2.b = x1.a
|
||
|
|
join t1 as x3 on x3.b = x1.b;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE x1 p0,p1,p2,p3,p4,p5,p6,p7 ALL ix1 NULL NULL NULL 13 100.00 Parent of 2 pushed join@1; Using where with pushed condition (`test`.`x1`.`b` is not null)
|
||
|
|
1 SIMPLE x2 p0,p1,p2,p3,p4,p5,p6,p7 ref ix1 ix1 5 test.x1.a 2 100.00 NULL
|
||
|
|
1 SIMPLE x3 p0,p1,p2,p3,p4,p5,p6,p7 ref ix1 ix1 5 test.x1.b 2 100.00 Child of 'x1' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 Can't push table 'x2' as child of 'x1', outer join of scan-child not implemented
|
||
|
|
Note 1003 /* select#1 */ select straight_join count(0) AS `count(*)` from `test`.`t1` `x1` left join `test`.`t1` `x2` on((`test`.`x2`.`b` = `test`.`x1`.`a`)) join `test`.`t1` `x3` where (`test`.`x3`.`b` = `test`.`x1`.`b`)
|
||
|
|
set ndb_join_pushdown=off;
|
||
|
|
select straight_join count(*) from t1 as x1
|
||
|
|
left join t1 as x2 on x2.b = x1.a
|
||
|
|
join t1 as x3 on x3.b = x1.b;
|
||
|
|
count(*)
|
||
|
|
2041
|
||
|
|
set ndb_join_pushdown=on;
|
||
|
|
select straight_join count(*) from t1 as x1
|
||
|
|
left join t1 as x2 on x2.b = x1.a
|
||
|
|
join t1 as x3 on x3.b = x1.b;
|
||
|
|
count(*)
|
||
|
|
2041
|
||
|
|
explain extended select straight_join count(*) from t1 as x1
|
||
|
|
join t1 as x2 on x2.b = x1.a
|
||
|
|
left join t1 as x3 on x3.b = x1.b;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE x1 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 13 100.00 Parent of 2 pushed join@1; Using where with pushed condition (`test`.`x1`.`a` is not null)
|
||
|
|
1 SIMPLE x2 p0,p1,p2,p3,p4,p5,p6,p7 ref ix1 ix1 5 test.x1.a 2 100.00 Child of 'x1' in pushed join@1
|
||
|
|
1 SIMPLE x3 p0,p1,p2,p3,p4,p5,p6,p7 ref ix1 ix1 5 test.x1.b 2 100.00 NULL
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 Can't push table 'x3' as child of 'x1', outer join of scan-child not implemented
|
||
|
|
Note 1003 /* select#1 */ select straight_join count(0) AS `count(*)` from `test`.`t1` `x1` join `test`.`t1` `x2` left join `test`.`t1` `x3` on((`test`.`x3`.`b` = `test`.`x1`.`b`)) where (`test`.`x2`.`b` = `test`.`x1`.`a`)
|
||
|
|
set ndb_join_pushdown=off;
|
||
|
|
select straight_join count(*) from t1 as x1
|
||
|
|
join t1 as x2 on x2.b = x1.a
|
||
|
|
left join t1 as x3 on x3.b = x1.b;
|
||
|
|
count(*)
|
||
|
|
2028
|
||
|
|
set ndb_join_pushdown=on;
|
||
|
|
select straight_join count(*) from t1 as x1
|
||
|
|
join t1 as x2 on x2.b = x1.a
|
||
|
|
left join t1 as x3 on x3.b = x1.b;
|
||
|
|
count(*)
|
||
|
|
2028
|
||
|
|
explain extended
|
||
|
|
select straight_join count(*) from t1 as x1
|
||
|
|
join t1 as x2 on x2.b = x1.a
|
||
|
|
join t1 as x3 on x3.pk = x1.a join t1 as x4 on x4.b = x3.a;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE x1 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 13 100.00 Parent of 4 pushed join@1; Using where with pushed condition ((`test`.`x1`.`a` is not null) and (`test`.`x1`.`a` is not null))
|
||
|
|
1 SIMPLE x2 p0,p1,p2,p3,p4,p5,p6,p7 ref ix1 ix1 5 test.x1.a 2 100.00 Child of 'x1' in pushed join@1
|
||
|
|
1 SIMPLE x3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.x1.a 1 100.00 Child of 'x1' in pushed join@1; Using where with pushed condition (`test`.`x3`.`a` is not null)
|
||
|
|
1 SIMPLE x4 p0,p1,p2,p3,p4,p5,p6,p7 ref ix1 ix1 5 test.x3.a 2 100.00 Child of 'x3' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select straight_join count(0) AS `count(*)` from `test`.`t1` `x1` join `test`.`t1` `x2` join `test`.`t1` `x3` join `test`.`t1` `x4` where ((`test`.`x2`.`b` = `test`.`x1`.`a`) and (`test`.`x3`.`pk` = `test`.`x1`.`a`) and (`test`.`x4`.`b` = `test`.`x3`.`a`))
|
||
|
|
set ndb_join_pushdown=off;
|
||
|
|
select straight_join count(*) from t1 as x1
|
||
|
|
join t1 as x2 on x2.b = x1.a
|
||
|
|
join t1 as x3 on x3.pk = x1.a join t1 as x4 on x4.b = x3.a;
|
||
|
|
count(*)
|
||
|
|
2028
|
||
|
|
set ndb_join_pushdown=on;
|
||
|
|
select straight_join count(*) from t1 as x1
|
||
|
|
join t1 as x2 on x2.b = x1.a
|
||
|
|
join t1 as x3 on x3.pk = x1.a join t1 as x4 on x4.b = x3.a;
|
||
|
|
count(*)
|
||
|
|
2028
|
||
|
|
explain extended select straight_join count(*) from t1 as x1
|
||
|
|
left join t1 as x3 on x3.b = x1.a
|
||
|
|
join t1 as x2 on x2.pk = x1.a;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE x1 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 13 100.00 Parent of 2 pushed join@1; Using where with pushed condition (`test`.`x1`.`a` is not null)
|
||
|
|
1 SIMPLE x3 p0,p1,p2,p3,p4,p5,p6,p7 ref ix1 ix1 5 test.x1.a 2 100.00 NULL
|
||
|
|
1 SIMPLE x2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.x1.a 1 100.00 Child of 'x1' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 Can't push table 'x3' as child of 'x1', outer join of scan-child not implemented
|
||
|
|
Note 1003 /* select#1 */ select straight_join count(0) AS `count(*)` from `test`.`t1` `x1` left join `test`.`t1` `x3` on((`test`.`x3`.`b` = `test`.`x1`.`a`)) join `test`.`t1` `x2` where (`test`.`x2`.`pk` = `test`.`x1`.`a`)
|
||
|
|
select straight_join count(*) from t1 as x1
|
||
|
|
left join t1 as x3 on x3.b = x1.a
|
||
|
|
join t1 as x2 on x2.pk = x1.a;
|
||
|
|
count(*)
|
||
|
|
156
|
||
|
|
update t1 set b=b+10;
|
||
|
|
select straight_join count(*) from t1 as x1
|
||
|
|
left join t1 as x3 on x3.b = x1.a
|
||
|
|
join t1 as x2 on x2.pk = x1.a;
|
||
|
|
count(*)
|
||
|
|
12
|
||
|
|
update t1 set b=b-10;
|
||
|
|
update t1 set u=u+100;
|
||
|
|
set ndb_join_pushdown=on;
|
||
|
|
set global debug='+d,max_64rows_in_spj_batches';
|
||
|
|
explain extended select straight_join count(*) from
|
||
|
|
(t1 as x join t1 as y on y.b = x.a)
|
||
|
|
left outer join t1 as z on z.u = x.a;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 13 100.00 Parent of 3 pushed join@1; Using where with pushed condition (`test`.`x`.`a` is not null)
|
||
|
|
1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 ref ix1 ix1 5 test.x.a 2 100.00 Child of 'x' in pushed join@1
|
||
|
|
1 SIMPLE z p0,p1,p2,p3,p4,p5,p6,p7 eq_ref ix2 ix2 4 test.x.a 1 100.00 Child of 'x' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select straight_join count(0) AS `count(*)` from `test`.`t1` `x` join `test`.`t1` `y` left join `test`.`t1` `z` on((`test`.`z`.`u` = `test`.`x`.`a`)) where (`test`.`y`.`b` = `test`.`x`.`a`)
|
||
|
|
select straight_join count(*) from
|
||
|
|
(t1 as x join t1 as y on y.b = x.a)
|
||
|
|
left outer join t1 as z on z.u = x.a;
|
||
|
|
count(*)
|
||
|
|
156
|
||
|
|
set global debug=@save_debug;
|
||
|
|
update t1 set u=u-100;
|
||
|
|
drop index ix2 on t1;
|
||
|
|
create unique index ix2 on t1(a,u);
|
||
|
|
set ndb_join_pushdown=on;
|
||
|
|
explain extended
|
||
|
|
select straight_join * from
|
||
|
|
t1 as table1 join
|
||
|
|
(t1 as table2 join t1 as table3 on table3.a = table2.a)
|
||
|
|
on table3.u = table1.u
|
||
|
|
where table2.pk = 3;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE table1 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 13 100.00 NULL
|
||
|
|
1 SIMPLE table2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY,ix2 PRIMARY 4 const 1 100.00 Using where with pushed condition (`test`.`table2`.`a` is not null)
|
||
|
|
1 SIMPLE table3 p0,p1,p2,p3,p4,p5,p6,p7 ref ix2 ix2 9 test.table2.a,test.table1.u 1 100.00 NULL
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 Can't push table 'table2' as child of 'table1', their dependency is 'const'
|
||
|
|
Note 1003 Can't push table 'table3' as child of 'table1', column 'table2.a' is outside scope of pushable join
|
||
|
|
Note 1003 Cannot push table 'table3' as child of 'table2', since it referes to column 'table1.u' prior to a potential 'const' root.
|
||
|
|
Note 1003 /* select#1 */ select straight_join `test`.`table1`.`pk` AS `pk`,`test`.`table1`.`u` AS `u`,`test`.`table1`.`a` AS `a`,`test`.`table1`.`b` AS `b`,`test`.`table2`.`pk` AS `pk`,`test`.`table2`.`u` AS `u`,`test`.`table2`.`a` AS `a`,`test`.`table2`.`b` AS `b`,`test`.`table3`.`pk` AS `pk`,`test`.`table3`.`u` AS `u`,`test`.`table3`.`a` AS `a`,`test`.`table3`.`b` AS `b` from `test`.`t1` `table1` join `test`.`t1` `table2` join `test`.`t1` `table3` where ((`test`.`table3`.`a` = `test`.`table2`.`a`) and (`test`.`table3`.`u` = `test`.`table1`.`u`) and (`test`.`table2`.`pk` = 3))
|
||
|
|
select straight_join * from
|
||
|
|
t1 as table1 join
|
||
|
|
(t1 as table2 join t1 as table3 on table3.a = table2.a)
|
||
|
|
on table3.u = table1.u
|
||
|
|
where table2.pk = 3;
|
||
|
|
pk u a b pk u a b pk u a b
|
||
|
|
0 0 10 10 3 3 10 10 0 0 10 10
|
||
|
|
1 1 10 10 3 3 10 10 1 1 10 10
|
||
|
|
10 10 10 10 3 3 10 10 10 10 10 10
|
||
|
|
11 11 10 10 3 3 10 10 11 11 10 10
|
||
|
|
2 2 10 10 3 3 10 10 2 2 10 10
|
||
|
|
3 3 10 10 3 3 10 10 3 3 10 10
|
||
|
|
4 4 10 10 3 3 10 10 4 4 10 10
|
||
|
|
5 5 10 10 3 3 10 10 5 5 10 10
|
||
|
|
6 6 10 10 3 3 10 10 6 6 10 10
|
||
|
|
7 7 10 10 3 3 10 10 7 7 10 10
|
||
|
|
8 8 10 10 3 3 10 10 8 8 10 10
|
||
|
|
9 9 10 10 3 3 10 10 9 9 10 10
|
||
|
|
drop table t1;
|
||
|
|
CREATE TABLE t1 (
|
||
|
|
a int NOT NULL,
|
||
|
|
b int NOT NULL,
|
||
|
|
c int NOT NULL,
|
||
|
|
d int NOT NULL,
|
||
|
|
PRIMARY KEY (`a`,`b`)
|
||
|
|
) ENGINE=ndbcluster;
|
||
|
|
insert into t1 values (1,1,1,1), (1,2,1,1), (1,3,1,1), (1,4,1,2);
|
||
|
|
CREATE TABLE t2 (
|
||
|
|
a int NOT NULL,
|
||
|
|
PRIMARY KEY (`a`)
|
||
|
|
) ENGINE=ndbcluster;
|
||
|
|
CREATE TABLE t3 (
|
||
|
|
a int NOT NULL,
|
||
|
|
b int NOT NULL,
|
||
|
|
PRIMARY KEY (`a`,`b`)
|
||
|
|
) ENGINE=ndbcluster;
|
||
|
|
insert into t2 values (0), (1), (2), (3), (4), (5), (6), (7), (8), (9);
|
||
|
|
insert into t3 select 1, x1.a * 10+x2.a from t2 as x1 cross join t2 as x2;
|
||
|
|
set global debug='+d,max_64rows_in_spj_batches';
|
||
|
|
explain select straight_join count(*) from t1 as x0
|
||
|
|
join t3 as x1 on x1.a=x0.c
|
||
|
|
join t1 as x2 on x2.a=x0.d
|
||
|
|
join t3 as x3 on x3.a=x2.c
|
||
|
|
join t1 as x4 on x4.a=x0.d and x4.b=x3.b;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE x0 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 4 100.00 Parent of 5 pushed join@1
|
||
|
|
1 SIMPLE x1 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.x0.c 1 100.00 Child of 'x0' in pushed join@1
|
||
|
|
1 SIMPLE x2 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.x0.d 1 100.00 Child of 'x0' in pushed join@1
|
||
|
|
1 SIMPLE x3 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.x2.c 1 100.00 Child of 'x2' in pushed join@1
|
||
|
|
1 SIMPLE x4 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 8 test.x0.d,test.x3.b 1 100.00 Child of 'x3' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Note 1003 /* select#1 */ select straight_join count(0) AS `count(*)` from `test`.`t1` `x0` join `test`.`t3` `x1` join `test`.`t1` `x2` join `test`.`t3` `x3` join `test`.`t1` `x4` where ((`test`.`x1`.`a` = `test`.`x0`.`c`) and (`test`.`x3`.`a` = `test`.`x2`.`c`) and (`test`.`x4`.`b` = `test`.`x3`.`b`) and (`test`.`x2`.`a` = `test`.`x0`.`d`) and (`test`.`x4`.`a` = `test`.`x0`.`d`))
|
||
|
|
select straight_join count(*) from t1 as x0
|
||
|
|
join t3 as x1 on x1.a=x0.c
|
||
|
|
join t1 as x2 on x2.a=x0.d
|
||
|
|
join t3 as x3 on x3.a=x2.c
|
||
|
|
join t1 as x4 on x4.a=x0.d and x4.b=x3.b;
|
||
|
|
count(*)
|
||
|
|
4800
|
||
|
|
explain select straight_join count(*) from t1 as x1
|
||
|
|
join t1 as x2 on x1.c=x2.a and x2.d=2
|
||
|
|
join t3 as x3 on x1.d=x3.a;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE x1 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL # # Parent of 3 pushed join@1
|
||
|
|
1 SIMPLE x2 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.x1.c # # Child of 'x1' in pushed join@1; Using where with pushed condition (`test`.`x2`.`d` = 2)
|
||
|
|
1 SIMPLE x3 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.x1.d # # Child of 'x1' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Note 1003 /* select#1 */ select straight_join count(0) AS `count(*)` from `test`.`t1` `x1` join `test`.`t1` `x2` join `test`.`t3` `x3` where ((`test`.`x2`.`d` = 2) and (`test`.`x2`.`a` = `test`.`x1`.`c`) and (`test`.`x3`.`a` = `test`.`x1`.`d`))
|
||
|
|
select straight_join count(*) from t1 as x1
|
||
|
|
join t1 as x2 on x1.c=x2.a and x2.d=2
|
||
|
|
join t3 as x3 on x1.d=x3.a;
|
||
|
|
count(*)
|
||
|
|
300
|
||
|
|
set global debug=@save_debug;
|
||
|
|
drop table t1;
|
||
|
|
drop table t2;
|
||
|
|
drop table t3;
|
||
|
|
create table t1(
|
||
|
|
d int not null,
|
||
|
|
e int null,
|
||
|
|
f int null,
|
||
|
|
a int not null,
|
||
|
|
b int not null,
|
||
|
|
c int not null,
|
||
|
|
primary key (a,b,c))
|
||
|
|
engine = ndb partition by key (b) partitions 8;
|
||
|
|
insert into t1(a,b,c,d,e,f) values
|
||
|
|
(1, 2, 3, 1, 2, 3),
|
||
|
|
(1, 2, 4, 1, 2, 3),
|
||
|
|
(2, 3, 4, 1, 2, 3),
|
||
|
|
(3, 4, 5, 1, 2, 3),
|
||
|
|
(4, 5, 6, 1, 2, 3),
|
||
|
|
(5, 6, 7, 1, 2, 3),
|
||
|
|
(6, 7, 8, 1, 2, 3),
|
||
|
|
(7, 8, 9, 1, 2, 3);
|
||
|
|
set ndb_join_pushdown=on;
|
||
|
|
explain extended
|
||
|
|
select straight_join * from t1 x, t1 y where y.a=x.d and y.b=x.e;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL # # Parent of 2 pushed join@1; Using where with pushed condition (`test`.`x`.`e` is not null)
|
||
|
|
1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 8 test.x.d,test.x.e # # Child of 'x' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select straight_join `test`.`x`.`d` AS `d`,`test`.`x`.`e` AS `e`,`test`.`x`.`f` AS `f`,`test`.`x`.`a` AS `a`,`test`.`x`.`b` AS `b`,`test`.`x`.`c` AS `c`,`test`.`y`.`d` AS `d`,`test`.`y`.`e` AS `e`,`test`.`y`.`f` AS `f`,`test`.`y`.`a` AS `a`,`test`.`y`.`b` AS `b`,`test`.`y`.`c` AS `c` from `test`.`t1` `x` join `test`.`t1` `y` where ((`test`.`y`.`b` = `test`.`x`.`e`) and (`test`.`y`.`a` = `test`.`x`.`d`))
|
||
|
|
select straight_join * from t1 x, t1 y where y.a=x.d and y.b=x.e;
|
||
|
|
d e f a b c d e f a b c
|
||
|
|
1 2 3 1 2 3 1 2 3 1 2 3
|
||
|
|
1 2 3 1 2 3 1 2 3 1 2 4
|
||
|
|
1 2 3 1 2 4 1 2 3 1 2 3
|
||
|
|
1 2 3 1 2 4 1 2 3 1 2 4
|
||
|
|
1 2 3 2 3 4 1 2 3 1 2 3
|
||
|
|
1 2 3 2 3 4 1 2 3 1 2 4
|
||
|
|
1 2 3 3 4 5 1 2 3 1 2 3
|
||
|
|
1 2 3 3 4 5 1 2 3 1 2 4
|
||
|
|
1 2 3 4 5 6 1 2 3 1 2 3
|
||
|
|
1 2 3 4 5 6 1 2 3 1 2 4
|
||
|
|
1 2 3 5 6 7 1 2 3 1 2 3
|
||
|
|
1 2 3 5 6 7 1 2 3 1 2 4
|
||
|
|
1 2 3 6 7 8 1 2 3 1 2 3
|
||
|
|
1 2 3 6 7 8 1 2 3 1 2 4
|
||
|
|
1 2 3 7 8 9 1 2 3 1 2 3
|
||
|
|
1 2 3 7 8 9 1 2 3 1 2 4
|
||
|
|
alter table t1 partition by key (a) partitions 8;
|
||
|
|
select straight_join * from t1 x, t1 y where y.a=x.d and y.b=x.e;
|
||
|
|
d e f a b c d e f a b c
|
||
|
|
1 2 3 1 2 3 1 2 3 1 2 3
|
||
|
|
1 2 3 1 2 3 1 2 3 1 2 4
|
||
|
|
1 2 3 1 2 4 1 2 3 1 2 3
|
||
|
|
1 2 3 1 2 4 1 2 3 1 2 4
|
||
|
|
1 2 3 2 3 4 1 2 3 1 2 3
|
||
|
|
1 2 3 2 3 4 1 2 3 1 2 4
|
||
|
|
1 2 3 3 4 5 1 2 3 1 2 3
|
||
|
|
1 2 3 3 4 5 1 2 3 1 2 4
|
||
|
|
1 2 3 4 5 6 1 2 3 1 2 3
|
||
|
|
1 2 3 4 5 6 1 2 3 1 2 4
|
||
|
|
1 2 3 5 6 7 1 2 3 1 2 3
|
||
|
|
1 2 3 5 6 7 1 2 3 1 2 4
|
||
|
|
1 2 3 6 7 8 1 2 3 1 2 3
|
||
|
|
1 2 3 6 7 8 1 2 3 1 2 4
|
||
|
|
1 2 3 7 8 9 1 2 3 1 2 3
|
||
|
|
1 2 3 7 8 9 1 2 3 1 2 4
|
||
|
|
alter table t1 partition by key (a,b) partitions 8;
|
||
|
|
select straight_join * from t1 x, t1 y where y.a=x.d and y.b=x.e;
|
||
|
|
d e f a b c d e f a b c
|
||
|
|
1 2 3 1 2 3 1 2 3 1 2 3
|
||
|
|
1 2 3 1 2 3 1 2 3 1 2 4
|
||
|
|
1 2 3 1 2 4 1 2 3 1 2 3
|
||
|
|
1 2 3 1 2 4 1 2 3 1 2 4
|
||
|
|
1 2 3 2 3 4 1 2 3 1 2 3
|
||
|
|
1 2 3 2 3 4 1 2 3 1 2 4
|
||
|
|
1 2 3 3 4 5 1 2 3 1 2 3
|
||
|
|
1 2 3 3 4 5 1 2 3 1 2 4
|
||
|
|
1 2 3 4 5 6 1 2 3 1 2 3
|
||
|
|
1 2 3 4 5 6 1 2 3 1 2 4
|
||
|
|
1 2 3 5 6 7 1 2 3 1 2 3
|
||
|
|
1 2 3 5 6 7 1 2 3 1 2 4
|
||
|
|
1 2 3 6 7 8 1 2 3 1 2 3
|
||
|
|
1 2 3 6 7 8 1 2 3 1 2 4
|
||
|
|
1 2 3 7 8 9 1 2 3 1 2 3
|
||
|
|
1 2 3 7 8 9 1 2 3 1 2 4
|
||
|
|
alter table t1 partition by key (b,a) partitions 8;
|
||
|
|
select straight_join * from t1 x, t1 y where y.a=x.d and y.b=x.e;
|
||
|
|
d e f a b c d e f a b c
|
||
|
|
1 2 3 1 2 3 1 2 3 1 2 3
|
||
|
|
1 2 3 1 2 3 1 2 3 1 2 4
|
||
|
|
1 2 3 1 2 4 1 2 3 1 2 3
|
||
|
|
1 2 3 1 2 4 1 2 3 1 2 4
|
||
|
|
1 2 3 2 3 4 1 2 3 1 2 3
|
||
|
|
1 2 3 2 3 4 1 2 3 1 2 4
|
||
|
|
1 2 3 3 4 5 1 2 3 1 2 3
|
||
|
|
1 2 3 3 4 5 1 2 3 1 2 4
|
||
|
|
1 2 3 4 5 6 1 2 3 1 2 3
|
||
|
|
1 2 3 4 5 6 1 2 3 1 2 4
|
||
|
|
1 2 3 5 6 7 1 2 3 1 2 3
|
||
|
|
1 2 3 5 6 7 1 2 3 1 2 4
|
||
|
|
1 2 3 6 7 8 1 2 3 1 2 3
|
||
|
|
1 2 3 6 7 8 1 2 3 1 2 4
|
||
|
|
1 2 3 7 8 9 1 2 3 1 2 3
|
||
|
|
1 2 3 7 8 9 1 2 3 1 2 4
|
||
|
|
alter table t1 partition by key (b) partitions 8;
|
||
|
|
select straight_join * from t1 x, t1 y where y.a=x.d and y.b=2;
|
||
|
|
d e f a b c d e f a b c
|
||
|
|
1 2 3 1 2 3 1 2 3 1 2 3
|
||
|
|
1 2 3 1 2 3 1 2 3 1 2 4
|
||
|
|
1 2 3 1 2 4 1 2 3 1 2 3
|
||
|
|
1 2 3 1 2 4 1 2 3 1 2 4
|
||
|
|
1 2 3 2 3 4 1 2 3 1 2 3
|
||
|
|
1 2 3 2 3 4 1 2 3 1 2 4
|
||
|
|
1 2 3 3 4 5 1 2 3 1 2 3
|
||
|
|
1 2 3 3 4 5 1 2 3 1 2 4
|
||
|
|
1 2 3 4 5 6 1 2 3 1 2 3
|
||
|
|
1 2 3 4 5 6 1 2 3 1 2 4
|
||
|
|
1 2 3 5 6 7 1 2 3 1 2 3
|
||
|
|
1 2 3 5 6 7 1 2 3 1 2 4
|
||
|
|
1 2 3 6 7 8 1 2 3 1 2 3
|
||
|
|
1 2 3 6 7 8 1 2 3 1 2 4
|
||
|
|
1 2 3 7 8 9 1 2 3 1 2 3
|
||
|
|
1 2 3 7 8 9 1 2 3 1 2 4
|
||
|
|
alter table t1 partition by key (a) partitions 8;
|
||
|
|
select straight_join * from t1 x, t1 y where y.a=1 and y.b=x.e;
|
||
|
|
d e f a b c d e f a b c
|
||
|
|
1 2 3 1 2 3 1 2 3 1 2 3
|
||
|
|
1 2 3 1 2 3 1 2 3 1 2 4
|
||
|
|
1 2 3 1 2 4 1 2 3 1 2 3
|
||
|
|
1 2 3 1 2 4 1 2 3 1 2 4
|
||
|
|
1 2 3 2 3 4 1 2 3 1 2 3
|
||
|
|
1 2 3 2 3 4 1 2 3 1 2 4
|
||
|
|
1 2 3 3 4 5 1 2 3 1 2 3
|
||
|
|
1 2 3 3 4 5 1 2 3 1 2 4
|
||
|
|
1 2 3 4 5 6 1 2 3 1 2 3
|
||
|
|
1 2 3 4 5 6 1 2 3 1 2 4
|
||
|
|
1 2 3 5 6 7 1 2 3 1 2 3
|
||
|
|
1 2 3 5 6 7 1 2 3 1 2 4
|
||
|
|
1 2 3 6 7 8 1 2 3 1 2 3
|
||
|
|
1 2 3 6 7 8 1 2 3 1 2 4
|
||
|
|
1 2 3 7 8 9 1 2 3 1 2 3
|
||
|
|
1 2 3 7 8 9 1 2 3 1 2 4
|
||
|
|
select straight_join * from t1 x, t1 y where y.a=0 and y.b=x.e;
|
||
|
|
d e f a b c d e f a b c
|
||
|
|
alter table t1 partition by key (a,b) partitions 8;
|
||
|
|
select straight_join * from t1 x, t1 y where y.a=1 and y.b=x.e;
|
||
|
|
d e f a b c d e f a b c
|
||
|
|
1 2 3 1 2 3 1 2 3 1 2 3
|
||
|
|
1 2 3 1 2 3 1 2 3 1 2 4
|
||
|
|
1 2 3 1 2 4 1 2 3 1 2 3
|
||
|
|
1 2 3 1 2 4 1 2 3 1 2 4
|
||
|
|
1 2 3 2 3 4 1 2 3 1 2 3
|
||
|
|
1 2 3 2 3 4 1 2 3 1 2 4
|
||
|
|
1 2 3 3 4 5 1 2 3 1 2 3
|
||
|
|
1 2 3 3 4 5 1 2 3 1 2 4
|
||
|
|
1 2 3 4 5 6 1 2 3 1 2 3
|
||
|
|
1 2 3 4 5 6 1 2 3 1 2 4
|
||
|
|
1 2 3 5 6 7 1 2 3 1 2 3
|
||
|
|
1 2 3 5 6 7 1 2 3 1 2 4
|
||
|
|
1 2 3 6 7 8 1 2 3 1 2 3
|
||
|
|
1 2 3 6 7 8 1 2 3 1 2 4
|
||
|
|
1 2 3 7 8 9 1 2 3 1 2 3
|
||
|
|
1 2 3 7 8 9 1 2 3 1 2 4
|
||
|
|
select straight_join * from t1 x, t1 y where y.a=x.d and y.b=2;
|
||
|
|
d e f a b c d e f a b c
|
||
|
|
1 2 3 1 2 3 1 2 3 1 2 3
|
||
|
|
1 2 3 1 2 3 1 2 3 1 2 4
|
||
|
|
1 2 3 1 2 4 1 2 3 1 2 3
|
||
|
|
1 2 3 1 2 4 1 2 3 1 2 4
|
||
|
|
1 2 3 2 3 4 1 2 3 1 2 3
|
||
|
|
1 2 3 2 3 4 1 2 3 1 2 4
|
||
|
|
1 2 3 3 4 5 1 2 3 1 2 3
|
||
|
|
1 2 3 3 4 5 1 2 3 1 2 4
|
||
|
|
1 2 3 4 5 6 1 2 3 1 2 3
|
||
|
|
1 2 3 4 5 6 1 2 3 1 2 4
|
||
|
|
1 2 3 5 6 7 1 2 3 1 2 3
|
||
|
|
1 2 3 5 6 7 1 2 3 1 2 4
|
||
|
|
1 2 3 6 7 8 1 2 3 1 2 3
|
||
|
|
1 2 3 6 7 8 1 2 3 1 2 4
|
||
|
|
1 2 3 7 8 9 1 2 3 1 2 3
|
||
|
|
1 2 3 7 8 9 1 2 3 1 2 4
|
||
|
|
alter table t1 drop primary key, add primary key using hash (d,b,a,c);
|
||
|
|
alter table t1 partition by key (b) partitions 8;
|
||
|
|
create index ix1 on t1(b,d,a);
|
||
|
|
explain extended
|
||
|
|
select straight_join * from t1 x, t1 y where y.a=x.d and y.b=x.e;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 ALL PRIMARY NULL NULL NULL # # Parent of 2 pushed join@1; Using where with pushed condition (`test`.`x`.`e` is not null)
|
||
|
|
1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 ref ix1 ix1 4 test.x.e # # Child of 'x' in pushed join@1; Using where
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select straight_join `test`.`x`.`d` AS `d`,`test`.`x`.`e` AS `e`,`test`.`x`.`f` AS `f`,`test`.`x`.`a` AS `a`,`test`.`x`.`b` AS `b`,`test`.`x`.`c` AS `c`,`test`.`y`.`d` AS `d`,`test`.`y`.`e` AS `e`,`test`.`y`.`f` AS `f`,`test`.`y`.`a` AS `a`,`test`.`y`.`b` AS `b`,`test`.`y`.`c` AS `c` from `test`.`t1` `x` join `test`.`t1` `y` where ((`test`.`y`.`b` = `test`.`x`.`e`) and (`test`.`y`.`a` = `test`.`x`.`d`))
|
||
|
|
insert into t1(a,b,c,d,e,f) values
|
||
|
|
(8, 9, 0, 1, null, 3),
|
||
|
|
(9, 9, 0, 1, 2, null);
|
||
|
|
alter table t1 partition by key (b) partitions 8;
|
||
|
|
select straight_join * from t1 x, t1 y where y.a=x.d and y.b=x.e;
|
||
|
|
d e f a b c d e f a b c
|
||
|
|
1 2 3 1 2 3 1 2 3 1 2 3
|
||
|
|
1 2 3 1 2 3 1 2 3 1 2 4
|
||
|
|
1 2 3 1 2 4 1 2 3 1 2 3
|
||
|
|
1 2 3 1 2 4 1 2 3 1 2 4
|
||
|
|
1 2 3 2 3 4 1 2 3 1 2 3
|
||
|
|
1 2 3 2 3 4 1 2 3 1 2 4
|
||
|
|
1 2 3 3 4 5 1 2 3 1 2 3
|
||
|
|
1 2 3 3 4 5 1 2 3 1 2 4
|
||
|
|
1 2 3 4 5 6 1 2 3 1 2 3
|
||
|
|
1 2 3 4 5 6 1 2 3 1 2 4
|
||
|
|
1 2 3 5 6 7 1 2 3 1 2 3
|
||
|
|
1 2 3 5 6 7 1 2 3 1 2 4
|
||
|
|
1 2 3 6 7 8 1 2 3 1 2 3
|
||
|
|
1 2 3 6 7 8 1 2 3 1 2 4
|
||
|
|
1 2 3 7 8 9 1 2 3 1 2 3
|
||
|
|
1 2 3 7 8 9 1 2 3 1 2 4
|
||
|
|
1 2 NULL 9 9 0 1 2 3 1 2 3
|
||
|
|
1 2 NULL 9 9 0 1 2 3 1 2 4
|
||
|
|
pruned
|
||
|
|
56
|
||
|
|
const_pruned
|
||
|
|
24
|
||
|
|
drop table t1;
|
||
|
|
create table t1 (pk int primary key, a int, b int) engine=ndb;
|
||
|
|
create index ix1 on t1(b,a);
|
||
|
|
insert into t1 values (0,10,10);
|
||
|
|
insert into t1 values (1,10,20);
|
||
|
|
insert into t1 values (2,20,20);
|
||
|
|
insert into t1 values (3,10,10);
|
||
|
|
insert into t1 values (4,10,20);
|
||
|
|
insert into t1 values (5,10,20);
|
||
|
|
insert into t1 values (6,10,10);
|
||
|
|
insert into t1 values (7,10,10);
|
||
|
|
insert into t1 values (8,10,20);
|
||
|
|
insert into t1 values (9,10,10);
|
||
|
|
explain extended select x1.pk,x1.a,x1.b from t1 as x1
|
||
|
|
join t1 as x2 on x1.a=x2.b
|
||
|
|
join t1 as x3 on x2.a=x3.b
|
||
|
|
order by x1.pk limit 70;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE x1 p0,p1,p2,p3,p4,p5,p6,p7 index NULL PRIMARY 4 NULL 10 100.00 Parent of 3 pushed join@1; Using where with pushed condition (`test`.`x1`.`a` is not null)
|
||
|
|
1 SIMPLE x2 p0,p1,p2,p3,p4,p5,p6,p7 ref ix1 ix1 5 test.x1.a 2 100.00 Child of 'x1' in pushed join@1; Using where with pushed condition (`test`.`x2`.`a` is not null)
|
||
|
|
1 SIMPLE x3 p0,p1,p2,p3,p4,p5,p6,p7 ref ix1 ix1 5 test.x2.a 2 100.00 Child of 'x2' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select `test`.`x1`.`pk` AS `pk`,`test`.`x1`.`a` AS `a`,`test`.`x1`.`b` AS `b` from `test`.`t1` `x1` join `test`.`t1` `x2` join `test`.`t1` `x3` where ((`test`.`x2`.`b` = `test`.`x1`.`a`) and (`test`.`x3`.`b` = `test`.`x2`.`a`)) order by `test`.`x1`.`pk` limit 70
|
||
|
|
select x1.pk,x1.a,x1.b from t1 as x1
|
||
|
|
join t1 as x2 on x1.a=x2.b
|
||
|
|
join t1 as x3 on x2.a=x3.b
|
||
|
|
order by x1.pk limit 70;
|
||
|
|
pk a b
|
||
|
|
0 10 10
|
||
|
|
0 10 10
|
||
|
|
0 10 10
|
||
|
|
0 10 10
|
||
|
|
0 10 10
|
||
|
|
0 10 10
|
||
|
|
0 10 10
|
||
|
|
0 10 10
|
||
|
|
0 10 10
|
||
|
|
0 10 10
|
||
|
|
0 10 10
|
||
|
|
0 10 10
|
||
|
|
0 10 10
|
||
|
|
0 10 10
|
||
|
|
0 10 10
|
||
|
|
0 10 10
|
||
|
|
0 10 10
|
||
|
|
0 10 10
|
||
|
|
0 10 10
|
||
|
|
0 10 10
|
||
|
|
0 10 10
|
||
|
|
0 10 10
|
||
|
|
0 10 10
|
||
|
|
0 10 10
|
||
|
|
0 10 10
|
||
|
|
1 10 20
|
||
|
|
1 10 20
|
||
|
|
1 10 20
|
||
|
|
1 10 20
|
||
|
|
1 10 20
|
||
|
|
1 10 20
|
||
|
|
1 10 20
|
||
|
|
1 10 20
|
||
|
|
1 10 20
|
||
|
|
1 10 20
|
||
|
|
1 10 20
|
||
|
|
1 10 20
|
||
|
|
1 10 20
|
||
|
|
1 10 20
|
||
|
|
1 10 20
|
||
|
|
1 10 20
|
||
|
|
1 10 20
|
||
|
|
1 10 20
|
||
|
|
1 10 20
|
||
|
|
1 10 20
|
||
|
|
1 10 20
|
||
|
|
1 10 20
|
||
|
|
1 10 20
|
||
|
|
1 10 20
|
||
|
|
1 10 20
|
||
|
|
2 20 20
|
||
|
|
2 20 20
|
||
|
|
2 20 20
|
||
|
|
2 20 20
|
||
|
|
2 20 20
|
||
|
|
2 20 20
|
||
|
|
2 20 20
|
||
|
|
2 20 20
|
||
|
|
2 20 20
|
||
|
|
2 20 20
|
||
|
|
2 20 20
|
||
|
|
2 20 20
|
||
|
|
2 20 20
|
||
|
|
2 20 20
|
||
|
|
2 20 20
|
||
|
|
2 20 20
|
||
|
|
2 20 20
|
||
|
|
2 20 20
|
||
|
|
2 20 20
|
||
|
|
2 20 20
|
||
|
|
explain extended select * from t1 as x1, t1 as x2 where x1.a=x2.b and x1.b = 3;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE x1 p0,p1,p2,p3,p4,p5,p6,p7 ref ix1 ix1 5 const 3 100.00 Parent of 2 pushed join@1; Using where with pushed condition (`test`.`x1`.`a` is not null)
|
||
|
|
1 SIMPLE x2 p0,p1,p2,p3,p4,p5,p6,p7 ref ix1 ix1 5 test.x1.a 2 100.00 Child of 'x1' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select `test`.`x1`.`pk` AS `pk`,`test`.`x1`.`a` AS `a`,`test`.`x1`.`b` AS `b`,`test`.`x2`.`pk` AS `pk`,`test`.`x2`.`a` AS `a`,`test`.`x2`.`b` AS `b` from `test`.`t1` `x1` join `test`.`t1` `x2` where ((`test`.`x1`.`b` = 3) and (`test`.`x2`.`b` = `test`.`x1`.`a`))
|
||
|
|
select * from t1 as x1, t1 as x2 where x1.a=x2.b and x1.b = 3;
|
||
|
|
pk a b pk a b
|
||
|
|
drop table t1;
|
||
|
|
create table t (pk int primary key, a int) engine=ndb;
|
||
|
|
insert into t values
|
||
|
|
(1,1), (2,1),
|
||
|
|
(4,3), (6,3),
|
||
|
|
(7,4), (8,4);
|
||
|
|
explain extended
|
||
|
|
select distinct straight_join table1.pk FROM
|
||
|
|
t as table1 join
|
||
|
|
(t as table2 join
|
||
|
|
(t as table3 join t as table4 on table3.pk = table4.a)
|
||
|
|
on table2.pk = table3.pk )
|
||
|
|
on table1.a = table4.pk
|
||
|
|
where table2.pk != 6;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE table1 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL # # Using where with pushed condition (`test`.`table1`.`a` is not null); Using temporary
|
||
|
|
1 SIMPLE table2 p0,p1,p2,p3,p4,p5,p6,p7 range PRIMARY PRIMARY 4 NULL # # Parent of 2 pushed join@1; Using where with pushed condition (`test`.`table2`.`pk` <> 6); Using MRR; Distinct; Using join buffer (Block Nested Loop)
|
||
|
|
1 SIMPLE table3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.table2.pk # # Child of 'table2' in pushed join@1; Distinct
|
||
|
|
1 SIMPLE table4 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.table1.a # # Using where; Distinct
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 Can't push table 'table2' as child, 'type' must be a 'ref' access
|
||
|
|
Note 1003 Cannot push table 'table3' as child of table 'table1'. Doing so would prevent using join buffer for table 'table2'.
|
||
|
|
Note 1003 Cannot push table 'table4' as child of table 'table1'. Doing so would prevent using join buffer for table 'table2'.
|
||
|
|
Note 1003 Cannot push table 'table4' as child of 'table2', since it referes to column 'table1.a' which will be stored in a join buffer.
|
||
|
|
Note 1003 /* select#1 */ select straight_join distinct `test`.`table1`.`pk` AS `pk` from `test`.`t` `table1` join `test`.`t` `table2` join `test`.`t` `table3` join `test`.`t` `table4` where ((`test`.`table3`.`pk` = `test`.`table2`.`pk`) and (`test`.`table4`.`a` = `test`.`table2`.`pk`) and (`test`.`table4`.`pk` = `test`.`table1`.`a`) and (`test`.`table2`.`pk` <> 6))
|
||
|
|
select distinct straight_join table1.pk FROM
|
||
|
|
t as table1 join
|
||
|
|
(t as table2 join
|
||
|
|
(t as table3 join t as table4 on table3.pk = table4.a)
|
||
|
|
on table2.pk = table3.pk )
|
||
|
|
on table1.a = table4.pk
|
||
|
|
where table2.pk != 6;
|
||
|
|
pk
|
||
|
|
1
|
||
|
|
2
|
||
|
|
drop table t;
|
||
|
|
create table t (b int, a int, primary key (a,b)) engine=ndb;
|
||
|
|
insert into t values(0,0);
|
||
|
|
explain extended
|
||
|
|
select * from t as t1 join t as t2 on t2.a=t1.a where t1.a < 8 or t1.a >= 8;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL PRIMARY NULL NULL NULL # # Parent of 2 pushed join@1; Using where with pushed condition ((`test`.`t1`.`a` < 8) or (`test`.`t1`.`a` >= 8))
|
||
|
|
1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.t1.a # # Child of 't1' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select `test`.`t1`.`b` AS `b`,`test`.`t1`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`a` AS `a` from `test`.`t` `t1` join `test`.`t` `t2` where ((`test`.`t2`.`a` = `test`.`t1`.`a`) and ((`test`.`t1`.`a` < 8) or (`test`.`t1`.`a` >= 8)))
|
||
|
|
select * from t as t1 join t as t2 on t2.a=t1.a where t1.a < 8 or t1.a >= 8;
|
||
|
|
b a b a
|
||
|
|
0 0 0 0
|
||
|
|
drop table t;
|
||
|
|
create table t (pk1 int, pk2 int, primary key(pk1,pk2)) engine = ndb;
|
||
|
|
insert into t values (1,3), (3,6), (6,9), (9,1);
|
||
|
|
explain extended
|
||
|
|
select * from t as t1 join t as t2
|
||
|
|
on t1.pk2 = t2.pk1
|
||
|
|
where t1.pk1 != 6
|
||
|
|
order by t1.pk1 DESC;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 range PRIMARY PRIMARY 4 NULL # # Parent of 2 pushed join@1; Using where with pushed condition (`test`.`t1`.`pk1` <> 6)
|
||
|
|
1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.t1.pk2 # # Child of 't1' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select `test`.`t1`.`pk1` AS `pk1`,`test`.`t1`.`pk2` AS `pk2`,`test`.`t2`.`pk1` AS `pk1`,`test`.`t2`.`pk2` AS `pk2` from `test`.`t` `t1` join `test`.`t` `t2` where ((`test`.`t2`.`pk1` = `test`.`t1`.`pk2`) and (`test`.`t1`.`pk1` <> 6)) order by `test`.`t1`.`pk1` desc
|
||
|
|
select * from t as t1 join t as t2
|
||
|
|
on t1.pk2 = t2.pk1
|
||
|
|
where t1.pk1 != 6
|
||
|
|
order by t1.pk1 DESC;
|
||
|
|
pk1 pk2 pk1 pk2
|
||
|
|
9 1 1 3
|
||
|
|
3 6 6 9
|
||
|
|
1 3 3 6
|
||
|
|
drop table t;
|
||
|
|
create table t (k int, uq int, unique key ix1 (uq)) engine = ndb;
|
||
|
|
insert into t values (1,3), (3,NULL), (6,9), (9,1);
|
||
|
|
explain extended
|
||
|
|
select straight_join * from t as a join t as b
|
||
|
|
on a.uq=b.uq or b.uq is null;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE a p0,p1,p2,p3,p4,p5,p6,p7 ALL ix1 NULL NULL NULL 4 100.00 NULL
|
||
|
|
1 SIMPLE b p0,p1,p2,p3,p4,p5,p6,p7 ref_or_null ix1 ix1 5 test.a.uq 2 100.00 Using where
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 Table 'b' is not pushable: This table access method can not be pushed.
|
||
|
|
Note 1003 /* select#1 */ select straight_join `test`.`a`.`k` AS `k`,`test`.`a`.`uq` AS `uq`,`test`.`b`.`k` AS `k`,`test`.`b`.`uq` AS `uq` from `test`.`t` `a` join `test`.`t` `b` where ((`test`.`b`.`uq` = `test`.`a`.`uq`) or isnull(`test`.`b`.`uq`))
|
||
|
|
select straight_join * from t as a join t as b
|
||
|
|
on a.uq=b.uq or b.uq is null;
|
||
|
|
k uq k uq
|
||
|
|
1 3 1 3
|
||
|
|
1 3 3 NULL
|
||
|
|
3 NULL 3 NULL
|
||
|
|
6 9 3 NULL
|
||
|
|
6 9 6 9
|
||
|
|
9 1 3 NULL
|
||
|
|
9 1 9 1
|
||
|
|
drop table t;
|
||
|
|
create table t (k int primary key, uq int) engine = ndb;
|
||
|
|
insert into t values (1,3), (3,NULL), (6,9), (9,1);
|
||
|
|
explain extended
|
||
|
|
select * from t as a left join t as b
|
||
|
|
on a.k is null and a.uq=b.uq;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE a p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 4 100.00 NULL
|
||
|
|
1 SIMPLE b p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 4 100.00 Using where; Using join buffer (Block Nested Loop)
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 Can't push table 'b' as child, 'type' must be a 'ref' access
|
||
|
|
Note 1003 /* select#1 */ select `test`.`a`.`k` AS `k`,`test`.`a`.`uq` AS `uq`,`test`.`b`.`k` AS `k`,`test`.`b`.`uq` AS `uq` from `test`.`t` `a` left join `test`.`t` `b` on((isnull(`test`.`a`.`k`) and (`test`.`a`.`uq` = `test`.`b`.`uq`))) where 1
|
||
|
|
select * from t as a left join t as b
|
||
|
|
on a.k is null and a.uq=b.uq;
|
||
|
|
k uq k uq
|
||
|
|
1 3 NULL NULL
|
||
|
|
3 NULL NULL NULL
|
||
|
|
6 9 NULL NULL
|
||
|
|
9 1 NULL NULL
|
||
|
|
drop table t;
|
||
|
|
create table tc(
|
||
|
|
a varchar(10) not null,
|
||
|
|
b varchar(10),
|
||
|
|
c varchar(10),
|
||
|
|
primary key (a),
|
||
|
|
unique key uk1 (b, c)
|
||
|
|
)engine=ndbcluster;
|
||
|
|
insert into tc values ('aa','bb', 'x'), ('bb','cc', 'x'), ('cc', 'dd', 'x');
|
||
|
|
explain extended select * from tc as x1
|
||
|
|
right outer join tc as x2 on x1.b=x2.a
|
||
|
|
left outer join tc as x3 on x2.b = x3.b and x1.c=x3.c;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE x2 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 3 100.00 NULL
|
||
|
|
1 SIMPLE x1 p0,p1,p2,p3,p4,p5,p6,p7 ref uk1 uk1 13 test.x2.a 1 100.00 Parent of 2 pushed join@1
|
||
|
|
1 SIMPLE x3 p0,p1,p2,p3,p4,p5,p6,p7 ref uk1 uk1 26 test.x2.b,test.x1.c 1 100.00 Child of 'x1' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 Can't push table 'x1' as child of 'x2', outer join of scan-child not implemented
|
||
|
|
Note 1003 Can't push table 'x3' as child of 'x2', column 'x1.c' is outside scope of pushable join
|
||
|
|
Note 1003 /* select#1 */ select `test`.`x1`.`a` AS `a`,`test`.`x1`.`b` AS `b`,`test`.`x1`.`c` AS `c`,`test`.`x2`.`a` AS `a`,`test`.`x2`.`b` AS `b`,`test`.`x2`.`c` AS `c`,`test`.`x3`.`a` AS `a`,`test`.`x3`.`b` AS `b`,`test`.`x3`.`c` AS `c` from `test`.`tc` `x2` left join `test`.`tc` `x1` on((`test`.`x1`.`b` = `test`.`x2`.`a`)) left join `test`.`tc` `x3` on(((`test`.`x2`.`b` = `test`.`x3`.`b`) and (`test`.`x1`.`c` = `test`.`x3`.`c`))) where 1
|
||
|
|
select * from tc as x1
|
||
|
|
right outer join tc as x2 on x1.b=x2.a
|
||
|
|
left outer join tc as x3 on x2.b = x3.b and x1.c=x3.c;
|
||
|
|
a b c a b c a b c
|
||
|
|
NULL NULL NULL aa bb x NULL NULL NULL
|
||
|
|
aa bb x bb cc x bb cc x
|
||
|
|
bb cc x cc dd x cc dd x
|
||
|
|
explain extended select * from tc as x1, tc as x2 where x1.b=x2.a for update;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE x1 p0,p1,p2,p3,p4,p5,p6,p7 ALL uk1 NULL NULL NULL 3 100.00 Using where with pushed condition (`test`.`x1`.`b` is not null)
|
||
|
|
1 SIMPLE x2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 12 test.x1.b 1 100.00 NULL
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 Table 'x1' is not pushable: lock modes other than 'read committed' not implemented
|
||
|
|
Note 1003 Table 'x2' is not pushable: lock modes other than 'read committed' not implemented
|
||
|
|
Note 1003 /* select#1 */ select `test`.`x1`.`a` AS `a`,`test`.`x1`.`b` AS `b`,`test`.`x1`.`c` AS `c`,`test`.`x2`.`a` AS `a`,`test`.`x2`.`b` AS `b`,`test`.`x2`.`c` AS `c` from `test`.`tc` `x1` join `test`.`tc` `x2` where (`test`.`x2`.`a` = `test`.`x1`.`b`)
|
||
|
|
explain extended select * from tc as x1, tc as x2 where x1.b=x2.a;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE x1 p0,p1,p2,p3,p4,p5,p6,p7 ALL uk1 NULL NULL NULL 3 100.00 Parent of 2 pushed join@1; Using where with pushed condition (`test`.`x1`.`b` is not null)
|
||
|
|
1 SIMPLE x2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 12 test.x1.b 1 100.00 Child of 'x1' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select `test`.`x1`.`a` AS `a`,`test`.`x1`.`b` AS `b`,`test`.`x1`.`c` AS `c`,`test`.`x2`.`a` AS `a`,`test`.`x2`.`b` AS `b`,`test`.`x2`.`c` AS `c` from `test`.`tc` `x1` join `test`.`tc` `x2` where (`test`.`x2`.`a` = `test`.`x1`.`b`)
|
||
|
|
drop table tc;
|
||
|
|
create table t1 (
|
||
|
|
a varchar(16) not null,
|
||
|
|
b int not null,
|
||
|
|
c varchar(16) not null,
|
||
|
|
d int not null,
|
||
|
|
primary key (a,b)
|
||
|
|
) engine ndb partition by key (a);
|
||
|
|
insert into t1 values ('aaa', 1, 'aaa', 1);
|
||
|
|
explain extended
|
||
|
|
select * from t1 as q1, t1 as q2 where q1.a = 'aaa' and q1.c=q2.a;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE q1 p3 ref PRIMARY PRIMARY 18 const 2 100.00 Parent of 2 pushed join@1
|
||
|
|
1 SIMPLE q2 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 18 test.q1.c 1 100.00 Child of 'q1' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select `test`.`q1`.`a` AS `a`,`test`.`q1`.`b` AS `b`,`test`.`q1`.`c` AS `c`,`test`.`q1`.`d` AS `d`,`test`.`q2`.`a` AS `a`,`test`.`q2`.`b` AS `b`,`test`.`q2`.`c` AS `c`,`test`.`q2`.`d` AS `d` from `test`.`t1` `q1` join `test`.`t1` `q2` where ((`test`.`q2`.`a` = `test`.`q1`.`c`) and (`test`.`q1`.`a` = 'aaa'))
|
||
|
|
select * from t1 as q1, t1 as q2 where q1.a = 'aaa' and q1.c=q2.a;
|
||
|
|
a b c d a b c d
|
||
|
|
aaa 1 aaa 1 aaa 1 aaa 1
|
||
|
|
drop table t1;
|
||
|
|
CREATE TABLE t1 (
|
||
|
|
id int NOT NULL AUTO_INCREMENT,
|
||
|
|
t2_id int,
|
||
|
|
PRIMARY KEY (id)
|
||
|
|
) ENGINE=ndbcluster DEFAULT CHARSET=latin1;
|
||
|
|
CREATE TABLE t2 (
|
||
|
|
id int NOT NULL AUTO_INCREMENT,
|
||
|
|
t3_id varchar(20) DEFAULT NULL,
|
||
|
|
PRIMARY KEY (id)
|
||
|
|
) ENGINE=ndbcluster DEFAULT CHARSET=latin1;
|
||
|
|
CREATE TABLE t3 (
|
||
|
|
id varchar(20) NOT NULL,
|
||
|
|
PRIMARY KEY (`id`)
|
||
|
|
) ENGINE=ndbcluster DEFAULT CHARSET=latin1;
|
||
|
|
CREATE TABLE t4 (
|
||
|
|
pk int NOT NULL,
|
||
|
|
id varchar(20) NOT NULL,
|
||
|
|
PRIMARY KEY (pk),
|
||
|
|
UNIQUE KEY (`id`)
|
||
|
|
) ENGINE=ndbcluster DEFAULT CHARSET=latin1;
|
||
|
|
INSERT INTO t1 VALUES (20, NULL);
|
||
|
|
INSERT INTO t1 VALUES (23, 24);
|
||
|
|
INSERT INTO t2 VALUES (24, NULL);
|
||
|
|
EXPLAIN EXTENDED
|
||
|
|
SELECT *
|
||
|
|
FROM t1
|
||
|
|
INNER JOIN t2 ON t2.id = t1.t2_id
|
||
|
|
LEFT OUTER JOIN t3 ON t3.id = t2.t3_id
|
||
|
|
WHERE t1.id = 20;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 const 1 100.00 Parent of 3 pushed join@1; Using where with pushed condition (`test`.`t1`.`t2_id` is not null)
|
||
|
|
1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.t1.t2_id 1 100.00 Child of 't1' in pushed join@1
|
||
|
|
1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 22 test.t2.t3_id 1 100.00 Child of 't2' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select `test`.`t1`.`id` AS `id`,`test`.`t1`.`t2_id` AS `t2_id`,`test`.`t2`.`id` AS `id`,`test`.`t2`.`t3_id` AS `t3_id`,`test`.`t3`.`id` AS `id` from `test`.`t1` join `test`.`t2` left join `test`.`t3` on((`test`.`t3`.`id` = `test`.`t2`.`t3_id`)) where ((`test`.`t2`.`id` = `test`.`t1`.`t2_id`) and (`test`.`t1`.`id` = 20))
|
||
|
|
SELECT *
|
||
|
|
FROM t1
|
||
|
|
INNER JOIN t2 ON t2.id = t1.t2_id
|
||
|
|
LEFT OUTER JOIN t3 ON t3.id = t2.t3_id
|
||
|
|
WHERE t1.id = 20;
|
||
|
|
id t2_id id t3_id id
|
||
|
|
EXPLAIN EXTENDED
|
||
|
|
SELECT *
|
||
|
|
FROM t1
|
||
|
|
INNER JOIN t2 ON t2.id = t1.t2_id
|
||
|
|
LEFT OUTER JOIN t3 ON t3.id = t2.t3_id
|
||
|
|
WHERE t1.id = 23;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 const 1 100.00 Parent of 3 pushed join@1; Using where with pushed condition (`test`.`t1`.`t2_id` is not null)
|
||
|
|
1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.t1.t2_id 1 100.00 Child of 't1' in pushed join@1
|
||
|
|
1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 22 test.t2.t3_id 1 100.00 Child of 't2' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select `test`.`t1`.`id` AS `id`,`test`.`t1`.`t2_id` AS `t2_id`,`test`.`t2`.`id` AS `id`,`test`.`t2`.`t3_id` AS `t3_id`,`test`.`t3`.`id` AS `id` from `test`.`t1` join `test`.`t2` left join `test`.`t3` on((`test`.`t3`.`id` = `test`.`t2`.`t3_id`)) where ((`test`.`t2`.`id` = `test`.`t1`.`t2_id`) and (`test`.`t1`.`id` = 23))
|
||
|
|
SELECT *
|
||
|
|
FROM t1
|
||
|
|
INNER JOIN t2 ON t2.id = t1.t2_id
|
||
|
|
LEFT OUTER JOIN t3 ON t3.id = t2.t3_id
|
||
|
|
WHERE t1.id = 23;
|
||
|
|
id t2_id id t3_id id
|
||
|
|
23 24 24 NULL NULL
|
||
|
|
EXPLAIN EXTENDED
|
||
|
|
SELECT *
|
||
|
|
FROM t1
|
||
|
|
INNER JOIN t2 ON t2.id = t1.t2_id
|
||
|
|
LEFT OUTER JOIN t4 ON t4.id = t2.t3_id
|
||
|
|
WHERE t1.id = 23;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 const 1 100.00 Parent of 3 pushed join@1; Using where with pushed condition (`test`.`t1`.`t2_id` is not null)
|
||
|
|
1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.t1.t2_id 1 100.00 Child of 't1' in pushed join@1
|
||
|
|
1 SIMPLE t4 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref id id 22 test.t2.t3_id 1 100.00 Child of 't2' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select `test`.`t1`.`id` AS `id`,`test`.`t1`.`t2_id` AS `t2_id`,`test`.`t2`.`id` AS `id`,`test`.`t2`.`t3_id` AS `t3_id`,`test`.`t4`.`pk` AS `pk`,`test`.`t4`.`id` AS `id` from `test`.`t1` join `test`.`t2` left join `test`.`t4` on((`test`.`t4`.`id` = `test`.`t2`.`t3_id`)) where ((`test`.`t2`.`id` = `test`.`t1`.`t2_id`) and (`test`.`t1`.`id` = 23))
|
||
|
|
SELECT *
|
||
|
|
FROM t1
|
||
|
|
INNER JOIN t2 ON t2.id = t1.t2_id
|
||
|
|
LEFT OUTER JOIN t4 ON t4.id = t2.t3_id
|
||
|
|
WHERE t1.id = 23;
|
||
|
|
id t2_id id t3_id pk id
|
||
|
|
23 24 24 NULL NULL NULL
|
||
|
|
EXPLAIN EXTENDED
|
||
|
|
SELECT *
|
||
|
|
FROM t1
|
||
|
|
LEFT OUTER JOIN t2 ON t2.id = t1.t2_id
|
||
|
|
LEFT OUTER JOIN t2 as t3 ON t3.id = t1.t2_id;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 2 100.00 Parent of 3 pushed join@1
|
||
|
|
1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.t1.t2_id 1 100.00 Child of 't1' in pushed join@1
|
||
|
|
1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.t1.t2_id 1 100.00 Child of 't1' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select `test`.`t1`.`id` AS `id`,`test`.`t1`.`t2_id` AS `t2_id`,`test`.`t2`.`id` AS `id`,`test`.`t2`.`t3_id` AS `t3_id`,`test`.`t3`.`id` AS `id`,`test`.`t3`.`t3_id` AS `t3_id` from `test`.`t1` left join `test`.`t2` on((`test`.`t2`.`id` = `test`.`t1`.`t2_id`)) left join `test`.`t2` `t3` on((`test`.`t3`.`id` = `test`.`t1`.`t2_id`)) where 1
|
||
|
|
SELECT *
|
||
|
|
FROM t1
|
||
|
|
LEFT OUTER JOIN t2 ON t2.id = t1.t2_id
|
||
|
|
LEFT OUTER JOIN t2 as t3 ON t3.id = t1.t2_id;
|
||
|
|
id t2_id id t3_id id t3_id
|
||
|
|
20 NULL NULL NULL NULL NULL
|
||
|
|
23 24 24 NULL 24 NULL
|
||
|
|
DROP TABLE t1,t2,t3,t4;
|
||
|
|
CREATE TABLE t1 (
|
||
|
|
a int NOT NULL,
|
||
|
|
b int NOT NULL,
|
||
|
|
c int NOT NULL,
|
||
|
|
d int,
|
||
|
|
PRIMARY KEY (`a`,`b`),
|
||
|
|
unique key(c)
|
||
|
|
) ENGINE=ndbcluster;
|
||
|
|
insert into t1 values
|
||
|
|
(1,1,1,1),
|
||
|
|
(1,2,2,1),
|
||
|
|
(1,3,3,1),
|
||
|
|
(1,4,4,1),
|
||
|
|
(1,5,5,2),
|
||
|
|
(1,6,6,2),
|
||
|
|
(1,7,7,2),
|
||
|
|
(1,8,8,2);
|
||
|
|
explain extended select count(*) from t1 as x1
|
||
|
|
join (t1 as x2
|
||
|
|
left join (t1 as x3
|
||
|
|
cross join t1 as x4)
|
||
|
|
on x2.d=x3.a)
|
||
|
|
on x2.c is null or x1.a=x4.d;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE x2 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 8 100.00 NULL
|
||
|
|
1 SIMPLE x3 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.x2.d 1 100.00 NULL
|
||
|
|
1 SIMPLE x4 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 8 100.00 Parent of 2 pushed join@1; Using where
|
||
|
|
1 SIMPLE x1 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.x4.d 1 100.00 Child of 'x4' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 Can't push table 'x3' as child of 'x2', outer join of scan-child not implemented
|
||
|
|
Note 1003 Can't push table 'x4' as child, 'type' must be a 'ref' access
|
||
|
|
Note 1003 Can't push table 'x1' as child of 'x2', column 'x4.d' is outside scope of pushable join
|
||
|
|
Note 1003 Can't push table 'x1' as child of 'x3', column 'x4.d' is outside scope of pushable join
|
||
|
|
Note 1003 /* select#1 */ select count(0) AS `count(*)` from `test`.`t1` `x1` join `test`.`t1` `x2` left join (`test`.`t1` `x3` join `test`.`t1` `x4`) on((`test`.`x3`.`a` = `test`.`x2`.`d`)) where (`test`.`x1`.`a` = `test`.`x4`.`d`)
|
||
|
|
select count(*) from t1 as x1
|
||
|
|
join (t1 as x2
|
||
|
|
left join (t1 as x3
|
||
|
|
cross join t1 as x4)
|
||
|
|
on x2.d=x3.a)
|
||
|
|
on x2.c is null or x1.a=x4.d;
|
||
|
|
count(*)
|
||
|
|
1024
|
||
|
|
explain extended select count(*) from t1 as x1
|
||
|
|
left join (t1 as x2
|
||
|
|
cross join t1 as x3)
|
||
|
|
on x1.d=x2.a;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE x1 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 8 100.00 NULL
|
||
|
|
1 SIMPLE x2 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.x1.d 1 100.00 NULL
|
||
|
|
1 SIMPLE x3 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 8 100.00 NULL
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 Can't push table 'x2' as child of 'x1', outer join of scan-child not implemented
|
||
|
|
Note 1003 Can't push table 'x3' as child, 'type' must be a 'ref' access
|
||
|
|
Note 1003 /* select#1 */ select count(0) AS `count(*)` from `test`.`t1` `x1` left join (`test`.`t1` `x2` join `test`.`t1` `x3`) on((`test`.`x1`.`d` = `test`.`x2`.`a`)) where 1
|
||
|
|
select count(*) from t1 as x1
|
||
|
|
left join (t1 as x2
|
||
|
|
cross join t1 as x3)
|
||
|
|
on x1.d=x2.a;
|
||
|
|
count(*)
|
||
|
|
260
|
||
|
|
explain extended select count(*) from t1 as x0
|
||
|
|
left join (t1 as x1
|
||
|
|
join (t1 as x2
|
||
|
|
left join (t1 as x3
|
||
|
|
join t1 as x4 on x3.d=x4.a)
|
||
|
|
on x2.d=x3.a)
|
||
|
|
on x2.c is null or x1.a=x4.d)
|
||
|
|
on x0.d=x1.a;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE x0 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 8 100.00 NULL
|
||
|
|
1 SIMPLE x1 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.x0.d 1 100.00 NULL
|
||
|
|
1 SIMPLE x2 p0,p1,p2,p3,p4,p5,p6,p7 ALL c NULL NULL NULL 8 100.00 NULL
|
||
|
|
1 SIMPLE x3 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.x2.d 1 100.00 Parent of 2 pushed join@1
|
||
|
|
1 SIMPLE x4 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 4 test.x3.d 1 100.00 Child of 'x3' in pushed join@1; Using where
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 Can't push table 'x1' as child of 'x0', outer join of scan-child not implemented
|
||
|
|
Note 1003 Can't push table 'x2' as child, 'type' must be a 'ref' access
|
||
|
|
Note 1003 Can't push table 'x3' as child of 'x0', column 'x2.d' is outside scope of pushable join
|
||
|
|
Note 1003 Can't push table 'x4' as child of 'x0', column 'x3.d' is outside scope of pushable join
|
||
|
|
Note 1003 Can't push table 'x3' as child of 'x1', column 'x2.d' is outside scope of pushable join
|
||
|
|
Note 1003 Can't push table 'x4' as child of 'x1', column 'x3.d' is outside scope of pushable join
|
||
|
|
Note 1003 Can't push table 'x3' as child of 'x2', outer join of scan-child not implemented
|
||
|
|
Note 1003 Can't push table 'x4' as child of 'x2', column 'x3.d' is outside scope of pushable join
|
||
|
|
Note 1003 /* select#1 */ select count(0) AS `count(*)` from `test`.`t1` `x0` left join (`test`.`t1` `x1` join `test`.`t1` `x2` left join (`test`.`t1` `x3` join `test`.`t1` `x4`) on(((`test`.`x2`.`d` = `test`.`x3`.`a`) and (`test`.`x3`.`d` = `test`.`x4`.`a`)))) on(((`test`.`x0`.`d` = `test`.`x1`.`a`) and (isnull(`test`.`x2`.`c`) or (`test`.`x1`.`a` = `test`.`x4`.`d`)))) where 1
|
||
|
|
select count(*) from t1 as x0
|
||
|
|
left join (t1 as x1
|
||
|
|
join (t1 as x2
|
||
|
|
left join (t1 as x3
|
||
|
|
join t1 as x4 on x3.d=x4.a)
|
||
|
|
on x2.d=x3.a)
|
||
|
|
on x2.c is null or x1.a=x4.d)
|
||
|
|
on x0.d=x1.a;
|
||
|
|
count(*)
|
||
|
|
2052
|
||
|
|
drop table t1;
|
||
|
|
create table t1 (pk char(10) primary key, u int not null) engine=ndb;
|
||
|
|
create table t2 (pk int primary key, u int not null) engine=ndb;
|
||
|
|
insert into t1 values ('wh',1);
|
||
|
|
insert into t1 values ('ik',2);
|
||
|
|
insert into t1 values ('cu',3);
|
||
|
|
insert into t1 values ('pw',4);
|
||
|
|
insert into t1 values ('cq',4);
|
||
|
|
insert into t2 values (1,2), (2,3), (3,4), (4,5);
|
||
|
|
explain select * from t1 join t2 on t1.u = t2.pk order by t1.pk;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 index NULL PRIMARY 10 NULL 5 100.00 Parent of 2 pushed join@1
|
||
|
|
1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.t1.u 1 100.00 Child of 't1' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Note 1003 /* select#1 */ select `test`.`t1`.`pk` AS `pk`,`test`.`t1`.`u` AS `u`,`test`.`t2`.`pk` AS `pk`,`test`.`t2`.`u` AS `u` from `test`.`t1` join `test`.`t2` where (`test`.`t2`.`pk` = `test`.`t1`.`u`) order by `test`.`t1`.`pk`
|
||
|
|
select * from t1 join t2 on t1.u = t2.pk order by t1.pk;
|
||
|
|
pk u pk u
|
||
|
|
cq 4 4 5
|
||
|
|
cu 3 3 4
|
||
|
|
ik 2 2 3
|
||
|
|
pw 4 4 5
|
||
|
|
wh 1 1 2
|
||
|
|
drop table t1;
|
||
|
|
drop table t2;
|
||
|
|
create table t1 (
|
||
|
|
a char(10) primary key,
|
||
|
|
b char(10) not null,
|
||
|
|
c char(10) not null,
|
||
|
|
l00 char(255) not null,
|
||
|
|
l01 char(255) not null,
|
||
|
|
l02 char(255) not null,
|
||
|
|
l03 char(255) not null,
|
||
|
|
l04 char(255) not null,
|
||
|
|
l05 char(255) not null,
|
||
|
|
l06 char(255) not null,
|
||
|
|
l07 char(255) not null,
|
||
|
|
l08 char(255) not null,
|
||
|
|
l09 char(255) not null,
|
||
|
|
l10 char(255) not null,
|
||
|
|
l11 char(255) not null,
|
||
|
|
l12 char(255) not null,
|
||
|
|
l13 char(255) not null,
|
||
|
|
l14 char(255) not null,
|
||
|
|
l15 char(255) not null,
|
||
|
|
l16 char(255) not null,
|
||
|
|
l17 char(255) not null,
|
||
|
|
l18 char(255) not null,
|
||
|
|
l19 char(255) not null,
|
||
|
|
l20 char(255) not null,
|
||
|
|
l21 char(255) not null,
|
||
|
|
l22 char(255) not null,
|
||
|
|
l23 char(255) not null,
|
||
|
|
l24 char(255) not null,
|
||
|
|
l25 char(255) not null,
|
||
|
|
l26 char(255) not null,
|
||
|
|
l27 char(255) not null,
|
||
|
|
l28 char(255) not null,
|
||
|
|
l29 char(255) not null,
|
||
|
|
l30 char(255) not null,
|
||
|
|
l31 char(255) not null,
|
||
|
|
index(c, b)
|
||
|
|
) engine=ndb partition by key(a) partitions 8;
|
||
|
|
insert into t1 values ('a','a','a','x','x','x','x','x','x','x','x','x','x','x','x','x','x','x','x','x','x','x','x','x','x','x','x','x','x','x','x','x','x','x','x');
|
||
|
|
insert into t1 values ('b','b','b','x','x','x','x','x','x','x','x','x','x','x','x','x','x','x','x','x','x','x','x','x','x','x','x','x','x','x','x','x','x','x','x');
|
||
|
|
insert into t1 values ('c','c','c','x','x','x','x','x','x','x','x','x','x','x','x','x','x','x','x','x','x','x','x','x','x','x','x','x','x','x','x','x','x','x','x');
|
||
|
|
explain select count(*) from t1 as x1 join t1 as x2 on x1.b = x2.c;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE x1 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL # # Parent of 2 pushed join@1
|
||
|
|
1 SIMPLE x2 p0,p1,p2,p3,p4,p5,p6,p7 ref c c 10 test.x1.b # # Child of 'x1' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Note 1003 /* select#1 */ select count(0) AS `count(*)` from `test`.`t1` `x1` join `test`.`t1` `x2` where (`test`.`x2`.`c` = `test`.`x1`.`b`)
|
||
|
|
select count(*) from t1 as x1 join t1 as x2 on x1.b = x2.c;
|
||
|
|
count(*)
|
||
|
|
3
|
||
|
|
drop table t1;
|
||
|
|
create table t1
|
||
|
|
(a int not null,
|
||
|
|
b int not null,
|
||
|
|
c int not null,
|
||
|
|
d int not null,
|
||
|
|
primary key(a,b,c,d)) engine=ndb partition by key (b,c);
|
||
|
|
insert into t1 values (0x4f, 0x4f, 0x4f, 0x4f);
|
||
|
|
explain select * from t1 as x1
|
||
|
|
join t1 as x2 on x1.c=0x4f and x2.a=0+x1.b and x2.b=x1.b
|
||
|
|
join t1 as x3 on x3.a=x2.d and x3.b=x1.d and x3.c=x2.c;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE x1 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL # # Using where with pushed condition (`test`.`x1`.`c` = 0x4f)
|
||
|
|
1 SIMPLE x2 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 8 func,test.x1.b # # Parent of 2 pushed join@1; Using where
|
||
|
|
1 SIMPLE x3 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 12 test.x2.d,test.x1.d,test.x2.c # # Child of 'x2' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Note 1003 Can't push table 'x2' as child, column 'a' does neither 'ref' a column nor a constant
|
||
|
|
Note 1003 Can't push table 'x3' as child of 'x1', column 'x2.d' is outside scope of pushable join
|
||
|
|
Note 1003 /* select#1 */ select `test`.`x1`.`a` AS `a`,`test`.`x1`.`b` AS `b`,`test`.`x1`.`c` AS `c`,`test`.`x1`.`d` AS `d`,`test`.`x2`.`a` AS `a`,`test`.`x2`.`b` AS `b`,`test`.`x2`.`c` AS `c`,`test`.`x2`.`d` AS `d`,`test`.`x3`.`a` AS `a`,`test`.`x3`.`b` AS `b`,`test`.`x3`.`c` AS `c`,`test`.`x3`.`d` AS `d` from `test`.`t1` `x1` join `test`.`t1` `x2` join `test`.`t1` `x3` where ((`test`.`x2`.`b` = `test`.`x1`.`b`) and (`test`.`x3`.`c` = `test`.`x2`.`c`) and (`test`.`x3`.`b` = `test`.`x1`.`d`) and (`test`.`x3`.`a` = `test`.`x2`.`d`) and (`test`.`x1`.`c` = 0x4f) and (`test`.`x2`.`a` = (0 + `test`.`x1`.`b`)))
|
||
|
|
select * from t1 as x1
|
||
|
|
join t1 as x2 on x1.c=0x4f and x2.a=0+x1.b and x2.b=x1.b
|
||
|
|
join t1 as x3 on x3.a=x2.c and x3.b=x1.d and x3.c=x2.c;
|
||
|
|
a b c d a b c d a b c d
|
||
|
|
79 79 79 79 79 79 79 79 79 79 79 79
|
||
|
|
explain select * from t1 as x1
|
||
|
|
join t1 as x2 on x1.c=0x4f and x2.a=0+x1.b and x2.b=x1.b
|
||
|
|
join t1 as x3 on x3.a=x2.d and x3.b=x1.d and x3.c=0x4f;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE x1 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL # # Using where with pushed condition (`test`.`x1`.`c` = 0x4f)
|
||
|
|
1 SIMPLE x2 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 8 func,test.x1.b # # Parent of 2 pushed join@1; Using where
|
||
|
|
1 SIMPLE x3 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY PRIMARY 12 test.x2.d,test.x1.d,const # # Child of 'x2' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Note 1003 Can't push table 'x2' as child, column 'a' does neither 'ref' a column nor a constant
|
||
|
|
Note 1003 Can't push table 'x3' as child of 'x1', column 'x2.d' is outside scope of pushable join
|
||
|
|
Note 1003 /* select#1 */ select `test`.`x1`.`a` AS `a`,`test`.`x1`.`b` AS `b`,`test`.`x1`.`c` AS `c`,`test`.`x1`.`d` AS `d`,`test`.`x2`.`a` AS `a`,`test`.`x2`.`b` AS `b`,`test`.`x2`.`c` AS `c`,`test`.`x2`.`d` AS `d`,`test`.`x3`.`a` AS `a`,`test`.`x3`.`b` AS `b`,`test`.`x3`.`c` AS `c`,`test`.`x3`.`d` AS `d` from `test`.`t1` `x1` join `test`.`t1` `x2` join `test`.`t1` `x3` where ((`test`.`x2`.`b` = `test`.`x1`.`b`) and (`test`.`x3`.`b` = `test`.`x1`.`d`) and (`test`.`x3`.`a` = `test`.`x2`.`d`) and (`test`.`x3`.`c` = 0x4f) and (`test`.`x1`.`c` = 0x4f) and (`test`.`x2`.`a` = (0 + `test`.`x1`.`b`)))
|
||
|
|
select * from t1 as x1
|
||
|
|
join t1 as x2 on x1.c=0x4f and x2.a=0+x1.b and x2.b=x1.b
|
||
|
|
join t1 as x3 on x3.a=x2.c and x3.b=x1.d and x3.c=0x4f;
|
||
|
|
a b c d a b c d a b c d
|
||
|
|
79 79 79 79 79 79 79 79 79 79 79 79
|
||
|
|
drop table t1;
|
||
|
|
create table t1 (
|
||
|
|
k1 int primary key,
|
||
|
|
i int,
|
||
|
|
name varchar(32),
|
||
|
|
key (name)
|
||
|
|
)
|
||
|
|
default charset = utf8
|
||
|
|
engine = ndb;
|
||
|
|
insert into t1 values (1, 1, 'Ole');
|
||
|
|
insert into t1 values (2, 2, 'Dole');
|
||
|
|
insert into t1 values (3, 3, 'Doffen');
|
||
|
|
insert into t1 values (4, 4, 'row# 999');
|
||
|
|
explain select * from t1 x, t1 y where y.k1=x.i and x.name in ('foo' , 'row# 0' , 'row# 1' , 'row# 2' , 'row# 3' , 'row# 4' , 'row# 5' , 'row# 6' , 'row# 7' , 'row# 8' , 'row# 9' , 'row# 10' , 'row# 11' , 'row# 12' , 'row# 13' , 'row# 14' , 'row# 15' , 'row# 16' , 'row# 17' , 'row# 18' , 'row# 19' , 'row# 20' , 'row# 21' , 'row# 22' , 'row# 23' , 'row# 24' , 'row# 25' , 'row# 26' , 'row# 27' , 'row# 28' , 'row# 29' , 'row# 30' , 'row# 31' , 'row# 32' , 'row# 33' , 'row# 34' , 'row# 35' , 'row# 36' , 'row# 37' , 'row# 38' , 'row# 39' , 'row# 40' , 'row# 41' , 'row# 42' , 'row# 43' , 'row# 44' , 'row# 45' , 'row# 46' , 'row# 47' , 'row# 48' , 'row# 49' , 'row# 50' , 'row# 51' , 'row# 52' , 'row# 53' , 'row# 54' , 'row# 55' , 'row# 56' , 'row# 57' , 'row# 58' , 'row# 59' , 'row# 60' , 'row# 61' , 'row# 62' , 'row# 63' , 'row# 64' , 'row# 65' , 'row# 66' , 'row# 67' , 'row# 68' , 'row# 69' , 'row# 70' , 'row# 71' , 'row# 72' , 'row# 73' , 'row# 74' , 'row# 75' , 'row# 76' , 'row# 77' , 'row# 78' , 'row# 79' , 'row# 80' , 'row# 81' , 'row# 82' , 'row# 83' , 'row# 84' , 'row# 85' , 'row# 86' , 'row# 87' , 'row# 88' , 'row# 89' , 'row# 90' , 'row# 91' , 'row# 92' , 'row# 93' , 'row# 94' , 'row# 95' , 'row# 96' , 'row# 97' , 'row# 98' , 'row# 99' , 'row# 100' , 'row# 101' , 'row# 102' , 'row# 103' , 'row# 104' , 'row# 105' , 'row# 106' , 'row# 107' , 'row# 108' , 'row# 109' , 'row# 110' , 'row# 111' , 'row# 112' , 'row# 113' , 'row# 114' , 'row# 115' , 'row# 116' , 'row# 117' , 'row# 118' , 'row# 119' , 'row# 120' , 'row# 121' , 'row# 122' , 'row# 123' , 'row# 124' , 'row# 125' , 'row# 126' , 'row# 127' , 'row# 128' , 'row# 129' , 'row# 130' , 'row# 131' , 'row# 132' , 'row# 133' , 'row# 134' , 'row# 135' , 'row# 136' , 'row# 137' , 'row# 138' , 'row# 139' , 'row# 140' , 'row# 141' , 'row# 142' , 'row# 143' , 'row# 144' , 'row# 145' , 'row# 146' , 'row# 147' , 'row# 148' , 'row# 149' , 'row# 150' , 'row# 151' , 'row# 152' , 'row# 153' , 'row# 154' , 'row# 155' , 'row# 156' , 'row# 157' , 'row# 158' , 'row# 159' , 'row# 160' , 'row# 161' , 'row# 162' , 'row# 163' , 'row# 164' , 'row# 165' , 'row# 166' , 'row# 167' , 'row# 168' , 'row# 169' , 'row# 170' , 'row# 171' , 'row# 172' , 'row# 173' , 'row# 174' , 'row# 175' , 'row# 176' , 'row# 177' , 'row# 178' , 'row# 179' , 'row# 180' , 'row# 181' , 'row# 182' , 'row# 183' , 'row# 184' , 'row# 185' , 'row# 186' , 'row# 187' , 'row# 188' , 'row# 189' , 'row# 190' , 'row# 191' , 'row# 192' , 'row# 193' , 'row# 194' , 'row# 195' , 'row# 196' , 'row# 197' , 'row# 198' , 'row# 199' , 'row# 200' , 'row# 201' , 'row# 202' , 'row# 203' , 'row# 204' , 'row# 205' , 'row# 206' , 'row# 207' , 'row# 208' , 'row# 209' , 'row# 210' , 'row# 211' , 'row# 212' , 'row# 213' , 'row# 214' , 'row# 215' , 'row# 216' , 'row# 217' , 'row# 218' , 'row# 219' , 'row# 220' , 'row# 221' , 'row# 222' , 'row# 223' , 'row# 224' , 'row# 225' , 'row# 226' , 'row# 227' , 'row# 228' , 'row# 229' , 'row# 230' , 'row# 231' , 'row# 232' , 'row# 233' , 'row# 234' , 'row# 235' , 'row# 236' , 'row# 237' , 'row# 238' , 'row# 239' , 'row# 240' , 'row# 241' , 'row# 242' , 'row# 243' , 'row# 244' , 'row# 245' , 'row# 246' , 'row# 247' , 'row# 248' , 'row# 249' , 'row# 250' , 'row# 251' , 'row# 252' , 'row# 253' , 'row# 254' , 'row# 255' , 'row# 256' , 'row# 257' , 'row# 258' , 'row# 259' , 'row# 260' , 'row# 261' , 'row# 262' , 'row# 263' , 'row# 264' , 'row# 265' , 'row# 266' , 'row# 267' , 'row# 268' , 'row# 269' , 'row# 270' , 'row# 271' , 'row# 272' , 'row# 273' , 'row# 274' , 'row# 275' , 'row# 276' , 'row# 277' , 'row# 278' , 'row# 279' , 'row# 280' , 'row# 281' , 'row# 282' , 'row# 283' , 'row# 284' , 'row# 285' , 'row# 286' , 'row# 287' , 'row# 288' , 'row# 289' , 'row# 290' , 'row# 291' , 'row# 292' , 'row# 293' , 'row# 294' , 'row# 295' , 'row# 296' , 'row# 297' , 'row# 298' , 'row# 299' , 'row# 300' , 'row# 301' , 'row# 302' , 'row# 303' , 'row# 304' , 'row# 305' , 'row# 306' , 'row# 307' , 'row# 308' , 'row# 309' , 'row# 310' , 'row# 311' , 'row# 312' , 'row# 313' , 'row# 314' , 'row# 315' , 'row# 316' , 'row# 317' ,
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 ALL name NULL NULL NULL 4 100.00 Parent of 2 pushed join@1; Using where with pushed condition ((`test`.`x`.`name` in ('foo','row# 0','row# 1','row# 2','row# 3','row# 4','row# 5','row# 6','row# 7','row# 8','row# 9','row# 10','row# 11','row# 12','row# 13','row# 14','row# 15','row# 16','row# 17','row# 18','row# 19','row# 20','row# 21','row# 22','row# 23','row# 24','row# 25','row# 26','row# 27','row# 28','row# 29','row# 30','row# 31','row# 32','row# 33','row# 34','row# 35','row# 36','row# 37','row# 38','row# 39','row# 40','row# 41','row# 42','row# 43','row# 44','row# 45','row# 46','row# 47','row# 48','row# 49','row# 50','row# 51','row# 52','row# 53','row# 54','row# 55','row# 56','row# 57','row# 58','row# 59','row# 60','row# 61','row# 62','row# 63','row# 64','row# 65','row# 66','row# 67','row# 68','row# 69','row# 70','row# 71','row# 72','row# 73','row# 74','row# 75','row# 76','row# 77','row# 78','row# 79','row# 80','row# 81','row# 82','row# 83','row# 84','row# 85','row# 86','row# 87','row# 88','row# 89','row# 90','row# 91','row# 92','row# 93','row# 94','row# 95','row# 96','row# 97','row# 98','row# 99','row# 100','row# 101','row# 102','row# 103','row# 104','row# 105','row# 106','row# 107','row# 108','row# 109','row# 110','row# 111','row# 112','row# 113','row# 114','row# 115','row# 116','row# 117','row# 118','row# 119','row# 120','row# 121','row# 122','row# 123','row# 124','row# 125','row# 126','row# 127','row# 128','row# 129','row# 130','row# 131','row# 132','row# 133','row# 134','row# 135','row# 136','row# 137','row# 138','row# 139','row# 140','row# 141','row# 142','row# 143','row# 144','row# 145','row# 146','row# 147','row# 148','row# 149','row# 150','row# 151','row# 152','row# 153','row# 154','row# 155','row# 156','row# 157','row# 158','row# 159','row# 160','row# 161','row# 162','row# 163','row# 164','row# 165','row# 166','row# 167','row# 168','row# 169','row# 170','row# 171','row# 172','row# 173','row# 174','row# 175','row# 176','row# 177','row# 178','row# 179','row# 180','row# 181','row# 182','row# 183','row# 184','row# 185','row# 186','row# 187','row# 188','row# 189','row# 190','row# 191','row# 192','row# 193','row# 194','row# 195','row# 196','row# 197','row# 198','row# 199','row# 200','row# 201','row# 202','row# 203','row# 204','row# 205','row# 206','row# 207','row# 208','row# 209','row# 210','row# 211','row# 212','row# 213','row# 214','row# 215','row# 216','row# 217','row# 218','row# 219','row# 220','row# 221','row# 222','row# 223','row# 224','row# 225','row# 226','row# 227','row# 228','row# 229','row# 230','row# 231','row# 232','row# 233','row# 234','row# 235','row# 236','row# 237','row# 238','row# 239','row# 240','row# 241','row# 242','row# 243','row# 244','row# 245','row# 246','row# 247','row# 248','row# 249','row# 250','row# 251','row# 252','row# 253','row# 254','row# 255','row# 256','row# 257','row# 258','row# 259','row# 260','row# 261','row# 262','row# 263','row# 264','row# 265','row# 266','row# 267','row# 268','row# 269','row# 270','row# 271','row# 272','row# 273','row# 274','row# 275','row# 276','row# 277','row# 278','row# 279','row# 280','row# 281','row# 282','row# 283','row# 284','row# 285','row# 286','row# 287','row# 288','row# 289','row# 290','row# 291','row# 292','row# 293','row# 294','row# 295','row# 296','row# 297','row# 298','row# 299','row# 300','row# 301','row# 302','row# 303','row# 304','row# 305','row# 306','row# 307','row# 308','row# 309','row# 310','row# 311','row# 312','row# 313','row# 314','row# 315','row# 316','row# 317','row# 318','row# 319','row# 320','row# 321','row# 322','row# 323','row# 324','row# 325','row# 326','row# 327','row# 328','row# 329','row# 330','row# 331','row# 332','row# 333','row# 334','row# 335','row# 336','row# 337','row# 338','row# 339','row# 340','row# 341','row# 342','row# 343','row# 344','row# 345','row# 346','row# 347','row# 348','row# 349','row# 350','row# 351','row# 352','row# 353','row# 354','row# 355','row# 356','row# 357','row# 358','row# 359','row# 360','row# 361','row# 362','row# 363','row# 364','row# 365','row# 366','row# 367
|
||
|
|
1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.x.i 1 100.00 Child of 'x' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Note 1003 /* select#1 */ select `test`.`x`.`k1` AS `k1`,`test`.`x`.`i` AS `i`,`test`.`x`.`name` AS `name`,`test`.`y`.`k1` AS `k1`,`test`.`y`.`i` AS `i`,`test`.`y`.`name` AS `name` from `test`.`t1` `x` join `test`.`t1` `y` where ((`test`.`y`.`k1` = `test`.`x`.`i`) and (`test`.`x`.`name` in ('foo','row# 0','row# 1','row# 2','row# 3','row# 4','row# 5','row# 6','row# 7','row# 8','row# 9','row# 10','row# 11','row# 12','row# 13','row# 14','row# 15','row# 16','row# 17','row# 18','row# 19','row# 20','row# 21','row# 22','row# 23','row# 24','row# 25','row# 26','row# 27','row# 28','row# 29','row# 30','row# 31','row# 32','row# 33','row# 34','row# 35','row# 36','row# 37','row# 38','row# 39','row# 40','row# 41','row# 42','row# 43','row# 44','row# 45','row# 46','row# 47','row# 48','row# 49','row# 50','row# 51','row# 52','row# 53','row# 54','row# 55','row# 56','row# 57','row# 58','row# 59','row# 60','row# 61','row# 62','row# 63','row# 64','row# 65','row# 66','row# 67','row# 68','row# 69','row# 70','row# 71','row# 72','row# 73','row# 74','row# 75','row# 76','row# 77','row# 78','row# 79','row# 80','row# 81','row# 82','row# 83','row# 84','row# 85','row# 86','row# 87','row# 88','row# 89','row# 90','row# 91','row# 92','row# 93','row# 94','row# 95','row# 96','row# 97','row# 98','row# 99','row# 100','row# 101','row# 102','row# 103','row# 104','row# 105','row# 106','row# 107','row# 108','row# 109','row# 110','row# 111','row# 112','row# 113','row# 114','row# 115','row# 116','row# 117','row# 118','row# 119','row# 120','row# 121','row# 122','row# 123','row# 124','row# 125','row# 126','row# 127','row# 128','row# 129','row# 130','row# 131','row# 132','row# 133','row# 134','row# 135','row# 136','row# 137','row# 138','row# 139','row# 140','row# 141','row# 142','row# 143','row# 144','row# 145','row# 146','row# 147','row# 148','row# 149','row# 150','row# 151','row# 152','row# 153','row# 154','row# 155','row# 156','row# 157','row# 158','row# 159','row# 160','row# 161','row# 162','row# 163','row# 164','row# 165','row# 166','row# 167','row# 168','row# 169','row# 170','row# 171','row# 172','row# 173','row# 174','row# 175','row# 176','row# 177','row# 178','row# 179','row# 180','row# 181','row# 182','row# 183','row# 184','row# 185','row# 186','row# 187','row# 188','row# 189','row# 190','row# 191','row# 192','row# 193','row# 194','row# 195','row# 196','row# 197','row# 198','row# 199','row# 200','row# 201','row# 202','row# 203','row# 204','row# 205','row# 206','row# 207','row# 208','row# 209','row# 210','row# 211','row# 212','row# 213','row# 214','row# 215','row# 216','row# 217','row# 218','row# 219','row# 220','row# 221','row# 222','row# 223','row# 224','row# 225','row# 226','row# 227','row# 228','row# 229','row# 230','row# 231','row# 232','row# 233','row# 234','row# 235','row# 236','row# 237','row# 238','row# 239','row# 240','row# 241','row# 242','row# 243','row# 244','row# 245','row# 246','row# 247','row# 248','row# 249','row# 250','row# 251','row# 252','row# 253','row# 254','row# 255','row# 256','row# 257','row# 258','row# 259','row# 260','row# 261','row# 262','row# 263','row# 264','row# 265','row# 266','row# 267','row# 268','row# 269','row# 270','row# 271','row# 272','row# 273','row# 274','row# 275','row# 276','row# 277','row# 278','row# 279','row# 280','row# 281','row# 282','row# 283','row# 284','row# 285','row# 286','row# 287','row# 288','row# 289','row# 290','row# 291','row# 292','row# 293','row# 294','row# 295','row# 296','row# 297','row# 298','row# 299','row# 300','row# 301','row# 302','row# 303','row# 304','row# 305','row# 306','row# 307','row# 308','row# 309','row# 310','row# 311','row# 312','row# 313','row# 314','row# 315','row# 316','row# 317','row# 318','row# 319','row# 320','row# 321','row# 322','row# 323','row# 324','row# 325','row# 326','row# 327','row# 328','row# 329','row# 330','row# 331','row# 332','row# 333','row# 334','row# 335','row# 336','row# 337','row# 338','row# 339','row# 340','row# 341','row# 342','row# 343','row# 344','row# 345','row# 346','row# 347','row# 348','row# 349','row# 350','row# 351','row# 352','row# 353','row# 354','ro
|
||
|
|
select * from t1 x, t1 y where y.k1=x.i and x.name in ('foo' , 'row# 0' , 'row# 1' , 'row# 2' , 'row# 3' , 'row# 4' , 'row# 5' , 'row# 6' , 'row# 7' , 'row# 8' , 'row# 9' , 'row# 10' , 'row# 11' , 'row# 12' , 'row# 13' , 'row# 14' , 'row# 15' , 'row# 16' , 'row# 17' , 'row# 18' , 'row# 19' , 'row# 20' , 'row# 21' , 'row# 22' , 'row# 23' , 'row# 24' , 'row# 25' , 'row# 26' , 'row# 27' , 'row# 28' , 'row# 29' , 'row# 30' , 'row# 31' , 'row# 32' , 'row# 33' , 'row# 34' , 'row# 35' , 'row# 36' , 'row# 37' , 'row# 38' , 'row# 39' , 'row# 40' , 'row# 41' , 'row# 42' , 'row# 43' , 'row# 44' , 'row# 45' , 'row# 46' , 'row# 47' , 'row# 48' , 'row# 49' , 'row# 50' , 'row# 51' , 'row# 52' , 'row# 53' , 'row# 54' , 'row# 55' , 'row# 56' , 'row# 57' , 'row# 58' , 'row# 59' , 'row# 60' , 'row# 61' , 'row# 62' , 'row# 63' , 'row# 64' , 'row# 65' , 'row# 66' , 'row# 67' , 'row# 68' , 'row# 69' , 'row# 70' , 'row# 71' , 'row# 72' , 'row# 73' , 'row# 74' , 'row# 75' , 'row# 76' , 'row# 77' , 'row# 78' , 'row# 79' , 'row# 80' , 'row# 81' , 'row# 82' , 'row# 83' , 'row# 84' , 'row# 85' , 'row# 86' , 'row# 87' , 'row# 88' , 'row# 89' , 'row# 90' , 'row# 91' , 'row# 92' , 'row# 93' , 'row# 94' , 'row# 95' , 'row# 96' , 'row# 97' , 'row# 98' , 'row# 99' , 'row# 100' , 'row# 101' , 'row# 102' , 'row# 103' , 'row# 104' , 'row# 105' , 'row# 106' , 'row# 107' , 'row# 108' , 'row# 109' , 'row# 110' , 'row# 111' , 'row# 112' , 'row# 113' , 'row# 114' , 'row# 115' , 'row# 116' , 'row# 117' , 'row# 118' , 'row# 119' , 'row# 120' , 'row# 121' , 'row# 122' , 'row# 123' , 'row# 124' , 'row# 125' , 'row# 126' , 'row# 127' , 'row# 128' , 'row# 129' , 'row# 130' , 'row# 131' , 'row# 132' , 'row# 133' , 'row# 134' , 'row# 135' , 'row# 136' , 'row# 137' , 'row# 138' , 'row# 139' , 'row# 140' , 'row# 141' , 'row# 142' , 'row# 143' , 'row# 144' , 'row# 145' , 'row# 146' , 'row# 147' , 'row# 148' , 'row# 149' , 'row# 150' , 'row# 151' , 'row# 152' , 'row# 153' , 'row# 154' , 'row# 155' , 'row# 156' , 'row# 157' , 'row# 158' , 'row# 159' , 'row# 160' , 'row# 161' , 'row# 162' , 'row# 163' , 'row# 164' , 'row# 165' , 'row# 166' , 'row# 167' , 'row# 168' , 'row# 169' , 'row# 170' , 'row# 171' , 'row# 172' , 'row# 173' , 'row# 174' , 'row# 175' , 'row# 176' , 'row# 177' , 'row# 178' , 'row# 179' , 'row# 180' , 'row# 181' , 'row# 182' , 'row# 183' , 'row# 184' , 'row# 185' , 'row# 186' , 'row# 187' , 'row# 188' , 'row# 189' , 'row# 190' , 'row# 191' , 'row# 192' , 'row# 193' , 'row# 194' , 'row# 195' , 'row# 196' , 'row# 197' , 'row# 198' , 'row# 199' , 'row# 200' , 'row# 201' , 'row# 202' , 'row# 203' , 'row# 204' , 'row# 205' , 'row# 206' , 'row# 207' , 'row# 208' , 'row# 209' , 'row# 210' , 'row# 211' , 'row# 212' , 'row# 213' , 'row# 214' , 'row# 215' , 'row# 216' , 'row# 217' , 'row# 218' , 'row# 219' , 'row# 220' , 'row# 221' , 'row# 222' , 'row# 223' , 'row# 224' , 'row# 225' , 'row# 226' , 'row# 227' , 'row# 228' , 'row# 229' , 'row# 230' , 'row# 231' , 'row# 232' , 'row# 233' , 'row# 234' , 'row# 235' , 'row# 236' , 'row# 237' , 'row# 238' , 'row# 239' , 'row# 240' , 'row# 241' , 'row# 242' , 'row# 243' , 'row# 244' , 'row# 245' , 'row# 246' , 'row# 247' , 'row# 248' , 'row# 249' , 'row# 250' , 'row# 251' , 'row# 252' , 'row# 253' , 'row# 254' , 'row# 255' , 'row# 256' , 'row# 257' , 'row# 258' , 'row# 259' , 'row# 260' , 'row# 261' , 'row# 262' , 'row# 263' , 'row# 264' , 'row# 265' , 'row# 266' , 'row# 267' , 'row# 268' , 'row# 269' , 'row# 270' , 'row# 271' , 'row# 272' , 'row# 273' , 'row# 274' , 'row# 275' , 'row# 276' , 'row# 277' , 'row# 278' , 'row# 279' , 'row# 280' , 'row# 281' , 'row# 282' , 'row# 283' , 'row# 284' , 'row# 285' , 'row# 286' , 'row# 287' , 'row# 288' , 'row# 289' , 'row# 290' , 'row# 291' , 'row# 292' , 'row# 293' , 'row# 294' , 'row# 295' , 'row# 296' , 'row# 297' , 'row# 298' , 'row# 299' , 'row# 300' , 'row# 301' , 'row# 302' , 'row# 303' , 'row# 304' , 'row# 305' , 'row# 306' , 'row# 307' , 'row# 308' , 'row# 309' , 'row# 310' , 'row# 311' , 'row# 312' , 'row# 313' , 'row# 314' , 'row# 315' , 'row# 316' , 'row# 317' , 'row# 31
|
||
|
|
k1 i name k1 i name
|
||
|
|
4 4 row# 999 4 4 row# 999
|
||
|
|
explain select * from t1 x, t1 y where y.k1=x.i and x.name in ('foo' , 'row# 0' , 'row# 1' , 'row# 2' , 'row# 3' , 'row# 4' , 'row# 5' , 'row# 6' , 'row# 7' , 'row# 8' , 'row# 9' , 'row# 10' , 'row# 11' , 'row# 12' , 'row# 13' , 'row# 14' , 'row# 15' , 'row# 16' , 'row# 17' , 'row# 18' , 'row# 19' , 'row# 20' , 'row# 21' , 'row# 22' , 'row# 23' , 'row# 24' , 'row# 25' , 'row# 26' , 'row# 27' , 'row# 28' , 'row# 29' , 'row# 30' , 'row# 31' , 'row# 32' , 'row# 33' , 'row# 34' , 'row# 35' , 'row# 36' , 'row# 37' , 'row# 38' , 'row# 39' , 'row# 40' , 'row# 41' , 'row# 42' , 'row# 43' , 'row# 44' , 'row# 45' , 'row# 46' , 'row# 47' , 'row# 48' , 'row# 49' , 'row# 50' , 'row# 51' , 'row# 52' , 'row# 53' , 'row# 54' , 'row# 55' , 'row# 56' , 'row# 57' , 'row# 58' , 'row# 59' , 'row# 60' , 'row# 61' , 'row# 62' , 'row# 63' , 'row# 64' , 'row# 65' , 'row# 66' , 'row# 67' , 'row# 68' , 'row# 69' , 'row# 70' , 'row# 71' , 'row# 72' , 'row# 73' , 'row# 74' , 'row# 75' , 'row# 76' , 'row# 77' , 'row# 78' , 'row# 79' , 'row# 80' , 'row# 81' , 'row# 82' , 'row# 83' , 'row# 84' , 'row# 85' , 'row# 86' , 'row# 87' , 'row# 88' , 'row# 89' , 'row# 90' , 'row# 91' , 'row# 92' , 'row# 93' , 'row# 94' , 'row# 95' , 'row# 96' , 'row# 97' , 'row# 98' , 'row# 99' , 'row# 100' , 'row# 101' , 'row# 102' , 'row# 103' , 'row# 104' , 'row# 105' , 'row# 106' , 'row# 107' , 'row# 108' , 'row# 109' , 'row# 110' , 'row# 111' , 'row# 112' , 'row# 113' , 'row# 114' , 'row# 115' , 'row# 116' , 'row# 117' , 'row# 118' , 'row# 119' , 'row# 120' , 'row# 121' , 'row# 122' , 'row# 123' , 'row# 124' , 'row# 125' , 'row# 126' , 'row# 127' , 'row# 128' , 'row# 129' , 'row# 130' , 'row# 131' , 'row# 132' , 'row# 133' , 'row# 134' , 'row# 135' , 'row# 136' , 'row# 137' , 'row# 138' , 'row# 139' , 'row# 140' , 'row# 141' , 'row# 142' , 'row# 143' , 'row# 144' , 'row# 145' , 'row# 146' , 'row# 147' , 'row# 148' , 'row# 149' , 'row# 150' , 'row# 151' , 'row# 152' , 'row# 153' , 'row# 154' , 'row# 155' , 'row# 156' , 'row# 157' , 'row# 158' , 'row# 159' , 'row# 160' , 'row# 161' , 'row# 162' , 'row# 163' , 'row# 164' , 'row# 165' , 'row# 166' , 'row# 167' , 'row# 168' , 'row# 169' , 'row# 170' , 'row# 171' , 'row# 172' , 'row# 173' , 'row# 174' , 'row# 175' , 'row# 176' , 'row# 177' , 'row# 178' , 'row# 179' , 'row# 180' , 'row# 181' , 'row# 182' , 'row# 183' , 'row# 184' , 'row# 185' , 'row# 186' , 'row# 187' , 'row# 188' , 'row# 189' , 'row# 190' , 'row# 191' , 'row# 192' , 'row# 193' , 'row# 194' , 'row# 195' , 'row# 196' , 'row# 197' , 'row# 198' , 'row# 199' , 'row# 200' , 'row# 201' , 'row# 202' , 'row# 203' , 'row# 204' , 'row# 205' , 'row# 206' , 'row# 207' , 'row# 208' , 'row# 209' , 'row# 210' , 'row# 211' , 'row# 212' , 'row# 213' , 'row# 214' , 'row# 215' , 'row# 216' , 'row# 217' , 'row# 218' , 'row# 219' , 'row# 220' , 'row# 221' , 'row# 222' , 'row# 223' , 'row# 224' , 'row# 225' , 'row# 226' , 'row# 227' , 'row# 228' , 'row# 229' , 'row# 230' , 'row# 231' , 'row# 232' , 'row# 233' , 'row# 234' , 'row# 235' , 'row# 236' , 'row# 237' , 'row# 238' , 'row# 239' , 'row# 240' , 'row# 241' , 'row# 242' , 'row# 243' , 'row# 244' , 'row# 245' , 'row# 246' , 'row# 247' , 'row# 248' , 'row# 249' , 'row# 250' , 'row# 251' , 'row# 252' , 'row# 253' , 'row# 254' , 'row# 255' , 'row# 256' , 'row# 257' , 'row# 258' , 'row# 259' , 'row# 260' , 'row# 261' , 'row# 262' , 'row# 263' , 'row# 264' , 'row# 265' , 'row# 266' , 'row# 267' , 'row# 268' , 'row# 269' , 'row# 270' , 'row# 271' , 'row# 272' , 'row# 273' , 'row# 274' , 'row# 275' , 'row# 276' , 'row# 277' , 'row# 278' , 'row# 279' , 'row# 280' , 'row# 281' , 'row# 282' , 'row# 283' , 'row# 284' , 'row# 285' , 'row# 286' , 'row# 287' , 'row# 288' , 'row# 289' , 'row# 290' , 'row# 291' , 'row# 292' , 'row# 293' , 'row# 294' , 'row# 295' , 'row# 296' , 'row# 297' , 'row# 298' , 'row# 299' , 'row# 300' , 'row# 301' , 'row# 302' , 'row# 303' , 'row# 304' , 'row# 305' , 'row# 306' , 'row# 307' , 'row# 308' , 'row# 309' , 'row# 310' , 'row# 311' , 'row# 312' , 'row# 313' , 'row# 314' , 'row# 315' , 'row# 316' , 'row# 317' ,
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 ALL name NULL NULL NULL 4 100.00 Parent of 2 pushed join@1; Using where with pushed condition ((`test`.`x`.`name` in ('foo','row# 0','row# 1','row# 2','row# 3','row# 4','row# 5','row# 6','row# 7','row# 8','row# 9','row# 10','row# 11','row# 12','row# 13','row# 14','row# 15','row# 16','row# 17','row# 18','row# 19','row# 20','row# 21','row# 22','row# 23','row# 24','row# 25','row# 26','row# 27','row# 28','row# 29','row# 30','row# 31','row# 32','row# 33','row# 34','row# 35','row# 36','row# 37','row# 38','row# 39','row# 40','row# 41','row# 42','row# 43','row# 44','row# 45','row# 46','row# 47','row# 48','row# 49','row# 50','row# 51','row# 52','row# 53','row# 54','row# 55','row# 56','row# 57','row# 58','row# 59','row# 60','row# 61','row# 62','row# 63','row# 64','row# 65','row# 66','row# 67','row# 68','row# 69','row# 70','row# 71','row# 72','row# 73','row# 74','row# 75','row# 76','row# 77','row# 78','row# 79','row# 80','row# 81','row# 82','row# 83','row# 84','row# 85','row# 86','row# 87','row# 88','row# 89','row# 90','row# 91','row# 92','row# 93','row# 94','row# 95','row# 96','row# 97','row# 98','row# 99','row# 100','row# 101','row# 102','row# 103','row# 104','row# 105','row# 106','row# 107','row# 108','row# 109','row# 110','row# 111','row# 112','row# 113','row# 114','row# 115','row# 116','row# 117','row# 118','row# 119','row# 120','row# 121','row# 122','row# 123','row# 124','row# 125','row# 126','row# 127','row# 128','row# 129','row# 130','row# 131','row# 132','row# 133','row# 134','row# 135','row# 136','row# 137','row# 138','row# 139','row# 140','row# 141','row# 142','row# 143','row# 144','row# 145','row# 146','row# 147','row# 148','row# 149','row# 150','row# 151','row# 152','row# 153','row# 154','row# 155','row# 156','row# 157','row# 158','row# 159','row# 160','row# 161','row# 162','row# 163','row# 164','row# 165','row# 166','row# 167','row# 168','row# 169','row# 170','row# 171','row# 172','row# 173','row# 174','row# 175','row# 176','row# 177','row# 178','row# 179','row# 180','row# 181','row# 182','row# 183','row# 184','row# 185','row# 186','row# 187','row# 188','row# 189','row# 190','row# 191','row# 192','row# 193','row# 194','row# 195','row# 196','row# 197','row# 198','row# 199','row# 200','row# 201','row# 202','row# 203','row# 204','row# 205','row# 206','row# 207','row# 208','row# 209','row# 210','row# 211','row# 212','row# 213','row# 214','row# 215','row# 216','row# 217','row# 218','row# 219','row# 220','row# 221','row# 222','row# 223','row# 224','row# 225','row# 226','row# 227','row# 228','row# 229','row# 230','row# 231','row# 232','row# 233','row# 234','row# 235','row# 236','row# 237','row# 238','row# 239','row# 240','row# 241','row# 242','row# 243','row# 244','row# 245','row# 246','row# 247','row# 248','row# 249','row# 250','row# 251','row# 252','row# 253','row# 254','row# 255','row# 256','row# 257','row# 258','row# 259','row# 260','row# 261','row# 262','row# 263','row# 264','row# 265','row# 266','row# 267','row# 268','row# 269','row# 270','row# 271','row# 272','row# 273','row# 274','row# 275','row# 276','row# 277','row# 278','row# 279','row# 280','row# 281','row# 282','row# 283','row# 284','row# 285','row# 286','row# 287','row# 288','row# 289','row# 290','row# 291','row# 292','row# 293','row# 294','row# 295','row# 296','row# 297','row# 298','row# 299','row# 300','row# 301','row# 302','row# 303','row# 304','row# 305','row# 306','row# 307','row# 308','row# 309','row# 310','row# 311','row# 312','row# 313','row# 314','row# 315','row# 316','row# 317','row# 318','row# 319','row# 320','row# 321','row# 322','row# 323','row# 324','row# 325','row# 326','row# 327','row# 328','row# 329','row# 330','row# 331','row# 332','row# 333','row# 334','row# 335','row# 336','row# 337','row# 338','row# 339','row# 340','row# 341','row# 342','row# 343','row# 344','row# 345','row# 346','row# 347','row# 348','row# 349','row# 350','row# 351','row# 352','row# 353','row# 354','row# 355','row# 356','row# 357','row# 358','row# 359','row# 360','row# 361','row# 362','row# 363','row# 364','row# 365','row# 366','row# 367
|
||
|
|
1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.x.i 1 100.00 Child of 'x' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 4294 Scan filter is too large, discarded
|
||
|
|
Note 1003 /* select#1 */ select `test`.`x`.`k1` AS `k1`,`test`.`x`.`i` AS `i`,`test`.`x`.`name` AS `name`,`test`.`y`.`k1` AS `k1`,`test`.`y`.`i` AS `i`,`test`.`y`.`name` AS `name` from `test`.`t1` `x` join `test`.`t1` `y` where ((`test`.`y`.`k1` = `test`.`x`.`i`) and (`test`.`x`.`name` in ('foo','row# 0','row# 1','row# 2','row# 3','row# 4','row# 5','row# 6','row# 7','row# 8','row# 9','row# 10','row# 11','row# 12','row# 13','row# 14','row# 15','row# 16','row# 17','row# 18','row# 19','row# 20','row# 21','row# 22','row# 23','row# 24','row# 25','row# 26','row# 27','row# 28','row# 29','row# 30','row# 31','row# 32','row# 33','row# 34','row# 35','row# 36','row# 37','row# 38','row# 39','row# 40','row# 41','row# 42','row# 43','row# 44','row# 45','row# 46','row# 47','row# 48','row# 49','row# 50','row# 51','row# 52','row# 53','row# 54','row# 55','row# 56','row# 57','row# 58','row# 59','row# 60','row# 61','row# 62','row# 63','row# 64','row# 65','row# 66','row# 67','row# 68','row# 69','row# 70','row# 71','row# 72','row# 73','row# 74','row# 75','row# 76','row# 77','row# 78','row# 79','row# 80','row# 81','row# 82','row# 83','row# 84','row# 85','row# 86','row# 87','row# 88','row# 89','row# 90','row# 91','row# 92','row# 93','row# 94','row# 95','row# 96','row# 97','row# 98','row# 99','row# 100','row# 101','row# 102','row# 103','row# 104','row# 105','row# 106','row# 107','row# 108','row# 109','row# 110','row# 111','row# 112','row# 113','row# 114','row# 115','row# 116','row# 117','row# 118','row# 119','row# 120','row# 121','row# 122','row# 123','row# 124','row# 125','row# 126','row# 127','row# 128','row# 129','row# 130','row# 131','row# 132','row# 133','row# 134','row# 135','row# 136','row# 137','row# 138','row# 139','row# 140','row# 141','row# 142','row# 143','row# 144','row# 145','row# 146','row# 147','row# 148','row# 149','row# 150','row# 151','row# 152','row# 153','row# 154','row# 155','row# 156','row# 157','row# 158','row# 159','row# 160','row# 161','row# 162','row# 163','row# 164','row# 165','row# 166','row# 167','row# 168','row# 169','row# 170','row# 171','row# 172','row# 173','row# 174','row# 175','row# 176','row# 177','row# 178','row# 179','row# 180','row# 181','row# 182','row# 183','row# 184','row# 185','row# 186','row# 187','row# 188','row# 189','row# 190','row# 191','row# 192','row# 193','row# 194','row# 195','row# 196','row# 197','row# 198','row# 199','row# 200','row# 201','row# 202','row# 203','row# 204','row# 205','row# 206','row# 207','row# 208','row# 209','row# 210','row# 211','row# 212','row# 213','row# 214','row# 215','row# 216','row# 217','row# 218','row# 219','row# 220','row# 221','row# 222','row# 223','row# 224','row# 225','row# 226','row# 227','row# 228','row# 229','row# 230','row# 231','row# 232','row# 233','row# 234','row# 235','row# 236','row# 237','row# 238','row# 239','row# 240','row# 241','row# 242','row# 243','row# 244','row# 245','row# 246','row# 247','row# 248','row# 249','row# 250','row# 251','row# 252','row# 253','row# 254','row# 255','row# 256','row# 257','row# 258','row# 259','row# 260','row# 261','row# 262','row# 263','row# 264','row# 265','row# 266','row# 267','row# 268','row# 269','row# 270','row# 271','row# 272','row# 273','row# 274','row# 275','row# 276','row# 277','row# 278','row# 279','row# 280','row# 281','row# 282','row# 283','row# 284','row# 285','row# 286','row# 287','row# 288','row# 289','row# 290','row# 291','row# 292','row# 293','row# 294','row# 295','row# 296','row# 297','row# 298','row# 299','row# 300','row# 301','row# 302','row# 303','row# 304','row# 305','row# 306','row# 307','row# 308','row# 309','row# 310','row# 311','row# 312','row# 313','row# 314','row# 315','row# 316','row# 317','row# 318','row# 319','row# 320','row# 321','row# 322','row# 323','row# 324','row# 325','row# 326','row# 327','row# 328','row# 329','row# 330','row# 331','row# 332','row# 333','row# 334','row# 335','row# 336','row# 337','row# 338','row# 339','row# 340','row# 341','row# 342','row# 343','row# 344','row# 345','row# 346','row# 347','row# 348','row# 349','row# 350','row# 351','row# 352','row# 353','row# 354','ro
|
||
|
|
select * from t1 x, t1 y where y.k1=x.i and x.name in ('foo' , 'row# 0' , 'row# 1' , 'row# 2' , 'row# 3' , 'row# 4' , 'row# 5' , 'row# 6' , 'row# 7' , 'row# 8' , 'row# 9' , 'row# 10' , 'row# 11' , 'row# 12' , 'row# 13' , 'row# 14' , 'row# 15' , 'row# 16' , 'row# 17' , 'row# 18' , 'row# 19' , 'row# 20' , 'row# 21' , 'row# 22' , 'row# 23' , 'row# 24' , 'row# 25' , 'row# 26' , 'row# 27' , 'row# 28' , 'row# 29' , 'row# 30' , 'row# 31' , 'row# 32' , 'row# 33' , 'row# 34' , 'row# 35' , 'row# 36' , 'row# 37' , 'row# 38' , 'row# 39' , 'row# 40' , 'row# 41' , 'row# 42' , 'row# 43' , 'row# 44' , 'row# 45' , 'row# 46' , 'row# 47' , 'row# 48' , 'row# 49' , 'row# 50' , 'row# 51' , 'row# 52' , 'row# 53' , 'row# 54' , 'row# 55' , 'row# 56' , 'row# 57' , 'row# 58' , 'row# 59' , 'row# 60' , 'row# 61' , 'row# 62' , 'row# 63' , 'row# 64' , 'row# 65' , 'row# 66' , 'row# 67' , 'row# 68' , 'row# 69' , 'row# 70' , 'row# 71' , 'row# 72' , 'row# 73' , 'row# 74' , 'row# 75' , 'row# 76' , 'row# 77' , 'row# 78' , 'row# 79' , 'row# 80' , 'row# 81' , 'row# 82' , 'row# 83' , 'row# 84' , 'row# 85' , 'row# 86' , 'row# 87' , 'row# 88' , 'row# 89' , 'row# 90' , 'row# 91' , 'row# 92' , 'row# 93' , 'row# 94' , 'row# 95' , 'row# 96' , 'row# 97' , 'row# 98' , 'row# 99' , 'row# 100' , 'row# 101' , 'row# 102' , 'row# 103' , 'row# 104' , 'row# 105' , 'row# 106' , 'row# 107' , 'row# 108' , 'row# 109' , 'row# 110' , 'row# 111' , 'row# 112' , 'row# 113' , 'row# 114' , 'row# 115' , 'row# 116' , 'row# 117' , 'row# 118' , 'row# 119' , 'row# 120' , 'row# 121' , 'row# 122' , 'row# 123' , 'row# 124' , 'row# 125' , 'row# 126' , 'row# 127' , 'row# 128' , 'row# 129' , 'row# 130' , 'row# 131' , 'row# 132' , 'row# 133' , 'row# 134' , 'row# 135' , 'row# 136' , 'row# 137' , 'row# 138' , 'row# 139' , 'row# 140' , 'row# 141' , 'row# 142' , 'row# 143' , 'row# 144' , 'row# 145' , 'row# 146' , 'row# 147' , 'row# 148' , 'row# 149' , 'row# 150' , 'row# 151' , 'row# 152' , 'row# 153' , 'row# 154' , 'row# 155' , 'row# 156' , 'row# 157' , 'row# 158' , 'row# 159' , 'row# 160' , 'row# 161' , 'row# 162' , 'row# 163' , 'row# 164' , 'row# 165' , 'row# 166' , 'row# 167' , 'row# 168' , 'row# 169' , 'row# 170' , 'row# 171' , 'row# 172' , 'row# 173' , 'row# 174' , 'row# 175' , 'row# 176' , 'row# 177' , 'row# 178' , 'row# 179' , 'row# 180' , 'row# 181' , 'row# 182' , 'row# 183' , 'row# 184' , 'row# 185' , 'row# 186' , 'row# 187' , 'row# 188' , 'row# 189' , 'row# 190' , 'row# 191' , 'row# 192' , 'row# 193' , 'row# 194' , 'row# 195' , 'row# 196' , 'row# 197' , 'row# 198' , 'row# 199' , 'row# 200' , 'row# 201' , 'row# 202' , 'row# 203' , 'row# 204' , 'row# 205' , 'row# 206' , 'row# 207' , 'row# 208' , 'row# 209' , 'row# 210' , 'row# 211' , 'row# 212' , 'row# 213' , 'row# 214' , 'row# 215' , 'row# 216' , 'row# 217' , 'row# 218' , 'row# 219' , 'row# 220' , 'row# 221' , 'row# 222' , 'row# 223' , 'row# 224' , 'row# 225' , 'row# 226' , 'row# 227' , 'row# 228' , 'row# 229' , 'row# 230' , 'row# 231' , 'row# 232' , 'row# 233' , 'row# 234' , 'row# 235' , 'row# 236' , 'row# 237' , 'row# 238' , 'row# 239' , 'row# 240' , 'row# 241' , 'row# 242' , 'row# 243' , 'row# 244' , 'row# 245' , 'row# 246' , 'row# 247' , 'row# 248' , 'row# 249' , 'row# 250' , 'row# 251' , 'row# 252' , 'row# 253' , 'row# 254' , 'row# 255' , 'row# 256' , 'row# 257' , 'row# 258' , 'row# 259' , 'row# 260' , 'row# 261' , 'row# 262' , 'row# 263' , 'row# 264' , 'row# 265' , 'row# 266' , 'row# 267' , 'row# 268' , 'row# 269' , 'row# 270' , 'row# 271' , 'row# 272' , 'row# 273' , 'row# 274' , 'row# 275' , 'row# 276' , 'row# 277' , 'row# 278' , 'row# 279' , 'row# 280' , 'row# 281' , 'row# 282' , 'row# 283' , 'row# 284' , 'row# 285' , 'row# 286' , 'row# 287' , 'row# 288' , 'row# 289' , 'row# 290' , 'row# 291' , 'row# 292' , 'row# 293' , 'row# 294' , 'row# 295' , 'row# 296' , 'row# 297' , 'row# 298' , 'row# 299' , 'row# 300' , 'row# 301' , 'row# 302' , 'row# 303' , 'row# 304' , 'row# 305' , 'row# 306' , 'row# 307' , 'row# 308' , 'row# 309' , 'row# 310' , 'row# 311' , 'row# 312' , 'row# 313' , 'row# 314' , 'row# 315' , 'row# 316' , 'row# 317' , 'row# 31
|
||
|
|
k1 i name k1 i name
|
||
|
|
4 4 row# 999 4 4 row# 999
|
||
|
|
Warnings:
|
||
|
|
Warning 4294 Scan filter is too large, discarded
|
||
|
|
explain select * from t1 x where x.name in ('foo' , 'row# 0' , 'row# 1' , 'row# 2' , 'row# 3' , 'row# 4' , 'row# 5' , 'row# 6' , 'row# 7' , 'row# 8' , 'row# 9' , 'row# 10' , 'row# 11' , 'row# 12' , 'row# 13' , 'row# 14' , 'row# 15' , 'row# 16' , 'row# 17' , 'row# 18' , 'row# 19' , 'row# 20' , 'row# 21' , 'row# 22' , 'row# 23' , 'row# 24' , 'row# 25' , 'row# 26' , 'row# 27' , 'row# 28' , 'row# 29' , 'row# 30' , 'row# 31' , 'row# 32' , 'row# 33' , 'row# 34' , 'row# 35' , 'row# 36' , 'row# 37' , 'row# 38' , 'row# 39' , 'row# 40' , 'row# 41' , 'row# 42' , 'row# 43' , 'row# 44' , 'row# 45' , 'row# 46' , 'row# 47' , 'row# 48' , 'row# 49' , 'row# 50' , 'row# 51' , 'row# 52' , 'row# 53' , 'row# 54' , 'row# 55' , 'row# 56' , 'row# 57' , 'row# 58' , 'row# 59' , 'row# 60' , 'row# 61' , 'row# 62' , 'row# 63' , 'row# 64' , 'row# 65' , 'row# 66' , 'row# 67' , 'row# 68' , 'row# 69' , 'row# 70' , 'row# 71' , 'row# 72' , 'row# 73' , 'row# 74' , 'row# 75' , 'row# 76' , 'row# 77' , 'row# 78' , 'row# 79' , 'row# 80' , 'row# 81' , 'row# 82' , 'row# 83' , 'row# 84' , 'row# 85' , 'row# 86' , 'row# 87' , 'row# 88' , 'row# 89' , 'row# 90' , 'row# 91' , 'row# 92' , 'row# 93' , 'row# 94' , 'row# 95' , 'row# 96' , 'row# 97' , 'row# 98' , 'row# 99' , 'row# 100' , 'row# 101' , 'row# 102' , 'row# 103' , 'row# 104' , 'row# 105' , 'row# 106' , 'row# 107' , 'row# 108' , 'row# 109' , 'row# 110' , 'row# 111' , 'row# 112' , 'row# 113' , 'row# 114' , 'row# 115' , 'row# 116' , 'row# 117' , 'row# 118' , 'row# 119' , 'row# 120' , 'row# 121' , 'row# 122' , 'row# 123' , 'row# 124' , 'row# 125' , 'row# 126' , 'row# 127' , 'row# 128' , 'row# 129' , 'row# 130' , 'row# 131' , 'row# 132' , 'row# 133' , 'row# 134' , 'row# 135' , 'row# 136' , 'row# 137' , 'row# 138' , 'row# 139' , 'row# 140' , 'row# 141' , 'row# 142' , 'row# 143' , 'row# 144' , 'row# 145' , 'row# 146' , 'row# 147' , 'row# 148' , 'row# 149' , 'row# 150' , 'row# 151' , 'row# 152' , 'row# 153' , 'row# 154' , 'row# 155' , 'row# 156' , 'row# 157' , 'row# 158' , 'row# 159' , 'row# 160' , 'row# 161' , 'row# 162' , 'row# 163' , 'row# 164' , 'row# 165' , 'row# 166' , 'row# 167' , 'row# 168' , 'row# 169' , 'row# 170' , 'row# 171' , 'row# 172' , 'row# 173' , 'row# 174' , 'row# 175' , 'row# 176' , 'row# 177' , 'row# 178' , 'row# 179' , 'row# 180' , 'row# 181' , 'row# 182' , 'row# 183' , 'row# 184' , 'row# 185' , 'row# 186' , 'row# 187' , 'row# 188' , 'row# 189' , 'row# 190' , 'row# 191' , 'row# 192' , 'row# 193' , 'row# 194' , 'row# 195' , 'row# 196' , 'row# 197' , 'row# 198' , 'row# 199' , 'row# 200' , 'row# 201' , 'row# 202' , 'row# 203' , 'row# 204' , 'row# 205' , 'row# 206' , 'row# 207' , 'row# 208' , 'row# 209' , 'row# 210' , 'row# 211' , 'row# 212' , 'row# 213' , 'row# 214' , 'row# 215' , 'row# 216' , 'row# 217' , 'row# 218' , 'row# 219' , 'row# 220' , 'row# 221' , 'row# 222' , 'row# 223' , 'row# 224' , 'row# 225' , 'row# 226' , 'row# 227' , 'row# 228' , 'row# 229' , 'row# 230' , 'row# 231' , 'row# 232' , 'row# 233' , 'row# 234' , 'row# 235' , 'row# 236' , 'row# 237' , 'row# 238' , 'row# 239' , 'row# 240' , 'row# 241' , 'row# 242' , 'row# 243' , 'row# 244' , 'row# 245' , 'row# 246' , 'row# 247' , 'row# 248' , 'row# 249' , 'row# 250' , 'row# 251' , 'row# 252' , 'row# 253' , 'row# 254' , 'row# 255' , 'row# 256' , 'row# 257' , 'row# 258' , 'row# 259' , 'row# 260' , 'row# 261' , 'row# 262' , 'row# 263' , 'row# 264' , 'row# 265' , 'row# 266' , 'row# 267' , 'row# 268' , 'row# 269' , 'row# 270' , 'row# 271' , 'row# 272' , 'row# 273' , 'row# 274' , 'row# 275' , 'row# 276' , 'row# 277' , 'row# 278' , 'row# 279' , 'row# 280' , 'row# 281' , 'row# 282' , 'row# 283' , 'row# 284' , 'row# 285' , 'row# 286' , 'row# 287' , 'row# 288' , 'row# 289' , 'row# 290' , 'row# 291' , 'row# 292' , 'row# 293' , 'row# 294' , 'row# 295' , 'row# 296' , 'row# 297' , 'row# 298' , 'row# 299' , 'row# 300' , 'row# 301' , 'row# 302' , 'row# 303' , 'row# 304' , 'row# 305' , 'row# 306' , 'row# 307' , 'row# 308' , 'row# 309' , 'row# 310' , 'row# 311' , 'row# 312' , 'row# 313' , 'row# 314' , 'row# 315' , 'row# 316' , 'row# 317' , 'row# 318' , 'row#
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 ALL name NULL NULL NULL 4 100.00 Using where with pushed condition (`test`.`x`.`name` in ('foo','row# 0','row# 1','row# 2','row# 3','row# 4','row# 5','row# 6','row# 7','row# 8','row# 9','row# 10','row# 11','row# 12','row# 13','row# 14','row# 15','row# 16','row# 17','row# 18','row# 19','row# 20','row# 21','row# 22','row# 23','row# 24','row# 25','row# 26','row# 27','row# 28','row# 29','row# 30','row# 31','row# 32','row# 33','row# 34','row# 35','row# 36','row# 37','row# 38','row# 39','row# 40','row# 41','row# 42','row# 43','row# 44','row# 45','row# 46','row# 47','row# 48','row# 49','row# 50','row# 51','row# 52','row# 53','row# 54','row# 55','row# 56','row# 57','row# 58','row# 59','row# 60','row# 61','row# 62','row# 63','row# 64','row# 65','row# 66','row# 67','row# 68','row# 69','row# 70','row# 71','row# 72','row# 73','row# 74','row# 75','row# 76','row# 77','row# 78','row# 79','row# 80','row# 81','row# 82','row# 83','row# 84','row# 85','row# 86','row# 87','row# 88','row# 89','row# 90','row# 91','row# 92','row# 93','row# 94','row# 95','row# 96','row# 97','row# 98','row# 99','row# 100','row# 101','row# 102','row# 103','row# 104','row# 105','row# 106','row# 107','row# 108','row# 109','row# 110','row# 111','row# 112','row# 113','row# 114','row# 115','row# 116','row# 117','row# 118','row# 119','row# 120','row# 121','row# 122','row# 123','row# 124','row# 125','row# 126','row# 127','row# 128','row# 129','row# 130','row# 131','row# 132','row# 133','row# 134','row# 135','row# 136','row# 137','row# 138','row# 139','row# 140','row# 141','row# 142','row# 143','row# 144','row# 145','row# 146','row# 147','row# 148','row# 149','row# 150','row# 151','row# 152','row# 153','row# 154','row# 155','row# 156','row# 157','row# 158','row# 159','row# 160','row# 161','row# 162','row# 163','row# 164','row# 165','row# 166','row# 167','row# 168','row# 169','row# 170','row# 171','row# 172','row# 173','row# 174','row# 175','row# 176','row# 177','row# 178','row# 179','row# 180','row# 181','row# 182','row# 183','row# 184','row# 185','row# 186','row# 187','row# 188','row# 189','row# 190','row# 191','row# 192','row# 193','row# 194','row# 195','row# 196','row# 197','row# 198','row# 199','row# 200','row# 201','row# 202','row# 203','row# 204','row# 205','row# 206','row# 207','row# 208','row# 209','row# 210','row# 211','row# 212','row# 213','row# 214','row# 215','row# 216','row# 217','row# 218','row# 219','row# 220','row# 221','row# 222','row# 223','row# 224','row# 225','row# 226','row# 227','row# 228','row# 229','row# 230','row# 231','row# 232','row# 233','row# 234','row# 235','row# 236','row# 237','row# 238','row# 239','row# 240','row# 241','row# 242','row# 243','row# 244','row# 245','row# 246','row# 247','row# 248','row# 249','row# 250','row# 251','row# 252','row# 253','row# 254','row# 255','row# 256','row# 257','row# 258','row# 259','row# 260','row# 261','row# 262','row# 263','row# 264','row# 265','row# 266','row# 267','row# 268','row# 269','row# 270','row# 271','row# 272','row# 273','row# 274','row# 275','row# 276','row# 277','row# 278','row# 279','row# 280','row# 281','row# 282','row# 283','row# 284','row# 285','row# 286','row# 287','row# 288','row# 289','row# 290','row# 291','row# 292','row# 293','row# 294','row# 295','row# 296','row# 297','row# 298','row# 299','row# 300','row# 301','row# 302','row# 303','row# 304','row# 305','row# 306','row# 307','row# 308','row# 309','row# 310','row# 311','row# 312','row# 313','row# 314','row# 315','row# 316','row# 317','row# 318','row# 319','row# 320','row# 321','row# 322','row# 323','row# 324','row# 325','row# 326','row# 327','row# 328','row# 329','row# 330','row# 331','row# 332','row# 333','row# 334','row# 335','row# 336','row# 337','row# 338','row# 339','row# 340','row# 341','row# 342','row# 343','row# 344','row# 345','row# 346','row# 347','row# 348','row# 349','row# 350','row# 351','row# 352','row# 353','row# 354','row# 355','row# 356','row# 357','row# 358','row# 359','row# 360','row# 361','row# 362','row# 363','row# 364','row# 365','row# 366','row# 367','row# 368','row# 369','row
|
||
|
|
Warnings:
|
||
|
|
Note 1003 /* select#1 */ select `test`.`x`.`k1` AS `k1`,`test`.`x`.`i` AS `i`,`test`.`x`.`name` AS `name` from `test`.`t1` `x` where (`test`.`x`.`name` in ('foo','row# 0','row# 1','row# 2','row# 3','row# 4','row# 5','row# 6','row# 7','row# 8','row# 9','row# 10','row# 11','row# 12','row# 13','row# 14','row# 15','row# 16','row# 17','row# 18','row# 19','row# 20','row# 21','row# 22','row# 23','row# 24','row# 25','row# 26','row# 27','row# 28','row# 29','row# 30','row# 31','row# 32','row# 33','row# 34','row# 35','row# 36','row# 37','row# 38','row# 39','row# 40','row# 41','row# 42','row# 43','row# 44','row# 45','row# 46','row# 47','row# 48','row# 49','row# 50','row# 51','row# 52','row# 53','row# 54','row# 55','row# 56','row# 57','row# 58','row# 59','row# 60','row# 61','row# 62','row# 63','row# 64','row# 65','row# 66','row# 67','row# 68','row# 69','row# 70','row# 71','row# 72','row# 73','row# 74','row# 75','row# 76','row# 77','row# 78','row# 79','row# 80','row# 81','row# 82','row# 83','row# 84','row# 85','row# 86','row# 87','row# 88','row# 89','row# 90','row# 91','row# 92','row# 93','row# 94','row# 95','row# 96','row# 97','row# 98','row# 99','row# 100','row# 101','row# 102','row# 103','row# 104','row# 105','row# 106','row# 107','row# 108','row# 109','row# 110','row# 111','row# 112','row# 113','row# 114','row# 115','row# 116','row# 117','row# 118','row# 119','row# 120','row# 121','row# 122','row# 123','row# 124','row# 125','row# 126','row# 127','row# 128','row# 129','row# 130','row# 131','row# 132','row# 133','row# 134','row# 135','row# 136','row# 137','row# 138','row# 139','row# 140','row# 141','row# 142','row# 143','row# 144','row# 145','row# 146','row# 147','row# 148','row# 149','row# 150','row# 151','row# 152','row# 153','row# 154','row# 155','row# 156','row# 157','row# 158','row# 159','row# 160','row# 161','row# 162','row# 163','row# 164','row# 165','row# 166','row# 167','row# 168','row# 169','row# 170','row# 171','row# 172','row# 173','row# 174','row# 175','row# 176','row# 177','row# 178','row# 179','row# 180','row# 181','row# 182','row# 183','row# 184','row# 185','row# 186','row# 187','row# 188','row# 189','row# 190','row# 191','row# 192','row# 193','row# 194','row# 195','row# 196','row# 197','row# 198','row# 199','row# 200','row# 201','row# 202','row# 203','row# 204','row# 205','row# 206','row# 207','row# 208','row# 209','row# 210','row# 211','row# 212','row# 213','row# 214','row# 215','row# 216','row# 217','row# 218','row# 219','row# 220','row# 221','row# 222','row# 223','row# 224','row# 225','row# 226','row# 227','row# 228','row# 229','row# 230','row# 231','row# 232','row# 233','row# 234','row# 235','row# 236','row# 237','row# 238','row# 239','row# 240','row# 241','row# 242','row# 243','row# 244','row# 245','row# 246','row# 247','row# 248','row# 249','row# 250','row# 251','row# 252','row# 253','row# 254','row# 255','row# 256','row# 257','row# 258','row# 259','row# 260','row# 261','row# 262','row# 263','row# 264','row# 265','row# 266','row# 267','row# 268','row# 269','row# 270','row# 271','row# 272','row# 273','row# 274','row# 275','row# 276','row# 277','row# 278','row# 279','row# 280','row# 281','row# 282','row# 283','row# 284','row# 285','row# 286','row# 287','row# 288','row# 289','row# 290','row# 291','row# 292','row# 293','row# 294','row# 295','row# 296','row# 297','row# 298','row# 299','row# 300','row# 301','row# 302','row# 303','row# 304','row# 305','row# 306','row# 307','row# 308','row# 309','row# 310','row# 311','row# 312','row# 313','row# 314','row# 315','row# 316','row# 317','row# 318','row# 319','row# 320','row# 321','row# 322','row# 323','row# 324','row# 325','row# 326','row# 327','row# 328','row# 329','row# 330','row# 331','row# 332','row# 333','row# 334','row# 335','row# 336','row# 337','row# 338','row# 339','row# 340','row# 341','row# 342','row# 343','row# 344','row# 345','row# 346','row# 347','row# 348','row# 349','row# 350','row# 351','row# 352','row# 353','row# 354','row# 355','row# 356','row# 357','row# 358','row# 359','row# 360','row# 361','row# 362','row# 363','row# 364','row# 365','row# 366','row#
|
||
|
|
select * from t1 x where x.name in ('foo' , 'row# 0' , 'row# 1' , 'row# 2' , 'row# 3' , 'row# 4' , 'row# 5' , 'row# 6' , 'row# 7' , 'row# 8' , 'row# 9' , 'row# 10' , 'row# 11' , 'row# 12' , 'row# 13' , 'row# 14' , 'row# 15' , 'row# 16' , 'row# 17' , 'row# 18' , 'row# 19' , 'row# 20' , 'row# 21' , 'row# 22' , 'row# 23' , 'row# 24' , 'row# 25' , 'row# 26' , 'row# 27' , 'row# 28' , 'row# 29' , 'row# 30' , 'row# 31' , 'row# 32' , 'row# 33' , 'row# 34' , 'row# 35' , 'row# 36' , 'row# 37' , 'row# 38' , 'row# 39' , 'row# 40' , 'row# 41' , 'row# 42' , 'row# 43' , 'row# 44' , 'row# 45' , 'row# 46' , 'row# 47' , 'row# 48' , 'row# 49' , 'row# 50' , 'row# 51' , 'row# 52' , 'row# 53' , 'row# 54' , 'row# 55' , 'row# 56' , 'row# 57' , 'row# 58' , 'row# 59' , 'row# 60' , 'row# 61' , 'row# 62' , 'row# 63' , 'row# 64' , 'row# 65' , 'row# 66' , 'row# 67' , 'row# 68' , 'row# 69' , 'row# 70' , 'row# 71' , 'row# 72' , 'row# 73' , 'row# 74' , 'row# 75' , 'row# 76' , 'row# 77' , 'row# 78' , 'row# 79' , 'row# 80' , 'row# 81' , 'row# 82' , 'row# 83' , 'row# 84' , 'row# 85' , 'row# 86' , 'row# 87' , 'row# 88' , 'row# 89' , 'row# 90' , 'row# 91' , 'row# 92' , 'row# 93' , 'row# 94' , 'row# 95' , 'row# 96' , 'row# 97' , 'row# 98' , 'row# 99' , 'row# 100' , 'row# 101' , 'row# 102' , 'row# 103' , 'row# 104' , 'row# 105' , 'row# 106' , 'row# 107' , 'row# 108' , 'row# 109' , 'row# 110' , 'row# 111' , 'row# 112' , 'row# 113' , 'row# 114' , 'row# 115' , 'row# 116' , 'row# 117' , 'row# 118' , 'row# 119' , 'row# 120' , 'row# 121' , 'row# 122' , 'row# 123' , 'row# 124' , 'row# 125' , 'row# 126' , 'row# 127' , 'row# 128' , 'row# 129' , 'row# 130' , 'row# 131' , 'row# 132' , 'row# 133' , 'row# 134' , 'row# 135' , 'row# 136' , 'row# 137' , 'row# 138' , 'row# 139' , 'row# 140' , 'row# 141' , 'row# 142' , 'row# 143' , 'row# 144' , 'row# 145' , 'row# 146' , 'row# 147' , 'row# 148' , 'row# 149' , 'row# 150' , 'row# 151' , 'row# 152' , 'row# 153' , 'row# 154' , 'row# 155' , 'row# 156' , 'row# 157' , 'row# 158' , 'row# 159' , 'row# 160' , 'row# 161' , 'row# 162' , 'row# 163' , 'row# 164' , 'row# 165' , 'row# 166' , 'row# 167' , 'row# 168' , 'row# 169' , 'row# 170' , 'row# 171' , 'row# 172' , 'row# 173' , 'row# 174' , 'row# 175' , 'row# 176' , 'row# 177' , 'row# 178' , 'row# 179' , 'row# 180' , 'row# 181' , 'row# 182' , 'row# 183' , 'row# 184' , 'row# 185' , 'row# 186' , 'row# 187' , 'row# 188' , 'row# 189' , 'row# 190' , 'row# 191' , 'row# 192' , 'row# 193' , 'row# 194' , 'row# 195' , 'row# 196' , 'row# 197' , 'row# 198' , 'row# 199' , 'row# 200' , 'row# 201' , 'row# 202' , 'row# 203' , 'row# 204' , 'row# 205' , 'row# 206' , 'row# 207' , 'row# 208' , 'row# 209' , 'row# 210' , 'row# 211' , 'row# 212' , 'row# 213' , 'row# 214' , 'row# 215' , 'row# 216' , 'row# 217' , 'row# 218' , 'row# 219' , 'row# 220' , 'row# 221' , 'row# 222' , 'row# 223' , 'row# 224' , 'row# 225' , 'row# 226' , 'row# 227' , 'row# 228' , 'row# 229' , 'row# 230' , 'row# 231' , 'row# 232' , 'row# 233' , 'row# 234' , 'row# 235' , 'row# 236' , 'row# 237' , 'row# 238' , 'row# 239' , 'row# 240' , 'row# 241' , 'row# 242' , 'row# 243' , 'row# 244' , 'row# 245' , 'row# 246' , 'row# 247' , 'row# 248' , 'row# 249' , 'row# 250' , 'row# 251' , 'row# 252' , 'row# 253' , 'row# 254' , 'row# 255' , 'row# 256' , 'row# 257' , 'row# 258' , 'row# 259' , 'row# 260' , 'row# 261' , 'row# 262' , 'row# 263' , 'row# 264' , 'row# 265' , 'row# 266' , 'row# 267' , 'row# 268' , 'row# 269' , 'row# 270' , 'row# 271' , 'row# 272' , 'row# 273' , 'row# 274' , 'row# 275' , 'row# 276' , 'row# 277' , 'row# 278' , 'row# 279' , 'row# 280' , 'row# 281' , 'row# 282' , 'row# 283' , 'row# 284' , 'row# 285' , 'row# 286' , 'row# 287' , 'row# 288' , 'row# 289' , 'row# 290' , 'row# 291' , 'row# 292' , 'row# 293' , 'row# 294' , 'row# 295' , 'row# 296' , 'row# 297' , 'row# 298' , 'row# 299' , 'row# 300' , 'row# 301' , 'row# 302' , 'row# 303' , 'row# 304' , 'row# 305' , 'row# 306' , 'row# 307' , 'row# 308' , 'row# 309' , 'row# 310' , 'row# 311' , 'row# 312' , 'row# 313' , 'row# 314' , 'row# 315' , 'row# 316' , 'row# 317' , 'row# 318' , 'row# 319' , '
|
||
|
|
k1 i name
|
||
|
|
4 4 row# 999
|
||
|
|
Warnings:
|
||
|
|
Warning 4294 Scan filter is too large, discarded
|
||
|
|
drop table t1;
|
||
|
|
create table t(
|
||
|
|
pk int primary key auto_increment,
|
||
|
|
i int,
|
||
|
|
j int,
|
||
|
|
k int,
|
||
|
|
index(i,j),
|
||
|
|
index(i),
|
||
|
|
index(j),
|
||
|
|
index(k)
|
||
|
|
) engine = ndb;
|
||
|
|
insert into t(i,j,k) values
|
||
|
|
(1,1,1), (1,1,1), (1,1,1),
|
||
|
|
(2,2,2), (2,2,2), (2,2,2);
|
||
|
|
set global debug='+d,max_4rows_in_spj_batches';
|
||
|
|
explain
|
||
|
|
select straight_join count(*) from
|
||
|
|
t as t1
|
||
|
|
join t as t2 on t2.i = t1.i
|
||
|
|
join (t as t3 join t as t4 on t4.k=t3.k join t as t5 on t5.i=t4.i and t5.j=t3.j) on t3.pk=t1.j
|
||
|
|
join t as t6 on t6.k = t1.k
|
||
|
|
where t1.i < 2;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 range i,i_2,j,k i 5 NULL # # Parent of 6 pushed join@1; Using where with pushed condition ((`test`.`t1`.`i` < 2) and (`test`.`t1`.`i` is not null) and (`test`.`t1`.`j` is not null) and (`test`.`t1`.`k` is not null)); Using MRR
|
||
|
|
1 SIMPLE t2 p0,p1,p2,p3,p4,p5,p6,p7 ref i,i_2 i 5 test.t1.i # # Child of 't1' in pushed join@1
|
||
|
|
1 SIMPLE t3 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY,j,k PRIMARY 4 test.t1.j # # Child of 't1' in pushed join@1; Using where with pushed condition ((`test`.`t3`.`k` is not null) and (`test`.`t3`.`j` is not null))
|
||
|
|
1 SIMPLE t4 p0,p1,p2,p3,p4,p5,p6,p7 ref i,i_2,k k 5 test.t3.k # # Child of 't3' in pushed join@1; Using where with pushed condition (`test`.`t4`.`i` is not null)
|
||
|
|
1 SIMPLE t5 p0,p1,p2,p3,p4,p5,p6,p7 ref i,i_2,j i 10 test.t4.i,test.t3.j # # Child of 't4' in pushed join@1
|
||
|
|
1 SIMPLE t6 p0,p1,p2,p3,p4,p5,p6,p7 ref k k 5 test.t1.k # # Child of 't1' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Note 1003 /* select#1 */ select straight_join count(0) AS `count(*)` from `test`.`t` `t1` join `test`.`t` `t2` join `test`.`t` `t3` join `test`.`t` `t4` join `test`.`t` `t5` join `test`.`t` `t6` where ((`test`.`t2`.`i` = `test`.`t1`.`i`) and (`test`.`t4`.`k` = `test`.`t3`.`k`) and (`test`.`t5`.`j` = `test`.`t3`.`j`) and (`test`.`t5`.`i` = `test`.`t4`.`i`) and (`test`.`t3`.`pk` = `test`.`t1`.`j`) and (`test`.`t6`.`k` = `test`.`t1`.`k`) and (`test`.`t1`.`i` < 2))
|
||
|
|
select straight_join count(*) from
|
||
|
|
t as t1
|
||
|
|
join t as t2 on t2.i = t1.i
|
||
|
|
join (t as t3 join t as t4 on t4.k=t3.k join t as t5 on t5.i=t4.i and t5.j=t3.j) on t3.pk=t1.j
|
||
|
|
join t as t6 on t6.k = t1.k
|
||
|
|
where t1.i < 2;
|
||
|
|
count(*)
|
||
|
|
243
|
||
|
|
set global debug=@save_debug;
|
||
|
|
drop table t;
|
||
|
|
create table t1 (a int primary key, b int, c int, index(b,c)) engine = ndb;
|
||
|
|
insert into t1 values (4,null, 2);
|
||
|
|
explain
|
||
|
|
select x.a from t1 as x join t1 as y on y.a = x.b where x.a=4;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE x p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY,b PRIMARY 4 const 1 100.00 Parent of 2 pushed join@1; Using where with pushed condition (`test`.`x`.`b` is not null)
|
||
|
|
1 SIMPLE y p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.x.b 1 100.00 Child of 'x' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Note 1003 /* select#1 */ select `test`.`x`.`a` AS `a` from `test`.`t1` `x` join `test`.`t1` `y` where ((`test`.`y`.`a` = `test`.`x`.`b`) and (`test`.`x`.`a` = 4))
|
||
|
|
select x.a from t1 as x join t1 as y on y.a = x.b where x.a=4;
|
||
|
|
a
|
||
|
|
drop table t1;
|
||
|
|
CREATE TABLE t1 (
|
||
|
|
a int NOT NULL,
|
||
|
|
b int DEFAULT NULL,
|
||
|
|
c int NOT NULL,
|
||
|
|
d int NOT NULL,
|
||
|
|
PRIMARY KEY (`a`)
|
||
|
|
) ENGINE=ndbcluster;
|
||
|
|
create unique index ix1 on t1(b,c) using hash;
|
||
|
|
Warnings:
|
||
|
|
Warning 1121 Ndb does not support unique index on NULL valued attributes, index access with NULL value will become full table scan
|
||
|
|
insert into t1 values (1,NULL,1,1);
|
||
|
|
explain extended select * from t1 as x1 left join (t1 as x2 join t1 as x3 on x2.d=x3.c) on x1.b=x3.b;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE x1 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 2 100.00 NULL
|
||
|
|
1 SIMPLE x2 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 2 100.00 Parent of 2 pushed join@1
|
||
|
|
1 SIMPLE x3 p0,p1,p2,p3,p4,p5,p6,p7 ref ix1 ix1 9 test.x1.b,test.x2.d 1 100.00 Child of 'x2' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 Can't push table 'x2' as child, 'type' must be a 'ref' access
|
||
|
|
Note 1003 Can't push table 'x3' as child of 'x1', column 'x2.d' is outside scope of pushable join
|
||
|
|
Note 1003 /* select#1 */ select `test`.`x1`.`a` AS `a`,`test`.`x1`.`b` AS `b`,`test`.`x1`.`c` AS `c`,`test`.`x1`.`d` AS `d`,`test`.`x2`.`a` AS `a`,`test`.`x2`.`b` AS `b`,`test`.`x2`.`c` AS `c`,`test`.`x2`.`d` AS `d`,`test`.`x3`.`a` AS `a`,`test`.`x3`.`b` AS `b`,`test`.`x3`.`c` AS `c`,`test`.`x3`.`d` AS `d` from `test`.`t1` `x1` left join (`test`.`t1` `x2` join `test`.`t1` `x3`) on(((`test`.`x1`.`b` = `test`.`x3`.`b`) and (`test`.`x2`.`d` = `test`.`x3`.`c`))) where 1
|
||
|
|
create temporary table scan_count
|
||
|
|
select * from information_schema.global_status
|
||
|
|
where variable_name = 'Ndb_scan_count';
|
||
|
|
select * from t1 as x1 left join (t1 as x2 join t1 as x3 on x2.d=x3.c) on x1.b=x3.b;
|
||
|
|
a b c d a b c d a b c d
|
||
|
|
1 NULL 1 1 NULL NULL NULL NULL NULL NULL NULL NULL
|
||
|
|
select scan_count.VARIABLE_NAME,
|
||
|
|
old.VARIABLE_VALUE - scan_count.VARIABLE_VALUE
|
||
|
|
from scan_count,information_schema.global_status as old
|
||
|
|
where old.variable_name = 'Ndb_scan_count';
|
||
|
|
VARIABLE_NAME old.VARIABLE_VALUE - scan_count.VARIABLE_VALUE
|
||
|
|
NDB_SCAN_COUNT 2
|
||
|
|
drop table scan_count;
|
||
|
|
drop table t1;
|
||
|
|
CREATE TABLE table1 (
|
||
|
|
col_int_unique int(11),
|
||
|
|
PRIMARY KEY (col_int_unique)
|
||
|
|
) ENGINE=ndbcluster;
|
||
|
|
CREATE TABLE table3 (
|
||
|
|
col_int int(11) NOT NULL DEFAULT '0',
|
||
|
|
KEY (col_int)
|
||
|
|
) ENGINE=ndbcluster;
|
||
|
|
CREATE TABLE table4 (
|
||
|
|
col_int int(11) DEFAULT NULL,
|
||
|
|
pk int(11) NOT NULL,
|
||
|
|
PRIMARY KEY (pk)
|
||
|
|
) ENGINE=ndbcluster;
|
||
|
|
CREATE TABLE table6 (
|
||
|
|
col_int int(11) DEFAULT NULL,
|
||
|
|
col_int_unique int(11) DEFAULT NULL
|
||
|
|
) ENGINE=ndbcluster;
|
||
|
|
insert into table6 values
|
||
|
|
(2,NULL),
|
||
|
|
(2,NULL),
|
||
|
|
(2,NULL),
|
||
|
|
(2,NULL),
|
||
|
|
(2,NULL),
|
||
|
|
(2,NULL),
|
||
|
|
(2,NULL),
|
||
|
|
(2,NULL);
|
||
|
|
set global debug='+d,max_4rows_in_spj_batches';
|
||
|
|
EXPLAIN EXTENDED
|
||
|
|
SELECT * FROM
|
||
|
|
table1 RIGHT JOIN
|
||
|
|
table3 LEFT JOIN table4 ON table3.col_int = table4.col_int
|
||
|
|
JOIN
|
||
|
|
table6 ON table4.pk = table6.col_int_unique
|
||
|
|
ON table1.col_int_unique = table6.col_int;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE table6 p0,p1,p2,p3,p4,p5,p6,p7 ALL NULL NULL NULL NULL 8 100.00 Parent of 4 pushed join@1
|
||
|
|
1 SIMPLE table1 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.table6.col_int 1 100.00 Child of 'table6' in pushed join@1
|
||
|
|
1 SIMPLE table4 p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.table6.col_int_unique 1 100.00 Child of 'table6' in pushed join@1; Using where with pushed condition (`test`.`table4`.`col_int` is not null)
|
||
|
|
1 SIMPLE table3 p0,p1,p2,p3,p4,p5,p6,p7 ref col_int col_int 4 test.table4.col_int 2 100.00 Child of 'table4' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 /* select#1 */ select `test`.`table1`.`col_int_unique` AS `col_int_unique`,`test`.`table3`.`col_int` AS `col_int`,`test`.`table4`.`col_int` AS `col_int`,`test`.`table4`.`pk` AS `pk`,`test`.`table6`.`col_int` AS `col_int`,`test`.`table6`.`col_int_unique` AS `col_int_unique` from `test`.`table3` join `test`.`table4` join `test`.`table6` left join `test`.`table1` on((`test`.`table1`.`col_int_unique` = `test`.`table6`.`col_int`)) where ((`test`.`table3`.`col_int` = `test`.`table4`.`col_int`) and (`test`.`table4`.`pk` = `test`.`table6`.`col_int_unique`))
|
||
|
|
SELECT * FROM
|
||
|
|
table1 RIGHT JOIN
|
||
|
|
table3 LEFT JOIN table4 ON table3.col_int = table4.col_int
|
||
|
|
JOIN
|
||
|
|
table6 ON table4.pk = table6.col_int_unique
|
||
|
|
ON table1.col_int_unique = table6.col_int;
|
||
|
|
col_int_unique col_int col_int pk col_int col_int_unique
|
||
|
|
set global debug=@save_debug;
|
||
|
|
drop table table6;
|
||
|
|
drop table table4;
|
||
|
|
drop table table3;
|
||
|
|
drop table table1;
|
||
|
|
5.6 tests
|
||
|
|
create table t1 (
|
||
|
|
a int not null,
|
||
|
|
b int not null,
|
||
|
|
c int not null,
|
||
|
|
d int not null,
|
||
|
|
primary key (`a`,`b`),
|
||
|
|
key(c), key(d)
|
||
|
|
) engine=ndbcluster;
|
||
|
|
insert into t1 values
|
||
|
|
(1,1,1,1), (2,2,2,2), (3,3,3,3), (4,4,4,4),
|
||
|
|
(1,2,5,1), (1,3,1,2), (1,4,2,3),
|
||
|
|
(2,1,3,4), (2,3,4,5), (2,4,5,1),
|
||
|
|
(3,1,1,2), (3,2,2,3), (3,4,3,4),
|
||
|
|
(4,1,4,5), (4,2,5,1), (4,3,1,2);
|
||
|
|
set global debug='+d,max_4rows_in_spj_batches';
|
||
|
|
set optimizer_switch='materialization=off';
|
||
|
|
explain extended
|
||
|
|
select count(*) from t1 where
|
||
|
|
t1.c in (select c from t1 as subq);
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL c NULL NULL NULL 16 100.00 NULL
|
||
|
|
1 SIMPLE subq p0,p1,p2,p3,p4,p5,p6,p7 ref c c 4 test.t1.c 2 100.00 FirstMatch(t1)
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 Can't push table 'subq' as child of 't1', 'FirstMatch' not allowed to contain scan-child
|
||
|
|
Note 1003 /* select#1 */ select count(0) AS `count(*)` from `test`.`t1` semi join (`test`.`t1` `subq`) where (`test`.`subq`.`c` = `test`.`t1`.`c`)
|
||
|
|
select count(*) from t1 where
|
||
|
|
t1.c in (select c from t1 as subq);
|
||
|
|
count(*)
|
||
|
|
16
|
||
|
|
explain extended
|
||
|
|
select count(*) from t1 where
|
||
|
|
t1.c in (select c from t1 as subq1) and
|
||
|
|
t1.d in (select d from t1 as subq2);
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL c,d NULL NULL NULL 16 100.00 NULL
|
||
|
|
1 SIMPLE subq1 p0,p1,p2,p3,p4,p5,p6,p7 ref c c 4 test.t1.c 2 100.00 FirstMatch(t1)
|
||
|
|
1 SIMPLE subq2 p0,p1,p2,p3,p4,p5,p6,p7 ref d d 4 test.t1.d 2 100.00 FirstMatch(subq1)
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 Can't push table 'subq1' as child of 't1', 'FirstMatch' not allowed to contain scan-child
|
||
|
|
Note 1003 Can't push table 'subq2' as child of 't1', 'FirstMatch' not allowed to contain scan-child
|
||
|
|
Note 1003 /* select#1 */ select count(0) AS `count(*)` from `test`.`t1` semi join (`test`.`t1` `subq1`) semi join (`test`.`t1` `subq2`) where ((`test`.`subq2`.`d` = `test`.`t1`.`d`) and (`test`.`subq1`.`c` = `test`.`t1`.`c`))
|
||
|
|
select count(*) from t1 where
|
||
|
|
t1.c in (select c from t1 as subq1) and
|
||
|
|
t1.d in (select d from t1 as subq2);
|
||
|
|
count(*)
|
||
|
|
16
|
||
|
|
explain extended
|
||
|
|
select count(*) from t1 where
|
||
|
|
t1.c in (select c from t1 as subq1 where
|
||
|
|
subq1.c in (select c from t1 as subq2));
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL c NULL NULL NULL 16 100.00 NULL
|
||
|
|
1 SIMPLE subq1 p0,p1,p2,p3,p4,p5,p6,p7 ref c c 4 test.t1.c 2 100.00 NULL
|
||
|
|
1 SIMPLE subq2 p0,p1,p2,p3,p4,p5,p6,p7 ref c c 4 test.t1.c 2 100.00 FirstMatch(t1)
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 Can't push table 'subq1' as child of 't1', 'FirstMatch' not allowed to contain scan-child
|
||
|
|
Note 1003 Can't push table 'subq2' as child of 't1', 'FirstMatch' not allowed to contain scan-child
|
||
|
|
Note 1003 /* select#1 */ select count(0) AS `count(*)` from `test`.`t1` semi join (`test`.`t1` `subq2` join `test`.`t1` `subq1`) where ((`test`.`subq1`.`c` = `test`.`t1`.`c`) and (`test`.`subq2`.`c` = `test`.`t1`.`c`))
|
||
|
|
select count(*) from t1 where
|
||
|
|
t1.c in (select c from t1 as subq1 where
|
||
|
|
subq1.c in (select c from t1 as subq2));
|
||
|
|
count(*)
|
||
|
|
16
|
||
|
|
explain extended
|
||
|
|
select count(*) from t1 where
|
||
|
|
t1.c in (select subq1.c from t1 as subq1 straight_join t1 as subq2 on subq1.a = subq2.c);
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE t1 p0,p1,p2,p3,p4,p5,p6,p7 ALL c NULL NULL NULL 16 100.00 NULL
|
||
|
|
1 SIMPLE subq1 p0,p1,p2,p3,p4,p5,p6,p7 ref PRIMARY,c c 4 test.t1.c 2 100.00 NULL
|
||
|
|
1 SIMPLE subq2 p0,p1,p2,p3,p4,p5,p6,p7 ref c c 4 test.subq1.a 2 100.00 FirstMatch(t1)
|
||
|
|
Warnings:
|
||
|
|
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
|
||
|
|
Note 1003 Can't push table 'subq1' as child of 't1', 'FirstMatch' not allowed to contain scan-child
|
||
|
|
Note 1003 Can't push table 'subq2' as child of 't1', column 'subq1.a' is outside scope of pushable join
|
||
|
|
Note 1003 Can't push table 'subq2' as child of 'subq1', 'FirstMatch' not allowed to contain scan-child
|
||
|
|
Note 1003 /* select#1 */ select count(0) AS `count(*)` from `test`.`t1` semi join (`test`.`t1` `subq1` straight_join `test`.`t1` `subq2`) where ((`test`.`subq2`.`c` = `test`.`subq1`.`a`) and (`test`.`subq1`.`c` = `test`.`t1`.`c`))
|
||
|
|
select count(*) from t1 where
|
||
|
|
t1.c in (select subq1.c from t1 as subq1 straight_join t1 as subq2 on subq1.a = subq2.c);
|
||
|
|
count(*)
|
||
|
|
16
|
||
|
|
set optimizer_switch='materialization=default';
|
||
|
|
set global debug=@save_debug;
|
||
|
|
drop table t1;
|
||
|
|
CREATE TABLE ndb_order_test (
|
||
|
|
node_id int(10) unsigned NOT NULL,
|
||
|
|
user_id int(10) unsigned NOT NULL,
|
||
|
|
sort_number int(10) unsigned NOT NULL,
|
||
|
|
KEY node_id (node_id,sort_number)
|
||
|
|
) ENGINE=ndbcluster DEFAULT CHARSET=utf8;
|
||
|
|
CREATE TABLE ndb_user_test (
|
||
|
|
user_id int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||
|
|
name varchar(20) NOT NULL,
|
||
|
|
PRIMARY KEY (user_id)
|
||
|
|
) ENGINE=ndbcluster DEFAULT CHARSET=utf8 AUTO_INCREMENT=2;
|
||
|
|
INSERT INTO ndb_order_test (node_id, user_id, sort_number) VALUES
|
||
|
|
(68, 1, 1398029),
|
||
|
|
(68, 1, 549053);
|
||
|
|
INSERT INTO ndb_user_test (user_id, name) VALUES
|
||
|
|
(1, 'Shawn');
|
||
|
|
EXPLAIN
|
||
|
|
SELECT *
|
||
|
|
FROM ndb_order_test JOIN ndb_user_test USING (user_id)
|
||
|
|
WHERE node_id = 68
|
||
|
|
ORDER BY sort_number DESC;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE ndb_order_test p0,p1,p2,p3,p4,p5,p6,p7 ref node_id node_id 4 const 2 100.00 Parent of 2 pushed join@1; Using where
|
||
|
|
1 SIMPLE ndb_user_test p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.ndb_order_test.user_id 1 100.00 Child of 'ndb_order_test' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Note 1003 /* select#1 */ select `test`.`ndb_order_test`.`user_id` AS `user_id`,`test`.`ndb_order_test`.`node_id` AS `node_id`,`test`.`ndb_order_test`.`sort_number` AS `sort_number`,`test`.`ndb_user_test`.`name` AS `name` from `test`.`ndb_order_test` join `test`.`ndb_user_test` where ((`test`.`ndb_user_test`.`user_id` = `test`.`ndb_order_test`.`user_id`) and (`test`.`ndb_order_test`.`node_id` = 68)) order by `test`.`ndb_order_test`.`sort_number` desc
|
||
|
|
SELECT *
|
||
|
|
FROM ndb_order_test JOIN ndb_user_test USING (user_id)
|
||
|
|
WHERE node_id = 68
|
||
|
|
ORDER BY sort_number DESC;
|
||
|
|
user_id node_id sort_number name
|
||
|
|
1 68 1398029 Shawn
|
||
|
|
1 68 549053 Shawn
|
||
|
|
EXPLAIN
|
||
|
|
SELECT *
|
||
|
|
FROM ndb_order_test JOIN ndb_user_test USING (user_id)
|
||
|
|
WHERE node_id = 68
|
||
|
|
ORDER BY sort_number ASC;
|
||
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||
|
|
1 SIMPLE ndb_order_test p0,p1,p2,p3,p4,p5,p6,p7 ref node_id node_id 4 const 2 100.00 Parent of 2 pushed join@1; Using where
|
||
|
|
1 SIMPLE ndb_user_test p0,p1,p2,p3,p4,p5,p6,p7 eq_ref PRIMARY PRIMARY 4 test.ndb_order_test.user_id 1 100.00 Child of 'ndb_order_test' in pushed join@1
|
||
|
|
Warnings:
|
||
|
|
Note 1003 /* select#1 */ select `test`.`ndb_order_test`.`user_id` AS `user_id`,`test`.`ndb_order_test`.`node_id` AS `node_id`,`test`.`ndb_order_test`.`sort_number` AS `sort_number`,`test`.`ndb_user_test`.`name` AS `name` from `test`.`ndb_order_test` join `test`.`ndb_user_test` where ((`test`.`ndb_user_test`.`user_id` = `test`.`ndb_order_test`.`user_id`) and (`test`.`ndb_order_test`.`node_id` = 68)) order by `test`.`ndb_order_test`.`sort_number`
|
||
|
|
SELECT *
|
||
|
|
FROM ndb_order_test JOIN ndb_user_test USING (user_id)
|
||
|
|
WHERE node_id = 68
|
||
|
|
ORDER BY sort_number ASC;
|
||
|
|
user_id node_id sort_number name
|
||
|
|
1 68 549053 Shawn
|
||
|
|
1 68 1398029 Shawn
|
||
|
|
DROP TABLE ndb_order_test, ndb_user_test;
|
||
|
|
select new.variable_name, new.variable_value - old.variable_value
|
||
|
|
from server_counts_at_startup as old,
|
||
|
|
information_schema.global_status as new
|
||
|
|
where new.variable_name = old.variable_name
|
||
|
|
order by new.variable_name;
|
||
|
|
variable_name new.variable_value - old.variable_value
|
||
|
|
NDB_PRUNED_SCAN_COUNT 8
|
||
|
|
NDB_PUSHED_QUERIES_DEFINED 426
|
||
|
|
NDB_PUSHED_QUERIES_DROPPED 8
|
||
|
|
NDB_SORTED_SCAN_COUNT 13
|
||
|
|
drop table server_counts_at_startup;
|
||
|
|
set ndb_join_pushdown = @save_ndb_join_pushdown;
|