Re: Server load statistics - Mailing list pgsql-general

From Andreas Kretschmer
Subject Re: Server load statistics
Date
Msg-id 20100725114827.GA16051@tux
Whole thread Raw
In response to Server load statistics  (Torsten Bronger <bronger@physik.rwth-aachen.de>)
List pgsql-general
Torsten Bronger <bronger@physik.rwth-aachen.de> wrote:

> Hallöchen!
>
> I need statistics about the PG server load.  At the moment, I use
> for this
>
> SELECT tup_returned + tup_fetched + tup_inserted + tup_updated +
>      tup_deleted FROM pg_stat_database WHERE datname='mydb';
>
> However, the figures are absurdly high (> 100.000 rows per second).

Do you know, that you have to call pg_stat_reset() to restart all the
counters? And yes, a update is a delete and a insert. With your query
you get 3 rows per one singel update (tup_updated + tup_deleted +
tup_inserted). That's maybe not that what you expected.

Not to mention, every operation affects the system-tables, so one single
update, for instance, procude more than 3 table-operations.


Andreas
--
Really, I'm not out to destroy Microsoft. That will just be a completely
unintentional side effect.                              (Linus Torvalds)
"If I was god, I would recompile penguin with --enable-fly."   (unknown)
Kaufbach, Saxony, Germany, Europe.              N 51.05082°, E 13.56889°

pgsql-general by date:

Previous
From: hubert depesz lubaczewski
Date:
Subject: Re: Server load statistics
Next
From: Torsten Bronger
Date:
Subject: Re: Server load statistics