mirror of
https://github.com/MariaDB/server.git
synced 2025-01-19 13:32:33 +01:00
refs #5733 test case for index vs range scan query plan for simple queries
git-svn-id: file:///svn/mysql/tests/mysql-test@50565 c7de825b-a66e-492c-adef-691d508d4ae1
This commit is contained in:
parent
d2118c28b9
commit
db5297b30f
4 changed files with 20118 additions and 0 deletions
10028
mysql-test/suite/tokudb.bugs/r/5733_innodb.result
Normal file
10028
mysql-test/suite/tokudb.bugs/r/5733_innodb.result
Normal file
File diff suppressed because it is too large
Load diff
10028
mysql-test/suite/tokudb.bugs/r/5733_tokudb.result
Normal file
10028
mysql-test/suite/tokudb.bugs/r/5733_tokudb.result
Normal file
File diff suppressed because it is too large
Load diff
31
mysql-test/suite/tokudb.bugs/t/5733_innodb.test
Normal file
31
mysql-test/suite/tokudb.bugs/t/5733_innodb.test
Normal file
|
@ -0,0 +1,31 @@
|
|||
# test that query planner selects range scan rather than full scan of the primary key
|
||||
# see ticket #5733
|
||||
|
||||
disable_warnings;
|
||||
drop table if exists t;
|
||||
enable_warnings;
|
||||
|
||||
set default_storage_engine='innodb';
|
||||
|
||||
create table t (id bigint primary key, x bigint not null);
|
||||
|
||||
let $i=0;
|
||||
let $n=10000;
|
||||
while ($i < $n) {
|
||||
eval insert into t values ($i,0);
|
||||
inc $i;
|
||||
}
|
||||
|
||||
explain select id from t where id>0 limit 10;
|
||||
explain select * from t where id>0 limit 10;
|
||||
|
||||
explain select id from t where id>1000 limit 10;
|
||||
explain select * from t where id>1000 limit 10;
|
||||
|
||||
explain select id from t where id>5000 limit 10;
|
||||
explain select * from t where id>5000 limit 10;
|
||||
|
||||
explain select id from t where id>6000 limit 10;
|
||||
explain select * from t where id>6000 limit 10;
|
||||
|
||||
drop table t;
|
31
mysql-test/suite/tokudb.bugs/t/5733_tokudb.test
Normal file
31
mysql-test/suite/tokudb.bugs/t/5733_tokudb.test
Normal file
|
@ -0,0 +1,31 @@
|
|||
# test that query planner selects range scan rather than full scan of the primary key
|
||||
# see ticket #5733
|
||||
|
||||
disable_warnings;
|
||||
drop table if exists t;
|
||||
enable_warnings;
|
||||
|
||||
set default_storage_engine='tokudb';
|
||||
|
||||
create table t (id bigint primary key, x bigint not null);
|
||||
|
||||
let $i=0;
|
||||
let $n=10000;
|
||||
while ($i < $n) {
|
||||
eval insert into t values ($i,0);
|
||||
inc $i;
|
||||
}
|
||||
|
||||
explain select id from t where id>0 limit 10;
|
||||
explain select * from t where id>0 limit 10;
|
||||
|
||||
explain select id from t where id>1000 limit 10;
|
||||
explain select * from t where id>1000 limit 10;
|
||||
|
||||
explain select id from t where id>5000 limit 10;
|
||||
explain select * from t where id>5000 limit 10;
|
||||
|
||||
explain select id from t where id>6000 limit 10;
|
||||
explain select * from t where id>6000 limit 10;
|
||||
|
||||
drop table t;
|
Loading…
Reference in a new issue