pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Josh Berkus <josh@agliodbs.com>
To: pgsql-performance@postgresql.org
Subject: Re: change sample size for statistics
Date: Fri, 10 Jun 2011 12:58:19 -0700
Message-ID: <4DF2775B.7070501@agliodbs.com> (raw)
In-Reply-To: <BANLkTik4st_UXVpjJYKcLp+wAtA+wKTe=g@mail.gmail.com>
References: <BANLkTik4st_UXVpjJYKcLp+wAtA+wKTe=g@mail.gmail.com>

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



view thread (5+ messages)  latest in thread

Message-ID: <4DF2775B.7070501@agliodbs.com>
Permalink:  ../4DF2775B.7070501@agliodbs.com/
Also on:    postgresql.org/message-id/4DF2775B.7070501@agliodbs.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: josh@agliodbs.com
  Subject: Re: change sample size for statistics
  In-Reply-To: <4DF2775B.7070501@agliodbs.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox