create table f (fact_id int, fact_val1 text, fact_val2 numeric);
create table d (dim_id int primary key, dim_value1 text, dim_value2 numeric);

-- d=100000 f=1000000

insert into d select i, md5(random()::text), random() from generate_series(0,99999) s(i);
insert into f select mod(i,100000), md5(random()::text), random() from generate_series(0,999999) s(i);

vacuum analyze d;
vacuum analyze f;

\i unijoins-queries.sql

-- d=1000000 f=10000000

truncate d;
truncate f;

insert into d select i, md5(random()::text), random() from generate_series(0,999999) s(i);
insert into f select mod(i,1000000), md5(random()::text), random() from generate_series(0,9999999) s(i);

vacuum analyze d;
vacuum analyze f;

\i unijoins-queries.sql

-- d=10000000 f=100000000

truncate d;
truncate f;

insert into d select i, md5(random()::text), random() from generate_series(0,9999999) s(i);
insert into f select mod(i,10000000), md5(random()::text), random() from generate_series(0,99999999) s(i);

vacuum analyze d;
vacuum analyze f;

\i unijoins-queries.sql
