Re: vacuum vs open transactions

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: "Ed L(dot)" <pgsql(at)bluepolka(dot)net>
Cc: Michael Fuhr <mike(at)fuhr(dot)org>, Scott Marlowe <smarlowe(at)g2switchworks(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: vacuum vs open transactions
Date: 2005-01-13 18:11:09
Message-ID: 20050113181108.GC7067@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)svana(dot)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.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message John Cunningham 2005-01-13 18:15:52 pgpool
Previous Message Michael Fuhr 2005-01-13 18:01:21 Re: allowing connections from additional hosts without a restart?