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>
To: pgsql-performance@postgresql.org
Subject: Re: Slow queries after vacuum analyze
Date: Thu, 13 Dec 2012 15:42:44 -0500
Message-ID: <20121213204244.80090@gmx.com> (raw)
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-performance>

Ghislain ROUVIGNAC wrote:

> Threre is a vacuum analyze planned during the night.
> The morning, 1 day out of 2, there are some extremely slow
> queries. Those queries lasts more than 5 minutes (never waited
> more and cancelled them) whereas when everything is OK they last
> less than 300ms.
> 
> In order to resolve this i have to execute a least one analyze,
> sometimes more.
> 
> My Configuration:
> Windows
> PostgreSQL 8.4.8
> default_statistics_target = 100
> 
> In addition to an increase for shared_buffers, work_mem, ..., i
> changed the default_statistics_target to 500 with no effect.
> It was even worse as i never managed to get rid of the slow
> queries after running many analyze.
> So i fell back to default_statistics_target=100 in order to get
> rid of those slow queries.

You probably need to adjust your cost factors to more accurately
reflect the actual costs of various activities on your system. What
is probably happening is that there are two plans which are very
close together in estimated costs using the current values, while
the actual costs are very different.  The particular random sample
chosen can push the balance one way or the other.

Please show the results from running the query on this page:

http://wiki.postgresql.org/wiki/Server_Configuration

Also, a description of the run environment would help.

Other information listed on this page would help, although cores,
RAM, and storage system information would probably be most
important.

http://wiki.postgresql.org/wiki/Server_Configuration

-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)  latest in thread

Message-ID: <20121213204244.80090@gmx.com>
Permalink:  ../20121213204244.80090@gmx.com/
Also on:    postgresql.org/message-id/20121213204244.80090@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: <20121213204244.80090@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