To rule out the effect of MDEV-12288, I rewrote the test to use a slow shutdown, so that it is an apples-to-apples comparison. In 10.3, the purge (resetting DB_TRX_ID) after the INSERT could run concurrently with the UPDATE.
--source include/have_innodb.inc
|
--source include/have_sequence.inc
|
create table t1 (id serial, c2 char(10) default 'foobar') engine=innodb;
|
select now();
|
insert into t1(id) select * from seq_1_to_1000000;
|
set global innodb_fast_shutdown=0;
|
select now();
|
--source include/restart_mysqld.inc
|
select now();
|
update t1 set c2='x';
|
select now();
|
drop table t1;
|
With this, a non-debug build of 10.2 shows me the following when running
./mtr --mem innodb.huge_update
|
10.2 8346acaf807587da751fdded5eb87fd72f5268a5
|
create table t1 (id serial, c2 char(10) default 'foobar') engine=innodb;
|
select now();
|
now()
|
2018-04-24 13:50:48
|
insert into t1(id) select * from seq_1_to_1000000;
|
set global innodb_fast_shutdown=0;
|
select now();
|
now()
|
2018-04-24 13:50:59
|
select now();
|
now()
|
2018-04-24 13:51:02
|
update t1 set c2='x';
|
select now();
|
now()
|
2018-04-24 13:51:06
|
drop table t1;
|
innodb.huge_update 'innodb' [ pass ] 17726
|
For 10.3 with the above revision merged, I get the following:
bb-10.3-marko fc106dadb27d9de19c6d17ff328bba2f37e5072d (based on 10.3 f79c5a658cc33a10d7744a748a4328254e2cbaf7)
|
create table t1 (id serial, c2 char(10) default 'foobar') engine=innodb;
|
select now();
|
now()
|
2018-04-24 13:49:18
|
insert into t1(id) select * from seq_1_to_1000000;
|
set global innodb_fast_shutdown=0;
|
select now();
|
now()
|
2018-04-24 13:49:40
|
select now();
|
now()
|
2018-04-24 13:49:53
|
update t1 set c2='x';
|
select now();
|
now()
|
2018-04-24 13:50:09
|
drop table t1;
|
innodb.huge_update 'innodb' [ pass ] 50824
|
The total test time is much longer (50.8 instead of 17.7 seconds; 33.1 seconds increase), divided as follows:
Stage |
10.2 Time |
10.3 Time |
INSERT |
11s |
22s |
Restart |
3s |
13s |
UPDATE |
5s |
16s |
Total |
17.7s |
50.8s |
The increased restart time is expected due to the purge (MDEV-12288 is resetting the DB_TRX_ID of all inserted records), but the performance regressions for INSERT (2Ă—) and UPDATE (3Ă—) are not.
To rule out the effect of
MDEV-12288, I rewrote the test to use a slow shutdown, so that it is an apples-to-apples comparison. In 10.3, the purge (resetting DB_TRX_ID) after the INSERT could run concurrently with the UPDATE.--source include/have_innodb.inc
--source include/have_sequence.inc
--source include/restart_mysqld.inc
With this, a non-debug build of 10.2 shows me the following when running
./mtr --mem innodb.huge_update
10.2 8346acaf807587da751fdded5eb87fd72f5268a5
create table t1 (id serial, c2 char(10) default 'foobar') engine=innodb;
select now();
now()
2018-04-24 13:50:48
insert into t1(id) select * from seq_1_to_1000000;
set global innodb_fast_shutdown=0;
select now();
now()
2018-04-24 13:50:59
select now();
now()
2018-04-24 13:51:02
update t1 set c2='x';
select now();
now()
2018-04-24 13:51:06
drop table t1;
innodb.huge_update 'innodb' [ pass ] 17726
For 10.3 with the above revision merged, I get the following:
bb-10.3-marko fc106dadb27d9de19c6d17ff328bba2f37e5072d (based on 10.3 f79c5a658cc33a10d7744a748a4328254e2cbaf7)
create table t1 (id serial, c2 char(10) default 'foobar') engine=innodb;
select now();
now()
2018-04-24 13:49:18
insert into t1(id) select * from seq_1_to_1000000;
set global innodb_fast_shutdown=0;
select now();
now()
2018-04-24 13:49:40
select now();
now()
2018-04-24 13:49:53
update t1 set c2='x';
select now();
now()
2018-04-24 13:50:09
drop table t1;
innodb.huge_update 'innodb' [ pass ] 50824
The total test time is much longer (50.8 instead of 17.7 seconds; 33.1 seconds increase), divided as follows:
The increased restart time is expected due to the purge (
MDEV-12288is resetting the DB_TRX_ID of all inserted records), but the performance regressions for INSERT (2Ă—) and UPDATE (3Ă—) are not.