Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 2af0971

Browse files
committed
Clarify documentation of EXPLAIN (TIMING OFF) option.
Clarify that this option doesn't suppress measurement of the statement's total runtime. Greg Smith
1 parent d4337a0 commit 2af0971

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

doc/src/sgml/ref/explain.sgml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -182,11 +182,13 @@ ROLLBACK;
182182
<term><literal>TIMING</literal></term>
183183
<listitem>
184184
<para>
185-
Include the actual startup time and time spent in the node in the output.
185+
Include actual startup time and time spent in each node in the output.
186186
The overhead of repeatedly reading the system clock can slow down the
187187
query significantly on some systems, so it may be useful to set this
188-
parameter to <literal>FALSE</literal> when only actual row counts, and not
189-
exact times, are needed.
188+
parameter to <literal>FALSE</literal> when only actual row counts, and
189+
not exact times, are needed. Run time of the entire statement is
190+
always measured, even when node-level timing is turned off with this
191+
option.
190192
This parameter may only be used when <literal>ANALYZE</literal> is also
191193
enabled. It defaults to <literal>TRUE</literal>.
192194
</para>

src/backend/commands/explain.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,10 @@ ExplainOnePlan(PlannedStmt *plannedstmt, IntoClause *into, ExplainState *es,
414414
if (es->buffers)
415415
instrument_option |= INSTRUMENT_BUFFERS;
416416

417+
/*
418+
* We always collect timing for the entire statement, even when
419+
* node-level timing is off, so we don't look at es->timing here.
420+
*/
417421
INSTR_TIME_SET_CURRENT(starttime);
418422

419423
/*

0 commit comments

Comments
 (0)