create table dim (id int, dval text);
insert into dim select i, md5(i::text) from generate_series(1,10000000) s(i);

create table fact (id int, fval text);
insert into fact select * from dim;
insert into fact select * from dim;
insert into fact select * from dim;
insert into fact select * from dim;
insert into fact select * from dim;
insert into fact select * from fact;

vacuum freeze;
analyze;
