Re: [HACKERS] [PATCHES] log_statement output for protocol

From: "Guillaume Smet" <guillaume(dot)smet(at)gmail(dot)com>
To: "Bruce Momjian" <bruce(at)momjian(dot)us>
Cc: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "Oliver Jowett" <oliver(at)opencloud(dot)com>, "Dave Cramer" <pg(at)fastcrypt(dot)com>, "Csaba Nagy" <nagy(at)ecircle-ag(dot)com>, "Postgres JDBC" <pgsql-jdbc(at)postgresql(dot)org>, PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: [HACKERS] [PATCHES] log_statement output for protocol
Date: 2006-08-26 11:34:27
Message-ID: 1d4e0c10608260434h4940da5anf96c1e48b8e1d151@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-jdbc pgsql-patches

On 8/7/06, Bruce Momjian <bruce(at)momjian(dot)us> wrote:
> Updated patch attached. It prints the text bind parameters on a single
> detail line. I still have not seen portal names generated by libpq.

I'm currently testing CVS tip to generate sample log files. I noticed
that Bruce only patched log_statement and not
log_min_duration_statement which still has the old behaviour ie:
[1-1] LOG: duration: 0.097 ms execute my_query: SELECT * FROM shop
WHERE name = $1
The problem of not having the bind parameters still remains.

A lot of people use log_min_duration_statement and it's usually
recommended to use it instead of log_statement because log_statement
generates far too much output.
I tried to find a way to fix it but it's not so simple as when we bind
the statement, we don't know if the query will be slower than
log_min_duration_statement.

My first idea is that we should add a DETAIL line with the parameter
values to the execute log line when we are in the
log_min_duration_statement case. AFAICS the values are in the portal
but I don't know the overhead introduced by generating the detail line
from the portal.

Does anyone have a better idea on how we could fix it?

Regards,

--
Guillaume

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jonah H. Harris 2006-08-26 12:35:10 Re: Adding fulldisjunctions to the contrib
Previous Message Nikolay Samokhvalov 2006-08-26 08:00:35 Re: New XML section for documentation

Browse pgsql-jdbc by date

  From Date Subject
Next Message Julien Patrouix 2006-08-28 07:35:22 Optimizations in the latest driver
Previous Message Oliver Jowett 2006-08-25 21:33:21 Re: XA Resources

Browse pgsql-patches by date

  From Date Subject
Next Message Jonah H. Harris 2006-08-26 12:35:10 Re: Adding fulldisjunctions to the contrib
Previous Message Zoltan Boszormenyi 2006-08-26 04:42:24 Re: IDENTITY/GENERATED columns