pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
"slow lock" log in addition to log_min_duration_statement ?
2+ messages / 2 participants
[nested] [flat]

* "slow lock" log in addition to log_min_duration_statement ?
@ 2010-11-10 20:28  Bryce Nesbitt <bryce2@obviously.com>
  0 siblings, 1 reply; 2+ messages in thread

From: Bryce Nesbitt @ 2010-11-10 20:28 UTC (permalink / raw)
  To: pgsql-sql

I have a cluster with log_min_duration_statement set to log slow 
queries. Presently what I'm tracking down is almost certainly a lock 
problem.  Is there any analog of log_min_duration_statement for locks?  
If there is a lock on a certain critical tables for more than a few 
hundredths of a second I want to know.

Similarly in pg_stat_activity, is there a way to get the parameters to 
the current_query?  I see the placeholders (e.g. $1, $2) but not the data.

This is with PostgreSQL 8.3.4
Thanks!



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

* Re: "slow lock" log in addition to log_min_duration_statement ?
@ 2010-11-12 15:50  Joshua Tolley <eggyknap@gmail.com>
  parent: Bryce Nesbitt <bryce2@obviously.com>
  0 siblings, 0 replies; 2+ messages in thread

From: Joshua Tolley @ 2010-11-12 15:50 UTC (permalink / raw)
  To: Bryce Nesbitt <bryce2@obviously.com>; +Cc: pgsql-sql

On Wed, Nov 10, 2010 at 12:28:46PM -0800, Bryce Nesbitt wrote:
> I have a cluster with log_min_duration_statement set to log slow  
> queries. Presently what I'm tracking down is almost certainly a lock  
> problem.  Is there any analog of log_min_duration_statement for locks?   
> If there is a lock on a certain critical tables for more than a few  
> hundredths of a second I want to know.

You could try log_lock_waits:
http://www.postgresql.org/docs/8.3/interactive/runtime-config-logging.html#GUC-LOG-LOCK-WAITS

It's defined in terms of deadlock_timeout, and reducing that to "a few
hundredths of a second" like you're interested in might cause all kinds of
load from the deadlock detector.

--
Joshua Tolley / eggyknap
End Point Corporation
http://www.endpoint.com

Attachments:

  [application/pgp-signature] signature.asc (196B, ../../4cdd6266.08c08e0a.59ee.ffffe39b@mx.google.com/2-signature.asc)
  download

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


end of thread, other threads:[~2010-11-12 15:50 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2010-11-10 20:28 "slow lock" log in addition to log_min_duration_statement ? Bryce Nesbitt <bryce2@obviously.com>
2010-11-12 15:50 ` Joshua Tolley <eggyknap@gmail.com>

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