Re: vacuum vs open transactions - Mailing list pgsql-general

From Martijn van Oosterhout
Subject Re: vacuum vs open transactions
Date
Msg-id 20050113181108.GC7067@svana.org
Whole thread Raw
In response to Re: vacuum vs open transactions  ("Ed L." <pgsql@bluepolka.net>)
Responses Re: vacuum vs open transactions  (Michael Fuhr <mike@fuhr.org>)
List pgsql-general
On Thu, Jan 13, 2005 at 08:44:56AM -0700, Ed L. wrote:
> 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.

Wouldn't the transaction ID be more useful. An earlier transaction ID
obviously started earlier. So you should be able to identify the oldest
transaction. Would the transaction ID field in pg_locks do?

Hope this helps,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.

Attachment

pgsql-general by date:

Previous
From: Doug McNaught
Date:
Subject: Re: Adding UNIQUE constraint on NULL column
Next
From: Michael Fuhr
Date:
Subject: Re: allowing connections from additional hosts without a restart?