Re: Performance issue: index not used on GROUP BY...

From: Josh Berkus <josh(at)agliodbs(dot)com>
To: pgsql-performance(at)postgresql(dot)org
Subject: Re: Performance issue: index not used on GROUP BY...
Date: 2014-08-28 20:48:05
Message-ID: 53FF9585.2020503@agliodbs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On 08/28/2014 01:50 AM, gmb wrote:
> Can somebody please confirm whether aggregate functions such as GROUP BY
> should use indexes ?

Sometimes. In your case, the index has one more column than the GROUP
BY, which makes it less likely that Postgres will use it (since
depending on the cardinality of ddet_id, it might actually be slower to
use the index).

In addition, other folks on this thread have already pointed out the
memory settings issues to you.

--
Josh Berkus
PostgreSQL Experts Inc.
http://pgexperts.com

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Burgess, Freddie 2014-08-29 04:28:58 Very slow running query PostgreSQL 9.3.4
Previous Message Emi Lu 2014-08-28 14:49:08 Re: autocommit (true/false) for more than 1 million records