psql test -c 'drop table if exists hashp' > /dev/null
psql test -c 'create table hashp (a int)' > /dev/null
psql test -c 'insert into hashp select i from generate_series(1,1000000) s(i)' > /dev/null
psql test -c 'vacuum analyze hashp' > /dev/null
psql test -c 'checkpoint' > /dev/null

for r in `seq 1 5`; do

    t=`pgbench -n -c 1 -f select.sql -T 10 test | grep excluding | awk '{print $3}'`
    echo 0 $t

done

for np in 100 1000 10000; do

    psql test -c 'drop table if exists hashp' > /dev/null

    psql test > /dev/null <<EOF
create table hashp (a int) partition by hash(a);
select 'create table hashp'||x::Text || ' partition of hashp for
values with (modulus $np, remainder '||x::text||');' from
generate_Series(0,$np-1) x;
\gexec
insert into hashp select i from generate_series(1,1000000) s(i);
vacuum analyze hashp;
checkpoint;
EOF

    for r in `seq 1 5`; do

        t=`pgbench -n -c 1 -f select.sql -T 10 test | grep excluding | awk '{print $3}'`

        echo $np $t

    done

done
