echo > U.dat
for n in 0 1 2 3 4 5 6 7 8
do
	psql -c "drop table if exists x;"
	psql -c "select (random()*1e$n)::int as i into x from generate_series(1, '1e7'::float8::int);"
	psql -c "vacuum analyze x;"
	sleep 2
	psql -t -A -c 'explain (analyze on, FORMAT json)  select * from x order by i;' | perl p.pl 1e$n >> U.dat
done
gnuplot -p U.plt
