X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id A0E645371F for ; Fri, 25 Mar 2005 02:33:03 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 48153-09 for ; Fri, 25 Mar 2005 02:32:54 +0000 (GMT) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id C5A835371D for ; Fri, 25 Mar 2005 02:32:52 +0000 (GMT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.1/8.13.1) with ESMTP id j2P2WuYR004010; Thu, 24 Mar 2005 21:32:56 -0500 (EST) To: Mark Lewis Cc: pgsql-performance@postgresql.org Subject: Re: Delete query takes exorbitant amount of time In-reply-to: <1111713798.23412.3.camel@amateljan.mirlogic.com> References: <1111709457.9085.127.camel@k2.cet.nau.edu> <2630.1111711927@sss.pgh.pa.us> <1111713798.23412.3.camel@amateljan.mirlogic.com> Comments: In-reply-to Mark Lewis message dated "Thu, 24 Mar 2005 17:23:19 -0800" Date: Thu, 24 Mar 2005 21:32:56 -0500 Message-ID: <4009.1111717976@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.007 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200503/531 X-Sequence-Number: 11236 Mark Lewis writes: > I've got a similar problem with deletes taking a very long time. I know > that there are lots of foreign keys referencing this table, and other > foreign keys referencing those tables, etc. I've been curious, is there > a way to find out how long the foreign key checks take for each > dependent table? There is not any easy way at the moment. Hmm ... I wonder how hard it would be to teach EXPLAIN ANALYZE to show the runtime expended in each trigger when the statement is of a kind that has triggers. We couldn't break down the time *within* the triggers, but even this info would help a lot in terms of finger pointing ... Seq Scan on ... (nn.nnn ms) Trigger foo: nn.mmm ms Trigger bar: nn.mmm ms Total time: nn.mmm ms regards, tom lane