pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
duration logging setting in 7.4
12+ messages / 4 participants
[nested] [flat]

* duration logging setting in 7.4
@ 2003-11-17 22:20 Ryszard Lach <siaco@autograf.pl>
  2003-11-18 02:37 ` Re: duration logging setting in 7.4 Bruce Momjian <pgman@candle.pha.pa.us>
  0 siblings, 1 reply; 12+ messages in thread

From: Ryszard Lach @ 2003-11-17 22:20 UTC (permalink / raw)
  To: pgsql-performance


Hi.

I'm trying to set run-time environment in pgsql7.4 so, that it prints
all statements with duration time, but I can't understand why setting
log_min_duration_statement to '0' causes printing to syslog plenty of
lines ending with 'duration: statement:', i.e. without any statement
string (except expected ones). Can anybody help me?

Richard.

-- 
"First they ignore you. Then they laugh at you. Then they
fight you. Then you win." - Mohandas Gandhi.



^ permalink  raw  reply  [nested|flat] 12+ messages in thread

* Re: duration logging setting in 7.4
  2003-11-17 22:20 duration logging setting in 7.4 Ryszard Lach <siaco@autograf.pl>
@ 2003-11-18 02:37 ` Bruce Momjian <pgman@candle.pha.pa.us>
  2003-11-18 09:16   ` Re: duration logging setting in 7.4 Ryszard Lach <siaco@autograf.pl>
  0 siblings, 1 reply; 12+ messages in thread

From: Bruce Momjian @ 2003-11-18 02:37 UTC (permalink / raw)
  To: Ryszard Lach <siaco@autograf.pl>; +Cc: pgsql-performance

Ryszard Lach wrote:
> 
> Hi.
> 
> I'm trying to set run-time environment in pgsql7.4 so, that it prints
> all statements with duration time, but I can't understand why setting
> log_min_duration_statement to '0' causes printing to syslog plenty of
> lines ending with 'duration: statement:', i.e. without any statement
> string (except expected ones). Can anybody help me?

Can you show us some of the log file?  If I do:
	
	test=> set log_min_duration_statement = 0;
	SET
	test=> select 1;
	 ?column?
	----------
	        1
	(1 row)

I get:

	LOG:  duration: 0.861 ms  statement: select 1;

-- 
  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



^ permalink  raw  reply  [nested|flat] 12+ messages in thread

* Re: duration logging setting in 7.4
  2003-11-17 22:20 duration logging setting in 7.4 Ryszard Lach <siaco@autograf.pl>
  2003-11-18 02:37 ` Re: duration logging setting in 7.4 Bruce Momjian <pgman@candle.pha.pa.us>
