Re: What happens between end of explain analyze and end of query execution ?

From: Franck Routier <franck(dot)routier(at)axege(dot)com>
To: pgsql-performance(at)postgresql(dot)org
Subject: Re: What happens between end of explain analyze and end of query execution ?
Date: 2013-04-07 12:12:33
Message-ID: 516162B1.8050909@axege.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-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

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Kevin Grittner 2013-04-07 15:15:42 Re: INDEX Performance Issue
Previous Message Greg Williamson 2013-04-07 10:21:20 Re: INDEX Performance Issue