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

Поиск
Список
Период
Сортировка
Искать
От
Mikheev, Vadim
Тема
RE: Really SLOW using GROUP BY ...!?
Дата
Msg-id
8F4C99C66D04D4118F580090272A7A234D315F@sectorbase1.sectorbase.com
Список
Дерево обсуждения
RE: Really SLOW using GROUP BY ...!? "Mikheev, Vadim" <vmikheev@SECTORBASE.COM>
> 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
В списке pgsql-general по дате отправления
От: Hervé Piedvache
Дата:
От: oberpwd@anubis.network.com (Wade D. Oberpriller)
Дата:
FAQ