@ 2003-11-18 09:16   ` Ryszard Lach <siaco@autograf.pl>
  2003-11-18 15:07     ` Re: duration logging setting in 7.4 Bruce Momjian <pgman@candle.pha.pa.us>
  2003-11-21 00:17     ` Re: duration logging setting in 7.4 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 2 replies; 12+ messages in thread

From: Ryszard Lach @ 2003-11-18 09:16 UTC (permalink / raw)
  To: pgsql-performance; +Cc: Bruce Momjian <pgman@candle.pha.pa.us>

On Mon, Nov 17, 2003 at 09:37:07PM -0500, Bruce Momjian wrote:
> Ryszard Lach wrote:
> > 
> > Hi.
> > 
> > I'm trying to set run-time environment in pgsql7.4 so, that it prints
> > all statements with duration time, but I can't understand why setting
> > log_min_duration_statement to '0' causes printing to syslog plenty of
> > lines ending with 'duration: statement:', i.e. without any statement
> > string (except expected ones). Can anybody help me?
> 
> Can you show us some of the log file?  If I do:
> 	

Sure.

Nov 18 10:05:20  postgres[1348]: [318-1] LOG:  duration: 0.297 ms  statement:
Nov 18 10:05:20  postgres[1311]: [5477-1] LOG:  duration: 0.617 ms  statement:
Nov 18 10:05:20  postgres[1312]: [5134-1] LOG:  duration: 0.477 ms  statement:
Nov 18 10:05:20  postgres[1349]: [318-1] LOG:  duration: 0.215 ms  statement:
Nov 18 10:05:20  postgres[1313]: [5449-1] LOG:  duration: 0.512 ms  statement:
Nov 18 10:05:20  postgres[1314]: [5534-1] LOG:  duration: 0.420 ms  statement:
Nov 18 10:05:20  postgres[1330]: [772-1] LOG:  duration: 1.386 ms  statement: SELECT * FROM mytablemius WHERE id = 0;
Nov 18 10:05:20  postgres[1315]: [5757-1] LOG:  duration: 0.417 ms  statement:
Nov 18 10:05:20  postgres[1316]: [5885-1] LOG:  duration: 0.315 ms  statement:
Nov 18 10:05:20  postgres[1317]: [5914-1] LOG:  duration: 0.301 ms  statement:
Nov 18 10:05:20  postgres[1318]: [5990-1] LOG:  duration: 0.293 ms  statement:
Nov 18 10:05:20  postgres[1319]: [6009-1] LOG:  duration: 0.211 ms  statement:
Nov 18 10:05:20  postgres[1320]: [6039-1] LOG:  duration: 0.188 ms  statement:


this is with setting

log_duration = false
log_statement = false
log_min_duration_statement = 0

The amount of lines containing statement string is nearly the same ase before
upgrade (from 7.3), all other lines are extra.

I don't know if this can be a reason, this is on a pretty busy machine (ca. 100
selects/second, but loadavg lower then 0.9), I'm logging postgres through syslog.

Richard.

-- 
"First they ignore you. Then they laugh at you. Then they
fight you. Then you win." - Mohandas Gandhi.



^ permalink  raw  reply  [nested|flat] 12+ messages in thread

* Re: duration logging setting in 7.4
  2003-11-17 22:20 duration logging setting in 7.4 Ryszard Lach <siaco@autograf.pl>
  2003-11-18 02:37 ` Re: duration logging setting in 7.4 Bruce Momjian <pgman@candle.pha.pa.us>
  2003-11-18 09:16   ` Re: duration logging setting in 7.4 Ryszard Lach <siaco@autograf.pl>
@ 2003-11-18 15:07     ` Bruce Momjian <pgman@candle.pha.pa.us>
  2003-11-19 18:38       ` Re: duration logging setting in 7.4 Ryszard Lach <ryszard@lach.name>
  1 sibling, 1 reply; 12+ messages in thread

From: Bruce Momjian @ 2003-11-18 15:07 UTC (permalink / raw)
  To: Ryszard Lach <siaco@autograf.pl>; +Cc: pgsql-performance


Wow, that is strange.  If you don't use syslog, do you see the proper
output?  If you turn on log_statement, do you see the statements?

---------------------------------------------------------------------------

Ryszard Lach wrote:
> On Mon, Nov 17, 2003 at 09:37:07PM -0500, Bruce Momjian wrote:
> > Ryszard Lach wrote:
> > > 
> > > Hi.
> > > 
> > > I'm trying to set run-time environment in pgsql7.4 so, that it prints
> > > all statements with duration time, but I can't understand why setting
> > > log_min_duration_statement to '0' causes printing to syslog plenty of
> > > lines ending with 'duration: statement:', i.e. without any statement
> > > string (except expected ones). Can anybody help me?
> > 
> > Can you show us some of the log file?  If I do:
> > 	
> 
> Sure.
> 
> Nov 18 10:05:20  postgres[1348]: [318-1] LOG:  duration: 0.297 ms  statement:
> Nov 18 10:05:20  postgres[1311]: [5477-1] LOG:  duration: 0.617 ms  statement:
> Nov 18 10:05:20  postgres[1312]: [5134-1] LOG:  duration: 0.477 ms  statement:
> Nov 18 10:05:20  postgres[1349]: [318-1] LOG:  duration: 0.215 ms  statement:
> Nov 18 10:05:20  postgres[1313]: [5449-1] LOG:  duration: 0.512 ms  statement:
> Nov 18 10:05:20  postgres[1314]: [5534-1] LOG:  duration: 0.420 ms  statement:
> Nov 18 10:05:20  postgres[1330]: [772-1] LOG:  duration: 1.386 ms  statement: SELECT * FROM mytablemius WHERE id = 0;
> Nov 18 10:05:20  postgres[1315]: [5757-1] LOG:  duration: 0.417 ms  statement:
> Nov 18 10:05:20  postgres[1316]: [5885-1] LOG:  duration: 0.315 ms  statement:
> Nov 18 10:05:20  postgres[1317]: [5914-1] LOG:  duration: 0.301 ms  statement:
> Nov 18 10:05:20  postgres[1318]: [5990-1] LOG:  duration: 0.293 ms  statement:
> Nov 18 10:05:20  postgres[1319]: [6009-1] LOG:  duration: 0.211 ms  statement:
> Nov 18 10:05:20  postgres[1320]: [6039-1] LOG:  duration: 0.188 ms  statement:
> 
> 
> this is with setting
> 
> log_duration = false
> log_statement = false
> log_min_duration_statement = 0
> 
> The amount of lines containing statement string is nearly the same ase before
> upgrade (from 7.3), all other lines are extra.
> 
> I don't know if this can be a reason, this is on a pretty busy machine (ca. 100
> selects/second, but loadavg lower then 0.9), I'm logging postgres through syslog.
> 
> Richard.
> 
> -- 
> "First they ignore you. Then they laugh at you. Then they
> fight you. Then you win." - Mohandas Gandhi.
> 

-- 
  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



^ permalink  raw  reply  [nested|flat] 12+ messages in thread

* Re: duration logging setting in 7.4
  2003-11-17 22:20 duration logging setting in 7.4 Ryszard Lach <siaco@autograf.pl>
  2003-11-18 02:37 ` Re: duration logging setting in 7.4 Bruce Momjian <pgman@candle.pha.pa.us>
  2003-11-18 09:16   ` Re: duration logging setting in 7.4 Ryszard Lach <siaco@autograf.pl>
  2003-11-18 15:07     ` Re: duration logging setting in 7.4 Bruce Momjian <pgman@candle.pha.pa.us>
