Re: long running transactions

От: Tom Lane
Тема: Re: long running transactions
Дата: ,
Msg-id: 25404.1160497420@sss.pgh.pa.us
(см: обсуждение, исходный текст)
Ответ на: long running transactions  (Tobias Brox)
Ответы: Re: long running transactions  (Tobias Brox)
Список: pgsql-performance

Скрыть дерево обсуждения

long running transactions  (Tobias Brox, )
 Re: long running transactions  (Tom Lane, )
  Re: long running transactions  (Tobias Brox, )
   Re: long running transactions  (Tobias Brox, )
    Re: long running transactions  (Tom Lane, )
     Re: long running transactions  (Tobias Brox, )
      Re: long running transactions  (Tom Lane, )
       Re: long running transactions  (Tobias Brox, )
        Re: long running transactions  (Tom Lane, )
         Re: long running transactions  (Tobias Brox, )
          Re: long running transactions  (Tom Lane, )
           Re: long running transactions  (Tobias Brox, )
            Re: long running transactions  (Tom Lane, )
             Re: long running transactions  (Tobias Brox, )

Tobias Brox <> writes:
> If pg_stat_activity.query_start actually is the start time of the
> transaction,

... but it isn't.

> Is there any way to find the longest running transaction?

Look in pg_locks to see the lowest-numbered transaction ID --- each
transaction will be holding exclusive lock on its own XID.  You can
correlate that back to pg_stat_activity via the PID.

            regards, tom lane


В списке pgsql-performance по дате сообщения:

От: Tom Lane
Дата:
Сообщение: Re: Scrub one large table against another
От: Brendan Curran
Дата:
Сообщение: Re: Scrub one large table against another