create table base (k integer primary key, v integer);
create table part1 (check (k between 1 and 10000)) inherits (base);
create table part2 (check (k between 10001 and 20000)) inherits (base);
create index pi1 on part1(v);
create index pi2 on part2(v);
insert into part1 values (generate_series(1,10000), random()*10000);
insert into part2 values (generate_series(10001,20000), random()*10000);
vacuum analyze part1;
vacuum analyze part2;
