pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Franck Routier <franck.routier@axege.com>
To: pgsql-performance@postgresql.org
Subject: Re: What happens between end of explain analyze and end of query execution ?
Date: Sat, 06 Apr 2013 11:05:11 +0200
Message-ID: <515FE547.3010301@axege.com> (raw)
In-Reply-To: <4113.1365171448@sss.pgh.pa.us>
References: <515D92BF.5000309@axege.com>
	<CAPmjWd100eemBz1RTw=r24zgh8+YO8iq86fThqsALznrPuyWqg@mail.gmail.com>
	<515D9FC5.7030105@axege.com>
	<18910.1365092713@sss.pgh.pa.us>
	<515DCB34.6040801@axege.com>
	<6354.1365102532@sss.pgh.pa.us>
	<515ED7BC.40907@axege.com>
	<4113.1365171448@sss.pgh.pa.us>
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-performance>

Le 05/04/2013 16:17, Tom Lane a écrit :
> What have you got the statistics targets set to in this database?

Ok, the problem definitely comes from the default_statistics_target 
which is obviously too high on the database.

I have experimented with explain on queries with another set of 4 joined 
tables.
In my first attempt, explain took more than 4 seconds (!)
Then I have set default_statistics_target to 100 and analyzed the 4 
tables. Explain took a few ms.
Restored default_statistics_target to 5000, analyzed again. Explain took 
1.8 seconds.

So, I seem to have two related problems: statistics are somewhat bloated 
(as re-analyzing with same target takes the explain time from 4 sec down 
to 1.8 sec).
And the target is far too high (as default target value take analyse 
down to a few ms).

Now... can someone help me understand what happens ? Where can I look 
(in pg_stats ?) to see the source of the problem ? maybe a column with a 
huge list of different values the palnner has to parse ?


Regards,
Franck

Attachments:

  smime.p7s (application/pkcs7-signature, 4.4K) download

view thread (21+ messages)  latest in thread

Message-ID: <515FE547.3010301@axege.com>
Permalink:  ../515FE547.3010301@axege.com/
Also on:    postgresql.org/message-id/515FE547.3010301@axege.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: franck.routier@axege.com
  Subject: Re: What happens between end of explain analyze and end of query execution ?
  In-Reply-To: <515FE547.3010301@axege.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