diff options
author | unknown <sergefp@mysql.com> | 2004-06-22 04:47:28 +0400 |
---|---|---|
committer | unknown <sergefp@mysql.com> | 2004-06-22 04:47:28 +0400 |
commit | b482176b6ddfce3b555111496fb47863c9db5fb8 (patch) | |
tree | b87bd41117f45565a9107145e291d6bd1d0558c6 /mysql-test/r/derived.result | |
parent | 6c50d995c1ce949c8499b609c26a783141f1121f (diff) | |
download | mariadb-git-b482176b6ddfce3b555111496fb47863c9db5fb8.tar.gz |
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)
Diffstat (limited to 'mysql-test/r/derived.result')
-rw-r--r-- | mysql-test/r/derived.result | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/mysql-test/r/derived.result b/mysql-test/r/derived.result index dd4c32403b5..c374a334d3d 100644 --- a/mysql-test/r/derived.result +++ b/mysql-test/r/derived.result @@ -318,11 +318,11 @@ create table t2 (a int, b int, primary key (a)); insert into t2 values (1,7),(2,7); explain select a from t2 where a>1; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 range PRIMARY PRIMARY 4 NULL 2 Using where; Using index +1 SIMPLE t2 index PRIMARY PRIMARY 4 NULL 2 Using where; Using index explain select a from (select a from t2 where a>1) tt; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY <derived2> system NULL NULL NULL NULL 1 -2 DERIVED t2 range PRIMARY PRIMARY 4 NULL 2 Using where; Using index +2 DERIVED t2 index PRIMARY PRIMARY 4 NULL 2 Using where; Using index drop table t2; CREATE TABLE `t1` ( `itemid` int(11) NOT NULL default '0', `grpid` varchar(15) NOT NULL default '', `vendor` int(11) NOT NULL default '0', `date_` date NOT NULL default '0000-00-00', `price` decimal(12,2) NOT NULL default '0.00', PRIMARY KEY (`itemid`,`grpid`,`vendor`,`date_`), KEY `itemid` (`itemid`,`vendor`), KEY `itemid_2` (`itemid`,`date_`)); insert into t1 values (128, 'rozn', 2, now(), 10),(128, 'rozn', 1, now(), 10); |