Re: Slow HashAggregate : How to optimize ?

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Bruno Baguette <bruno(dot)baguette(at)gmail(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Slow HashAggregate : How to optimize ?
Date: 2009-01-22 16:27:31
Message-ID: 603c8f070901220827u462bc17dpcf59bc138a854f88@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

> I'm having a problem with a query that takes more or less 3.2 seconds to be
> executed.
>
> This query uses a view which encapsulates some calculations (in order to
> avoid duplicating theses calculations at several places in the project).
>
> In order to keep that post readable, I've put the view details on that page
> : <http://pastebin.com/m1523940>
>
> Here's the EXPLAIN ANALYZE of a query using that view :
> <http://pastebin.com/m1b94cd9b>
>
> As I read the query plan, the HashAggregate takes near than 3 seconds, which
> represent 90% of the query duration time.

Well, it IS aggregating almost 80,000 rows. That doesn't sound that
bad to me. What kind of hardware are you running this on?

...Robert

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Claus Guttesen 2009-01-22 16:36:36 Re: postgresql 8.3 tps rate
Previous Message Ibrahim Harrani 2009-01-22 15:47:39 postgresql 8.3 tps rate