Re: Shouldn't we have a way to avoid "risky" plans? - Mailing list pgsql-performance

From Josh Berkus
Subject Re: Shouldn't we have a way to avoid "risky" plans?
Date
Msg-id 4DAE3BF0.2060806@agliodbs.com
Whole thread Raw
In response to Re: Shouldn't we have a way to avoid "risky" plans?  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: Shouldn't we have a way to avoid "risky" plans?  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-performance
On 4/19/11 7:29 AM, Robert Haas wrote:
> Another thought is that we might want to consider reducing
> autovacuum_analyze_scale_factor.  The root of the original problem
> seems to be that the table had some data churn but not enough to cause
> an ANALYZE.  Now, if the data churn is random, auto-analyzing after
> 10% churn might be reasonable, but a lot of data churn is non-random,
> and ANALYZE is fairly cheap.

I wouldn't reduce the defaults for PostgreSQL; this is something you do
on specific tables.

For example, on very large tables I've been known to set
analyze_scale_factor to 0 and analyze_threshold to 5000.

And don't assume that analyzing is always cheap.  If you have an 800GB
table, most of which is very cold data, and have statistics set to 5000
for some columns, accessing many of the older blocks could take a while.

--
Josh Berkus
PostgreSQL Experts Inc.
http://pgexperts.com

pgsql-performance by date:

Previous
From: philippe
Date:
Subject: Re: How to configure a read-only database server?
Next
From: Joby Joba
Date:
Subject: Re: Two different execution plans for similar requests