Re: Server load statistics

From: Andreas Kretschmer <akretschmer(at)spamfence(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Server load statistics
Date: 2010-07-25 11:48:27
Message-ID: 20100725114827.GA16051@tux
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Torsten Bronger <bronger(at)physik(dot)rwth-aachen(dot)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°

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Torsten Bronger 2010-07-25 11:50:53 Re: Server load statistics
Previous Message hubert depesz lubaczewski 2010-07-25 11:01:17 Re: Server load statistics