mirror of
https://github.com/postgres/postgres.git
synced 2025-06-14 18:42:34 +03:00
Fix failure of contrib/auto_explain to print per-node timing information.
This has been broken since commit af7914c662
,
which added the EXPLAIN (TIMING) option. Although that commit included
updates to auto_explain, they evidently weren't tested very carefully,
because the code failed to print node timings even when it should, due to
failure to set es.timing in the ExplainState struct. Reported off-list by
Neelakanth Nadgir of Salesforce.
In passing, clean up the documentation for auto_explain's options a
little bit, including re-ordering them into what seems to me a more
logical order.
This commit is contained in:
@ -26,7 +26,7 @@ static bool auto_explain_log_analyze = false;
|
||||
static bool auto_explain_log_verbose = false;
|
||||
static bool auto_explain_log_buffers = false;
|
||||
static bool auto_explain_log_triggers = false;
|
||||
static bool auto_explain_log_timing = false;
|
||||
static bool auto_explain_log_timing = true;
|
||||
static int auto_explain_log_format = EXPLAIN_FORMAT_TEXT;
|
||||
static bool auto_explain_log_nested_statements = false;
|
||||
|
||||
@ -200,8 +200,6 @@ explain_ExecutorStart(QueryDesc *queryDesc, int eflags)
|
||||
queryDesc->instrument_options |= INSTRUMENT_TIMER;
|
||||
else
|
||||
queryDesc->instrument_options |= INSTRUMENT_ROWS;
|
||||
|
||||
|
||||
if (auto_explain_log_buffers)
|
||||
queryDesc->instrument_options |= INSTRUMENT_BUFFERS;
|
||||
}
|
||||
@ -302,6 +300,7 @@ explain_ExecutorEnd(QueryDesc *queryDesc)
|
||||
es.analyze = (queryDesc->instrument_options && auto_explain_log_analyze);
|
||||
es.verbose = auto_explain_log_verbose;
|
||||
es.buffers = (es.analyze && auto_explain_log_buffers);
|
||||
es.timing = (es.analyze && auto_explain_log_timing);
|
||||
es.format = auto_explain_log_format;
|
||||
|
||||
ExplainBeginOutput(&es);
|
||||
|
Reference in New Issue
Block a user