aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2013-05-19 22:03:32 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2013-05-19 22:03:32 -0400
commit2af0971f35a4a7b87312b83782d9bb0cc6a40ad0 (patch)
tree2751f7dd7009680db9b3c923cce26d3379467e1b
parentd4337a0dcbd29e5b11c2157f808916de62de05e4 (diff)
downloadpostgresql-2af0971f35a4a7b87312b83782d9bb0cc6a40ad0.tar.gz
postgresql-2af0971f35a4a7b87312b83782d9bb0cc6a40ad0.zip
Clarify documentation of EXPLAIN (TIMING OFF) option.
Clarify that this option doesn't suppress measurement of the statement's total runtime. Greg Smith
-rw-r--r--doc/src/sgml/ref/explain.sgml8
-rw-r--r--src/backend/commands/explain.c4
2 files changed, 9 insertions, 3 deletions
diff --git a/doc/src/sgml/ref/explain.sgml b/doc/src/sgml/ref/explain.sgml
index 1f35a1d1552..74f33256b9e 100644
--- a/doc/src/sgml/ref/explain.sgml
+++ b/doc/src/sgml/ref/explain.sgml
@@ -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>
diff --git a/src/backend/commands/explain.c b/src/backend/commands/explain.c
index 38ce0efe031..c6398e3c8e7 100644
--- a/src/backend/commands/explain.c
+++ b/src/backend/commands/explain.c
@@ -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);
/*