1
0
mirror of https://github.com/MariaDB/server.git synced 2025-12-24 11:21:21 +03:00

Range optimizer fix:

If cost(full_scan_on_shortest_covering_index) < cost(best_range_scan) <  cost(full_table_scan)
  use full_scan_on_shortest_covering_index
(before this fix best_range_scan was used)
This commit is contained in:
sergefp@mysql.com
2004-06-22 04:47:28 +04:00
parent 7a9f4c6a2a
commit f874071a26
14 changed files with 36 additions and 36 deletions

View File

@@ -3,10 +3,10 @@ create table t1 (a varchar(10), key(a));
insert into t1 values ("a"),("abc"),("abcd"),("hello"),("test");
explain select * from t1 where a like 'abc%';
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range a a 11 NULL 1 Using where; Using index
1 SIMPLE t1 index a a 11 NULL 5 Using where; Using index
explain select * from t1 where a like concat('abc','%');
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range a a 11 NULL 1 Using where; Using index
1 SIMPLE t1 index a a 11 NULL 5 Using where; Using index
select * from t1 where a like "abc%";
a
abc