| 1 |
CREATE TABLE t1 ( |
| 2 |
a char(10) CHARSET latin1 NOT NULL, |
| 3 |
e varbinary(3000) not null, |
| 4 |
b int, |
| 5 |
c blob, |
| 6 |
d varbinary(26000), |
| 7 |
primary key(e,a), |
| 8 |
unique key (b) |
| 9 |
) comment='NDB_TABLE=FULLY_REPLICATED=1' ENGINE=ndbcluster; |
| 10 |
use ndbinfo; |
| 11 |
select tab_partitions, tab_fragments from table_distribution_status as tds join dict_obj_info as doi where tds.table_id = doi.id and doi.fq_name = 'test/def/t1'; |
| 12 |
tab_partitions tab_fragments |
| 13 |
8 8 |
| 14 |
select partition_id, fragment_id, partition_order, log_part_id, preferred_primary from table_fragments as tf join dict_obj_info as doi where tf.table_id = doi.id and doi.fq_name = 'test/def/t1' order by fragment_id; |
| 15 |
partition_id fragment_id partition_order log_part_id preferred_primary |
| 16 |
0 0 0 0 1 |
| 17 |
1 1 0 1 2 |
| 18 |
2 2 0 2 1 |
| 19 |
3 3 0 3 2 |
| 20 |
4 4 0 0 2 |
| 21 |
5 5 0 1 1 |
| 22 |
6 6 0 2 2 |
| 23 |
7 7 0 3 1 |
| 24 |
select fragment_id, replica_node_id from table_replicas as tr join dict_obj_info as doi where tr.table_id = doi.id and doi.fq_name = 'test/def/t1' order by fragment_id, replica_node_id; |
| 25 |
fragment_id replica_node_id |
| 26 |
0 1 |
| 27 |
0 2 |
| 28 |
1 1 |
| 29 |
1 2 |
| 30 |
2 1 |
| 31 |
2 2 |
| 32 |
3 1 |
| 33 |
3 2 |
| 34 |
4 1 |
| 35 |
4 2 |
| 36 |
5 1 |
| 37 |
5 2 |
| 38 |
6 1 |
| 39 |
6 2 |
| 40 |
7 1 |
| 41 |
7 2 |
| 42 |
select read_backup, fully_replicated from table_info as ti join dict_obj_info as doi where ti.table_id = doi.id and doi.fq_name = 'test/def/t1'; |
| 43 |
read_backup fully_replicated |
| 44 |
1 1 |
| 45 |
use test; |
| 46 |
insert into t1 values ('24', REPEAT('1', 3000), 24, REPEAT('24', 3000), REPEAT('A', 26000)); |
| 47 |
insert into t1 values ('23', REPEAT('1', 3000), 23, REPEAT('23', 3000), REPEAT('A', 26000)); |
| 48 |
insert into t1 values ('22', REPEAT('1', 3000), 22, REPEAT('22', 3000), REPEAT('A', 26000)); |
| 49 |
insert into t1 values ('21', REPEAT('1', 3000), 21, REPEAT('21', 3000), REPEAT('A', 26000)); |
| 50 |
insert into t1 values ('20', REPEAT('1', 3000), 20, REPEAT('20', 3000), REPEAT('A', 26000)); |
| 51 |
insert into t1 values ('19', REPEAT('1', 3000), 19, REPEAT('19', 3000), REPEAT('A', 26000)); |
| 52 |
insert into t1 values ('18', REPEAT('1', 3000), 18, REPEAT('18', 3000), REPEAT('A', 26000)); |
| 53 |
insert into t1 values ('17', REPEAT('1', 3000), 17, REPEAT('17', 3000), REPEAT('A', 26000)); |
| 54 |
insert into t1 values ('16', REPEAT('1', 3000), 16, REPEAT('16', 3000), REPEAT('A', 26000)); |
| 55 |
insert into t1 values ('15', REPEAT('1', 3000), 15, REPEAT('15', 3000), REPEAT('A', 26000)); |
| 56 |
insert into t1 values ('14', REPEAT('1', 3000), 14, REPEAT('14', 3000), REPEAT('A', 26000)); |
| 57 |
insert into t1 values ('13', REPEAT('1', 3000), 13, REPEAT('13', 3000), REPEAT('A', 26000)); |
| 58 |
insert into t1 values ('12', REPEAT('1', 3000), 12, REPEAT('12', 3000), REPEAT('A', 26000)); |
| 59 |
insert into t1 values ('11', REPEAT('1', 3000), 11, REPEAT('11', 3000), REPEAT('A', 26000)); |
| 60 |
insert into t1 values ('10', REPEAT('1', 3000), 10, REPEAT('10', 3000), REPEAT('A', 26000)); |
| 61 |
insert into t1 values ('9', REPEAT('1', 3000), 9, REPEAT('9', 3000), REPEAT('A', 26000)); |
| 62 |
insert into t1 values ('8', REPEAT('1', 3000), 8, REPEAT('8', 3000), REPEAT('A', 26000)); |
| 63 |
insert into t1 values ('7', REPEAT('1', 3000), 7, REPEAT('7', 3000), REPEAT('A', 26000)); |
| 64 |
insert into t1 values ('6', REPEAT('1', 3000), 6, REPEAT('6', 3000), REPEAT('A', 26000)); |
| 65 |
insert into t1 values ('5', REPEAT('1', 3000), 5, REPEAT('5', 3000), REPEAT('A', 26000)); |
| 66 |
insert into t1 values ('4', REPEAT('1', 3000), 4, REPEAT('4', 3000), REPEAT('A', 26000)); |
| 67 |
insert into t1 values ('3', REPEAT('1', 3000), 3, REPEAT('3', 3000), REPEAT('A', 26000)); |
| 68 |
insert into t1 values ('2', REPEAT('1', 3000), 2, REPEAT('2', 3000), REPEAT('A', 26000)); |
| 69 |
insert into t1 values ('1', REPEAT('1', 3000), 1, REPEAT('1', 3000), REPEAT('A', 26000)); |
| 70 |
create temporary table t1_frag_size ( |
| 71 |
fragment_num int primary key, |
| 72 |
fixed_elem_count int |
| 73 |
); |
| 74 |
insert into t1_frag_size select fragment_num, fixed_elem_count from `ndbinfo`.`memory_per_fragment` |
| 75 |
where fq_name = 'test/def/t1' and node_id = 1; |
| 76 |
set @numpart = (select count(*) from t1_frag_size); |
| 77 |
select mpf.node_id, mpf.fragment_num, mpf.fixed_elem_count, tfs.fragment_num, tfs.fixed_elem_count |
| 78 |
from `ndbinfo`.`memory_per_fragment` mpf |
| 79 |
join t1_frag_size tfs |
| 80 |
on tfs.fragment_num = mpf.fragment_num mod @numpart |
| 81 |
where mpf.fq_name = 'test/def/t1' |
| 82 |
and mpf.fixed_elem_count <> tfs.fixed_elem_count |
| 83 |
order by tfs.fragment_num, mpf.node_id, mpf.fragment_num; |
| 84 |
node_id fragment_num fixed_elem_count fragment_num fixed_elem_count |
| 85 |
create temporary table counters_at_startup |
| 86 |
select counter_name, sum(val) as val |
| 87 |
from ndbinfo.counters |
| 88 |
group by counter_name; |
| 89 |
select a,b,LENGTH(c) from t1 where a = '1' and e = REPEAT('1', 3000); |
| 90 |
a b LENGTH(c) |
| 91 |
1 1 3000 |
| 92 |
select a,b,LENGTH(c) from t1 where a = '2' and e = REPEAT('1', 3000); |
| 93 |
a b LENGTH(c) |
| 94 |
2 2 3000 |
| 95 |
select a,b,LENGTH(c) from t1 where a = '3' and e = REPEAT('1', 3000); |
| 96 |
a b LENGTH(c) |
| 97 |
3 3 3000 |
| 98 |
select a,b,LENGTH(c) from t1 where a = '4' and e = REPEAT('1', 3000); |
| 99 |
a b LENGTH(c) |
| 100 |
4 4 3000 |
| 101 |
select a,b,LENGTH(c) from t1 where a = '5' and e = REPEAT('1', 3000); |
| 102 |
a b LENGTH(c) |
| 103 |
5 5 3000 |
| 104 |
select a,b,LENGTH(c) from t1 where a = '6' and e = REPEAT('1', 3000); |
| 105 |
a b LENGTH(c) |
| 106 |
6 6 3000 |
| 107 |
select a,b,LENGTH(c) from t1 where a = '7' and e = REPEAT('1', 3000); |
| 108 |
a b LENGTH(c) |
| 109 |
7 7 3000 |
| 110 |
select a,b,LENGTH(c) from t1 where a = '8' and e = REPEAT('1', 3000); |
| 111 |
a b LENGTH(c) |
| 112 |
8 8 3000 |
| 113 |
select a,b,LENGTH(c) from t1 where a in ('1', '2', '3', '4', '5', '6', '7', '8') and e = REPEAT('1', 3000); |
| 114 |
a b LENGTH(c) |
| 115 |
1 1 3000 |
| 116 |
2 2 3000 |
| 117 |
3 3 3000 |
| 118 |
4 4 3000 |
| 119 |
5 5 3000 |
| 120 |
6 6 3000 |
| 121 |
7 7 3000 |
| 122 |
8 8 3000 |
| 123 |
select a,b,LENGTH(c) from t1 where a in ('2', '3', '4', '5', '6', '7', '8') and e = REPEAT('1', 3000); |
| 124 |
a b LENGTH(c) |
| 125 |
2 2 3000 |
| 126 |
3 3 3000 |
| 127 |
4 4 3000 |
| 128 |
5 5 3000 |
| 129 |
6 6 3000 |
| 130 |
7 7 3000 |
| 131 |
8 8 3000 |
| 132 |
select a,b,LENGTH(c) from t1 where a in ('3', '4', '5', '6', '7', '8') and e = REPEAT('1', 3000); |
| 133 |
a b LENGTH(c) |
| 134 |
3 3 3000 |
| 135 |
4 4 3000 |
| 136 |
5 5 3000 |
| 137 |
6 6 3000 |
| 138 |
7 7 3000 |
| 139 |
8 8 3000 |
| 140 |
select a,b,LENGTH(c) from t1 where a in ('4', '5', '6', '7', '8') and e = REPEAT('1', 3000); |
| 141 |
a b LENGTH(c) |
| 142 |
4 4 3000 |
| 143 |
5 5 3000 |
| 144 |
6 6 3000 |
| 145 |
7 7 3000 |
| 146 |
8 8 3000 |
| 147 |
select a,b,LENGTH(c) from t1 where a in ('5', '6', '7', '8') and e = REPEAT('1', 3000); |
| 148 |
a b LENGTH(c) |
| 149 |
5 5 3000 |
| 150 |
6 6 3000 |
| 151 |
7 7 3000 |
| 152 |
8 8 3000 |
| 153 |
select a,b,LENGTH(c) from t1 where a in ('6', '7', '8') and e = REPEAT('1', 3000); |
| 154 |
a b LENGTH(c) |
| 155 |
6 6 3000 |
| 156 |
7 7 3000 |
| 157 |
8 8 3000 |
| 158 |
select a,b,LENGTH(c) from t1 where a in ('7', '8') and e = REPEAT('1', 3000); |
| 159 |
a b LENGTH(c) |
| 160 |
7 7 3000 |
| 161 |
8 8 3000 |
| 162 |
select s1.counter_name, s2.val - s1.val as diff |
| 163 |
from counters_at_startup s1, |
| 164 |
(select counter_name, sum(val) as val |
| 165 |
from ndbinfo.counters |
| 166 |
group by counter_name) s2 |
| 167 |
where s1.counter_name = s2.counter_name |
| 168 |
and ( s1.counter_name = 'LOCAL_READS' or s1.counter_name = 'READS' ) |
| 169 |
order by 1; |
| 170 |
counter_name diff |
| 171 |
LOCAL_READS 131 |
| 172 |
READS 131 |
| 173 |
drop table counters_at_startup; |
| 174 |
output_line |
| 175 |
-- t1 -- |
| 176 |
Table options: readbackup, fullyreplicated |
| 177 |
-- Attributes -- |
| 178 |
-- NDB$BLOB_#_# -- |
| 179 |
Table options: readbackup, fullyreplicated |
| 180 |
-- Attributes -- |
| 181 |
Creating nodegroup |
| 182 |
Nodegroup 1 created |
| 183 |
alter table t1 algorithm=inplace, reorganize partition; |
| 184 |
use ndbinfo; |
| 185 |
select tab_partitions, tab_fragments from table_distribution_status as tds join dict_obj_info as doi where tds.table_id = doi.id and doi.fq_name = 'test/def/t1'; |
| 186 |
tab_partitions tab_fragments |
| 187 |
8 16 |
| 188 |
select partition_id, fragment_id, log_part_id, partition_order, preferred_primary from table_fragments as tf join dict_obj_info as doi where tf.table_id = doi.id and doi.fq_name = 'test/def/t1' order by fragment_id; |
| 189 |
partition_id fragment_id log_part_id partition_order preferred_primary |
| 190 |
0 0 0 0 1 |
| 191 |
1 1 1 0 2 |
| 192 |
2 2 2 0 1 |
| 193 |
3 3 3 0 2 |
| 194 |
4 4 0 0 2 |
| 195 |
5 5 1 0 1 |
| 196 |
6 6 2 0 2 |
| 197 |
7 7 3 0 1 |
| 198 |
0 8 0 1 3 |
| 199 |
1 9 1 1 4 |
| 200 |
2 10 2 1 3 |
| 201 |
3 11 3 1 4 |
| 202 |
4 12 0 1 4 |
| 203 |
5 13 1 1 3 |
| 204 |
6 14 2 1 4 |
| 205 |
7 15 3 1 3 |
| 206 |
select fragment_id, replica_node_id from table_replicas as tr join dict_obj_info as doi where tr.table_id = doi.id and doi.fq_name = 'test/def/t1' order by fragment_id, replica_node_id; |
| 207 |
fragment_id replica_node_id |
| 208 |
0 1 |
| 209 |
0 2 |
| 210 |
1 1 |
| 211 |
1 2 |
| 212 |
2 1 |
| 213 |
2 2 |
| 214 |
3 1 |
| 215 |
3 2 |
| 216 |
4 1 |
| 217 |
4 2 |
| 218 |
5 1 |
| 219 |
5 2 |
| 220 |
6 1 |
| 221 |
6 2 |
| 222 |
7 1 |
| 223 |
7 2 |
| 224 |
8 3 |
| 225 |
8 4 |
| 226 |
9 3 |
| 227 |
9 4 |
| 228 |
10 3 |
| 229 |
10 4 |
| 230 |
11 3 |
| 231 |
11 4 |
| 232 |
12 3 |
| 233 |
12 4 |
| 234 |
13 3 |
| 235 |
13 4 |
| 236 |
14 3 |
| 237 |
14 4 |
| 238 |
15 3 |
| 239 |
15 4 |
| 240 |
use test; |
| 241 |
set global ndb_data_node_neighbour = 1; |
| 242 |
create table c as select node_id, fragment_num, tot_frag_scans |
| 243 |
from `ndbinfo`.`operations_per_fragment` |
| 244 |
where fq_name = 'test/def/t1'; |
| 245 |
select count(*) from t1; |
| 246 |
count(*) |
| 247 |
24 |
| 248 |
select distinct o.node_id |
| 249 |
from `ndbinfo`.`operations_per_fragment` o join c |
| 250 |
on o.node_id = c.node_id and o.fragment_num = c.fragment_num |
| 251 |
where fq_name = 'test/def/t1' and o.tot_frag_scans > c.tot_frag_scans; |
| 252 |
node_id |
| 253 |
1 |
| 254 |
drop table c; |
| 255 |
set global ndb_data_node_neighbour = 2; |
| 256 |
create table c as select node_id, fragment_num, tot_frag_scans |
| 257 |
from `ndbinfo`.`operations_per_fragment` |
| 258 |
where fq_name = 'test/def/t1'; |
| 259 |
select count(*) from t1; |
| 260 |
count(*) |
| 261 |
24 |
| 262 |
select distinct o.node_id |
| 263 |
from `ndbinfo`.`operations_per_fragment` o join c |
| 264 |
on o.node_id = c.node_id and o.fragment_num = c.fragment_num |
| 265 |
where fq_name = 'test/def/t1' and o.tot_frag_scans > c.tot_frag_scans; |
| 266 |
node_id |
| 267 |
2 |
| 268 |
drop table c; |
| 269 |
set global ndb_data_node_neighbour = 3; |
| 270 |
create table c as select node_id, fragment_num, tot_frag_scans |
| 271 |
from `ndbinfo`.`operations_per_fragment` |
| 272 |
where fq_name = 'test/def/t1'; |
| 273 |
select a,b,LENGTH(c) from t1 where a = 1; |
| 274 |
a b LENGTH(c) |
| 275 |
1 1 3000 |
| 276 |
select distinct o.node_id |
| 277 |
from `ndbinfo`.`operations_per_fragment` o join c |
| 278 |
on o.node_id = c.node_id and o.fragment_num = c.fragment_num |
| 279 |
where fq_name = 'test/def/t1' and o.tot_frag_scans > c.tot_frag_scans; |
| 280 |
node_id |
| 281 |
3 |
| 282 |
drop table c; |
| 283 |
set global ndb_data_node_neighbour = 4; |
| 284 |
create table c as select node_id, fragment_num, tot_frag_scans |
| 285 |
from `ndbinfo`.`operations_per_fragment` |
| 286 |
where fq_name = 'test/def/t1'; |
| 287 |
select a,b,LENGTH(c) from t1; |
| 288 |
a b LENGTH(c) |
| 289 |
1 1 3000 |
| 290 |
10 10 6000 |
| 291 |
11 11 6000 |
| 292 |
12 12 6000 |
| 293 |
13 13 6000 |
| 294 |
14 14 6000 |
| 295 |
15 15 6000 |
| 296 |
16 16 6000 |
| 297 |
17 17 6000 |
| 298 |
18 18 6000 |
| 299 |
19 19 6000 |
| 300 |
2 2 3000 |
| 301 |
20 20 6000 |
| 302 |
21 21 6000 |
| 303 |
22 22 6000 |
| 304 |
23 23 6000 |
| 305 |
24 24 6000 |
| 306 |
3 3 3000 |
| 307 |
4 4 3000 |
| 308 |
5 5 3000 |
| 309 |
6 6 3000 |
| 310 |
7 7 3000 |
| 311 |
8 8 3000 |
| 312 |
9 9 3000 |
| 313 |
select distinct o.node_id |
| 314 |
from `ndbinfo`.`operations_per_fragment` o join c |
| 315 |
on o.node_id = c.node_id and o.fragment_num = c.fragment_num |
| 316 |
where fq_name = 'test/def/t1' and o.tot_frag_scans > c.tot_frag_scans; |
| 317 |
node_id |
| 318 |
4 |
| 319 |
drop table c; |
| 320 |
set global ndb_data_node_neighbour = 0; |
| 321 |
select mpf.node_id, mpf.fragment_num, mpf.fixed_elem_count, tfs.fragment_num, tfs.fixed_elem_count |
| 322 |
from `ndbinfo`.`memory_per_fragment` mpf |
| 323 |
join t1_frag_size tfs |
| 324 |
on tfs.fragment_num = mpf.fragment_num mod @numpart |
| 325 |
where mpf.fq_name = 'test/def/t1' |
| 326 |
and mpf.fixed_elem_count <> tfs.fixed_elem_count |
| 327 |
order by tfs.fragment_num, mpf.node_id, mpf.fragment_num; |
| 328 |
node_id fragment_num fixed_elem_count fragment_num fixed_elem_count |
| 329 |
create temporary table counters_at_startup |
| 330 |
select counter_name, sum(val) as val |
| 331 |
from ndbinfo.counters |
| 332 |
group by counter_name; |
| 333 |
select a,b,LENGTH(c) from t1 where a = '1' and e = REPEAT('1', 3000); |
| 334 |
a b LENGTH(c) |
| 335 |
1 1 3000 |
| 336 |
select a,b,LENGTH(c) from t1 where a = '2' and e = REPEAT('1', 3000); |
| 337 |
a b LENGTH(c) |
| 338 |
2 2 3000 |
| 339 |
select a,b,LENGTH(c) from t1 where a = '3' and e = REPEAT('1', 3000); |
| 340 |
a b LENGTH(c) |
| 341 |
3 3 3000 |
| 342 |
select a,b,LENGTH(c) from t1 where a = '4' and e = REPEAT('1', 3000); |
| 343 |
a b LENGTH(c) |
| 344 |
4 4 3000 |
| 345 |
select a,b,LENGTH(c) from t1 where a = '5' and e = REPEAT('1', 3000); |
| 346 |
a b LENGTH(c) |
| 347 |
5 5 3000 |
| 348 |
select a,b,LENGTH(c) from t1 where a = '6' and e = REPEAT('1', 3000); |
| 349 |
a b LENGTH(c) |
| 350 |
6 6 3000 |
| 351 |
select a,b,LENGTH(c) from t1 where a = '7' and e = REPEAT('1', 3000); |
| 352 |
a b LENGTH(c) |
| 353 |
7 7 3000 |
| 354 |
select a,b,LENGTH(c) from t1 where a = '8' and e = REPEAT('1', 3000); |
| 355 |
a b LENGTH(c) |
| 356 |
8 8 3000 |
| 357 |
select a,b,LENGTH(c) from t1 where a in ('1', '2', '3', '4', '5', '6', '7', '8') and e = REPEAT('1', 3000); |
| 358 |
a b LENGTH(c) |
| 359 |
1 1 3000 |
| 360 |
2 2 3000 |
| 361 |
3 3 3000 |
| 362 |
4 4 3000 |
| 363 |
5 5 3000 |
| 364 |
6 6 3000 |
| 365 |
7 7 3000 |
| 366 |
8 8 3000 |
| 367 |
select a,b,LENGTH(c) from t1 where a in ('2', '3', '4', '5', '6', '7', '8') and e = REPEAT('1', 3000); |
| 368 |
a b LENGTH(c) |
| 369 |
2 2 3000 |
| 370 |
3 3 3000 |
| 371 |
4 4 3000 |
| 372 |
5 5 3000 |
| 373 |
6 6 3000 |
| 374 |
7 7 3000 |
| 375 |
8 8 3000 |
| 376 |
select a,b,LENGTH(c) from t1 where a in ('3', '4', '5', '6', '7', '8') and e = REPEAT('1', 3000); |
| 377 |
a b LENGTH(c) |
| 378 |
3 3 3000 |
| 379 |
4 4 3000 |
| 380 |
5 5 3000 |
| 381 |
6 6 3000 |
| 382 |
7 7 3000 |
| 383 |
8 8 3000 |
| 384 |
select a,b,LENGTH(c) from t1 where a in ('4', '5', '6', '7', '8') and e = REPEAT('1', 3000); |
| 385 |
a b LENGTH(c) |
| 386 |
4 4 3000 |
| 387 |
5 5 3000 |
| 388 |
6 6 3000 |
| 389 |
7 7 3000 |
| 390 |
8 8 3000 |
| 391 |
select a,b,LENGTH(c) from t1 where a in ('5', '6', '7', '8') and e = REPEAT('1', 3000); |
| 392 |
a b LENGTH(c) |
| 393 |
5 5 3000 |
| 394 |
6 6 3000 |
| 395 |
7 7 3000 |
| 396 |
8 8 3000 |
| 397 |
select a,b,LENGTH(c) from t1 where a in ('6', '7', '8') and e = REPEAT('1', 3000); |
| 398 |
a b LENGTH(c) |
| 399 |
6 6 3000 |
| 400 |
7 7 3000 |
| 401 |
8 8 3000 |
| 402 |
select a,b,LENGTH(c) from t1 where a in ('7', '8') and e = REPEAT('1', 3000); |
| 403 |
a b LENGTH(c) |
| 404 |
7 7 3000 |
| 405 |
8 8 3000 |
| 406 |
select s1.counter_name, s2.val - s1.val as diff |
| 407 |
from counters_at_startup s1, |
| 408 |
(select counter_name, sum(val) as val |
| 409 |
from ndbinfo.counters |
| 410 |
group by counter_name) s2 |
| 411 |
where s1.counter_name = s2.counter_name |
| 412 |
and ( s1.counter_name = 'LOCAL_READS' or s1.counter_name = 'READS' ) |
| 413 |
order by 1; |
| 414 |
counter_name diff |
| 415 |
LOCAL_READS 129 |
| 416 |
READS 129 |
| 417 |
drop table counters_at_startup; |
| 418 |
select mpf.node_id, mpf.fragment_num, mpf.fixed_elem_count, tfs.fragment_num, tfs.fixed_elem_count |
| 419 |
from `ndbinfo`.`memory_per_fragment` mpf |
| 420 |
join t1_frag_size tfs |
| 421 |
on tfs.fragment_num = mpf.fragment_num mod @numpart |
| 422 |
where mpf.fq_name = 'test/def/t1' |
| 423 |
and mpf.fixed_elem_count <> tfs.fixed_elem_count |
| 424 |
order by tfs.fragment_num, mpf.node_id, mpf.fragment_num; |
| 425 |
node_id fragment_num fixed_elem_count fragment_num fixed_elem_count |
| 426 |
output_line |
| 427 |
-- t1 -- |
| 428 |
Table options: readbackup, fullyreplicated |
| 429 |
-- Attributes -- |
| 430 |
-- NDB$BLOB_#_# -- |
| 431 |
Table options: readbackup, fullyreplicated |
| 432 |
-- Attributes -- |
| 433 |
Creating nodegroup |
| 434 |
Nodegroup 2 created |
| 435 |
Creating nodegroup |
| 436 |
Nodegroup 3 created |
| 437 |
alter table t1 algorithm=inplace, reorganize partition; |
| 438 |
use ndbinfo; |
| 439 |
select tab_partitions, tab_fragments from table_distribution_status as tds join dict_obj_info as doi where tds.table_id = doi.id and doi.fq_name = 'test/def/t1'; |
| 440 |
tab_partitions tab_fragments |
| 441 |
8 32 |
| 442 |
select partition_id, fragment_id, partition_order, log_part_id, preferred_primary from table_fragments as tf join dict_obj_info as doi where tf.table_id = doi.id and doi.fq_name = 'test/def/t1' order by fragment_id; |
| 443 |
partition_id fragment_id partition_order log_part_id preferred_primary |
| 444 |
0 0 0 0 1 |
| 445 |
1 1 0 1 2 |
| 446 |
2 2 0 2 1 |
| 447 |
3 3 0 3 2 |
| 448 |
4 4 0 0 2 |
| 449 |
5 5 0 1 1 |
| 450 |
6 6 0 2 2 |
| 451 |
7 7 0 3 1 |
| 452 |
0 8 1 0 3 |
| 453 |
1 9 1 1 4 |
| 454 |
2 10 1 2 3 |
| 455 |
3 11 1 3 4 |
| 456 |
4 12 1 0 4 |
| 457 |
5 13 1 1 3 |
| 458 |
6 14 1 2 4 |
| 459 |
7 15 1 3 3 |
| 460 |
0 16 2 0 5 |
| 461 |
1 17 2 1 6 |
| 462 |
2 18 2 2 5 |
| 463 |
3 19 2 3 6 |
| 464 |
4 20 2 0 6 |
| 465 |
5 21 2 1 5 |
| 466 |
6 22 2 2 6 |
| 467 |
7 23 2 3 5 |
| 468 |
0 24 3 3 8 |
| 469 |
1 25 3 0 7 |
| 470 |
2 26 3 1 8 |
| 471 |
3 27 3 2 7 |
| 472 |
4 28 3 3 7 |
| 473 |
5 29 3 0 8 |
| 474 |
6 30 3 1 7 |
| 475 |
7 31 3 2 8 |
| 476 |
select fragment_id, replica_node_id from table_replicas as tr join dict_obj_info as doi where tr.table_id = doi.id and doi.fq_name = 'test/def/t1' order by fragment_id, replica_node_id; |
| 477 |
fragment_id replica_node_id |
| 478 |
0 1 |
| 479 |
0 2 |
| 480 |
1 1 |
| 481 |
1 2 |
| 482 |
2 1 |
| 483 |
2 2 |
| 484 |
3 1 |
| 485 |
3 2 |
| 486 |
4 1 |
| 487 |
4 2 |
| 488 |
5 1 |
| 489 |
5 2 |
| 490 |
6 1 |
| 491 |
6 2 |
| 492 |
7 1 |
| 493 |
7 2 |
| 494 |
8 3 |
| 495 |
8 4 |
| 496 |
9 3 |
| 497 |
9 4 |
| 498 |
10 3 |
| 499 |
10 4 |
| 500 |
11 3 |
| 501 |
11 4 |
| 502 |
12 3 |
| 503 |
12 4 |
| 504 |
13 3 |
| 505 |
13 4 |
| 506 |
14 3 |
| 507 |
14 4 |
| 508 |
15 3 |
| 509 |
15 4 |
| 510 |
16 5 |
| 511 |
16 6 |
| 512 |
17 5 |
| 513 |
17 6 |
| 514 |
18 5 |
| 515 |
18 6 |
| 516 |
19 5 |
| 517 |
19 6 |
| 518 |
20 5 |
| 519 |
20 6 |
| 520 |
21 5 |
| 521 |
21 6 |
| 522 |
22 5 |
| 523 |
22 6 |
| 524 |
23 5 |
| 525 |
23 6 |
| 526 |
24 7 |
| 527 |
24 8 |
| 528 |
25 7 |
| 529 |
25 8 |
| 530 |
26 7 |
| 531 |
26 8 |
| 532 |
27 7 |
| 533 |
27 8 |
| 534 |
28 7 |
| 535 |
28 8 |
| 536 |
29 7 |
| 537 |
29 8 |
| 538 |
30 7 |
| 539 |
30 8 |
| 540 |
31 7 |
| 541 |
31 8 |
| 542 |
use test; |
| 543 |
select mpf.node_id, mpf.fragment_num, mpf.fixed_elem_count, tfs.fragment_num, tfs.fixed_elem_count |
| 544 |
from `ndbinfo`.`memory_per_fragment` mpf |
| 545 |
join t1_frag_size tfs |
| 546 |
on tfs.fragment_num = mpf.fragment_num mod @numpart |
| 547 |
where mpf.fq_name = 'test/def/t1' |
| 548 |
and mpf.fixed_elem_count <> tfs.fixed_elem_count |
| 549 |
order by tfs.fragment_num, mpf.node_id, mpf.fragment_num; |
| 550 |
node_id fragment_num fixed_elem_count fragment_num fixed_elem_count |
| 551 |
drop table t1; |
| 552 |
Dropping nodegroups |
| 553 |
Drop Node Group 3 done |
| 554 |
Drop Node Group 2 done |
| 555 |
Drop Node Group 1 done |