Received: from localhost (unknown [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id 897169FC420 for ; Wed, 24 Oct 2007 11:03:45 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-maia, port 10024) with ESMTP id 52038-03 for ; Wed, 24 Oct 2007 11:03:29 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id 64A879FC3D9 for ; Wed, 24 Oct 2007 11:03:39 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.1/8.14.1) with ESMTP id l9OE3a85002052; Wed, 24 Oct 2007 10:03:37 -0400 (EDT) To: "Giulio Cesare Solaroli" cc: pgsql-performance@postgresql.org Subject: Re: Finalizing commit taking very long In-reply-to: References: <1302.1193231756@sss.pgh.pa.us> Comments: In-reply-to "Giulio Cesare Solaroli" message dated "Wed, 24 Oct 2007 15:37:07 +0200" Date: Wed, 24 Oct 2007 10:03:36 -0400 Message-ID: <2051.1193234616@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200710/274 X-Sequence-Number: 27296 "Giulio Cesare Solaroli" writes: > How can I try to isolate the trigger taking so long, in oder to > understand which is/are the missing index(es)? Try SET CONSTRAINTS ALL IMMEDIATE and then EXPLAIN ANALYZE the delete. This should cause all the triggers to run within the scope of the EXPLAIN ANALYZE, and you'll be able to see which one(s) are slow. (This assumes you're running a recent release of PG; I think EXPLAIN shows trigger times since 8.1 or so.) regards, tom lane