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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user