pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tobias Brox <tobias@nordicbet.com>
To: Sachchida Ojha <sojha@secure-elements.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Long running transaction in pg_activity_log
Date: Wed, 22 Aug 2007 23:08:58 +0200
Message-ID: <20070822210858.GH21893@oppetid.no> (raw)
In-Reply-To: <E099DB9EF394534CBA0F62ED03CF3BBF0607772D@EXVS01.IceMAIL.com>
References: <E099DB9EF394534CBA0F62ED03CF3BBF0607772D@EXVS01.IceMAIL.com>

[Sachchida Ojha - Wed at 04:40:09PM -0400]
> I see some long running transaction in my pg_activity_log table. My app
> becomes almost unusable. My question is 
> How can I query the database to see what sql these transactions are
> running. 

"<IDLE> in transaction" means that no sql query is running at the
moment.

Most probably it's a problem with the application, it starts a
transaction, but does not close it (through a commit or rollback).  This
is very harmful for the performance, as the hours, days and weeks pass
by any database supporting transactions will get problems.

Restarting the application and vacuuming is a one-time-shot which should
solve the problem for a short while.  For a permanent fix, the
application needs to be fixed, or you'll have to ensure that the
autocommit feature is used.



view thread (4+ messages)  latest in thread

Message-ID: <20070822210858.GH21893@oppetid.no>
Permalink:  ../20070822210858.GH21893@oppetid.no/
Also on:    postgresql.org/message-id/20070822210858.GH21893@oppetid.no

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: tobias@nordicbet.com, sojha@secure-elements.com
  Subject: Re: Long running transaction in pg_activity_log
  In-Reply-To: <20070822210858.GH21893@oppetid.no>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox