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: Sun, 07 Apr 2013 14:12:33 +0200
Message-ID: <516162B1.8050909@axege.com> (raw)
In-Reply-To: <5541.1365265641@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>
	<515FE547.3010301@axege.com>
	<5541.1365265641@sss.pgh.pa.us>
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-performance>

Le 06/04/2013 18:27, Tom Lane a écrit :
>> Ok, the problem definitely comes from the default_statistics_target
>> which is obviously too high on the database.
> Yeah, eqjoinsel() is O(N^2) in the lengths of the MCV lists, in the
> worst case where there's little overlap in the list memberships.
> The actual cost would depend a lot on the specific column datatypes.
>
> Not sure about your report that re-analyzing with the same stats target
> made a significant difference.  It might have been a matter of chance
> variation in the sampled MCV list leading to more or fewer matches.
>
> 			regards, tom lane
>
>
Thank you all for your help, I appreciate it really much.

Just a last note: maybe the documentation could draw the attention on 
this side effect of high statistics target.
Right now it says:
  "Larger values increase the time needed to do ANALYZE, but might 
improve the quality of the planner's estimates" 
(http://www.postgresql.org/docs/9.2/static/runtime-config-query.html#GUC-DEFAULT-STATISTICS-TARGET)
and: "Raising the limit might allow more accurate planner estimates to 
be made, particularly for columns with irregular data distributions, at 
the price of consuming more space in pg_statistic and slightly more time 
to compute the estimates." 
(http://www.postgresql.org/docs/9.2/static/planner-stats.html).

It could be noted that a too high target can also have a noticeable cost 
on query planning.

Best regards,
Franck

Attachments:

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

view thread (21+ messages)  latest in thread

Message-ID: <516162B1.8050909@axege.com>
Permalink:  ../516162B1.8050909@axege.com/
Also on:    postgresql.org/message-id/516162B1.8050909@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: <516162B1.8050909@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