~jlukas79/+junk/mysql-server

« back to all changes in this revision

Viewing changes to mysql-test/r/subselect_mat.result

manual merge 6.0-main --> 6.0-bka-review

Show diffs side-by-side

added added

removed removed

Lines of Context:
209
209
1       PRIMARY t1      ALL     NULL    NULL    NULL    NULL    3       100.00  Using where
210
210
2       SUBQUERY        t2      ALL     NULL    NULL    NULL    NULL    5       100.00  
211
211
Warnings:
212
 
Note    1003    select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from `test`.`t1` where <in_optimizer>((`test`.`t1`.`a1`,`test`.`t1`.`a2`),(`test`.`t1`.`a1`,`test`.`t1`.`a2`) in ( <materialize> (select `test`.`t2`.`b1` AS `b1`,`test`.`t2`.`b2` AS `b2` from `test`.`t2` ), <primary_index_lookup>(`test`.`t1`.`a1` in <temporary table> on distinct_key)))
 
212
Note    1003    select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from `test`.`t1` where <in_optimizer>((`test`.`t1`.`a1`,`test`.`t1`.`a2`),(`test`.`t1`.`a1`,`test`.`t1`.`a2`) in ( <materialize> (select `test`.`t2`.`b1` AS `b1`,`test`.`t2`.`b2` AS `b2` from `test`.`t2` order by `test`.`t2`.`b1`,`test`.`t2`.`b2` ), <primary_index_lookup>(`test`.`t1`.`a1` in <temporary table> on distinct_key)))
213
213
select * from t1 where (a1, a2) in (select b1, b2 from t2 order by b1, b2);
214
214
a1      a2
215
215
1 - 01  2 - 01
220
220
1       PRIMARY t1i     index   NULL    it1i3   18      NULL    3       100.00  Using where; Using index
221
221
2       SUBQUERY        t2i     index   NULL    it2i3   18      NULL    5       100.00  Using index
222
222
Warnings:
223
 
Note    1003    select `test`.`t1i`.`a1` AS `a1`,`test`.`t1i`.`a2` AS `a2` from `test`.`t1i` where <in_optimizer>((`test`.`t1i`.`a1`,`test`.`t1i`.`a2`),(`test`.`t1i`.`a1`,`test`.`t1i`.`a2`) in ( <materialize> (select `test`.`t2i`.`b1` AS `b1`,`test`.`t2i`.`b2` AS `b2` from `test`.`t2i` ), <primary_index_lookup>(`test`.`t1i`.`a1` in <temporary table> on distinct_key)))
 
223
Note    1003    select `test`.`t1i`.`a1` AS `a1`,`test`.`t1i`.`a2` AS `a2` from `test`.`t1i` where <in_optimizer>((`test`.`t1i`.`a1`,`test`.`t1i`.`a2`),(`test`.`t1i`.`a1`,`test`.`t1i`.`a2`) in ( <materialize> (select `test`.`t2i`.`b1` AS `b1`,`test`.`t2i`.`b2` AS `b2` from `test`.`t2i` order by `test`.`t2i`.`b1`,`test`.`t2i`.`b2` ), <primary_index_lookup>(`test`.`t1i`.`a1` in <temporary table> on distinct_key)))
224
224
select * from t1i where (a1, a2) in (select b1, b2 from t2i order by b1, b2);
225
225
a1      a2
226
226
1 - 01  2 - 01
1134
1134
2
1135
1135
3
1136
1136
drop table t1, t2, t3;
 
1137
create table t2 (a int, b int, key(a), key(b));
 
1138
insert into t2 values (3,3),(3,3),(3,3);
 
1139
select 1 from t2 where  
 
1140
t2.a > 1 
 
1141
or 
 
1142
t2.a = 3 and not t2.a not in (select t2.b from t2);
 
1143
1
 
1144
1
 
1145
1
 
1146
1
 
1147
drop table t2;