mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
merge with 4.0.15
This commit is contained in:
@ -253,4 +253,23 @@ explain select * from t1, t1 t2 where t1.y = 2 and t2.x >= 0 and t2.x <= t1.y;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ref y y 5 const 1 Using where
|
||||
1 SIMPLE t2 range x x 5 NULL 2 Using where
|
||||
explain select count(*) from t1 where x in (1);
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 range x x 5 NULL 1 Using where; Using index
|
||||
explain select count(*) from t1 where x in (1,2);
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 range x x 5 NULL 2 Using where; Using index
|
||||
drop table t1;
|
||||
CREATE TABLE t1 (key1 int(11) NOT NULL default '0', KEY i1 (key1), KEY i2 (key1));
|
||||
INSERT INTO t1 VALUES (0),(0),(1),(1);
|
||||
CREATE TABLE t2 (keya int(11) NOT NULL default '0', KEY j1 (keya));
|
||||
INSERT INTO t2 VALUES (0),(0),(1),(1),(2),(2);
|
||||
explain select * from t1, t2 where (t1.key1 <t2.keya + 1) and t2.keya=3;
|
||||
table type possible_keys key key_len ref rows Extra
|
||||
t2 ref j1 j1 4 const 1 Using where; Using index
|
||||
t1 ALL i1,i2 NULL NULL NULL 4 Range checked for each record (index map: 3)
|
||||
explain select * from t1 force index(i2), t2 where (t1.key1 <t2.keya + 1) and t2.keya=3;
|
||||
table type possible_keys key key_len ref rows Extra
|
||||
t2 ref j1 j1 4 const 1 Using where; Using index
|
||||
t1 ALL i2 NULL NULL NULL 4 Range checked for each record (index map: 2)
|
||||
DROP TABLE t1,t2;
|
||||
|
Reference in New Issue
Block a user