Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1W37uL-0001B1-M1 for pgsql-performance@arkaria.postgresql.org; Tue, 14 Jan 2014 17:36:09 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1W37uL-0004RD-4K for pgsql-performance@arkaria.postgresql.org; Tue, 14 Jan 2014 17:36:09 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1W37uK-0004R6-0v for pgsql-performance@postgresql.org; Tue, 14 Jan 2014 17:36:08 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1W37uH-0000DA-FP for pgsql-performance@postgresql.org; Tue, 14 Jan 2014 17:36:07 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id s0EHa16L019783; Tue, 14 Jan 2014 12:36:01 -0500 From: Tom Lane To: Josh Kupershmidt cc: pgsql-performance@postgresql.org, Matt Klein Subject: Re: COMMIT stuck for days after bulk delete In-reply-to: References: Comments: In-reply-to Josh Kupershmidt message dated "Tue, 14 Jan 2014 11:51:42 -0500" Date: Tue, 14 Jan 2014 12:36:01 -0500 Message-ID: <19782.1389720961@sss.pgh.pa.us> X-Pg-Spam-Score: -2.0 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-performance Precedence: bulk Sender: pgsql-performance-owner@postgresql.org Josh Kupershmidt writes: > We have a 9.1.11 backend (Ubuntu 12.04 x86_64, m1.medium EC2 instance) > which seems to be stuck at COMMIT for 2 days now: > ... > The transaction behind that COMMIT has been the only thing running on > this Postgres instance for the past 3 days or so, since Postgres was > started on that machine. I spun the EC2 instance for this database up > solely to test a database subsetting process, which is what the > transaction was doing before it got stuck at COMMIT -- using a bunch > of DELETEs and ALTER TABLE ... DROP|ADD CONSTRAINTs to delete 90% or > so of our data in order to be able to pg_dump a slimmed-down > development copy. A plausible guess is that the backend is running around trying to verify that some deferred foreign key constraints still hold. But without knowing what your schema is, that's only a guess. If that is it, a likely solution is to drop *all* the FK constraints before doing the bulk delete, then (in a new transaction, probably) recreate the ones you still want. regards, tom lane -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance