On Tue, Mar 13, 2012 at 09:28:33PM +0000, Greg Stark wrote:
> hmph. One thing that could speed up analyze on raid arrays would be
> doing prefetching so more than one spindle can be busy. Sacrificing
> statistical accuracy by reading a less random sample on contiguous
> blocks of rows would also be faster but less accurate -- we've gone
> around on that topic at least once in the past.
>
> +1 to the idea that pg_upgrade could run analyze with a
> statistics_target of 10 and then let autovacuum analyze it again later
> with the normal targets at its leisure.
Well, that's going to take quite a bit of infrastructure. We can tell
users to use the PGOPTIONS setting when they run vacuumdb, but we are
going to need some way to cause autovacuum to run later with a higher
statistics target --- right now I don't think autovacuum cares how
large a statistics target the previous analyze run used. It might be a
simple case of causing autovacuum to analyze if it has statistics that
don't match the current statistics target, but I don't think autovacuum
has easy access to those values.
-- Bruce Momjian <bruce@momjian.us> http://momjian.us EnterpriseDB
http://enterprisedb.com
+ It's impossible for everything to be true. +