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

BUG#8924 'Explain' shows different strategy

- If number of records in table is 4, the calculated cost for using "index" and "range" become so close so that any rounding errors becomes visible.
 - Added one more record to the tables for heap test and expoect "range" to be selected
 - Decrease number of records in t1 for range and expect "index" to be choosen.


mysql-test/r/heap.result:
  Add one more record to table t1 and expect explain to use "range"
mysql-test/r/heap_btree.result:
  Add one more record to table t1 and expect explain to use "range"
mysql-test/r/heap_hash.result:
  Add one more record to table t1 and expect explain to use "range"
mysql-test/r/range.result:
  Update results
mysql-test/t/heap.test:
  Add one more record to table t1 and expect explain to use "range"
mysql-test/t/heap_btree.test:
  Add one more record to table t1 and expect explain to use "range"
mysql-test/t/heap_hash.test:
  Add one more record to table t1 in order for optimizer to select use of "range" deterministic
mysql-test/t/range.test:
  Remove one record from table t1 to avoid that cost for "index" and "range" are so close that rounding error become visible.
This commit is contained in:
unknown
2005-04-12 12:04:43 +02:00
parent e997201180
commit 5b5a12395c
8 changed files with 13 additions and 13 deletions

View File

@@ -40,7 +40,7 @@ a b
4 4
drop table t1;
create table t1 (a int not null) engine=heap;
insert into t1 values (869751),(736494),(226312),(802616);
insert into t1 values (869751),(736494),(226312),(802616),(728912);
select * from t1 where a > 736494;
a
869751
@@ -66,7 +66,7 @@ a
alter table t1 engine=myisam;
explain select * from t1 where a in (869751,736494,226312,802616);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index uniq_id uniq_id 4 NULL 4 Using where; Using index
1 SIMPLE t1 range uniq_id uniq_id 4 NULL 4 Using where; Using index
drop table t1;
create table t1 (x int not null, y int not null, key x using BTREE (x,y), unique y using BTREE (y))
engine=heap;