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 -- Sent via pgsql-performance mailing list (pgsql-performance@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance