pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Craig Ringer <ringerc@ringerc.id.au>
Cc: Alexander Stanier <alexander.stanier@egsgroup.com>
Cc: Dave Cramer <pg@fastcrypt.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: Change in Log Format and Prepared Statements
Date: Thu, 20 Sep 2012 11:26:14 -0400
Message-ID: <17970.1348154774@sss.pgh.pa.us> (raw)
In-Reply-To: <505B171A.5060603@ringerc.id.au>
References: <5051D5DA.8050404@egsgroup.com>
	<CADK3HHLdcyq54NRCa7qYr0UiBZVxh9np=y1WJrCbq9zKfg1EfA@mail.gmail.com>
	<5056B201.5020809@ringerc.id.au>
	<5056C6FA.1020800@egsgroup.com>
	<50595763.8070008@ringerc.id.au>
	<16243.1348036326@sss.pgh.pa.us>
	<505B171A.5060603@ringerc.id.au>

Craig Ringer <ringerc@ringerc.id.au> writes:
> On 09/19/2012 02:32 PM, Tom Lane wrote:
>> AFAICT from looking at the backend code, they are labeled ...

> Yes, they have command tags, and if a suitable log_line_prefix like:

>      log_line_prefix = 'cmd=%i pid=%p '

> is set they are visible:

> cmd=INSERT pid=4067 LOG:  execute <unnamed>: INSERT INTO hold VALUES (1)
> cmd=INSERT pid=4067 LOG:  duration: 1.454 ms
> cmd=PARSE pid=4067 LOG:  duration: 0.066 ms
> cmd=PARSE pid=4067 LOG:  duration: 0.028 ms
> cmd=BIND pid=4067 LOG:  duration: 0.007 ms

Oh.  You are talking about log_duration output, which is *meant* to be
terse.  It's designed that way for high-query-volume installations that
can't afford more log text than that.  If you want something that's more
easily readable, turn that off and instead set
log_min_duration_statement to zero, as indeed is recommended in the
documentation.

> but that just makes things more confusing. What's with the two PARSEs? 
> and why is the INSERT logged *before* the PARSE and BIND?

It's hard to be sure without seeing the more verbose logging, but
I think you are looking at interleaved parsing/execution of multiple
prepared statements.  Because that's allowed, simplifying the logging as
you suggest doesn't seem very practical.

My recollection is that the current behavior of the duration-logging
options was hashed out in considerable detail some years ago, and is
meant to serve multiple sets of requirements.  It's not going to be
that easy to persuade people to change it.

			regards, tom lane




view thread (11+ messages)

Message-ID: <17970.1348154774@sss.pgh.pa.us>
Permalink:  ../17970.1348154774@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/17970.1348154774@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: tgl@sss.pgh.pa.us, ringerc@ringerc.id.au, alexander.stanier@egsgroup.com, pg@fastcrypt.com
  Subject: Re: Change in Log Format and Prepared Statements
  In-Reply-To: <17970.1348154774@sss.pgh.pa.us>
  References: <5051D5DA.8050404@egsgroup.com> <CADK3HHLdcyq54NRCa7qYr0UiBZVxh9np=y1WJrCbq9zKfg1EfA@mail.gmail.com> <5056B201.5020809@ringerc.id.au> <5056C6FA.1020800@egsgroup.com> <50595763.8070008@ringerc.id.au> <16243.1348036326@sss.pgh.pa.us> <505B171A.5060603@ringerc.id.au> <17970.1348154774@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox