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';

create temporary table randomhex (t text);
copy randomhex from program 'cat /dev/urandom | hexdump -e ''/1 "%02x"'' -n 102400 -v';
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 '512b random', substr(b, 0, 512), 75000, true from randombytes;

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