Re: Is there a tool used to display statement times from postgres logs

From: "Pinter Bernd" <bernd(dot)pinter(at)wien(dot)gv(dot)at>
To: <pgsql-general(at)postgresql(dot)org>
Subject: Re: Is there a tool used to display statement times from postgres logs
Date: 2009-11-23 07:28:38
Message-ID: B7FF1455C90F974C98CD3AA74E27E293041FAE1C@exadv11.host.magwien.gv.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

We currently evaluate PgFouine to analyse all executed statements in a
Postgres 8.4 cluster. But we don't use syslog - instead we use logging
via STDERR. Analyzing of the logs works fine with that combination. We
also tested big logfiles (~ 3GB) with pgFouine - also works fine, but
took about 2h30min for parsing...

To do so, we use the following settings in postgresql.conf:
log_destination = 'stderr'
logging_collector = on
log_min_duration_statement = 0
# log EVERY statement in every DB of the cluster
log_line_prefix = '%t [%p]: [%l-1] user=%u,db=%d ' # for pgFouine
Statistics.

after reloading the config (with `pg_ctl reload`) every sql-statement in
every database of the cluster should be logged. To analyze the log with
pgFouine do something like:
[bernd(at)vmlxdb]$ ./pgfouine.php -file PG84-2009-11-09.log -logtype
stderr -report history


If you also need the query-plans in the logfile, then you maybe want to
take a look at the contrib-package 'autoexplain'. This package can write
the query-plan of a sql-statement into the log. But you should be
warned: pgFouine will be a little bit confused with the plans in the
logfile (detect the sql-statement and the associated plan as two
separate statements)...

bernd.

________________________________

Von: pgsql-general-owner(at)postgresql(dot)org
[mailto:pgsql-general-owner(at)postgresql(dot)org] Im Auftrag von Chris Barnes
*EXTERN*
Gesendet: Freitag, 20. November 2009 18:59
An: Postgres General Postgres General
Betreff: [GENERAL] Is there a tool used to display statement
times from postgres logs


Would someone have a tool that displays statement execution
times/stats from the standard output from postgres logs?

I have attempted pgfouine but not had sucess with the log
format.

Does anyone use pgfouine or have something that works for them?

Chris


________________________________

Windows Live: Make it easier for your friends to see what you're
up to on Facebook. <http://go.microsoft.com/?linkid=9691811>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Jason Armstrong 2009-11-23 07:58:21 Returning bigint from C extension
Previous Message Scott Marlowe 2009-11-23 05:58:06 Re: [HACKERS] Updating column on row update