@ 2003-11-19 18:38       ` Ryszard Lach <ryszard@lach.name>
  2003-11-19 18:58         ` Re: duration logging setting in 7.4 Bruce Momjian <pgman@candle.pha.pa.us>
  0 siblings, 1 reply; 12+ messages in thread

From: Ryszard Lach @ 2003-11-19 18:38 UTC (permalink / raw)
  To: Bruce Momjian <pgman@candle.pha.pa.us>; +Cc: pgsql-performance

On Tue, Nov 18, 2003 at 10:07:48AM -0500, Bruce Momjian wrote:
> 
> Wow, that is strange.  If you don't use syslog, do you see the proper
> output?

I've just checked this. It behaves exactly the same way.


> If you turn on log_statement, do you see the statements?

If I turn on log_min_duration_statement (i.e. set to 0), log_statement and
log_duration, then I receive something like that

Nov 17 22:33:27 postgres[22945]: [29231-1] LOG:  statement:
Nov 17 22:33:27 postgres[22945]: [29232-1] LOG:  duration: 0.198 ms
Nov 17 22:33:27 postgres[22945]: [29233-1] LOG:  duration: 0.198 ms  statement:
Nov 17 22:33:27 postgres[22946]: [29231-1] LOG:  statement:
Nov 17 22:33:27 postgres[22946]: [29232-1] LOG:  duration: 0.191 ms
Nov 17 22:33:27 postgres[22946]: [29233-1] LOG:  duration: 0.191 ms  statement:
Nov 17 22:33:27 postgres[22678]: [147134-1] LOG:  statement: select * from cms where id=1465
Nov 17 22:33:27 postgres[22679]: [154907-1] LOG:  statement:
Nov 17 22:33:27 postgres[22679]: [154908-1] LOG:  duration: 0.867 ms
Nov 17 22:33:27 postgres[22679]: [154909-1] LOG:  duration: 0.867 ms  statement:
Nov 17 22:33:27 postgres[22678]: [147135-1] LOG:  duration: 1.458 ms
Nov 17 22:33:27 postgres[22678]: [147136-1] LOG:  duration: 1.458 ms  statement: select * from cms where id=1465
Nov 17 22:33:27 postgres[22680]: [158366-1] LOG:  statement:
Nov 17 22:33:27 postgres[22680]: [158367-1] LOG:  duration: 0.620 ms
Nov 17 22:33:27 postgres[22680]: [158368-1] LOG:  duration: 0.620 ms  statement:
Nov 17 22:33:27 postgres[22681]: [161294-1] LOG:  statement:
Nov 17 22:33:27 postgres[22681]: [161295-1] LOG:  duration: 0.650 ms

It seems, that log_duration is responsible only for "duration:" lines,
log_statement - for "statement:" ones, and "log_min_duration_statement" - for
"duration: .* statement:". I think, that the above output should exclude losing
of data by syslog from further delibarations. Do you thing that could be
a bug? 

There is another one thing: logs from the same database running on 7.3 and the same
application contained lines like 'select getdatabaseencoding()', 'select
datestyle()' and similar (not used by application explicite, probably
added by JDBC driver), now they are missed - maybe this is the
problem?

Richard.

-- 
"First they ignore you. Then they laugh at you. Then they
fight you. Then you win." - Mohandas Gandhi.



^ permalink  raw  reply  [nested|flat] 12+ messages in thread

* Re: duration logging setting in 7.4
  2003-11-17 22:20 duration logging setting in 7.4 Ryszard Lach <siaco@autograf.pl>
  2003-11-18 02:37 ` Re: duration logging setting in 7.4 Bruce Momjian <pgman@candle.pha.pa.us>
  2003-11-18 09:16   ` Re: duration logging setting in 7.4 Ryszard Lach <siaco@autograf.pl>
  2003-11-18 15:07     ` Re: duration logging setting in 7.4 Bruce Momjian <pgman@candle.pha.pa.us>
  2003-11-19 18:38       ` Re: duration logging setting in 7.4 Ryszard Lach <ryszard@lach.name>
@ 2003-11-19 18:58         ` Bruce Momjian <pgman@candle.pha.pa.us>
  2003-11-19 19:28           ` Re: duration logging setting in 7.4 Ryszard Lach <siaco@autograf.pl>
  0 siblings, 1 reply; 12+ messages in thread

From: Bruce Momjian @ 2003-11-19 18:58 UTC (permalink / raw)
  To: Ryszard Lach <ryszard@lach.name>; +Cc: pgsql-performance

Ryszard Lach wrote:
> If I turn on log_min_duration_statement (i.e. set to 0), log_statement and
> log_duration, then I receive something like that
> 
> Nov 17 22:33:27 postgres[22945]: [29231-1] LOG:  statement:
> Nov 17 22:33:27 postgres[22945]: [29232-1] LOG:  duration: 0.198 ms
> Nov 17 22:33:27 postgres[22945]: [29233-1] LOG:  duration: 0.198 ms  statement:
> Nov 17 22:33:27 postgres[22946]: [29231-1] LOG:  statement:
> Nov 17 22:33:27 postgres[22946]: [29232-1] LOG:  duration: 0.191 ms
> Nov 17 22:33:27 postgres[22946]: [29233-1] LOG:  duration: 0.191 ms  statement:
> Nov 17 22:33:27 postgres[22678]: [147134-1] LOG:  statement: select * from cms where id=1465
> Nov 17 22:33:27 postgres[22679]: [154907-1] LOG:  statement:
> Nov 17 22:33:27 postgres[22679]: [154908-1] LOG:  duration: 0.867 ms
> Nov 17 22:33:27 postgres[22679]: [154909-1] LOG:  duration: 0.867 ms  statement:
> Nov 17 22:33:27 postgres[22678]: [147135-1] LOG:  duration: 1.458 ms
> Nov 17 22:33:27 postgres[22678]: [147136-1] LOG:  duration: 1.458 ms  statement: select * from cms where id=1465
> Nov 17 22:33:27 postgres[22680]: [158366-1] LOG:  statement:
> Nov 17 22:33:27 postgres[22680]: [158367-1] LOG:  duration: 0.620 ms
> Nov 17 22:33:27 postgres[22680]: [158368-1] LOG:  duration: 0.620 ms  statement:
> Nov 17 22:33:27 postgres[22681]: [161294-1] LOG:  statement:
> Nov 17 22:33:27 postgres[22681]: [161295-1] LOG:  duration: 0.650 ms
> 
> It seems, that log_duration is responsible only for "duration:" lines,
> log_statement - for "statement:" ones, and "log_min_duration_statement" - for
> "duration: .* statement:". I think, that the above output should exclude losing
> of data by syslog from further delibarations. Do you thing that could be
> a bug? 

