You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
insert into t1 select 1, x1.a * 10+x2.a, 1, 0 from tx as x1 cross join tx as x2;
2079
+
insert into t1 select 1, x1.a * 10+x2.a, 1, 1 from tx as x1 cross join tx as x2;
2080
2080
explain select count(*) from t1 as x1
2081
2081
join t1 as x2 on x2.a = x1.c and x1.b < 2
2082
-
join t1 as x3 on x3.a = x1.c;
2082
+
join t1 as x3 on x3.a = x1.d;
2083
2083
id select_type table type possible_keys key key_len ref rows Extra
2084
2084
1 SIMPLE x1 ALL NULL NULL NULL NULL 100 Parent of 3 pushed join@1; Using where with pushed condition
2085
2085
1 SIMPLE x2 ref PRIMARY PRIMARY 4 test.x1.c 1 Child of 'x1' in pushed join@1
2086
-
1 SIMPLE x3 ref PRIMARY PRIMARY 4 test.x1.c 1 Child of 'x1' in pushed join@1
2086
+
1 SIMPLE x3 ref PRIMARY PRIMARY 4 test.x1.d 1 Child of 'x1' in pushed join@1
2087
2087
select count(*) from t1 as x1
2088
2088
join t1 as x2 on x2.a = x1.c and x1.b < 2
2089
-
join t1 as x3 on x3.a = x1.c;
2089
+
join t1 as x3 on x3.a = x1.d;
2090
2090
count(*)
2091
2091
20000
2092
2092
drop table t1;
@@ -2925,20 +2925,22 @@ a3 b3 c3 d3 a3 b3 c3 d3
2925
2925
explain extended
2926
2926
select straight_join * from
2927
2927
t3 as x1
2928
-
join t3 as y1 on x1.b3 = y1.b3 and x1.d3 = y1.d3
2929
-
join t3 as x2 on x2.b3 = y1.b3
2928
+
join t3 as y1 on y1.b3 = x1.b3 and y1.d3 = x1.d3
2929
+
join t3 as x2 on x2.b3 = y1.b3+0
2930
2930
join t3 as y2 on y2.b3 = x2.c3 and y2.d3 = x1.c3;
2931
2931
id select_type table type possible_keys key key_len ref rows filtered Extra
2932
-
1 SIMPLE x1 ALL b3,c3,c3_2 NULL NULL NULL 7 100.00 Parent of 4 pushed join@1
2932
+
1 SIMPLE x1 ALL b3,c3,c3_2 NULL NULL NULL 7 100.00 Parent of 2 pushed join@1
2933
2933
1 SIMPLE y1 ref b3 b3 9 test.x1.b3,test.x1.d3 1 100.00 Child of 'x1' in pushed join@1; Using where
2934
-
1 SIMPLE x2 ref b3,c3,c3_2 b3 4 test.x1.b3 1 100.00 Child of 'x1' in pushed join@1
2935
-
1 SIMPLE y2 ref b3 b3 9 test.x2.c3,test.x1.c3 1 100.00 Child of 'x2' in pushed join@1; Using where
2934
+
1 SIMPLE x2 ref b3,c3,c3_2 b3 4 func 1 100.00 Parent of 2 pushed join@2; Using where
2935
+
1 SIMPLE y2 ref b3 b3 9 test.x2.c3,test.x1.c3 1 100.00 Child of 'x2' in pushed join@2; Using where
2936
2936
Warnings:
2937
-
Note 1003 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`.`x2`.`b3` = `test`.`x1`.`b3`) and (`test`.`y2`.`d3` = `test`.`x1`.`c3`) and (`test`.`y2`.`b3` = `test`.`x2`.`c3`))
2937
+
Note 9999 Can't push table 'x2' as child, column 'b3' does neither 'ref' a column nor a constant
2938
+
Note 9999 Can't push table 'y2' as child of 'x1', column 'x2.c3' is outside scope of pushable join
2939
+
Note 1003 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)))
0 commit comments