Re: Postgres is too slow? - Mailing list pgsql-general

From Richard Huxton
Subject Re: Postgres is too slow?
Date
Msg-id 002601c0fb0e$2cbef580$1001a8c0@archonet.com
Whole thread Raw
In response to Postgres is too slow?  (Paul Mamin <magamos@mail.ru>)
List pgsql-general
From: "Richard Huxton" <dev@archonet.com>

> Paul Mamin wrote:
> >
> > The SQL command I need to request:
> > ----------------------------------------------------------------
> > select numberid, sum(TarifDurationAir-CallDuration)/count(*)
> > from callbase
> > group by numberid;
> > ----------------------------------------------------------------

Made up some test data (3491 values of numberid, 140 entries for each).
Timings I'm getting on an old AMD-K6ii - 400Mhz w/256 MB (and a lot of
quiescent apps)

For your query: 54secs

By setting sort_mem to 8192 (8MB) I get a time of 49s but at the cost of a
much larger backend process.

Just doing:

SELECT numberid FROM callbase GROUP BY numberid;

Gives a timing of 34secs.

Disk activity is minimal - CPU is maxed out in user processing. I'd expect
your setup to be 10% faster at least.

HTH

- Richard Huxton


pgsql-general by date:

Previous
From: "Yasuo Ohgaki"
Date:
Subject: Re: Re[2]: Postgres is too slow?
Next
From: "Yasuo Ohgaki"
Date:
Subject: Re: Re[2]: Postgres is too slow?