1 eval create
table t1 (a datetime not null, primary key(a)) engine=$engine
3 partition pa1 max_rows=20 min_rows=2,
4 partition pa2 max_rows=30 min_rows=3,
5 partition pa3 max_rows=30 min_rows=4,
6 partition pa4 max_rows=40 min_rows=2);
8 insert into t1 values ('1975-01-01 21:21:21'), ('2020-12-31 12:10:30'), ('1980-10-14 03:03'), ('2000-06-15 23:59');
10 select * from t1 where a=19801014030300;
11 delete from t1 where a=19801014030300;
15 eval create
table t2 (a datetime not null, primary key(a)) engine=$engine
16 partition by key (a) partitions 12;
18 insert into t2 values ('1975-01-01 0:1:1'), ('2020-12-31 10:11:12'), ('1980-10-14 13:14:15'), ('2000-06-15 14:15:16');
20 select * from t2 where a='1980-10-14 13:14:15';
21 delete from t2 where a='1980-10-14 13:14:15';
25 --echo $count inserts;
29 eval insert into t2 values (19700101000000+$count);
32 select count(*) from t2;
36 eval create
table t3 (a datetime not null, primary key(a)) engine=$engine
37 partition by range (month(a)) subpartition by key (a)
39 partition quarter1 values less than (4),
40 partition quarter2 values less than (7),
41 partition quarter3 values less than (10),
42 partition quarter4 values less than (13)
46 --echo $count inserts;
49 eval insert into t3 values (adddate(19700101000000,interval $count-1 month));
52 select count(*) from t3;
56 eval create
table t4 (a datetime not null, primary key(a)) engine=$engine
57 partition by list (month(a)) subpartition by key (a)
59 partition quarter1 values in (1,2,3),
60 partition quarter2 values in (4,5,6),
61 partition quarter3 values in (7,8,9),
62 partition quarter4 values in (10,11,12)
66 --echo $count inserts;
69 eval insert into t4 values (adddate(19700101000000,interval $count-1 month));
72 select count(*) from t4;