Обсуждение: Help with GROUP BY

Поиск
Список
Период
Сортировка

Help with GROUP BY

От
Jean-Christophe Boggio
Дата:
Hi,

I have a (quite) big table with ~3M rows.

Every row has a NBPOINTS (int4) and a REASON (int4)

select sum(nbpoints) from points; it takes about 10s

select sum(nbpoints) from points group by reason it takes about 210s

Same table structure, same data on Oracle gives respectively 8 and 22
seconds.

Is there a way to optimize this ?

(REASON is indexed though I can see no interest in this query.)

TIA!

--
Jean-Christophe Boggio
cat@thefreecat.org
Independant Consultant and Developer
Delphi, Linux, Oracle, Perl