Yes, the problem is not related to syslog.  Are you using prepared
queries, perhaps?  I don't think those show the query, but it seems we
should display something better than blanks.

> There is another one thing: logs from the same database running on 7.3 and the same
> application contained lines like 'select getdatabaseencoding()', 'select
> datestyle()' and similar (not used by application explicite, probably
> added by JDBC driver), now they are missed - maybe this is the
> problem?

No, those are missing because the new 7.4 wire protocol doesn't require
those queries anymore --- the data is send automatically.

-- 
  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



^ permalink  raw  reply  [nested|flat] 12+ messages in thread

* Re: duration logging setting in 7.4
  2003-11-17 22:20 duration logging setting in 7.4 Ryszard Lach <siaco@autograf.pl>
  2003-11-18 02:37 ` Re: duration logging setting in 7.4 Bruce Momjian <pgman@candle.pha.pa.us>
  2003-11-18 09:16   ` Re: duration logging setting in 7.4 Ryszard Lach <siaco@autograf.pl>
  2003-11-18 15:07     ` Re: duration logging setting in 7.4 Bruce Momjian <pgman@candle.pha.pa.us>
  2003-11-19 18:38       ` Re: duration logging setting in 7.4 Ryszard Lach <ryszard@lach.name>
  2003-11-19 18:58         ` Re: duration logging setting in 7.4 Bruce Momjian <pgman@candle.pha.pa.us>
@ 2003-11-19 19:28           ` Ryszard Lach <siaco@autograf.pl>
  2003-11-19 19:42             ` Re: duration logging setting in 7.4 Bruce Momjian <pgman@candle.pha.pa.us>
  0 siblings, 1 reply; 12+ messages in thread

From: Ryszard Lach @ 2003-11-19 19:28 UTC (permalink / raw)
  To: Bruce Momjian <pgman@candle.pha.pa.us>; +Cc: pgsql-performance

On Wed, Nov 19, 2003 at 01:58:27PM -0500, Bruce Momjian wrote:
> Ryszard Lach wrote:
> 
> > There is another one thing: logs from the same database running on 7.3 and the same
> > application contained lines like 'select getdatabaseencoding()', 'select
> > datestyle()' and similar (not used by application explicite, probably
> > added by JDBC driver), now they are missed - maybe this is the
> > problem?
> 
> No, those are missing because the new 7.4 wire protocol doesn't require
> those queries anymore --- the data is send automatically.
> 

Mayby this is a solution? Because of some
charset-related problems we are still using an old (AFAiR modified)
version of JDBC driver. I'm not a programmer, but I think and don't know
what JDBC driver does, but maybe it sends from client side those queries
and server doesn't know what to do with them? I'll ask our programmers
to try with 7.4 driver and tell you about results.

Richard.

-- 
"First they ignore you. Then they laugh at you. Then they
fight you. Then you win." - Mohandas Gandhi.



^ permalink  raw  reply  [nested|flat] 12+ messages in thread

* Re: duration logging setting in 7.4
  2003-11-17 22:20 duration logging setting in 7.4 Ryszard Lach <siaco@autograf.pl>
  2003-11-18 02:37 ` Re: duration logging setting in 7.4 Bruce Momjian <pgman@candle.pha.pa.us>
  2003-11-18 09:16   ` Re: duration logging setting in 7.4 Ryszard Lach <siaco@autograf.pl>
  2003-11-18 15:07     ` Re: duration logging setting in 7.4 Bruce Momjian <pgman@candle.pha.pa.us>
  2003-11-19 18:38       ` Re: duration logging setting in 7.4 Ryszard Lach <ryszard@lach.name>
  2003-11-19 18:58         ` Re: duration logging setting in 7.4 Bruce Momjian <pgman@candle.pha.pa.us>
  2003-11-19 19:28           ` Re: duration logging setting in 7.4 Ryszard Lach <siaco@autograf.pl>
@ 2003-11-19 19:42             ` Bruce Momjian <pgman@candle.pha.pa.us>
  0 siblings, 0 replies; 12+ messages in thread

