Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 9667E1337B4E for ; Wed, 2 Mar 2011 07:06:06 -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 43102-08 for ; Wed, 2 Mar 2011 11:05:59 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail.cs.helsinki.fi (courier.cs.helsinki.fi [128.214.9.1]) by mail.postgresql.org (Postfix) with ESMTP id 31FD51337B34 for ; Wed, 2 Mar 2011 07:05:58 -0400 (AST) Received: from pgsqls-MacBook-Pro.local (dsl-hkibrasgw4-fe45f800-165.dhcp.inet.fi [84.248.69.165]) (AUTH: PLAIN mtiikkaj, TLS: TLSv1/SSLv3,256bits,AES256-SHA) by mail.cs.helsinki.fi with esmtp; Wed, 02 Mar 2011 13:05:58 +0200 id 00093E54.4D6E2496.0000722B Message-ID: <4D6E2495.9010400@cs.helsinki.fi> Date: Wed, 02 Mar 2011 13:05:57 +0200 From: Marko Tiikkaja User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.14) Gecko/20110221 Thunderbird/3.1.8 MIME-Version: 1.0 To: Tom Lane CC: pgsql-docs@postgresql.org Subject: ModifyTable, EXPLAIN ANALYZE and AFTER triggers Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-4.21 tagged_above=-5 required=5 tests=BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201103/1 X-Sequence-Number: 6434 Hi, 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. Regards, Marko Tiikkaja