Re: Additional global stats for pg_database?

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Magnus Hagander <magnus(at)hagander(dot)net>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Additional global stats for pg_database?
Date: 2007-03-15 14:25:57
Message-ID: 20070315142557.GG5645@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Magnus Hagander wrote:
> Hi!
>
> I'd like to add the ability to show global counters of a couple of
> things currently available in pg_stat_all_tables (for example number of
> rows added etc) in a global counter for the entire cluster, for
> monitoring of an entire cluster without having to connect to each
> individual database.
>
> Should I try adding this to the exsting pg_stat_database view, or should
> I look at creating a separate view or two?

I'd say add that to each database entry. To get the sum of all
databases you'd need some sort of refactoring, because currently when a
backend reads the stats file it only gets its own stats. One idea is to
create an additional counter in the stats file, stored separately from
database entries.

If you add a tuples updated/deleted/inserted to databases, autovacuum
can make use of that too (it's even mentioned on an XXX comment in the
code somewhere).

--
Alvaro Herrera http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2007-03-15 14:40:35 Re: Backend crash in 8.2.3 with plpgsql function
Previous Message Alvaro Herrera 2007-03-15 14:20:23 Re: how to add seconds to a TimestampTz