drop table if exists t1;
CREATE TABLE t1 (a int not null primary key) engine=InnoDB;
set global innodb_limit_optimistic_insert_debug = 2;
insert into t1 values (1);
insert into t1 values (5);
insert into t1 values (4);
insert into t1 values (3);
insert into t1 values (2);
analyze table t1;
Table	Op	Msg_type	Msg_text
test.t1	analyze	status	OK
select DATA_LENGTH / 16384 from information_schema.TABLES where TABLE_SCHEMA = 'test' and TABLE_NAME = 't1';
DATA_LENGTH / 16384
10.0000
delete from t1 where a=4;
analyze table t1;
Table	Op	Msg_type	Msg_text
test.t1	analyze	status	OK
select DATA_LENGTH / 16384 from information_schema.TABLES where TABLE_SCHEMA = 'test' and TABLE_NAME = 't1';
DATA_LENGTH / 16384
8.0000
delete from t1 where a=5;
analyze table t1;
Table	Op	Msg_type	Msg_text
test.t1	analyze	status	OK
select DATA_LENGTH / 16384 from information_schema.TABLES where TABLE_SCHEMA = 'test' and TABLE_NAME = 't1';
DATA_LENGTH / 16384
5.0000
set global innodb_limit_optimistic_insert_debug = 10000;
delete from t1 where a=2;
analyze table t1;
Table	Op	Msg_type	Msg_text
test.t1	analyze	status	OK
select DATA_LENGTH / 16384 from information_schema.TABLES where TABLE_SCHEMA = 'test' and TABLE_NAME = 't1';
DATA_LENGTH / 16384
3.0000
insert into t1 values (2);
delete from t1 where a=2;
analyze table t1;
Table	Op	Msg_type	Msg_text
test.t1	analyze	status	OK
select DATA_LENGTH / 16384 from information_schema.TABLES where TABLE_SCHEMA = 'test' and TABLE_NAME = 't1';
DATA_LENGTH / 16384
2.0000
insert into t1 values (2);
delete from t1 where a=2;
analyze table t1;
Table	Op	Msg_type	Msg_text
test.t1	analyze	status	OK
select DATA_LENGTH / 16384 from information_schema.TABLES where TABLE_SCHEMA = 'test' and TABLE_NAME = 't1';
DATA_LENGTH / 16384
1.0000
drop table t1;
