Erik Jones <erik(at)myemma(dot)com> writes:
> ... 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?
The age() calculation will produce a total transaction count across the
whole installation, not individual databases --- perhaps that's the
source of your confusion?
regards, tom lane