From: Bruce Momjian @ 2003-11-19 19:42 UTC (permalink / raw)
  To: Ryszard Lach <siaco@autograf.pl>; +Cc: pgsql-performance

Ryszard Lach wrote:
> On Wed, Nov 19, 2003 at 01:58:27PM -0500, Bruce Momjian wrote:
> > Ryszard Lach wrote:
> > 
> > > There is another one thing: logs from the same database running on 7.3 and the same
> > > application contained lines like 'select getdatabaseencoding()', 'select
> > > datestyle()' and similar (not used by application explicite, probably
> > > added by JDBC driver), now they are missed - maybe this is the
> > > problem?
> > 
> > No, those are missing because the new 7.4 wire protocol doesn't require
> > those queries anymore --- the data is send automatically.
> > 
> 
> Mayby this is a solution? Because of some
> charset-related problems we are still using an old (AFAiR modified)
> version of JDBC driver. I'm not a programmer, but I think and don't know
> what JDBC driver does, but maybe it sends from client side those queries
> and server doesn't know what to do with them? I'll ask our programmers
> to try with 7.4 driver and tell you about results.

Also, try plain psql and issue a query and see if it appears.

-- 
  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



^ permalink  raw  reply  [nested|flat] 12+ messages in thread

* Re: duration logging setting in 7.4
  2003-11-17 22:20 duration logging setting in 7.4 Ryszard Lach <siaco@autograf.pl>
  2003-11-18 02:37 ` Re: duration logging setting in 7.4 Bruce Momjian <pgman@candle.pha.pa.us>
  2003-11-18 09:16   ` Re: duration logging setting in 7.4 Ryszard Lach <siaco@autograf.pl>
