mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
Fix for BUG#13455: Make "ref" optimizer able to make this inference:
"t.key BETWEEN c1 AND c2" and c1 = c2 -> can access table t using "t.key = c1".
This commit is contained in:
@@ -1997,10 +1997,10 @@ id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 range v v 13 NULL # Using where; Using index
|
||||
explain select count(*) from t1 where v between 'a' and 'a ';
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 range v v 13 NULL # Using where; Using index
|
||||
1 SIMPLE t1 ref v v 13 const # Using where; Using index
|
||||
explain select count(*) from t1 where v between 'a' and 'a ' and v between 'a ' and 'b\n';
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 range v v 13 NULL # Using where; Using index
|
||||
1 SIMPLE t1 ref v v 13 const # Using where; Using index
|
||||
alter table t1 add unique(v);
|
||||
ERROR 23000: Duplicate entry '{ ' for key 1
|
||||
alter table t1 add key(v);
|
||||
@@ -2188,10 +2188,10 @@ id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 range v v 303 NULL # Using where; Using index
|
||||
explain select count(*) from t1 where v between 'a' and 'a ';
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 range v v 303 NULL # Using where; Using index
|
||||
1 SIMPLE t1 ref v v 303 const # Using where; Using index
|
||||
explain select count(*) from t1 where v between 'a' and 'a ' and v between 'a ' and 'b\n';
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 range v v 303 NULL # Using where; Using index
|
||||
1 SIMPLE t1 ref v v 303 const # Using where; Using index
|
||||
explain select * from t1 where v='a';
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ref v v 303 const # Using where
|
||||
@@ -2268,10 +2268,10 @@ id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 range v v 33 NULL # Using where
|
||||
explain select count(*) from t1 where v between 'a' and 'a ';
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 range v v 33 NULL # Using where
|
||||
1 SIMPLE t1 ref v v 33 const # Using where
|
||||
explain select count(*) from t1 where v between 'a' and 'a ' and v between 'a ' and 'b\n';
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 range v v 33 NULL # Using where
|
||||
1 SIMPLE t1 ref v v 33 const # Using where
|
||||
explain select * from t1 where v='a';
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ref v v 33 const # Using where
|
||||
|
Reference in New Issue
Block a user