"Saleem Burhani Baloch" <peseek(at)khi(dot)wol(dot)net(dot)pk> writes:
> PostgreSQL 7.1.3-2
Aside from the config issues Chris mentioned, I'd recommend trying
a somewhat less obsolete version of Postgres. I believe the poor
performance with grouped aggregates should be fixed in 7.4 and later.
(Red Hat 7.2 is a bit long in the tooth as well.)
regards, tom lane