| 1 |
--echo # |
| 2 |
--echo # Test of heap table memory usage |
| 3 |
--echo # |
| 4 |
|
| 5 |
--source include/word_size.inc |
| 6 |
|
| 7 |
# |
| 8 |
# Show that MIN_ROWS and MAX_ROWS have an effect on how data_length |
| 9 |
# and index_length are allocated. |
| 10 |
# Result is different for 32 / 64 bit machines as pointer lengths are different |
| 11 |
# |
| 12 |
|
| 13 |
CREATE TABLE t1 (a int, index(a)) engine=heap min_rows=10 max_rows=100; |
| 14 |
insert into t1 values(1); |
| 15 |
select data_length,index_length from information_schema.tables where table_schema="test" and table_name="t1"; |
| 16 |
drop table t1; |
| 17 |
|
| 18 |
CREATE TABLE t1 (a int, index(a)) engine=heap min_rows=10 max_rows=10000; |
| 19 |
insert into t1 values(1); |
| 20 |
select data_length,index_length from information_schema.tables where table_schema="test" and table_name="t1"; |
| 21 |
drop table t1; |
| 22 |
CREATE TABLE t1 (a int, index(a)) engine=heap min_rows=3000 max_rows=3000; |
| 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 |
drop table t1; |
| 26 |
CREATE TABLE t1 (a int, index(a)) engine=heap max_rows=15000; |
| 27 |
insert into t1 values(1); |
| 28 |
select data_length,index_length from information_schema.tables where table_schema="test" and table_name="t1"; |
| 29 |
drop table t1; |
| 30 |
|
| 31 |
create table t1 (c1 int, index(c1)) engine=heap max_rows=10000; |
| 32 |
insert into t1 select rand(100000000); |
| 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; |
| 40 |
insert into t1 select rand(100000000) from t1; |
| 41 |
insert into t1 select rand(100000000) from t1; |
| 42 |
insert into t1 select rand(100000000) from t1 limit 488; |
| 43 |
select data_length,index_length from information_schema.tables where table_schema="test" and table_name="t1"; |
| 44 |
insert into t1 select rand(100000000) from t1 limit 1; |
| 45 |
select data_length,index_length from information_schema.tables where table_schema="test" and table_name="t1"; |
| 46 |
insert into t1 select rand(100000000) from t1 limit 1000; |
| 47 |
select data_length,index_length from information_schema.tables where table_schema="test" and table_name="t1"; |
| 48 |
insert into t1 select rand(100000000) from t1; |
| 49 |
select data_length,index_length from information_schema.tables where table_schema="test" and table_name="t1"; |
| 50 |
drop table t1; |