@ 2003-11-21 00:17     ` Tom Lane <tgl@sss.pgh.pa.us>
  2003-11-21 08:53       ` Re: duration logging setting in 7.4 Ryszard Lach <siaco@autograf.pl>
  2003-11-21 10:18       ` Re: duration logging setting in 7.4 Ryszard Lach <ryszard@lach.name>
  1 sibling, 2 replies; 12+ messages in thread

From: Tom Lane @ 2003-11-21 00:17 UTC (permalink / raw)
  To: Ryszard Lach <siaco@autograf.pl>; +Cc: pgsql-performance@postgresql.org, Bruce Momjian <pgman@candle.pha.pa.us>

Ryszard Lach <siaco@autograf.pl> writes:
> Nov 18 10:05:20  postgres[1348]: [318-1] LOG:  duration: 0.297 ms  statement:
> Nov 18 10:05:20  postgres[1311]: [5477-1] LOG:  duration: 0.617 ms  statement:
> Nov 18 10:05:20  postgres[1312]: [5134-1] LOG:  duration: 0.477 ms  statement:
> Nov 18 10:05:20  postgres[1349]: [318-1] LOG:  duration: 0.215 ms  statement:
> Nov 18 10:05:20  postgres[1313]: [5449-1] LOG:  duration: 0.512 ms  statement:
> Nov 18 10:05:20  postgres[1314]: [5534-1] LOG:  duration: 0.420 ms  statement:
> Nov 18 10:05:20  postgres[1330]: [772-1] LOG:  duration: 1.386 ms  statement: SELECT * FROM mytablemius WHERE id = 0;
> Nov 18 10:05:20  postgres[1315]: [5757-1] LOG:  duration: 0.417 ms  statement:
> Nov 18 10:05:20  postgres[1316]: [5885-1] LOG:  duration: 0.315 ms  statement:
> Nov 18 10:05:20  postgres[1317]: [5914-1] LOG:  duration: 0.301 ms  statement:
> Nov 18 10:05:20  postgres[1318]: [5990-1] LOG:  duration: 0.293 ms  statement:
> Nov 18 10:05:20  postgres[1319]: [6009-1] LOG:  duration: 0.211 ms  statement:
> Nov 18 10:05:20  postgres[1320]: [6039-1] LOG:  duration: 0.188 ms  statement:


Is it possible that you're sending a lot of queries that have an initial
newline in the text?  I'd expect the first line of log output for such a
query to look as above.

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 12+ messages in thread

* Re: duration logging setting in 7.4
  2003-11-17 22:20 duration logging setting in 7.4 Ryszard Lach <siaco@autograf.pl>
  2003-11-18 02:37 ` Re: duration logging setting in 7.4 Bruce Momjian <pgman@candle.pha.pa.us>
  2003-11-18 09:16   ` Re: duration logging setting in 7.4 Ryszard Lach <siaco@autograf.pl>
  2003-11-21 00:17     ` Re: duration logging setting in 7.4 Tom Lane <tgl@sss.pgh.pa.us>
@ 2003-11-21 08:53       ` Ryszard Lach <siaco@autograf.pl>
  1 sibling, 0 replies; 12+ messages in thread

From: Ryszard Lach @ 2003-11-21 08:53 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-performance@postgresql.org, Bruce Momjian <pgman@candle.pha.pa.us>

On Thu, Nov 20, 2003 at 07:17:01PM -0500, Tom Lane wrote:
> 
> 
> Is it possible that you're sending a lot of queries that have an initial
> newline in the text?  I'd expect the first line of log output for such a
> query to look as above.

I don't think so, but it is possible, that queries have e.g. two
semicolons on end - I've just noticed, that separating two queries with
two or more semicolons gives one empty log entry for each redundand
semicolon. We'll debug our application keeping this in mind.

Richard.

-- 
"First they ignore you. Then they laugh at you. Then they
fight you. Then you win." - Mohandas Gandhi.



^ permalink  raw  reply  [nested|flat] 12+ messages in thread

* Re: duration logging setting in 7.4
  2003-11-17 22:20 duration logging setting in 7.4 Ryszard Lach <siaco@autograf.pl>
  2003-11-18 02:37 ` Re: duration logging setting in 7.4 Bruce Momjian <pgman@candle.pha.pa.us>
  2003-11-18 09:16   ` Re: duration logging setting in 7.4 Ryszard Lach <siaco@autograf.pl>
  2003-11-21 00:17     ` Re: duration logging setting in 7.4 Tom Lane <tgl@sss.pgh.pa.us>
@ 2003-11-21 10:18       ` Ryszard Lach <ryszard@lach.name>
  2003-11-21 14:54         ` Re: duration logging setting in 7.4 Tom Lane <tgl@sss.pgh.pa.us>
  1 sibling, 1 reply; 12+ messages in thread

From: Ryszard Lach @ 2003-11-21 10:18 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-performance@postgresql.org, Bruce Momjian <pgman@candle.pha.pa.us>


Hi, again.

I've turned on only log_connections and log_statement. See the following
log fragment (I've included lines only related to opening of new
connection);

Nov 21 11:06:44 postgres[3359]: [3-1] LOG:  connection received: host= port=
Nov 21 11:06:44 postgres[3359]: [4-1] LOG:  connection authorized: user=pracuj database=pracuj
Nov 21 11:06:44 postgres[3359]: [5-1] LOG:  statement: set datestyle to 'ISO'; select version(), case when pg_encoding_to_char(1) = 'SQL_ASCII' then 'UNKNOWN' else
Nov 21 11:06:44 postgres[3359]: [5-2]  getdatabaseencoding() end;
Nov 21 11:06:44 postgres[3359]: [6-1] LOG:  statement:
Nov 21 11:06:44 postgres[3359]: [7-1] LOG:  statement: select * from ...

