| 1 |
Testing the behaviour of ANALYZE TABLE before and |
| 2 |
after table reorganisation, and then during subsequent |
| 3 |
node restarts |
| 4 |
|
| 5 |
Create initial table |
| 6 |
create table t_offset(a int primary key) engine=ndb; |
| 7 |
create table t_orig(id int PRIMARY KEY, d1 bigint, d2 int, key(d1), key(d2)) engine=ndb; |
| 8 |
Put some data in with different key distributions |
| 9 |
Analyze the indices on the table |
| 10 |
analyze table test.t_orig; |
| 11 |
Table Op Msg_type Msg_text |
| 12 |
test.t_orig analyze status OK |
| 13 |
Add the nodes |
| 14 |
Create a table with the new topology |
| 15 |
create table t_new(id int PRIMARY KEY, d1 bigint, d2 int, key(d1), key(d2)) engine=ndb; |
| 16 |
Insert data into it |
| 17 |
insert into t_new select * from t_orig; |
| 18 |
Analyze the new table |
| 19 |
analyze table test.t_new; |
| 20 |
Table Op Msg_type Msg_text |
| 21 |
test.t_new analyze status OK |
| 22 |
Reorganize the original table across the new set of nodes |
| 23 |
alter table t_orig reorganize partition; |
| 24 |
Check ANALYZE succeeds after table reorganization |
| 25 |
analyze table t_orig; |
| 26 |
Table Op Msg_type Msg_text |
| 27 |
test.t_orig analyze status OK |
| 28 |
analyze table t_new; |
| 29 |
Table Op Msg_type Msg_text |
| 30 |
test.t_new analyze status OK |
| 31 |
Restart data nodes, checking that ANALYZE TABLE |
| 32 |
succeeds in all intermediate states |
| 33 |
Restart node 1 |
| 34 |
Node 1: NOT_STARTED |
| 35 |
Node 1: STARTED |
| 36 |
Restart finished |
| 37 |
Analyze the tables |
| 38 |
analyze table test.t_orig; |
| 39 |
Table Op Msg_type Msg_text |
| 40 |
test.t_orig analyze status OK |
| 41 |
analyze table test.t_new; |
| 42 |
Table Op Msg_type Msg_text |
| 43 |
test.t_new analyze status OK |
| 44 |
Restart node 2 |
| 45 |
Node 2: NOT_STARTED |
| 46 |
Node 2: STARTED |
| 47 |
Restart finished |
| 48 |
Analyze the tables |
| 49 |
analyze table test.t_orig; |
| 50 |
Table Op Msg_type Msg_text |
| 51 |
test.t_orig analyze status OK |
| 52 |
analyze table test.t_new; |
| 53 |
Table Op Msg_type Msg_text |
| 54 |
test.t_new analyze status OK |
| 55 |
Restart node 3 |
| 56 |
Node 3: NOT_STARTED |
| 57 |
Node 3: STARTED |
| 58 |
Restart finished |
| 59 |
Analyze the tables |
| 60 |
analyze table test.t_orig; |
| 61 |
Table Op Msg_type Msg_text |
| 62 |
test.t_orig analyze status OK |
| 63 |
analyze table test.t_new; |
| 64 |
Table Op Msg_type Msg_text |
| 65 |
test.t_new analyze status OK |
| 66 |
Restart node 4 |
| 67 |
Node 4: NOT_STARTED |
| 68 |
Node 4: STARTED |
| 69 |
Restart finished |
| 70 |
Analyze the tables |
| 71 |
analyze table test.t_orig; |
| 72 |
Table Op Msg_type Msg_text |
| 73 |
test.t_orig analyze status OK |
| 74 |
analyze table test.t_new; |
| 75 |
Table Op Msg_type Msg_text |
| 76 |
test.t_new analyze status OK |
| 77 |
Cleanup |
| 78 |
drop table t_offset,t_orig,t_new; |