mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
MWL#17: Table elimination
- More dbug printouts - More testcases
This commit is contained in:
@ -202,3 +202,20 @@ t2.pk3=t2.pk1;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 4
|
||||
drop table t1, t2;
|
||||
create table t1 (pk int primary key, col int);
|
||||
insert into t1 values (1,1),(2,2);
|
||||
create table t2 like t1;
|
||||
insert into t2 select * from t1;
|
||||
create table t3 like t1;
|
||||
insert into t3 select * from t1;
|
||||
explain
|
||||
select t1.* from t1 left join ( t2 left join t3 on t3.pk=t2.col) on t2.col=t1.col;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 2
|
||||
1 SIMPLE t2 ALL NULL NULL NULL NULL 2
|
||||
explain
|
||||
select t1.*, t2.* from t1 left join (t2 left join t3 on t3.pk=t2.col) on t2.pk=t1.col;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 2
|
||||
1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t1.col 1
|
||||
drop table t1, t2;
|
||||
|
Reference in New Issue
Block a user