Re: Performance issue: index not used on GROUP BY... - Mailing list pgsql-performance

From Josh Berkus
Subject Re: Performance issue: index not used on GROUP BY...
Date
Msg-id 53FF9585.2020503@agliodbs.com
Whole thread Raw
In response to Performance issue: index not used on GROUP BY...  (gmb <gmbouwer@gmail.com>)
Responses Re: Performance issue: index not used on GROUP BY...  (gmb <gmbouwer@gmail.com>)
List 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


pgsql-performance by date:

Previous
From: Emi Lu
Date:
Subject: Re: autocommit (true/false) for more than 1 million records
Next
From: "Burgess, Freddie"
Date:
Subject: Very slow running query PostgreSQL 9.3.4