RE: Really SLOW using GROUP BY ...!?

From: "Mikheev, Vadim" <vmikheev(at)SECTORBASE(dot)COM>
To: "'herve(at)elma(dot)fr'" <herve(at)elma(dot)fr>, pgsql-general(at)postgresql(dot)org
Subject: RE: Really SLOW using GROUP BY ...!?
Date: 2000-11-08 20:58:13
Message-ID: 8F4C99C66D04D4118F580090272A7A234D315F@sectorbase1.sectorbase.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> But when I do :
> select sum(points) from gains group by idcond;
>
> With Oracle : 22 sec
> With PostGreSQL : about 3 minutes !!!

Try

select sum(points) from gains where idcond >= _minimum_id_cond_value_
group by idcond;

to see if forced index usage will help. Unfortunately, PG will anyway
try to sort result before grouping, but probably this trick will help
somehow. Also, use -S 2048 (or more) backend arg to increase sort
memory size.

Vadim

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Wade D. Oberpriller 2000-11-08 21:13:50 Built-in Postgres Types as shown in Chap. 4 Programmer's Guide
Previous Message Hervé Piedvache 2000-11-08 20:55:31 Really SLOW using GROUP BY ...!?