CREATE TABLE tests (
    testname text,
    data bytea,
    nrows integer,
    enabled boolean
);


COPY tests (testname, data, nrows, enabled) FROM stdin;
5k text	\\x[encoded data, 10240 characters]	25000	t
\.

insert into tests (testname, data, nrows, enabled)
select '512b text', substr(data, 0, 512), 100000, true from tests where testname = '5k text';

insert into tests (testname, data, nrows, enabled)
select '256b text', substr(data, 0, 256), 200000, true from tests where testname = '5k text';

insert into tests (testname, data, nrows, enabled)
select '1K text', substr(data, 0, 1024), 50000, true from tests where testname = '5k text';

insert into tests (testname, data, nrows, enabled)
select '3K text', substr(data, 0, 3072), 50000, true from tests where testname = '5k text';

create temporary table randomhex (t text);
--copy randomhex from program 'cat /dev/urandom | hexdump -e ''/1 "%02x"'' -n 102400 -v';
copy randomhex from '/home/amit/installation/bin/randomhex.txt';
create temporary table randombytes (b bytea);
insert into randombytes select ('\x' || t)::bytea from randomhex;

insert into tests (testname, data, nrows, enabled)
select '2k random', substr(b, 0, 2048), 20000, true from randombytes;

insert into tests (testname, data, nrows, enabled)
select '100k random', substr(b, 0, 102400), 500, true from randombytes;

insert into tests (testname, data, nrows, enabled)
select '500k random', substr(b, 0, 512000), 100, true from randombytes;

insert into tests (testname, data, nrows, enabled)
select '512b random', substr(b, 0, 512), 75000, true from randombytes;

insert into tests (testname, data, nrows, enabled)
select '256b random', substr(b, 0, 256), 150000, true from randombytes;

insert into tests (testname, data, nrows, enabled)
select '1K random', substr(b, 0, 1024), 35000, true from randombytes;

insert into tests (testname, data, nrows, enabled)
select '10k of same byte', ('\x' || repeat('aa', 10240))::bytea, 35000, true;

insert into tests (testname, data, nrows, enabled)
select '100k of same byte', ('\x' || repeat('aa', 102400))::bytea, 35000, true;


insert into tests (testname, data, nrows, enabled)
select '500k of same byte', ('\x' || repeat('aa', 512000))::bytea, 5000, true;
