Re: Slow query problem

From: Richard Huxton <dev(at)archonet(dot)com>
To: Dennis Björklund <db(at)zigo(dot)dhs(dot)org>, Bradley Tate <btate(at)objectmastery(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Slow query problem
Date: 2004-01-09 08:54:46
Message-ID: 200401090854.46480.dev@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

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

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Dennis Björklund 2004-01-09 08:57:09 Re: Slow query problem
Previous Message Dennis Björklund 2004-01-09 07:29:57 Re: Slow query problem