Tracking database activity

From: Erik Jones <erik(at)myemma(dot)com>
To: pgsql general <pgsql-general(at)postgresql(dot)org>
Subject: Tracking database activity
Date: 2007-01-22 16:44:08
Message-ID: 45B4E9D8.8050307@myemma.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi, I'm hoping someone can help me wrap my head around some #s I'm using
to track database activity. I have a script that runs hourly and
queries pg_stat_database and checks age(datfrozenxid) in pg_database.
It logs those stats and the next hour, when it runs, it takes the
differences to check the amount of activity over the last hour and then
logs the new stats. I was previously under the impression that by
tracking age(datfrozenxid) in pg_database over time I'd be able to know
how many transactions were processed in a certain amount of time.
However, I've seend that pg_stat_database.xact_commit +
pg_stat_database.xact_rollback < pg_database.age(datfrozenxid) by a
factor of as much as 6 for any given time frame. Am I misunderstanding
something here? Where is the discrepancy coming from?

--
erik jones <erik(at)myemma(dot)com>
software development
emma(r)

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ron Peterson 2007-01-22 16:49:46 Re: CAST function for user defined type
Previous Message Tom Lane 2007-01-22 16:40:08 Re: CAST function for user defined type