Re: pg_upgrade and statistics

Kevin Grittner <kevin.grittner@wicourts.gov>

From: "Kevin Grittner" <Kevin.Grittner@wicourts.gov>
To: "Peter Eisentraut" <peter_e@gmx.net>, "Bruce Momjian" <bruce@momjian.us>
Cc: "Daniel Farina" <daniel@heroku.com>,"Greg Stark" <stark@mit.edu>, "pgsql-hackers" <pgsql-hackers@postgresql.org>, "Tom Lane" <tgl@sss.pgh.pa.us>
Date: 2012-03-13T20:29:22Z
Lists: pgsql-hackers
Bruce Momjian <bruce@momjian.us> wrote:
 
> OK, good idea.  Kevin, can you test this:
> 
>   PGOPTIONS='-c default_statistics_target=10' vacuumdb --all
>     --analyze-only
> 
> Is it faster?  Thanks.
 
Well, I just did something similar in psql -- I disabled the delays
by:
 
set vacuum_cost_delay = 0;
 
I checked for any statistics overrides, and found none (if I did
this right):
 
cir=# select attrelid::regclass, attname, attstattarget from
pg_attribute where attstattarget > 0;
 attrelid | attname | attstattarget 
----------+---------+---------------
(0 rows)
 
I went even lower than you suggested:
 
set default_statistics_target = 4;
 
And it was much faster, but still more time than the pg_upgrade run
itself:
 
cir=# analyze;
ANALYZE
Time: 474319.826 ms
 
A little under 8 minutes.
 
-Kevin