Clarify documentation of EXPLAIN (TIMING OFF) option.
authorTom Lane <tgl@sss.pgh.pa.us>
Mon, 20 May 2013 02:03:32 +0000 (22:03 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Mon, 20 May 2013 02:03:32 +0000 (22:03 -0400)
Clarify that this option doesn't suppress measurement of the statement's
total runtime.

Greg Smith

doc/src/sgml/ref/explain.sgml
src/backend/commands/explain.c

index 1f35a1d155279f4f50aefd4b32739d4e4259a3b1..74f33256b9e542422467a5aed1ff115131a7c661 100644 (file)
@@ -182,11 +182,13 @@ ROLLBACK;
     <term><literal>TIMING</literal></term>
     <listitem>
      <para>
-      Include the actual startup time and time spent in the node in the output.
+      Include actual startup time and time spent in each node in the output.
       The overhead of repeatedly reading the system clock can slow down the
       query significantly on some systems, so it may be useful to set this
-      parameter to <literal>FALSE</literal> when only actual row counts, and not
-      exact times, are needed.
+      parameter to <literal>FALSE</literal> when only actual row counts, and
+      not exact times, are needed.  Run time of the entire statement is
+      always measured, even when node-level timing is turned off with this
+      option.
       This parameter may only be used when <literal>ANALYZE</literal> is also
       enabled.  It defaults to <literal>TRUE</literal>.
      </para>
index 38ce0efe031e2790ecd7ec2a31d496405e2142e9..c6398e3c8e7ef6bec1d693a82fbaa18df00911e2 100644 (file)
@@ -414,6 +414,10 @@ ExplainOnePlan(PlannedStmt *plannedstmt, IntoClause *into, ExplainState *es,
    if (es->buffers)
        instrument_option |= INSTRUMENT_BUFFERS;
 
+   /*
+    * We always collect timing for the entire statement, even when
+    * node-level timing is off, so we don't look at es->timing here.
+    */
    INSTR_TIME_SET_CURRENT(starttime);
 
    /*