Re: proposal for 9.5: monitoring lock time for slow queries - Mailing list pgsql-hackers

From Pavel Stehule
Subject Re: proposal for 9.5: monitoring lock time for slow queries
Date
Msg-id CAFj8pRB-gotm4qZK3fPLO62ot0S3W6GAOEhmQgT6KyBpwPqqxw@mail.gmail.com
Whole thread Raw
In response to Re: proposal for 9.5: monitoring lock time for slow queries  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers



2014-08-13 7:19 GMT+02:00 Tom Lane <tgl@sss.pgh.pa.us>:
Michael Paquier <michael.paquier@gmail.com> writes:
> Doing a join on pg_stat_activity and pg_locks is not going to help
> much as you could only get the moment when query has started or its
> state has changed. Have you thought about the addition of a new column
> in pg_locks containing the timestamp of the moment a lock has been
> taken? I am sure that we are concerned about the performance impact
> that extra calls to gettimeofday could have though...

In theory this could be driven off the same gettimeofday needed to
start the deadlock_timeout timer.  Not sure how messy that'd be.

we use it in out custom patch without problems

Pavel
 

                        regards, tom lane

pgsql-hackers by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: proposal for 9.5: monitoring lock time for slow queries
Next
From: Michael Paquier
Date:
Subject: Re: Support for N synchronous standby servers