Nov 21 11:06:45 postgres[3376]: [3-1] LOG:  connection received: host= port=
Nov 21 11:06:45 postgres[3376]: [4-1] LOG:  connection authorized: user=pracuj database=pracuj
Nov 21 11:06:45 postgres[3376]: [5-1] LOG:  statement: set datestyle to 'ISO'; select version(), case when pg_encoding_to_char(1) = 'S
QL_ASCII' then ' else
Nov 21 11:06:45 postgres[3376]: [5-2]  getdatabaseencoding() end;
Nov 21 11:06:45 postgres[3376]: [6-1] LOG:  statement:

It seems, that empty statements are generated during opening of
connection.

Please, note also:

1. We are using an older jdbc driver (pgjdbc2)
2. We ar using encoding in URL
(jdbc:postgresql://localhost:5432/database?charSet=iso-8859-1)

Richard.

-- 
"First they ignore you. Then they laugh at you. Then they
fight you. Then you win." - Mohandas Gandhi.



^ permalink  raw  reply  [nested|flat] 12+ messages in thread

* Re: duration logging setting in 7.4
  2003-11-17 22:20 duration logging setting in 7.4 Ryszard Lach <siaco@autograf.pl>
  2003-11-18 02:37 ` Re: duration logging setting in 7.4 Bruce Momjian <pgman@candle.pha.pa.us>
  2003-11-18 09:16   ` Re: duration logging setting in 7.4 Ryszard Lach <siaco@autograf.pl>
  2003-11-21 00:17     ` Re: duration logging setting in 7.4 Tom Lane <tgl@sss.pgh.pa.us>
  2003-11-21 10:18       ` Re: duration logging setting in 7.4 Ryszard Lach <ryszard@lach.name>
@ 2003-11-21 14:54         ` Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 12+ messages in thread

From: Tom Lane @ 2003-11-21 14:54 UTC (permalink / raw)
  To: Ryszard Lach <ryszard@lach.name>; +Cc: pgsql-performance@postgresql.org, Bruce Momjian <pgman@candle.pha.pa.us>

Ryszard Lach <ryszard@lach.name> writes:
> It seems, that empty statements are generated during opening of
> connection.

Hmm.  Try asking about that on the pgsql-jdbc list.  I think the JDBC
driver must actually be sending empty commands.

Looking at the backend code, I realize that 7.4 will emit LOG: entries
for empty query strings, whereas prior releases would not.  This isn't
a bug IMHO, but it does explain why you are noticing output that wasn't
there before you updated to 7.4.

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 12+ messages in thread


end of thread, other threads:[~2003-11-21 14:54 UTC | newest]

Thread overview: 12+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2003-11-17 22:20 duration logging setting in 7.4 Ryszard Lach <siaco@autograf.pl>
2003-11-18 02:37 ` Bruce Momjian <pgman@candle.pha.pa.us>
2003-11-18 09:16   ` Ryszard Lach <siaco@autograf.pl>
2003-11-18 15:07     ` Bruce Momjian <pgman@candle.pha.pa.us>
2003-11-19 18:38       ` Ryszard Lach <ryszard@lach.name>
2003-11-19 18:58         ` Bruce Momjian <pgman@candle.pha.pa.us>
2003-11-19 19:28           ` Ryszard Lach <siaco@autograf.pl>
2003-11-19 19:42             ` Bruce Momjian <pgman@candle.pha.pa.us>
2003-11-21 00:17     ` Tom Lane <tgl@sss.pgh.pa.us>
2003-11-21 08:53       ` Ryszard Lach <siaco@autograf.pl>
2003-11-21 10:18       ` Ryszard Lach <ryszard@lach.name>
2003-11-21 14:54         ` Tom Lane <tgl@sss.pgh.pa.us>

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