Re: change sample size for statistics

From: Josh Berkus <josh(at)agliodbs(dot)com>
To: pgsql-performance(at)postgresql(dot)org
Subject: Re: change sample size for statistics
Date: 2011-06-10 19:58:19
Message-ID: 4DF2775B.7070501@agliodbs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-performance

On 6/10/11 5:15 AM, Willy-Bas Loos wrote:
> Hi,
>
> is there a way to change the sample size for statistics (that analyze
> gathers)?
> It is said to be 10%. i would like to raise that, because we are getting bas
> estimations for n_distinct.

It's not 10%. We use a fixed sample size, which is configurable on the
system, table, or column basis.

Some reading (read all these pages to understand what you're doing):
http://www.postgresql.org/docs/9.0/static/planner-stats.html
http://www.postgresql.org/docs/9.0/static/runtime-config-query.html#RUNTIME-CONFIG-QUERY-OTHER
http://www.postgresql.org/docs/9.0/static/planner-stats-details.html
http://www.postgresql.org/docs/9.0/static/sql-altertable.html
(scroll down to "set storage" on that last page)

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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Nathan Boley 2011-06-10 20:07:19 Re: change sample size for statistics
Previous Message akp geek 2011-06-10 19:46:52 setting up streaming error. Please help

Browse pgsql-performance by date

  From Date Subject
Next Message Nathan Boley 2011-06-10 20:07:19 Re: change sample size for statistics
Previous Message Anibal David Acosta 2011-06-10 18:16:33 Re: how much postgres can scale up?