Re: vacuum vs open transactions

Поиск
Список
Период
Сортировка
От Ed L.
Тема Re: vacuum vs open transactions
Дата
Msg-id 200501130844.57129.pgsql@bluepolka.net
обсуждение исходный текст
Ответ на Re: vacuum vs open transactions  (Michael Fuhr <mike@fuhr.org>)
Ответы Re: vacuum vs open transactions  (Michael Fuhr <mike@fuhr.org>)
Re: vacuum vs open transactions  (Martijn van Oosterhout <kleptog@svana.org>)
Список pgsql-general
On Wednesday January 12 2005 11:30, Michael Fuhr wrote:
> On Wed, Jan 12, 2005 at 11:49:12AM -0700, Ed L. wrote:
> > Is it possible via SQL query to tell how long a transaction has been
> > open?
>
> I'm not aware of a way to find out when a transaction started, but
> if you have stats_command_string enabled then you can query
> pg_stat_activity to see when a session's current query started.

Yes, I see that in 7.4 (not in 7.3).  But my purpose would be to remotely
identify long-open transactions that are causing table bloat by making
vacuum fail to reclaim space, so it seems I need the transaction start
time, not query start time.  Most likely this situation occurs when 1)
someone starts a transaction in psql and then leaves it there, or 2) an
application opens a transaction prior to getting user input.

Ed


В списке pgsql-general по дате отправления:

Предыдущее
От: "Ed L."
Дата:
Сообщение: Re: vacuum vs open transactions
Следующее
От: Greg Stark
Дата:
Сообщение: Re: [HACKERS] Much Ado About COUNT(*)