----- Original Message -----
From: "Hannu Krosing" <hannu@tm.ee>
> If you are inserting into an empty table with primary key (or other
> constraints), you can run ANALYZE on that table in 1-2 minutes after you
> have started the INSERTs, so that constraint-checking logic will do the
> right thing (use inedex for pk).
This is one of the things that pg_autovaccum attempts to do. If you are
doing a lot of inserts into a table, it will perform periodic analyze
commands. The threshold for performing analyze is much lower than the
threshold for vacuum. Also, inserts don't effect the count towards the
vacuum threshold, only the analyze threshold.