mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +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:
@ -30,13 +30,13 @@ id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ref a,b a 5 const 3 Using where; Using index
|
||||
explain select * from t1 where a is null and b=9 or a is null and b=7 limit 3;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 range a,b a 9 NULL 2 Using where; Using index
|
||||
1 SIMPLE t1 ref a,b a 5 const 2 Using where; Using index
|
||||
explain select * from t1 where a > 1 and a < 3 limit 1;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 range a a 5 NULL 1 Using where; Using index
|
||||
1 SIMPLE t1 index a a 9 NULL 12 Using where; Using index
|
||||
explain select * from t1 where a > 8 and a < 9;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 range a a 5 NULL 1 Using where; Using index
|
||||
1 SIMPLE t1 index a a 9 NULL 12 Using where; Using index
|
||||
select * from t1 where a is null;
|
||||
a b
|
||||
NULL 7
|
||||
|
Reference in New Issue
Block a user