X-Original-To: pgsql-performance@postgresql.org Received: from spampd.localdomain (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id C0371474E5C for ; Tue, 25 Mar 2003 08:12:31 -0500 (EST) Received: from mail.libertyrms.com (unknown [209.167.124.227]) by postgresql.org (Postfix) with ESMTP id CA616474E44 for ; Tue, 25 Mar 2003 08:12:30 -0500 (EST) Received: from andrew by mail.libertyrms.com with local (Exim 3.22 #3 (Debian)) id 18xoEE-0005Pk-00 for ; Tue, 25 Mar 2003 08:12:34 -0500 Date: Tue, 25 Mar 2003 08:12:34 -0500 From: Andrew Sullivan To: pgsql-performance@postgresql.org Subject: Finding the PID keeping a transaction open Message-ID: <20030325081233.B18817@mail.libertyrms.com> Mail-Followup-To: Andrew Sullivan , pgsql-performance@postgresql.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i X-Spam-Status: No, hits=-12.1 required=5.0 tests=BAYES_10,USER_AGENT_MUTT autolearn=ham version=2.50 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) X-Archive-Number: 200303/172 X-Sequence-Number: 1470 Hi, Using 7.2.3 and 7.2.4 (the last .3 is being retired this weekend). I'm struggling with an application which is keeping open a transaction (or, likely from the results, more than one) against a pair of frequently-updated tables. Unfortunately, the frequently-updated tables are also a performance bottleneck. These tables are small, but their physical size is very large, because of all the updates. The problem is, of course, that vacuum isn't working because _something_ is holding open the transaction. But I can't tell what. We connect to the database via JDBC; we have a pool which recycles its connections. In the next version of the pool, the autocommit foolishness (end transaction and issue immediate BEGIN) is gone, but that won't help me in the case at hand. What I'm trying to figure out is whether there is a way to learn which pids are responsible for the long-running transaction(s) that touch(es) the candidate tables. Then I can find a way of paring those processes back, so that I can get vacuum to succeed. I think there must be a way with gdb, but I'm stumped. Any suggestions? The time a process has been living is not a guide, because the connections (and hence processes) get recycled in the pool. A -- ---- Andrew Sullivan 204-4141 Yonge Street Liberty RMS Toronto, Ontario Canada M2P 2A8 +1 416 646 3304 x110