606
607
insert into t2 select @v:=A.a+10*B.a, @v from t1 A, t1 B;
608
609
explain select * from t1;
609
611
show status like '%cost%';
610
612
select 'The cost of accessing t1 (dont care if it changes' '^';
612
614
select 'vv: Following query must use ALL(t1), eq_ref(A), eq_ref(B): vv' Z;
614
616
explain select * from t1, t2 A, t2 B where A.a = t1.a and B.a=A.b;
615
618
show status like '%cost%';
616
619
select '^^: The above should be ~= 20 + cost(select * from t1). Value less than 20 is an error' Z;