Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id A6DCB1336971 for ; Wed, 2 Mar 2011 11:31:18 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 64598-08 for ; Wed, 2 Mar 2011 15:31:11 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id F2A72133655C for ; Wed, 2 Mar 2011 11:31:10 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id p22FTr7p017241; Wed, 2 Mar 2011 10:29:54 -0500 (EST) To: Marko Tiikkaja cc: pgsql-docs@postgresql.org Subject: Re: ModifyTable, EXPLAIN ANALYZE and AFTER triggers In-reply-to: <4D6E2495.9010400@cs.helsinki.fi> References: <4D6E2495.9010400@cs.helsinki.fi> Comments: In-reply-to Marko Tiikkaja message dated "Wed, 02 Mar 2011 13:05:57 +0200" Date: Wed, 02 Mar 2011 10:29:53 -0500 Message-ID: <17240.1299079793@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-5 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201103/2 X-Sequence-Number: 6435 Marko Tiikkaja writes: > The recent commit 09b49a8439fde63826f93f55430868cf2585644b claims: > + Time spent firing triggers, if any, is charged to the Insert, > + Update, or Delete node, and is also shown separately for each trigger. > + Note, however, that deferred triggers will not be fired until end of > + transaction and are thus not accounted for in the output of > + EXPLAIN ANALYZE. > But that's only part of the truth; the ModifyTable nodes queue AFTER > triggers, but don't actually fire them. I remember there was some > discussion during 9.0's development about making the ModifyTable nodes > also count the time spent firing AFTER triggers, but I don't remember > what we decided back then. Meanwhile, I think this part in the > documentation needs a small clarification. Oh, you're right --- I was thinking that the fireASTriggers call would actually execute the triggers, but of course it only queues them. Will fix. regards, tom lane