pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Kevin Grittner <kgrittn@ymail.com>
To: ach <alanchines@gmail.com>
To: pgsql-performance@postgresql.org <pgsql-performance@postgresql.org>
Subject: Re: statistics target for columns in unique constraint?
Date: Mon, 20 May 2013 07:12:20 -0700 (PDT)
Message-ID: <1369059140.15629.YahooMailNeo@web162906.mail.bf1.yahoo.com> (raw)
In-Reply-To: <1368891351220-5756093.post@n5.nabble.com>
References: <1368457293547-5755256.post@n5.nabble.com>
	<CABRT9RBwmDxjq-tzLMh6rFX-suJYVQMiGSQAADsueg07rvB1dg@mail.gmail.com>
	<51916C59.6010700@catalyst.net.nz>
	<1368891351220-5756093.post@n5.nabble.com>
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-performance>

ach <alanchines@gmail.com> wrote:

> One quick follow up since I'm expecting y'all might know:  Do the
> statistics targets actually speed performance on an index search
> itself; the actual lookup?  Or are the JUST to inform the planner
> towards the best pathway decision?

Since the statistics are just a random sampling and generally not
completely up-to-date, they really can't be used for anything other
than *estimating* relative costs in order to try to pick the best
plan.  Once a plan is chosen, its execution time is not influenced
by the statistics.  A higher statistics target can increase
planning time.  In a complex query with many joins and many indexes
on the referenced tables, the increase in planning time can be
significant.  I have seen cases where blindly increasing the
default statistics target resulted in planning time which was
longer than run time -- without any increase in plan quality.

Generally when something is configurable, it's because there can be
benefit to adjusting it.  If there was a single setting which could
not be materially improved upon for some cases, we wouldn't expose
a configuration option.  This is something which is not only
globally adjustable, you can override the setting for individual
columns -- again, we don't go to the trouble of supporting that
without a good reason.

-- 
Kevin Grittner
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


-- 
Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance



view thread (5+ messages)

Message-ID: <1369059140.15629.YahooMailNeo@web162906.mail.bf1.yahoo.com>
Permalink:  ../1369059140.15629.YahooMailNeo@web162906.mail.bf1.yahoo.com/
Also on:    postgresql.org/message-id/1369059140.15629.YahooMailNeo@web162906.mail.bf1.yahoo.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: kgrittn@ymail.com, alanchines@gmail.com
  Subject: Re: statistics target for columns in unique constraint?
  In-Reply-To: <1369059140.15629.YahooMailNeo@web162906.mail.bf1.yahoo.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