diff --git a/doc/src/sgml/ref/explain.sgml b/doc/src/sgml/ref/explain.sgml index 1f35a1d..627119b 100644 --- a/doc/src/sgml/ref/explain.sgml +++ b/doc/src/sgml/ref/explain.sgml @@ -186,7 +186,8 @@ ROLLBACK; 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 FALSE when only actual row counts, and not - exact times, are needed. + exact times, are needed. Running time of the entire statement is always + collected, even when node level timing is turned off with this option. This parameter may only be used when ANALYZE is also enabled. It defaults to TRUE. diff --git a/src/backend/commands/explain.c b/src/backend/commands/explain.c index 38ce0ef..90fc727 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; + /* + * Always collect timing for the entire statement, even when + * node level timing is off. + */ INSTR_TIME_SET_CURRENT(starttime); /*