| 1 |
drop table if exists t1; |
| 2 |
set global innodb_stats_persistent = false; |
| 3 |
CREATE TABLE t1 (a int not null primary key) engine=InnoDB; |
| 4 |
set global innodb_limit_optimistic_insert_debug = 2; |
| 5 |
insert into t1 values (1); |
| 6 |
insert into t1 values (5); |
| 7 |
insert into t1 values (4); |
| 8 |
insert into t1 values (3); |
| 9 |
insert into t1 values (2); |
| 10 |
analyze table t1; |
| 11 |
Table Op Msg_type Msg_text |
| 12 |
test.t1 analyze status OK |
| 13 |
select CLUST_INDEX_SIZE from information_schema.INNODB_TABLESTATS where NAME = 'test/t1'; |
| 14 |
CLUST_INDEX_SIZE |
| 15 |
10 |
| 16 |
delete from t1 where a=4; |
| 17 |
set global innodb_purge_stop_now=ON; |
| 18 |
set global innodb_purge_run_now=ON; |
| 19 |
analyze table t1; |
| 20 |
Table Op Msg_type Msg_text |
| 21 |
test.t1 analyze status OK |
| 22 |
select CLUST_INDEX_SIZE from information_schema.INNODB_TABLESTATS where NAME = 'test/t1'; |
| 23 |
CLUST_INDEX_SIZE |
| 24 |
8 |
| 25 |
delete from t1 where a=5; |
| 26 |
set global innodb_purge_stop_now=ON; |
| 27 |
set global innodb_purge_run_now=ON; |
| 28 |
analyze table t1; |
| 29 |
Table Op Msg_type Msg_text |
| 30 |
test.t1 analyze status OK |
| 31 |
select CLUST_INDEX_SIZE from information_schema.INNODB_TABLESTATS where NAME = 'test/t1'; |
| 32 |
CLUST_INDEX_SIZE |
| 33 |
5 |
| 34 |
set global innodb_limit_optimistic_insert_debug = 0; |
| 35 |
delete from t1 where a=2; |
| 36 |
set global innodb_purge_stop_now=ON; |
| 37 |
set global innodb_purge_run_now=ON; |
| 38 |
analyze table t1; |
| 39 |
Table Op Msg_type Msg_text |
| 40 |
test.t1 analyze status OK |
| 41 |
select CLUST_INDEX_SIZE from information_schema.INNODB_TABLESTATS where NAME = 'test/t1'; |
| 42 |
CLUST_INDEX_SIZE |
| 43 |
3 |
| 44 |
insert into t1 values (2); |
| 45 |
delete from t1 where a=2; |
| 46 |
set global innodb_purge_stop_now=ON; |
| 47 |
set global innodb_purge_run_now=ON; |
| 48 |
analyze table t1; |
| 49 |
Table Op Msg_type Msg_text |
| 50 |
test.t1 analyze status OK |
| 51 |
select CLUST_INDEX_SIZE from information_schema.INNODB_TABLESTATS where NAME = 'test/t1'; |
| 52 |
CLUST_INDEX_SIZE |
| 53 |
2 |
| 54 |
insert into t1 values (2); |
| 55 |
delete from t1 where a=2; |
| 56 |
set global innodb_purge_stop_now=ON; |
| 57 |
set global innodb_purge_run_now=ON; |
| 58 |
analyze table t1; |
| 59 |
Table Op Msg_type Msg_text |
| 60 |
test.t1 analyze status OK |
| 61 |
select CLUST_INDEX_SIZE from information_schema.INNODB_TABLESTATS where NAME = 'test/t1'; |
| 62 |
CLUST_INDEX_SIZE |
| 63 |
1 |
| 64 |
drop table t1; |