pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Richard Huxton <dev@archonet.com>
To: Dennis Björklund <db@zigo.dhs.org>
To: Bradley Tate <btate@objectmastery.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Slow query problem
Date: Fri, 9 Jan 2004 08:54:46 +0000
Message-ID: <200401090854.46480.dev@archonet.com> (raw)
In-Reply-To: <Pine.LNX.4.44.0401090825500.13405-100000@zigo.dhs.org>
References: <Pine.LNX.4.44.0401090825500.13405-100000@zigo.dhs.org>

On Friday 09 January 2004 07:29, Dennis Björklund wrote:
> On Thu, 8 Jan 2004, Bradley Tate wrote:
> >
> > select invheadref, invprodref, sum(units)
> > from invtran
> > group by invheadref, invprodref

> For the above query, shouldn't you have one index for both columns
> (invheadref, invprodref). Then it should not need to sort at all to do the
> grouping and it should all be fast.

Not sure if that would make a difference here, since the whole table is being 
read. 

-- 
  Richard Huxton
  Archonet Ltd



view thread (11+ messages)  latest in thread

Message-ID: <200401090854.46480.dev@archonet.com>
Permalink:  ../200401090854.46480.dev@archonet.com/
Also on:    postgresql.org/message-id/200401090854.46480.dev@archonet.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: dev@archonet.com, db@zigo.dhs.org, btate@objectmastery.com
  Subject: Re: Slow query problem
  In-Reply-To: <200401090854.46480.dev@archonet.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