pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Josh Berkus <josh@agliodbs.com>
To: pgsql-performance@postgresql.org
Subject: Re: Performance issue: index not used on GROUP BY...
Date: Thu, 28 Aug 2014 13:48:05 -0700
Message-ID: <53FF9585.2020503@agliodbs.com> (raw)
In-Reply-To: <WM!27115ef8b4317c46a4776e3d9cbecb6a14f32edaaaa884ab1aff4dd2cdf4db1b19fbf04cb6af48a1d395e18bed4c0287!@asav-3.01.com>
References: <1409215840535-5816702.post@n5.nabble.com>
	<WM!27115ef8b4317c46a4776e3d9cbecb6a14f32edaaaa884ab1aff4dd2cdf4db1b19fbf04cb6af48a1d395e18bed4c0287!@asav-3.01.com>
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-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


-- 
Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance



view thread (9+ messages)  latest in thread

Message-ID: <53FF9585.2020503@agliodbs.com>
Permalink:  ../53FF9585.2020503@agliodbs.com/
Also on:    postgresql.org/message-id/53FF9585.2020503@agliodbs.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: josh@agliodbs.com
  Subject: Re: Performance issue: index not used on GROUP BY...
  In-Reply-To: <53FF9585.2020503@agliodbs.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox