Re: Finding if old transactions are running...

From: Vsevolod Lobko <seva(at)sevasoft(dot)kiev(dot)ua>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>, Christopher Browne <cbbrowne(at)acm(dot)org>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Finding if old transactions are running...
Date: 2005-02-24 18:47:39
Message-ID: 20050224184739.GB85119@robin.ip.net.ua
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Feb 24, 2005 at 11:14:07AM -0500, Tom Lane wrote:
> Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au> writes:
> >> It sure would be nice to be able to have a way to query the start time
> >> of the eldest transaction on the system. If that could be done at a
> >> not-too-high cost, it would be eminently helpful for various sorts of
> >> maintenance processes so that you could assortedly:
>
> > You can get that from pg_stat_activity, if you have the relevant stats
> > turned on.
>
> pg_stat_activity will tell you about the oldest active query, but not
> about oldest open transaction.

You can get list of currently runing transactions from pg_locks table,
but no start time...
But if you can remember oldest transaction_id from the last vacuum then
you got what you need: if oldest transaction still here - you not
need to vacuum

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Greg Stark 2005-02-24 19:18:43 [Mail Delivery System <Mailer-Daemon@xeocode.com>] Mail delivery failed: returning message to sender
Previous Message Greg Stark 2005-02-24 18:34:36 Re: [pgsql-hackers-win32] win32 performance - fsync question