Help with GROUP BY

Поиск
Список
Период
Сортировка
От Jean-Christophe Boggio
Тема Help with GROUP BY
Дата
Msg-id 15127090156.20001105190328@thefreecat.org
обсуждение исходный текст
Список pgsql-sql
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




В списке pgsql-sql по дате отправления:

Предыдущее
От: "ANDREAS STEINBACH"
Дата:
Сообщение: Oracle, ODBC, MS IIS -> problem!
Следующее
От: "pgsql-sql"
Дата:
Сообщение: alter pg_shadow