Re: change sample size for statistics - Mailing list pgsql-performance

From Josh Berkus
Subject Re: change sample size for statistics
Date
Msg-id 4DF2775B.7070501@agliodbs.com
Whole thread Raw
In response to change sample size for statistics  (Willy-Bas Loos <willybas@gmail.com>)
Responses Re: change sample size for statistics  (Willy-Bas Loos <willybas@gmail.com>)
List 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

pgsql-performance by date:

Previous
From: "Anibal David Acosta"
Date:
Subject: Re: how much postgres can scale up?
Next
From: Nathan Boley
Date:
Subject: Re: change sample size for statistics