| 1 |
DROP TABLE IF EXISTS t1; |
| 2 |
create table t1 (a int key, b int) engine ndb; |
| 3 |
create table t2 (a int key, b int) engine ndb; |
| 4 |
insert into t1 values (0,0),(1,1),(2,2); |
| 5 |
insert into t2 select * from t1; |
| 6 |
begin; |
| 7 |
set transaction_allow_batching=1; |
| 8 |
update t1 set b=0 where a=2; |
| 9 |
commit; |
| 10 |
ndb_execute_count |
| 11 |
1 |
| 12 |
select * from t1 order by a; |
| 13 |
a b |
| 14 |
0 0 |
| 15 |
1 1 |
| 16 |
2 0 |
| 17 |
|
| 18 |
With batching only 1 roundtrip |
| 19 |
|
| 20 |
begin; |
| 21 |
set transaction_allow_batching=1; |
| 22 |
insert into t1 values (10,10); |
| 23 |
insert into t2 values (10,10); |
| 24 |
commit; |
| 25 |
ndb_execute_count |
| 26 |
1 |
| 27 |
select * from t1 order by a; |
| 28 |
a b |
| 29 |
0 0 |
| 30 |
1 1 |
| 31 |
2 0 |
| 32 |
10 10 |
| 33 |
|
| 34 |
Without batching only 3 roundtrips |
| 35 |
|
| 36 |
begin; |
| 37 |
set transaction_allow_batching=0; |
| 38 |
insert into t1 values (11,11); |
| 39 |
insert into t2 values (11,11); |
| 40 |
commit; |
| 41 |
ndb_execute_count |
| 42 |
3 |
| 43 |
select * from t1 order by a; |
| 44 |
a b |
| 45 |
0 0 |
| 46 |
1 1 |
| 47 |
2 0 |
| 48 |
10 10 |
| 49 |
11 11 |
| 50 |
drop table t1, t2; |