| 1 |
create table t1 (a float not null, primary key(a)) engine='InnoDB' |
| 2 |
partition by key (a) ( |
| 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); |
| 7 |
show create table t1; |
| 8 |
Table Create Table |
| 9 |
t1 CREATE TABLE `t1` ( |
| 10 |
`a` float NOT NULL, |
| 11 |
PRIMARY KEY (`a`) |
| 12 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci |
| 13 |
/*!50100 PARTITION BY KEY (a) |
| 14 |
(PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = InnoDB, |
| 15 |
PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = InnoDB, |
| 16 |
PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = InnoDB, |
| 17 |
PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = InnoDB) */ |
| 18 |
insert into t1 values (-3.402823466E+38), (3.402823466E+38), (-1.5), (-1), (0), (1), (1.5); |
| 19 |
select * from t1; |
| 20 |
a |
| 21 |
0 |
| 22 |
-3.40282e38 |
| 23 |
-1.5 |
| 24 |
-1 |
| 25 |
1 |
| 26 |
1.5 |
| 27 |
3.40282e38 |
| 28 |
select * from t1 where a=1.5; |
| 29 |
a |
| 30 |
1.5 |
| 31 |
delete from t1 where a=1.5; |
| 32 |
select * from t1; |
| 33 |
a |
| 34 |
0 |
| 35 |
-3.40282e38 |
| 36 |
-1.5 |
| 37 |
-1 |
| 38 |
1 |
| 39 |
3.40282e38 |
| 40 |
drop table t1; |
| 41 |
create table t2 (a float not null, primary key(a)) engine='InnoDB' |
| 42 |
partition by key (a) partitions 10; |
| 43 |
show create table t2; |
| 44 |
Table Create Table |
| 45 |
t2 CREATE TABLE `t2` ( |
| 46 |
`a` float NOT NULL, |
| 47 |
PRIMARY KEY (`a`) |
| 48 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci |
| 49 |
/*!50100 PARTITION BY KEY (a) |
| 50 |
PARTITIONS 10 */ |
| 51 |
insert into t2 values (-3.402823466E+38), (-3.402823466E+37), (-123.456), (0), (1234546.789), (123.456), (1.5); |
| 52 |
select * from t2; |
| 53 |
a |
| 54 |
0 |
| 55 |
-3.40282e38 |
| 56 |
-3.40282e37 |
| 57 |
-123.456 |
| 58 |
1.5 |
| 59 |
123.456 |
| 60 |
1234550 |
| 61 |
select * from t2 where a=123.456; |
| 62 |
a |
| 63 |
delete from t2 where a=123.456; |
| 64 |
select * from t2; |
| 65 |
a |
| 66 |
0 |
| 67 |
-3.40282e38 |
| 68 |
-3.40282e37 |
| 69 |
-123.456 |
| 70 |
1.5 |
| 71 |
123.456 |
| 72 |
1234550 |
| 73 |
select * from t2 where a=1.5; |
| 74 |
a |
| 75 |
1.5 |
| 76 |
delete from t2 where a=1.5; |
| 77 |
select * from t2; |
| 78 |
a |
| 79 |
0 |
| 80 |
-3.40282e38 |
| 81 |
-3.40282e37 |
| 82 |
-123.456 |
| 83 |
123.456 |
| 84 |
1234550 |
| 85 |
delete from t2; |
| 86 |
1024*3 inserts; |
| 87 |
select count(*) from t2; |
| 88 |
count(*) |
| 89 |
3072 |
| 90 |
drop table t2; |
| 91 |
create table t1 (a double not null, primary key(a)) engine='InnoDB' |
| 92 |
partition by key (a) ( |
| 93 |
partition pa1 max_rows=20 min_rows=2, |
| 94 |
partition pa2 max_rows=30 min_rows=3, |
| 95 |
partition pa3 max_rows=30 min_rows=4, |
| 96 |
partition pa4 max_rows=40 min_rows=2); |
| 97 |
show create table t1; |
| 98 |
Table Create Table |
| 99 |
t1 CREATE TABLE `t1` ( |
| 100 |
`a` double NOT NULL, |
| 101 |
PRIMARY KEY (`a`) |
| 102 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci |
| 103 |
/*!50100 PARTITION BY KEY (a) |
| 104 |
(PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = InnoDB, |
| 105 |
PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = InnoDB, |
| 106 |
PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = InnoDB, |
| 107 |
PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = InnoDB) */ |
| 108 |
insert into t1 values (-2.2250738585072014E+208), (-2.2250738585072014E-208), (-1.5), (-1), (0), (1.5), (1234.567), (2.2250738585072014E+208); |
| 109 |
select * from t1; |
| 110 |
a |
| 111 |
-2.2250738585072014e-208 |
| 112 |
1234.567 |
| 113 |
-2.2250738585072016e208 |
| 114 |
0 |
| 115 |
-1.5 |
| 116 |
-1 |
| 117 |
1.5 |
| 118 |
2.2250738585072016e208 |
| 119 |
select * from t1 where a=1.5; |
| 120 |
a |
| 121 |
1.5 |
| 122 |
delete from t1 where a=1.5; |
| 123 |
select * from t1; |
| 124 |
a |
| 125 |
-2.2250738585072014e-208 |
| 126 |
1234.567 |
| 127 |
-2.2250738585072016e208 |
| 128 |
0 |
| 129 |
-1.5 |
| 130 |
-1 |
| 131 |
2.2250738585072016e208 |
| 132 |
drop table t1; |
| 133 |
create table t2 (a double not null, primary key(a)) engine='InnoDB' |
| 134 |
partition by key (a) partitions 10; |
| 135 |
show create table t2; |
| 136 |
Table Create Table |
| 137 |
t2 CREATE TABLE `t2` ( |
| 138 |
`a` double NOT NULL, |
| 139 |
PRIMARY KEY (`a`) |
| 140 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci |
| 141 |
/*!50100 PARTITION BY KEY (a) |
| 142 |
PARTITIONS 10 */ |
| 143 |
insert into t2 values (-2.2250738585072014E+208), (-2.2250738585072014E-208), (-1.5), (-1), (0), (1.5), (1234.567), (2.2250738585072014E+208); |
| 144 |
select * from t2; |
| 145 |
a |
| 146 |
0 |
| 147 |
-1.5 |
| 148 |
1.5 |
| 149 |
2.2250738585072016e208 |
| 150 |
-2.2250738585072014e-208 |
| 151 |
1234.567 |
| 152 |
-2.2250738585072016e208 |
| 153 |
-1 |
| 154 |
select * from t2 where a=1234.567; |
| 155 |
a |
| 156 |
1234.567 |
| 157 |
delete from t2 where a=1234.567; |
| 158 |
select * from t2; |
| 159 |
a |
| 160 |
0 |
| 161 |
-1.5 |
| 162 |
1.5 |
| 163 |
2.2250738585072016e208 |
| 164 |
-2.2250738585072014e-208 |
| 165 |
-2.2250738585072016e208 |
| 166 |
-1 |
| 167 |
delete from t2; |
| 168 |
1024*3 inserts; |
| 169 |
select count(*) from t2; |
| 170 |
count(*) |
| 171 |
3072 |
| 172 |
drop table t2; |