1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
USE test;
# Standard HEAP table with 2 indexes
CREATE TABLE heap_standard ( f1 VARCHAR(32) NOT NULL, f2 VARCHAR(64) , f3 VARCHAR(1024), f4 VARCHAR(1024) NOT NULL, PRIMARY KEY (f1) , KEY (f2) ) ENGINE=HEAP ROW_FORMAT=DYNAMIC KEY_BLOCK_SIZE=99;
# Oversize primary key
CREATE TABLE heap_oversize_pk ( f1 VARCHAR(1024) NOT NULL, f2 VARCHAR(64), f3 VARCHAR(1024), f4 VARCHAR(1024) NOT NULL, PRIMARY KEY (f1) ) ENGINE=HEAP ROW_FORMAT=DYNAMIC KEY_BLOCK_SIZE=1027;
# Very small KEY_BLOCK_SIZE
CREATE TABLE heap_small_block ( f1 VARCHAR(1) NOT NULL, f2 VARCHAR(1024), f3 VARCHAR(1024), f4 VARCHAR(1024) NOT NULL, PRIMARY KEY (f1) ) ENGINE=HEAP ROW_FORMAT=DYNAMIC KEY_BLOCK_SIZE=5;
# Very large KEY_BLOCK_SIZE
CREATE TABLE heap_large_block ( f1 VARCHAR(1024) NOT NULL, f2 VARCHAR(1024), f3 VARCHAR(1024), f4 VARCHAR(1024) NOT NULL, PRIMARY KEY (f1) ) ENGINE=HEAP ROW_FORMAT=DYNAMIC KEY_BLOCK_SIZE=65535;
# Complex indexes
CREATE TABLE heap_complex_indexes ( f1 VARCHAR(32) NOT NULL, f2 VARCHAR(32) NOT NULL, f3 VARCHAR(32), f4 VARCHAR(32), PRIMARY KEY (f1, f2), KEY (f2, f3) , UNIQUE (f3, f4)) ENGINE=HEAP ROW_FORMAT=DYNAMIC KEY_BLOCK_SIZE=134;
# No indexes at all, small records # Due to bug 784468 , we can not use VARCHAR(2) or similar
CREATE TABLE heap_noindexes_small ( f1 VARCHAR(31), f2 VARCHAR(31), f3 VARCHAR(31), f4 VARCHAR(31) NOT NULL) ENGINE=HEAP ROW_FORMAT=DYNAMIC KEY_BLOCK_SIZE=1024;
# No indexes at all, large records
CREATE TABLE heap_noindexes_large ( f1 VARCHAR(1024), f2 VARCHAR(1024), f3 VARCHAR(1024), f4 VARCHAR(1024) NOT NULL) ENGINE=HEAP ROW_FORMAT=DYNAMIC KEY_BLOCK_SIZE=128;
|