Re: query logging of prepared statements - Mailing list pgsql-hackers

From Justin Pryzby
Subject Re: query logging of prepared statements
Date
Msg-id 20190407153101.GA10080@telsasoft.com
Whole thread Raw
In response to Re: query logging of prepared statements  (Andres Freund <andres@anarazel.de>)
Responses Re: query logging of prepared statements
List pgsql-hackers
Hi,

Thanks both for thinking about this.

On Fri, Apr 05, 2019 at 06:16:38PM -0700, Andres Freund wrote:
> On 2019-04-04 16:01:26 -0300, Alvaro Herrera wrote:
> > Also, if you parse once and bind/execute many times, IMO the statement
> > should be logged exactly once.  I think you could that with the flag I
> > propose.

> I think deduplicating the logging between bind and execute has less of
> that hazard.

Do you mean the bind parameters, which are only duplicated in the case of
log_min_duration_statement ?

I actually implemented that, using Alvaro's suggestion of a flag in the Portal,
and decided that if duration is exceeded, for bind or execute, then it's likely
desirable to log the params, even if it's duplicitive.  Since I've been using
log_statement=all, and not log_min_duration_statement, I don't have a strong
opinion about it.

Perhaps you're right (and perhaps I should switch to
log_min_duration_statement).  I'll tentately plan to withdraw the patch.

Thanks,
Justin



pgsql-hackers by date:

Previous
From: Justin Pryzby
Date:
Subject: Re: ToDo: show size of partitioned table
Next
From: David Rowley
Date:
Subject: Re: Speed up transaction completion faster after many relations areaccessed in a transaction