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 0E92E53522 for ; Fri, 25 Mar 2005 05:38:55 +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 51023-06 for ; Fri, 25 Mar 2005 05:38:45 +0000 (GMT) Received: from ra.sai.msu.su (ra.sai.msu.su [158.250.29.2]) by svr1.postgresql.org (Postfix) with ESMTP id C5629537D8 for ; Fri, 25 Mar 2005 05:38:44 +0000 (GMT) Received: from ra (ra [158.250.29.2]) by ra.sai.msu.su (8.12.10/8.12.10) with ESMTP id j2P5cY5Q007029; Fri, 25 Mar 2005 08:38:34 +0300 (MSK) Date: Fri, 25 Mar 2005 08:38:33 +0300 (MSK) From: Oleg Bartunov X-X-Sender: megera@ra.sai.msu.su To: Tom Lane Cc: Mark Lewis , pgsql-performance@postgresql.org Subject: Re: Delete query takes exorbitant amount of time In-Reply-To: <4009.1111717976@sss.pgh.pa.us> Message-ID: References: <1111709457.9085.127.camel@k2.cet.nau.edu> <2630.1111711927@sss.pgh.pa.us> <1111713798.23412.3.camel@amateljan.mirlogic.com> <4009.1111717976@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.34 tagged_above=0 required=5 tests=AWL, DNS_FROM_RFC_ABUSE X-Spam-Level: X-Archive-Number: 200503/537 X-Sequence-Number: 11242 On Thu, 24 Mar 2005, Tom Lane wrote: > 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 and if you add Index foo_idx: nn.mm ss Heap foo_tbl: nn.mm ss > > regards, tom lane > > ---------------------------(end of broadcast)--------------------------- > TIP 5: Have you checked our extensive FAQ? > > http://www.postgresql.org/docs/faq > Regards, Oleg _____________________________________________________________ Oleg Bartunov, sci.researcher, hostmaster of AstroNet, Sternberg Astronomical Institute, Moscow University (Russia) Internet: oleg@sai.msu.su, http://www.sai.msu.su/~megera/ phone: +007(095)939-16-83, +007(095)939-23-83