Re: Increasing the length of

From: Simon Riggs <simon(at)2ndquadrant(dot)com>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: David Parker <dparker(at)tazznetworks(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Increasing the length of
Date: 2004-12-01 08:38:56
Message-ID: 1101890336.5728.32.camel@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, 2004-11-30 at 19:32, Bruce Momjian wrote:
> David Parker wrote:
> > I've been using "log_min_duration_statement = 0" to get durations on all
> > SQL statements for the purposes of performance tuning, because this logs
> > the duration on the same line as the statement. My reading of this TODO
> > is that now log_min_duration_statement = 0 would give me the statements
> > but no total duration?
>
> Oh, sorry, you are right. I forgot about the duration part! I got so
> excited I forgot.
>
> TODO item removed.

David's objection was noted, and why I hadn't coded it (yet).

There are currently two ways of getting statement and duration output,
which is confusing....

You can either
1. Individual statements
- log_statement = all
- log_duration = true
- log_line_prefix includes processid

which produces 2 log lines like
statement: xxxxxxxxx
duration: yyyyyyyyyy

2. log_min_duration
log_min_duration_statement=0
which produces 1 log line like
duration: yyyyyyy statement: xxxxxxxxxx

These two things do exactly the same thing, apart from the way the
output is presented to the user in the log line.

I'd like to change log_min_duration_statement as suggested, but this
side-effect behaviour of being a better log_statement than log_statement
kindof gets in the way. It makes me wonder why we have log_statement at
all.

We all want to do performance tracing. I'd also like to be able to
dynamically monitor what is actually happening *now* on the system.
There is no way right now to monitor for rogue queries, other than to
cancel anything that runs more than statement_timeout. Thats not good
either, even if it does keep the current behaviour.

My preference would be to do the following:
- add a script to contrib to process the log file
- always add processid to log_statement_prefix when both log_statement
and log_duration are specified, so you can always tie up the data

Anybody?

--
Best Regards, Simon Riggs

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Richard Huxton 2004-12-01 08:49:28 Re: Error handling in plperl and pltcl
Previous Message Neil Conway 2004-12-01 08:37:21 Re: nodeAgg perf tweak