316
316
(1,1,1), (3,1,1), (1,2,1);
317
317
EXPLAIN SELECT * FROM t1,t2 WHERE t1.a=t2.a AND t1.b=t2.b;
318
318
id select_type table type possible_keys key key_len ref rows Extra
319
1 SIMPLE t2 ALL PRIMARY NULL NULL NULL 7
320
1 SIMPLE t1 eq_ref PRIMARY PRIMARY 8 test.t2.a,test.t2.b 1
319
1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 6
320
1 SIMPLE t2 ref PRIMARY PRIMARY 8 test.t1.a,test.t1.b 1
321
321
EXPLAIN SELECT * FROM t1,t2 WHERE (t1.a,t1.b)=(t2.a,t2.b);
322
322
id select_type table type possible_keys key key_len ref rows Extra
323
1 SIMPLE t2 ALL PRIMARY NULL NULL NULL 7
324
1 SIMPLE t1 eq_ref PRIMARY PRIMARY 8 test.t2.a,test.t2.b 1
323
1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 6
324
1 SIMPLE t2 ref PRIMARY PRIMARY 8 test.t1.a,test.t1.b 1
325
325
SELECT * FROM t1,t2 WHERE t1.a=t2.a and t1.b=t2.b;
333
333
SELECT * FROM t1,t2 WHERE (t1.a,t1.b)=(t2.a,t2.b);
341
341
EXPLAIN SELECT * FROM t1,t2 WHERE t1.a=t2.a AND t1.b=2;
342
342
id select_type table type possible_keys key key_len ref rows Extra
343
1 SIMPLE t2 ALL PRIMARY NULL NULL NULL 7
344
1 SIMPLE t1 eq_ref PRIMARY PRIMARY 8 test.t2.a,const 1
343
1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 6 Using where
344
1 SIMPLE t2 ref PRIMARY PRIMARY 4 test.t1.a 1
345
345
EXPLAIN SELECT * FROM t1,t2 WHERE (t1.a,t1.b)=(t2.a,2);
346
346
id select_type table type possible_keys key key_len ref rows Extra
347
1 SIMPLE t2 ALL PRIMARY NULL NULL NULL 7
348
1 SIMPLE t1 eq_ref PRIMARY PRIMARY 8 test.t2.a,const 1
347
1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 6 Using where
348
1 SIMPLE t2 ref PRIMARY PRIMARY 4 test.t1.a 1
349
349
SELECT * FROM t1,t2 WHERE t1.a=1 and t1.b=t2.b;
357
357
SELECT * FROM t1,t2 WHERE (t1.a,t1.b)=(t2.a,2);
365
365
EXPLAIN EXTENDED SELECT * FROM t1,t2 WHERE (t1.a,t1.b)=(t2.a,t2.b+1);
366
366
id select_type table type possible_keys key key_len ref rows filtered Extra
367
1 SIMPLE t2 ALL PRIMARY NULL NULL NULL 7 100.00
368
1 SIMPLE t1 eq_ref PRIMARY PRIMARY 8 test.t2.a,func 1 100.00 Using where
367
1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 6 100.00
368
1 SIMPLE t2 ref PRIMARY PRIMARY 4 test.t1.a 1 100.00 Using where
370
Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c` from `test`.`t1` join `test`.`t2` where ((`test`.`t1`.`a` = `test`.`t2`.`a`) and (`test`.`t1`.`b` = (`test`.`t2`.`b` + 1)))
370
Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c` from `test`.`t1` join `test`.`t2` where ((`test`.`t2`.`a` = `test`.`t1`.`a`) and (`test`.`t1`.`b` = (`test`.`t2`.`b` + 1)))
371
371
SELECT * FROM t1,t2 WHERE (t1.a,t1.b)=(t2.a,t2.b+1);
377
377
EXPLAIN EXTENDED SELECT * FROM t1,t2 WHERE (t1.a-1,t1.b)=(t2.a-1,t2.b+1);
378
378
id select_type table type possible_keys key key_len ref rows filtered Extra
379
379
1 SIMPLE t1 ALL NULL NULL NULL NULL 6 100.00