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,10,100,1000),(2,20,200,2000),(3,30,300,3000),(4,40,400,4000),(5,50,500,5000),(6,60,600,6000),(7,70,700,7000),(8,80,800,8000),(9,90,900,9000);
5explain select * from t1 where a > 5;
6id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
71	SIMPLE	t1	range	PRIMARY	PRIMARY	4	NULL	NULL;	Using where
8select * from t1 where a > 5;
9a	b	c	d
106	60	600	6000
117	70	700	7000
128	80	800	8000
139	90	900	9000
14explain select * from t1 where b > 30;
15id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
161	SIMPLE	t1	range	b	b	5	NULL	NULL;	Using where; Using index
17select * from t1 where b > 30;
18a	b	c	d
194	40	400	4000
205	50	500	5000
216	60	600	6000
227	70	700	7000
238	80	800	8000
249	90	900	9000
25explain select * from t1 where c > 750;
26id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
271	SIMPLE	t1	range	c	c	5	NULL	NULL;	Using where
28select * from t1 where c > 750;
29a	b	c	d
308	80	800	8000
319	90	900	9000
32explain select a from t1 where a > 8;
33id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
341	SIMPLE	t1	range	PRIMARY	PRIMARY	4	NULL	NULL;	Using where; Using index
35select a from t1 where a > 8;
36a
379
38explain select a,b from t1 where b > 30;
39id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
401	SIMPLE	t1	range	b	b	5	NULL	NULL;	Using where; Using index
41select a,b from t1 where b > 30;
42a	b
434	40
445	50
456	60
467	70
478	80
489	90
49explain select a,b from t1 where c > 750;
50id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
511	SIMPLE	t1	range	c	c	5	NULL	NULL;	Using where
52select a,c from t1 where c > 750;
53a	c
548	800
559	900
56delete from t1 where b>30 and b < 60;
57select * from t1;
58a	b	c	d
591	10	100	1000
602	20	200	2000
613	30	300	3000
626	60	600	6000
637	70	700	7000
648	80	800	8000
659	90	900	9000
66explain select * from t1 where a > 5;
67id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
681	SIMPLE	t1	range	PRIMARY	PRIMARY	4	NULL	NULL;	Using where
69select * from t1 where a > 5;
70a	b	c	d
716	60	600	6000
727	70	700	7000
738	80	800	8000
749	90	900	9000
75explain select * from t1 where b > 30;
76id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
771	SIMPLE	t1	index	b	b	5	NULL	NULL;	Using where; Using index
78select * from t1 where b > 30;
79a	b	c	d
806	60	600	6000
817	70	700	7000
828	80	800	8000
839	90	900	9000
84explain select * from t1 where c > 750;
85id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
861	SIMPLE	t1	range	c	c	5	NULL	NULL;	Using where
87select * from t1 where c > 750;
88a	b	c	d
898	80	800	8000
909	90	900	9000
91explain select a from t1 where a > 8;
92id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
931	SIMPLE	t1	range	PRIMARY	PRIMARY	4	NULL	NULL;	Using where; Using index
94select a from t1 where a > 8;
95a
969
97explain select a,b from t1 where b > 30;
98id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
991	SIMPLE	t1	index	b	b	5	NULL	NULL;	Using where; Using index
100select a,b from t1 where b > 30;
101a	b
1026	60
1037	70
1048	80
1059	90
106explain select a,b from t1 where c > 750;
107id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
1081	SIMPLE	t1	range	c	c	5	NULL	NULL;	Using where
109select a,c from t1 where c > 750;
110a	c
1118	800
1129	900
113alter table t1 drop primary key;
114explain select * from t1 where a > 5;
115id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
1161	SIMPLE	t1	ALL	NULL	NULL	NULL	NULL	NULL;	Using where
117select * from t1 where a > 5;
118a	b	c	d
1196	60	600	6000
1207	70	700	7000
1218	80	800	8000
1229	90	900	9000
123explain select * from t1 where b > 30;
124id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
1251	SIMPLE	t1	range	b	b	5	NULL	NULL;	Using where; Using index
126select * from t1 where b > 30;
127a	b	c	d
1286	60	600	6000
1297	70	700	7000
1308	80	800	8000
1319	90	900	9000
132explain select * from t1 where c > 750;
133id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
1341	SIMPLE	t1	range	c	c	5	NULL	NULL;	Using where
135select * from t1 where c > 750;
136a	b	c	d
1378	80	800	8000
1389	90	900	9000
139explain select a from t1 where a > 5;
140id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
1411	SIMPLE	t1	ALL	NULL	NULL	NULL	NULL	NULL;	Using where
142select a from t1 where a > 5;
143a
1446
1457
1468
1479
148explain select a,b from t1 where b > 30;
149id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
1501	SIMPLE	t1	range	b	b	5	NULL	NULL;	Using where; Using index
151select a,b from t1 where b > 30;
152a	b
1536	60
1547	70
1558	80
1569	90
157explain select a,b from t1 where c > 750;
158id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
1591	SIMPLE	t1	range	c	c	5	NULL	NULL;	Using where
160select a,c from t1 where c > 750;
161a	c
1628	800
1639	900
164delete from t1 where b > 10 and b < 90;
165select * from t1;
166a	b	c	d
1671	10	100	1000
1689	90	900	9000
169explain select * from t1 where a > 5;
170id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
1711	SIMPLE	t1	ALL	NULL	NULL	NULL	NULL	NULL;	Using where
172select * from t1 where a > 5;
173a	b	c	d
1749	90	900	9000
175explain select * from t1 where b > 30;
176id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
1771	SIMPLE	t1	index	b	b	5	NULL	NULL;	Using where; Using index
178select * from t1 where b > 30;
179a	b	c	d
1809	90	900	9000
181explain select * from t1 where c > 750;
182id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
1831	SIMPLE	t1	ALL	c	NULL	NULL	NULL	NULL;	Using where
184select * from t1 where c > 750;
185a	b	c	d
1869	90	900	9000
187explain select a from t1 where a > 5;
188id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
1891	SIMPLE	t1	ALL	NULL	NULL	NULL	NULL	NULL;	Using where
190select a from t1 where a > 5;
191a
1929
193explain select a,b from t1 where b > 30;
194id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
1951	SIMPLE	t1	index	b	b	5	NULL	NULL;	Using where; Using index
196select a,b from t1 where b > 30;
197a	b
1989	90
199explain select a,b from t1 where c > 750;
200id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
2011	SIMPLE	t1	ALL	c	NULL	NULL	NULL	NULL;	Using where
202select a,c from t1 where c > 750;
203a	c
2049	900
205drop table t1;
206