Skip site navigation (1) Skip section navigation (2)

Re: performance with query

From: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
To: "Alberto Dalmaso" <dalmaso(at)clesius(dot)it>
Cc: <pgsql-performance(at)postgresql(dot)org>
Subject: Re: performance with query
Date: 2009-06-18 19:26:58
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-performance
Alberto Dalmaso <dalmaso(at)clesius(dot)it> wrote: 
> P.S.: to understand what the query has to make (and 80% of the view
> hve these to make): a lot of time is spend to pivoting a table with
> a structure like
> identifier, description_of_value, numeric value
> that has to be transformed in
> identifier, description_1, description_2, ..., description_n
> where n is not a fixed number (it changes in function of the type of
> calculation that was used to generate the rows in the table).
> perhaps this information could help.
What would help more is the actual query, if that can be shared.  It
leaves a lot less to the imagination than descriptions of it.
There are a couple things which have been requested which would help
pin down the reason the optimizer is not getting to a good plan, so
that it can be allowed to do a good job.  As Tom said, this would be a
much more productive focus than casting about for ways to force it to
do what you think is the best thing.  (Maybe, given the chance, it can
come up with a plan which runs in seconds, rather than over the 24
minutes you've gotten.)
With all the optimizer options on, and the from_collapse_limit and
join_collapse_limit values both set to 100, run an EXPLAIN (no
ANALYZE) on your big problem query.  Let us know how long the EXPLAIN
runs.  If it gets any errors, copy and paste all available
information.  (General descriptions aren't likely to get us very far.)
Since EXPLAIN without ANALYZE only *plans* the query, but doesn't run
it, it should not take long to do this.
If there are any views or custom functions involved, showing those
along with the query source would be good.
If we get this information, we have a much better chance to find the
real problem and get it fixed.

In response to


pgsql-performance by date

Next:From: Tom LaneDate: 2009-06-18 19:39:21
Subject: Re: performance with query
Previous:From: Kenneth MarshallDate: 2009-06-18 18:30:52
Subject: Re: Strange performance response for high load times

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group