Update discussion of EXPLAIN to reflect existence of ModifyTable nodes.
authorTom Lane
Tue, 1 Mar 2011 16:36:09 +0000 (11:36 -0500)
committerTom Lane
Tue, 1 Mar 2011 16:36:09 +0000 (11:36 -0500)
Back-patch to 9.0, since this was changed then.

doc/src/sgml/perform.sgml

index 43073703406baa45ff7e0436bfe15d059b8f0773..1c18274e89b645380b96fe3cc4fac930269f5246 100644 (file)
@@ -430,18 +430,27 @@ WHERE t1.unique1 < 100 AND t1.unique2 = t2.unique2;
 
    
     The Total runtime shown by EXPLAIN
-    ANALYZE includes executor start-up and shut-down time, as well
-    as time spent processing the result rows.  It does not include parsing,
-    rewriting, or planning time.  For a SELECT query, the total
-    run time will normally be just a little larger than the total time
-    reported for the top-level plan node.  For INSERT,
-    UPDATE, and DELETE commands, the total run time
-    might be considerably larger, because it includes the time spent processing
-    the result rows.  For these commands, the time for the top plan node is
-    essentially the time spent locating the old rows and/or computing
-    the new ones, but it doesn't include the time spent applying the changes.
-    Time spent firing triggers, if any, is also outside the top plan node,
-    and is shown separately for each trigger.
+    ANALYZE includes executor start-up and shut-down time, but not
+    parsing, rewriting, or planning time.  For INSERT,
+    UPDATE, and DELETE commands, the time spent
+    applying the table changes is charged to a top-level Insert, Update,
+    or Delete plan node.  (The plan nodes underneath this node represent
+    the work of locating the old rows and/or computing the new ones.)
+    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.
+   
+
+   
+    There are two significant ways in which runtimes measured by
+    EXPLAIN ANALYZE can deviate from normal execution of
+    the same query.  First, since no output rows are delivered to the client,
+    network transmission costs and I/O formatting costs are not included.
+    Second, the overhead added by EXPLAIN ANALYZE can be
+    significant, especially on machines with slow gettimeofday()
+    kernel calls.