pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Kevin Grittner <kgrittn@mail.com>
To: Ghislain ROUVIGNAC <ghr@sylob.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Slow queries after vacuum analyze
Date: Fri, 21 Dec 2012 10:34:13 -0500
Message-ID: <20121221153413.144660@gmx.com> (raw)
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-performance>

Ghislain ROUVIGNAC wrote:

>> I would leave default_statistics_target alone unless you see a lot of
>> estimates which are off by more than an order of magnitude. Even then, it
>> is often better to set a higher value for a few individual columns than for
>> everything.
> 
> 
> We had an issue with a customer where we had to increase the statistics
> parameter for a primary key.
> So I'd like to know if there is a way to identify for which column we have
> to change the statistics.

I don't know a better way than to investigate queries which seem to
be running longer than you would expect, and look for cases where
EXPLAIN ANALYZE shows an estimated row count which is off from
actual by enough to cause a problem. Sometimes this is caused by
correlations between values in different columns, in which case a
higher target is not likely to help; but sometimes it's a matter
that there is an uneven distribution among values not included in
the "most common values", in which case boosting the target to
store more values and finer-grained information on ranges will be
exactly what you need.

-Kevin


-- 
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: <20121221153413.144660@gmx.com>
Permalink:  ../20121221153413.144660@gmx.com/
Also on:    postgresql.org/message-id/20121221153413.144660@gmx.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@mail.com, ghr@sylob.com
  Subject: Re: Slow queries after vacuum analyze
  In-Reply-To: <20121221153413.144660@gmx.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