Commit 7e49330c authored by Tom Lane's avatar Tom Lane

Correct mistaken claims about EXPLAIN ANALYZE's handling of triggers.

Time spent executing AFTER triggers is not included in the runtime of the
associated ModifyTable node; in my patch of yesterday I confused queuing of
these triggers with their actual execution.  Spotted by Marko Tiikkaja.
parent 4c966d92
...@@ -436,10 +436,13 @@ WHERE t1.unique1 < 100 AND t1.unique2 = t2.unique2; ...@@ -436,10 +436,13 @@ WHERE t1.unique1 < 100 AND t1.unique2 = t2.unique2;
applying the table changes is charged to a top-level Insert, Update, applying the table changes is charged to a top-level Insert, Update,
or Delete plan node. (The plan nodes underneath this node represent or Delete plan node. (The plan nodes underneath this node represent
the work of locating the old rows and/or computing the new ones.) the work of locating the old rows and/or computing the new ones.)
Time spent firing triggers, if any, is charged to the Insert, Time spent executing <literal>BEFORE</> triggers, if any, is charged to
Update, or Delete node, and is also shown separately for each trigger. the related Insert, Update, or Delete node, although time spent executing
Note, however, that deferred triggers will not be fired until end of <literal>AFTER</> triggers is not. The time spent in each trigger
transaction and are thus not accounted for in the output of (either <literal>BEFORE</> or <literal>AFTER</>) is also shown separately
and is included in total runtime.
Note, however, that deferred constraint triggers will not be executed
until end of transaction and are thus not shown by
<command>EXPLAIN ANALYZE</command>. <command>EXPLAIN ANALYZE</command>.
</para> </para>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment