Commit db5297b3 authored by Rich Prohaska's avatar Rich Prohaska

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
parent d2118c28
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
# 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;
# 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;
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment