Re: use of pg_stat_database

Lists: pgsql-hackers
From: abdelhak benmohamed <abdelhak(dot)benmohamed(at)yahoo(dot)fr>
To: pgsql-hackers(at)postgresql(dot)org
Subject: use of pg_stat_database
Date: 2009-06-30 11:13:47
Message-ID: 633560.69013.qm@web24206.mail.ird.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Hellow,
 
I like to track the number of committed transaction for my database
So I use the following command
Select * from pg_stat_database;
 
The column xact_commit gives me the number of transaction committed
 
But if I execute the same command another time, the column xact_commit gives me an other number.
 
Between the first select and the second select I don’t execute any transaction on my database
 
Please, can any one help me to understanding the cause of the change?
 
Thanks very much


From: "A(dot) Kretschmer" <andreas(dot)kretschmer(at)schollglas(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: use of pg_stat_database
Date: 2009-06-30 11:34:58
Message-ID: 20090630113458.GG19653@a-kretschmer.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

In response to abdelhak benmohamed :
> Hellow,
>
>
>
> I like to track the number of committed transaction for my database
>
> So I use the following command
>
> Select * from pg_stat_database;
>
>
>
> The column xact_commit gives me the number of transaction committed
>
>
>
> But if I execute the same command another time, the column xact_commit gives me
> an other number.

I can't reproduce that:

test=*# Select sum(xact_commit) from pg_stat_database;
sum
-------
73470
(1 row)

-- 5 minutes later:

test=*# Select sum(xact_commit) from pg_stat_database;
sum
-------
73470
(1 row)

>
>
>
> Between the first select and the second select I don?t execute any transaction
> on my database

Autovacuum?

Andreas
--
Andreas Kretschmer
Kontakt: Heynitz: 035242/47150, D1: 0160/7141639 (mehr: -> Header)
GnuPG-ID: 0x3FFF606C, privat 0x7F4584DA http://wwwkeys.de.pgp.net


From: Merlin Moncure <mmoncure(at)gmail(dot)com>
To: abdelhak benmohamed <abdelhak(dot)benmohamed(at)yahoo(dot)fr>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: use of pg_stat_database
Date: 2009-06-30 13:26:23
Message-ID: b42b73150906300626w3c6355b9pef9a046e2e0354c9@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Tue, Jun 30, 2009 at 7:13 AM, abdelhak
benmohamed<abdelhak(dot)benmohamed(at)yahoo(dot)fr> wrote:
> Hellow,
>
>
>
> I like to track the number of committed transaction for my database
>
> So I use the following command
>
> Select * from pg_stat_database;
>
>
>
> The column xact_commit gives me the number of transaction committed
>
>
>
> But if I execute the same command another time, the column xact_commit gives
> me an other number.
>
>
>
> Between the first select and the second select I don’t execute any
> transaction on my database
>
>
>
> Please, can any one help me to understanding the cause of the change?

try turning on statement logging (log_statement='all'). please post
q&a time questions to -general.

merlin