418
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
1 SIMPLE # range uid_index uid_index 4 # # Using where
422
1 SIMPLE # ref uid_index uid_index 4 # #
421
1 SIMPLE t1 range uid_index uid_index 4 NULL # Using where
422
1 SIMPLE t2 ref uid_index uid_index 4 test.t1.uid #
423
423
explain select * from t1, t2 where t1.uid=t2.uid AND t2.uid > 0;
424
424
id select_type table type possible_keys key key_len ref rows Extra
425
1 SIMPLE # range uid_index uid_index 4 # # Using where
426
1 SIMPLE # ref uid_index uid_index 4 # #
425
1 SIMPLE t1 range uid_index uid_index 4 NULL # Using where
426
1 SIMPLE t2 ref uid_index uid_index 4 test.t1.uid #
427
427
explain select * from t1, t2 where t1.uid=t2.uid AND t1.uid != 0;
428
428
id select_type table type possible_keys key key_len ref rows Extra
429
1 SIMPLE # range uid_index uid_index 4 # # Using where
430
1 SIMPLE # ref uid_index uid_index 4 # #
429
1 SIMPLE t1 range uid_index uid_index 4 NULL # Using where
430
1 SIMPLE t2 ref uid_index uid_index 4 test.t1.uid #
431
431
explain select * from t1, t2 where t1.uid=t2.uid AND t2.uid != 0;
432
432
id select_type table type possible_keys key key_len ref rows Extra
433
1 SIMPLE # range uid_index uid_index 4 # # Using where
434
1 SIMPLE # ref uid_index uid_index 4 # #
433
1 SIMPLE t1 range uid_index uid_index 4 NULL # Using where
434
1 SIMPLE t2 ref uid_index uid_index 4 test.t1.uid #
435
435
select * from t1, t2 where t1.uid=t2.uid AND t1.uid > 0;
436
436
id name uid id name uid
437
437
1001 A 1 1001 A 1
694
694
v.oxrootid ='d8c4177d09f8b11f5.52725521' AND
695
695
s.oxleft > v.oxleft AND s.oxleft < v.oxright;
696
696
id select_type table type possible_keys key key_len ref rows Extra
697
1 SIMPLE # ALL OXLEFT,OXRIGHT,OXROOTID NULL NULL # # Using where
698
1 SIMPLE # ALL OXLEFT NULL NULL # # Range checked for each record (index map: 0x4)
697
1 SIMPLE v ALL OXLEFT,OXRIGHT,OXROOTID NULL NULL NULL # Using where
698
1 SIMPLE s ALL OXLEFT NULL NULL NULL # Range checked for each record (index map: 0x4)
699
699
SELECT s.oxid FROM t1 v, t1 s
700
700
WHERE s.oxrootid = 'd8c4177d09f8b11f5.52725521' AND
701
701
v.oxrootid ='d8c4177d09f8b11f5.52725521' AND
961
961
insert into t2 select * from t1;
962
962
explain select * from t1 where a between 'a' and 'a ';
963
963
id select_type table type possible_keys key key_len ref rows Extra
964
1 SIMPLE # ref a a 43 # # Using where
964
1 SIMPLE t1 ref a a 43 const # Using where
965
965
explain select * from t1 where a = 'a' or a='a ';
966
966
id select_type table type possible_keys key key_len ref rows Extra
967
1 SIMPLE # ref a a 43 # # Using where
967
1 SIMPLE t1 ref a a 43 const # Using where
968
968
explain select * from t2 where a between 'a' and 'a ';
969
969
id select_type table type possible_keys key key_len ref rows Extra
970
1 SIMPLE # ref a a 43 # # Using where
970
1 SIMPLE t2 ref a a 43 const # Using where
971
971
explain select * from t2 where a = 'a' or a='a ';
972
972
id select_type table type possible_keys key key_len ref rows Extra
973
1 SIMPLE # ref a a 43 # # Using where
973
1 SIMPLE t2 ref a a 43 const # 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 t1 ALL a NULL NULL NULL # Using where
978
978
select a, hex(filler) from t1 where a not between 'b' and 'b';
1030
1030
('A2','2005-12-01 08:00:00',1000);
1031
1031
EXPLAIN SELECT * FROM t1 WHERE item='A1' AND started<='2005-12-01 23:59:59';
1032
1032
id select_type table type possible_keys key key_len ref rows Extra
1033
1 SIMPLE # range PRIMARY PRIMARY 90 # # Using where
1033
1 SIMPLE t1 range PRIMARY PRIMARY 90 NULL # Using where
1034
1034
SELECT * FROM t1 WHERE item='A1' AND started<='2005-12-01 23:59:59';
1035
1035
item started price
1036
1036
A1 2005-11-01 08:00:00 1000.000