| 1 |
# |
| 2 |
# Test of heap table memory usage |
| 3 |
# |
| 4 |
CREATE TABLE t1 (a int, index(a)) engine=heap min_rows=10 max_rows=100; |
| 5 |
insert into t1 values(1); |
| 6 |
select data_length,index_length from information_schema.tables where table_schema="test" and table_name="t1"; |
| 7 |
data_length index_length |
| 8 |
16352 16352 |
| 9 |
drop table t1; |
| 10 |
CREATE TABLE t1 (a int, index(a)) engine=heap min_rows=10 max_rows=10000; |
| 11 |
insert into t1 values(1); |
| 12 |
select data_length,index_length from information_schema.tables where table_schema="test" and table_name="t1"; |
| 13 |
data_length index_length |
| 14 |
16352 16352 |
| 15 |
drop table t1; |
| 16 |
CREATE TABLE t1 (a int, index(a)) engine=heap min_rows=3000 max_rows=3000; |
| 17 |
insert into t1 values(1); |
| 18 |
select data_length,index_length from information_schema.tables where table_schema="test" and table_name="t1"; |
| 19 |
data_length index_length |
| 20 |
65504 131040 |
| 21 |
drop table t1; |
| 22 |
CREATE TABLE t1 (a int, index(a)) engine=heap max_rows=15000; |
| 23 |
insert into t1 values(1); |
| 24 |
select data_length,index_length from information_schema.tables where table_schema="test" and table_name="t1"; |
| 25 |
data_length index_length |
| 26 |
16352 32736 |
| 27 |
drop table t1; |
| 28 |
create table t1 (c1 int, index(c1)) engine=heap max_rows=10000; |
| 29 |
insert into t1 select rand(100000000); |
| 30 |
insert into t1 select rand(100000000) from t1; |
| 31 |
insert into t1 select rand(100000000) from t1; |
| 32 |
insert into t1 select rand(100000000) from t1; |
| 33 |
insert into t1 select rand(100000000) from t1; |
| 34 |
insert into t1 select rand(100000000) from t1; |
| 35 |
insert into t1 select rand(100000000) from t1; |
| 36 |
insert into t1 select rand(100000000) from t1; |
| 37 |
insert into t1 select rand(100000000) from t1; |
| 38 |
insert into t1 select rand(100000000) from t1; |
| 39 |
insert into t1 select rand(100000000) from t1 limit 488; |
| 40 |
select data_length,index_length from information_schema.tables where table_schema="test" and table_name="t1"; |
| 41 |
data_length index_length |
| 42 |
32704 32704 |
| 43 |
insert into t1 select rand(100000000) from t1 limit 1; |
| 44 |
select data_length,index_length from information_schema.tables where table_schema="test" and table_name="t1"; |
| 45 |
data_length index_length |
| 46 |
32704 32704 |
| 47 |
insert into t1 select rand(100000000) from t1 limit 1000; |
| 48 |
select data_length,index_length from information_schema.tables where table_schema="test" and table_name="t1"; |
| 49 |
data_length index_length |
| 50 |
49056 65408 |
| 51 |
insert into t1 select rand(100000000) from t1; |
| 52 |
select data_length,index_length from information_schema.tables where table_schema="test" and table_name="t1"; |
| 53 |
data_length index_length |
| 54 |
81760 114464 |
| 55 |
drop table t1; |