1SET DEFAULT_STORAGE_ENGINE='tokudb';
2DROP TABLE IF EXISTS t1;
3create table t1(a int, b int, c int, d int, primary key(a), key(b) clustering=yes, key (c))engine=tokudb;
4insert into t1 values (1,1,1,1),(2,2,2,2),(3,3,3,3),(4,4,4,4),(5,5,5,5),(6,6,6,6),(7,7,7,7),(8,8,8,8),(9,9,9,9);
5explain select * from t1 where b > 2;
6id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
71	SIMPLE	t1	range	b	b	5	NULL	NULL;	Using where; Using index
8explain select * from t1 where c > 2;
9id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
101	SIMPLE	t1	ALL	c	NULL	NULL	NULL	NULL;	Using where
11explain select * from t1 where a > 4;
12id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
131	SIMPLE	t1	range	PRIMARY	PRIMARY	4	NULL	NULL;	Using where
14explain select * from t1 where c > 7;
15id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
161	SIMPLE	t1	range	c	c	5	NULL	NULL;	Using where
17explain select * from t1 where b > 7;
18id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
191	SIMPLE	t1	range	b	b	5	NULL	NULL;	Using where; Using index
20explain select a from t1 where b > 0;
21id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
221	SIMPLE	t1	index	b	b	5	NULL	NULL;	Using where; Using index
23explain select a from t1 where c > 0;
24id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
251	SIMPLE	t1	index	c	c	5	NULL	NULL;	Using where; Using index
26drop table t1;
27