217
217
update t1 set y=x;
218
218
explain select * from t1, t1 t2 where t1.y = 8 and t2.x between 7 and t1.y+0;
219
219
id select_type table type possible_keys key key_len ref rows Extra
220
1 SIMPLE t1 ref y y 5 const 1
220
1 SIMPLE t1 ref y y 5 const 1 Using where
221
221
1 SIMPLE t2 ALL x NULL NULL NULL 9 Using where; Using join buffer
222
222
explain select * from t1, t1 t2 where t1.y = 8 and t2.x >= 7 and t2.x <= t1.y+0;
223
223
id select_type table type possible_keys key key_len ref rows Extra
224
1 SIMPLE t1 ref y y 5 const 1
224
1 SIMPLE t1 ref y y 5 const 1 Using where
225
225
1 SIMPLE t2 ALL x NULL NULL NULL 9 Using where; Using join buffer
226
226
explain select * from t1, t1 t2 where t1.y = 2 and t2.x between t1.y-1 and t1.y+1;
227
227
id select_type table type possible_keys key key_len ref rows Extra
228
1 SIMPLE t1 ref y y 5 const 1
228
1 SIMPLE t1 ref y y 5 const 1 Using where
229
229
1 SIMPLE t2 ALL x NULL NULL NULL 9 Using where; Using join buffer
230
230
explain select * from t1, t1 t2 where t1.y = 2 and t2.x >= t1.y-1 and t2.x <= t1.y+1;
231
231
id select_type table type possible_keys key key_len ref rows Extra
232
1 SIMPLE t1 ref y y 5 const 1
232
1 SIMPLE t1 ref y y 5 const 1 Using where
233
233
1 SIMPLE t2 ALL x NULL NULL NULL 9 Using where; Using join buffer
234
234
explain select * from t1, t1 t2 where t1.y = 2 and t2.x between 0 and t1.y;
235
235
id select_type table type possible_keys key key_len ref rows Extra
236
1 SIMPLE t1 ref y y 5 const 1
236
1 SIMPLE t1 ref y y 5 const 1 Using where
237
237
1 SIMPLE t2 ALL x NULL NULL NULL 9 Using where; Using join buffer
238
238
explain select * from t1, t1 t2 where t1.y = 2 and t2.x >= 0 and t2.x <= t1.y;
239
239
id select_type table type possible_keys key key_len ref rows Extra
240
1 SIMPLE t1 ref y y 5 const 1
240
1 SIMPLE t1 ref y y 5 const 1 Using where
241
241
1 SIMPLE t2 ALL x NULL NULL NULL 9 Using where; Using join buffer
242
242
explain select count(*) from t1 where x in (1);
243
243
id select_type table type possible_keys key key_len ref rows Extra
244
1 SIMPLE t1 ref x x 5 const 1
244
1 SIMPLE t1 ref x x 5 const 1 Using where
245
245
explain select count(*) from t1 where x in (1,2);
246
246
id select_type table type possible_keys key key_len ref rows Extra
247
247
1 SIMPLE t1 range x x 5 NULL 2 Using where
415
415
analyze table t1,t2;
416
416
Table Op Msg_type Msg_text
417
test.t1 analyze note The storage engine for the table doesn't support analyze
418
test.t2 analyze note The storage engine for the table doesn't support analyze
417
test.t1 analyze status OK
418
test.t2 analyze status OK
419
419
explain select * from t1, t2 where t1.uid=t2.uid AND t1.uid > 0;
420
420
id select_type table type possible_keys key key_len ref rows Extra
421
421
1 SIMPLE # ALL uid_index NULL NULL # # Using where
974
974
update t1 set a='b' where a<>'a';
975
975
explain select * from t1 where a not between 'b' and 'b';
976
976
id select_type table type possible_keys key key_len ref rows Extra
977
1 SIMPLE # ALL a NULL NULL # # Using where
977
1 SIMPLE # # # # # # # Using where
978
978
select a, hex(filler) from t1 where a not between 'b' and 'b';