From: Tom Lane <tgl@sss.pgh.pa.us>
To: Tobias Brox <tobias@nordicbet.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: long running transactions
Date: Tue, 10 Oct 2006 12:23:40 -0400
Message-ID: <25404.1160497420@sss.pgh.pa.us> (raw)
In-Reply-To: <20061010161027.GA18908@oppetid.no>
References: <20061010161027.GA18908@oppetid.no>
Tobias Brox <tobias@nordicbet.com> writes:
> If pg_stat_activity.query_start actually is the start time of the
> transaction,
... but it isn't.
> Is there any way to find the longest running transaction?
Look in pg_locks to see the lowest-numbered transaction ID --- each
transaction will be holding exclusive lock on its own XID. You can
correlate that back to pg_stat_activity via the PID.
regards, tom lane
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: tgl@sss.pgh.pa.us, tobias@nordicbet.com
Subject: Re: long running transactions
In-Reply-To: <25404.1160497420@sss.pgh.pa.us>
* 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