Re: Exec statement logging - Mailing list pgsql-patches

From Bruce Momjian
Subject Re: Exec statement logging
Date
Msg-id 200505120215.j4C2FTs02235@candle.pha.pa.us
Whole thread Raw
In response to Exec statement logging  (Simon Riggs <simon@2ndquadrant.com>)
Responses Re: Exec statement logging  (Simon Riggs <simon@2ndquadrant.com>)
List pgsql-patches
Simon Riggs wrote:
> Following patch is a minor addition to postgres.c that allows the two
> existing statement logging techniques to work with V3 exec. This then
> allows statement logging with PostgreSQL 8.0+ for JDBC and other V3
> connection types.

Good.

> The rationale of this patch is to add functionality without modifying
> existing behaviour. There is expected to be some difficulty with
> log_statement producing a log line at both parse and exec, but some may
> find that useful. Since there are two ways of producing statement
> logging with duration times, setting log_min_duration_statement=0 will
> avoid the logging of statements for both parse and exec. For many this
> method is already the preferred way of logging statement performance
> stats.

I don't understand what you are saying above.  How is the logging
different from what we currently have in terms of the GUC variables?

> There is no attempt to log parameters, since these are not often
> required for performance analysis.

Makes sense.

> The enclosed patch has been tested against cvstip.
>
> I also see this as a backpatch onto 8.0, since it prevents statements
> from being logged as described in the manual and prevents effective
> performance tuning. It has not been tested against 8.0.2, though was
> originally written against 8.0.1 and is believed to apply cleanly.

Unlikely for 8.0.X as current behavior is not a bug nor has it been
complained about alot.

> Some code has been duplicated with this patch; refactoring and cleanup
> can be performed should anybody desire it.

Yes, is it worth factoring it out?  I am thinking not.

> The patch was produced quickly to assist tuning efforts during
> Scalability & Performance benchmarking of PostgreSQL 8.0 carried out at
> Unisys Corporation's Mission Viejo engineering laboratory. The
> development was sponsored by Unisys Corporation and the patch has now
> been donated to the PostgreSQL community under the standard
> PostgreSQL/BSD licence. Approval for release of this code has been given
> in writing to me by the Director, Open Runtime Products, Unisys on April
> 8, 2005.

Amazing something in writing was required for this.  Was this their
idea, or yours, or based on their previous litigation over the "GIF"
patent?

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

pgsql-patches by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: CSV consecutive newline bug
Next
From: Tom Lane
Date:
Subject: Re: [HACKERS] plperl and pltcl installcheck targets