mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
Fix for BUG#10037
* Add 0.01 to cost of 'range'+'using index' scan to avoid optimizer choice races with 'index' scan. mysql-test/r/range.result: Update the test result after the changed cost sql/opt_range.cc: Fix for BUG#10037 * Add 0.01 to cost of 'range'+'using index' scan to avoid optimizer choice races with 'index' scan. * make QUICK_GROUP_MIN_MAX_SELECT handle the case where the source table is empty.
This commit is contained in:
@ -256,12 +256,12 @@ 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;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t2 ref j1 j1 4 const 1 Using index
|
||||
1 SIMPLE t1 range i1 i1 4 NULL 7 Using where; Using index
|
||||
1 SIMPLE t1 index i1 i1 4 NULL 7 Using where; Using index
|
||||
explain select * from t1 force index(i1), t2 force index(j1) where
|
||||
(t1.key1 <t2.keya + 1) and t2.keya=3;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t2 ref j1 j1 4 const 1 Using index
|
||||
1 SIMPLE t1 range i1 i1 4 NULL 7 Using where; Using index
|
||||
1 SIMPLE t1 index i1 i1 4 NULL 7 Using where; Using index
|
||||
DROP TABLE t1,t2;
|
||||
CREATE TABLE t1 (
|
||||
a int(11) default NULL,
|
||||
|
Reference in New Issue
Block a user