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)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);
5select * from t1;
6a	b	c	d
71	10	100	1000
82	20	200	2000
93	30	300	3000
104	40	400	4000
115	50	500	5000
126	60	600	6000
137	70	700	7000
148	80	800	8000
159	90	900	9000
16delete from t1 where d > 8000;
17select * from t1;
18a	b	c	d
191	10	100	1000
202	20	200	2000
213	30	300	3000
224	40	400	4000
235	50	500	5000
246	60	600	6000
257	70	700	7000
268	80	800	8000
27explain select * From t1 where b > 0;
28id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
291	SIMPLE	t1	index	b	b	5	NULL	NULL;	Using where; Using index
30select * From t1 where b > 0;
31a	b	c	d
321	10	100	1000
332	20	200	2000
343	30	300	3000
354	40	400	4000
365	50	500	5000
376	60	600	6000
387	70	700	7000
398	80	800	8000
40delete from t1 where a > 7;
41select * from t1;
42a	b	c	d
431	10	100	1000
442	20	200	2000
453	30	300	3000
464	40	400	4000
475	50	500	5000
486	60	600	6000
497	70	700	7000
50explain select * From t1 where b > 0;
51id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
521	SIMPLE	t1	index	b	b	5	NULL	NULL;	Using where; Using index
53select * From t1 where b > 0;
54a	b	c	d
551	10	100	1000
562	20	200	2000
573	30	300	3000
584	40	400	4000
595	50	500	5000
606	60	600	6000
617	70	700	7000
62delete from t1 where b > 30;
63select * from t1;
64a	b	c	d
651	10	100	1000
662	20	200	2000
673	30	300	3000
68explain select * From t1 where b > 0;
69id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
701	SIMPLE	t1	index	b	b	5	NULL	NULL;	Using where; Using index
71select * From t1 where b > 0;
72a	b	c	d
731	10	100	1000
742	20	200	2000
753	30	300	3000
76drop table t1;
77create table t1(a int, b int, c int, d int, key(b) clustering=yes)engine=tokudb;
78insert into t1 values (2,20,200,2000),(4,40,400,4000),(1,10,100,1000),(5,50,500,5000),(6,60,600,6000),(7,70,700,7000),(8,80,800,8000),(3,30,300,3000),(9,90,900,9000);
79select * from t1;
80a	b	c	d
811	10	100	1000
822	20	200	2000
833	30	300	3000
844	40	400	4000
855	50	500	5000
866	60	600	6000
877	70	700	7000
888	80	800	8000
899	90	900	9000
90delete from t1 where d > 8000;
91select * from t1;
92a	b	c	d
931	10	100	1000
942	20	200	2000
953	30	300	3000
964	40	400	4000
975	50	500	5000
986	60	600	6000
997	70	700	7000
1008	80	800	8000
101explain select * From t1 where b > 0;
102id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
1031	SIMPLE	t1	index	b	b	5	NULL	NULL;	Using where; Using index
104select * From t1 where b > 0;
105a	b	c	d
1061	10	100	1000
1072	20	200	2000
1083	30	300	3000
1094	40	400	4000
1105	50	500	5000
1116	60	600	6000
1127	70	700	7000
1138	80	800	8000
114delete from t1 where b > 30;
115select * from t1;
116a	b	c	d
1171	10	100	1000
1182	20	200	2000
1193	30	300	3000
120explain select * From t1 where b > 0;
121id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
1221	SIMPLE	t1	index	b	b	5	NULL	NULL;	Using where; Using index
123select * From t1 where b > 0;
124a	b	c	d
1251	10	100	1000
1262	20	200	2000
1273	30	300	3000
128drop table t1;
129