PostgreSQL Source Code  git master
auto_explain.c File Reference
#include "postgres.h"
#include <limits.h>
#include "access/parallel.h"
#include "commands/explain.h"
#include "common/pg_prng.h"
#include "executor/instrument.h"
#include "jit/jit.h"
#include "utils/guc.h"
Include dependency graph for auto_explain.c:

Go to the source code of this file.

Macros

#define auto_explain_enabled()
 

Functions

void _PG_init (void)
 
void _PG_fini (void)
 
static void explain_ExecutorStart (QueryDesc *queryDesc, int eflags)
 
static void explain_ExecutorRun (QueryDesc *queryDesc, ScanDirection direction, uint64 count, bool execute_once)
 
static void explain_ExecutorFinish (QueryDesc *queryDesc)
 
static void explain_ExecutorEnd (QueryDesc *queryDesc)
 

Variables

 PG_MODULE_MAGIC
 
static int auto_explain_log_min_duration = -1
 
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_wal = false
 
static bool auto_explain_log_triggers = false
 
static bool auto_explain_log_timing = true
 
static bool auto_explain_log_settings = false
 
static int auto_explain_log_format = EXPLAIN_FORMAT_TEXT
 
static int auto_explain_log_level = LOG
 
static bool auto_explain_log_nested_statements = false
 
static double auto_explain_sample_rate = 1
 
static const struct config_enum_entry format_options []
 
static const struct config_enum_entry loglevel_options []
 
static int nesting_level = 0
 
static bool current_query_sampled = false
 
static ExecutorStart_hook_type prev_ExecutorStart = NULL
 
static ExecutorRun_hook_type prev_ExecutorRun = NULL
 
static ExecutorFinish_hook_type prev_ExecutorFinish = NULL
 
static ExecutorEnd_hook_type prev_ExecutorEnd = NULL
 

Macro Definition Documentation

◆ auto_explain_enabled

#define auto_explain_enabled ( )
Value:
static int auto_explain_log_min_duration
Definition: auto_explain.c:27
static bool auto_explain_log_nested_statements
Definition: auto_explain.c:37
static int nesting_level
Definition: auto_explain.c:63
static bool current_query_sampled
Definition: auto_explain.c:66

Definition at line 68 of file auto_explain.c.

Function Documentation

◆ _PG_fini()

void _PG_fini ( void  )

Definition at line 251 of file auto_explain.c.

252 {
253  /* Uninstall hooks. */
258 }
static ExecutorRun_hook_type prev_ExecutorRun
Definition: auto_explain.c:75
static ExecutorStart_hook_type prev_ExecutorStart
Definition: auto_explain.c:74
static ExecutorEnd_hook_type prev_ExecutorEnd
Definition: auto_explain.c:77
static ExecutorFinish_hook_type prev_ExecutorFinish
Definition: auto_explain.c:76
ExecutorEnd_hook_type ExecutorEnd_hook
Definition: execMain.c:74
ExecutorFinish_hook_type ExecutorFinish_hook
Definition: execMain.c:73
ExecutorStart_hook_type ExecutorStart_hook
Definition: execMain.c:71
ExecutorRun_hook_type ExecutorRun_hook
Definition: execMain.c:72

References ExecutorEnd_hook, ExecutorFinish_hook, ExecutorRun_hook, ExecutorStart_hook, prev_ExecutorEnd, prev_ExecutorFinish, prev_ExecutorRun, and prev_ExecutorStart.

◆ _PG_init()

void _PG_init ( void  )

Definition at line 94 of file auto_explain.c.

95 {
96  /* Define custom GUC variables. */
97  DefineCustomIntVariable("auto_explain.log_min_duration",
98  "Sets the minimum execution time above which plans will be logged.",
99  "Zero prints all plans. -1 turns this feature off.",
101  -1,
102  -1, INT_MAX,
103  PGC_SUSET,
104  GUC_UNIT_MS,
105  NULL,
106  NULL,
107  NULL);
108 
109  DefineCustomBoolVariable("auto_explain.log_analyze",
110  "Use EXPLAIN ANALYZE for plan logging.",
111  NULL,
113  false,
114  PGC_SUSET,
115  0,
116  NULL,
117  NULL,
118  NULL);
119 
120  DefineCustomBoolVariable("auto_explain.log_settings",
121  "Log modified configuration parameters affecting query planning.",
122  NULL,
124  false,
125  PGC_SUSET,
126  0,
127  NULL,
128  NULL,
129  NULL);
130 
131  DefineCustomBoolVariable("auto_explain.log_verbose",
132  "Use EXPLAIN VERBOSE for plan logging.",
133  NULL,
135  false,
136  PGC_SUSET,
137  0,
138  NULL,
139  NULL,
140  NULL);
141 
142  DefineCustomBoolVariable("auto_explain.log_buffers",
143  "Log buffers usage.",
144  NULL,
146  false,
147  PGC_SUSET,
148  0,
149  NULL,
150  NULL,
151  NULL);
152 
153  DefineCustomBoolVariable("auto_explain.log_wal",
154  "Log WAL usage.",
155  NULL,
157  false,
158  PGC_SUSET,
159  0,
160  NULL,
161  NULL,
162  NULL);
163 
164  DefineCustomBoolVariable("auto_explain.log_triggers",
165  "Include trigger statistics in plans.",
166  "This has no effect unless log_analyze is also set.",
168  false,
169  PGC_SUSET,
170  0,
171  NULL,
172  NULL,
173  NULL);
174 
175  DefineCustomEnumVariable("auto_explain.log_format",
176  "EXPLAIN format to be used for plan logging.",
177  NULL,
181  PGC_SUSET,
182  0,
183  NULL,
184  NULL,
185  NULL);
186 
187  DefineCustomEnumVariable("auto_explain.log_level",
188  "Log level for the plan.",
189  NULL,
191  LOG,
193  PGC_SUSET,
194  0,
195  NULL,
196  NULL,
197  NULL);
198 
199  DefineCustomBoolVariable("auto_explain.log_nested_statements",
200  "Log nested statements.",
201  NULL,
203  false,
204  PGC_SUSET,
205  0,
206  NULL,
207  NULL,
208  NULL);
209 
210  DefineCustomBoolVariable("auto_explain.log_timing",
211  "Collect timing data, not just row counts.",
212  NULL,
214  true,
215  PGC_SUSET,
216  0,
217  NULL,
218  NULL,
219  NULL);
220 
221  DefineCustomRealVariable("auto_explain.sample_rate",
222  "Fraction of queries to process.",
223  NULL,
225  1.0,
226  0.0,
227  1.0,
228  PGC_SUSET,
229  0,
230  NULL,
231  NULL,
232  NULL);
233 
234  EmitWarningsOnPlaceholders("auto_explain");
235 
236  /* Install hooks. */
245 }
static bool auto_explain_log_analyze
Definition: auto_explain.c:28
static void explain_ExecutorEnd(QueryDesc *queryDesc)
Definition: auto_explain.c:370
static bool auto_explain_log_wal
Definition: auto_explain.c:31
static double auto_explain_sample_rate
Definition: auto_explain.c:38
static bool auto_explain_log_verbose
Definition: auto_explain.c:29
static void explain_ExecutorFinish(QueryDesc *queryDesc)
Definition: auto_explain.c:349
static void explain_ExecutorStart(QueryDesc *queryDesc, int eflags)
Definition: auto_explain.c:264
static const struct config_enum_entry loglevel_options[]
Definition: auto_explain.c:48
static bool auto_explain_log_timing
Definition: auto_explain.c:33
static int auto_explain_log_format
Definition: auto_explain.c:35
static bool auto_explain_log_buffers
Definition: auto_explain.c:30
static bool auto_explain_log_triggers
Definition: auto_explain.c:32
static const struct config_enum_entry format_options[]
Definition: auto_explain.c:40
static int auto_explain_log_level
Definition: auto_explain.c:36
static void explain_ExecutorRun(QueryDesc *queryDesc, ScanDirection direction, uint64 count, bool execute_once)
Definition: auto_explain.c:327
static bool auto_explain_log_settings
Definition: auto_explain.c:34
#define LOG
Definition: elog.h:25
@ EXPLAIN_FORMAT_TEXT
Definition: explain.h:22
void DefineCustomRealVariable(const char *name, const char *short_desc, const char *long_desc, double *valueAddr, double bootValue, double minValue, double maxValue, GucContext context, int flags, GucRealCheckHook check_hook, GucRealAssignHook assign_hook, GucShowHook show_hook)
Definition: guc.c:9264
void DefineCustomEnumVariable(const char *name, const char *short_desc, const char *long_desc, int *valueAddr, int bootValue, const struct config_enum_entry *options, GucContext context, int flags, GucEnumCheckHook check_hook, GucEnumAssignHook assign_hook, GucShowHook show_hook)
Definition: guc.c:9319
void DefineCustomBoolVariable(const char *name, const char *short_desc, const char *long_desc, bool *valueAddr, bool bootValue, GucContext context, int flags, GucBoolCheckHook check_hook, GucBoolAssignHook assign_hook, GucShowHook show_hook)
Definition: guc.c:9208
void EmitWarningsOnPlaceholders(const char *className)
Definition: guc.c:9351
void DefineCustomIntVariable(const char *name, const char *short_desc, const char *long_desc, int *valueAddr, int bootValue, int minValue, int maxValue, GucContext context, int flags, GucIntCheckHook check_hook, GucIntAssignHook assign_hook, GucShowHook show_hook)
Definition: guc.c:9234
#define GUC_UNIT_MS
Definition: guc.h:224
@ PGC_SUSET
Definition: guc.h:75

References auto_explain_log_analyze, auto_explain_log_buffers, auto_explain_log_format, auto_explain_log_level, auto_explain_log_min_duration, auto_explain_log_nested_statements, auto_explain_log_settings, auto_explain_log_timing, auto_explain_log_triggers, auto_explain_log_verbose, auto_explain_log_wal, auto_explain_sample_rate, DefineCustomBoolVariable(), DefineCustomEnumVariable(), DefineCustomIntVariable(), DefineCustomRealVariable(), EmitWarningsOnPlaceholders(), ExecutorEnd_hook, ExecutorFinish_hook, ExecutorRun_hook, ExecutorStart_hook, explain_ExecutorEnd(), explain_ExecutorFinish(), explain_ExecutorRun(), explain_ExecutorStart(), EXPLAIN_FORMAT_TEXT, format_options, GUC_UNIT_MS, LOG, loglevel_options, PGC_SUSET, prev_ExecutorEnd, prev_ExecutorFinish, prev_ExecutorRun, and prev_ExecutorStart.

◆ explain_ExecutorEnd()

static void explain_ExecutorEnd ( QueryDesc queryDesc)
static

Definition at line 370 of file auto_explain.c.

371 {
372  if (queryDesc->totaltime && auto_explain_enabled())
373  {
374  MemoryContext oldcxt;
375  double msec;
376 
377  /*
378  * Make sure we operate in the per-query context, so any cruft will be
379  * discarded later during ExecutorEnd.
380  */
381  oldcxt = MemoryContextSwitchTo(queryDesc->estate->es_query_cxt);
382 
383  /*
384  * Make sure stats accumulation is done. (Note: it's okay if several
385  * levels of hook all do this.)
386  */
387  InstrEndLoop(queryDesc->totaltime);
388 
389  /* Log plan if duration is exceeded. */
390  msec = queryDesc->totaltime->total * 1000.0;
391  if (msec >= auto_explain_log_min_duration)
392  {
394 
398  es->wal = (es->analyze && auto_explain_log_wal);
399  es->timing = (es->analyze && auto_explain_log_timing);
400  es->summary = es->analyze;
403 
404  ExplainBeginOutput(es);
405  ExplainQueryText(es, queryDesc);
406  ExplainPrintPlan(es, queryDesc);
408  ExplainPrintTriggers(es, queryDesc);
409  if (es->costs)
410  ExplainPrintJITSummary(es, queryDesc);
411  ExplainEndOutput(es);
412 
413  /* Remove last line break */
414  if (es->str->len > 0 && es->str->data[es->str->len - 1] == '\n')
415  es->str->data[--es->str->len] = '\0';
416 
417  /* Fix JSON to output an object */
419  {
420  es->str->data[0] = '{';
421  es->str->data[es->str->len - 1] = '}';
422  }
423 
424  /*
425  * Note: we rely on the existing logging of context or
426  * debug_query_string to identify just which statement is being
427  * reported. This isn't ideal but trying to do it here would
428  * often result in duplication.
429  */
431  (errmsg("duration: %.3f ms plan:\n%s",
432  msec, es->str->data),
433  errhidestmt(true)));
434  }
435 
436  MemoryContextSwitchTo(oldcxt);
437  }
438 
439  if (prev_ExecutorEnd)
440  prev_ExecutorEnd(queryDesc);
441  else
442  standard_ExecutorEnd(queryDesc);
443 }
#define auto_explain_enabled()
Definition: auto_explain.c:68
int errhidestmt(bool hide_stmt)
Definition: elog.c:1245
int errmsg(const char *fmt,...)
Definition: elog.c:904
#define ereport(elevel,...)
Definition: elog.h:143
void standard_ExecutorEnd(QueryDesc *queryDesc)
Definition: execMain.c:468
void ExplainEndOutput(ExplainState *es)
Definition: explain.c:4779
void ExplainPrintJITSummary(ExplainState *es, QueryDesc *queryDesc)
Definition: explain.c:843
void ExplainQueryText(ExplainState *es, QueryDesc *queryDesc)
Definition: explain.c:963
void ExplainBeginOutput(ExplainState *es)
Definition: explain.c:4748
ExplainState * NewExplainState(void)
Definition: explain.c:311
void ExplainPrintPlan(ExplainState *es, QueryDesc *queryDesc)
Definition: explain.c:751
void ExplainPrintTriggers(ExplainState *es, QueryDesc *queryDesc)
Definition: explain.c:800
@ EXPLAIN_FORMAT_JSON
Definition: explain.h:24
void InstrEndLoop(Instrumentation *instr)
Definition: instrument.c:140
static MemoryContext MemoryContextSwitchTo(MemoryContext context)
Definition: palloc.h:109
MemoryContext es_query_cxt
Definition: execnodes.h:605
bool verbose
Definition: explain.h:41
bool settings
Definition: explain.h:48
bool timing
Definition: explain.h:46
bool analyze
Definition: explain.h:42
StringInfo str
Definition: explain.h:39
ExplainFormat format
Definition: explain.h:49
bool wal
Definition: explain.h:45
bool summary
Definition: explain.h:47
bool costs
Definition: explain.h:43
bool buffers
Definition: explain.h:44
int instrument_options
Definition: execdesc.h:44
EState * estate
Definition: execdesc.h:48
struct Instrumentation * totaltime
Definition: execdesc.h:55

References ExplainState::analyze, auto_explain_enabled, auto_explain_log_analyze, auto_explain_log_buffers, auto_explain_log_format, auto_explain_log_level, auto_explain_log_min_duration, auto_explain_log_settings, auto_explain_log_timing, auto_explain_log_triggers, auto_explain_log_verbose, auto_explain_log_wal, ExplainState::buffers, ExplainState::costs, StringInfoData::data, ereport, errhidestmt(), errmsg(), EState::es_query_cxt, QueryDesc::estate, EXPLAIN_FORMAT_JSON, ExplainBeginOutput(), ExplainEndOutput(), ExplainPrintJITSummary(), ExplainPrintPlan(), ExplainPrintTriggers(), ExplainQueryText(), ExplainState::format, InstrEndLoop(), QueryDesc::instrument_options, StringInfoData::len, MemoryContextSwitchTo(), NewExplainState(), prev_ExecutorEnd, ExplainState::settings, standard_ExecutorEnd(), ExplainState::str, ExplainState::summary, ExplainState::timing, Instrumentation::total, QueryDesc::totaltime, ExplainState::verbose, and ExplainState::wal.

Referenced by _PG_init().

◆ explain_ExecutorFinish()

static void explain_ExecutorFinish ( QueryDesc queryDesc)
static

Definition at line 349 of file auto_explain.c.

350 {
351  nesting_level++;
352  PG_TRY();
353  {
355  prev_ExecutorFinish(queryDesc);
356  else
357  standard_ExecutorFinish(queryDesc);
358  }
359  PG_FINALLY();
360  {
361  nesting_level--;
362  }
363  PG_END_TRY();
364 }
#define PG_END_TRY()
Definition: elog.h:324
#define PG_TRY()
Definition: elog.h:299
#define PG_FINALLY()
Definition: elog.h:316
void standard_ExecutorFinish(QueryDesc *queryDesc)
Definition: execMain.c:408

References nesting_level, PG_END_TRY, PG_FINALLY, PG_TRY, prev_ExecutorFinish, and standard_ExecutorFinish().

Referenced by _PG_init().

◆ explain_ExecutorRun()

static void explain_ExecutorRun ( QueryDesc queryDesc,
ScanDirection  direction,
uint64  count,
bool  execute_once 
)
static

Definition at line 327 of file auto_explain.c.

329 {
330  nesting_level++;
331  PG_TRY();
332  {
333  if (prev_ExecutorRun)
334  prev_ExecutorRun(queryDesc, direction, count, execute_once);
335  else
336  standard_ExecutorRun(queryDesc, direction, count, execute_once);
337  }
338  PG_FINALLY();
339  {
340  nesting_level--;
341  }
342  PG_END_TRY();
343 }
void standard_ExecutorRun(QueryDesc *queryDesc, ScanDirection direction, uint64 count, bool execute_once)
Definition: execMain.c:309

References nesting_level, PG_END_TRY, PG_FINALLY, PG_TRY, prev_ExecutorRun, and standard_ExecutorRun().

Referenced by _PG_init().

◆ explain_ExecutorStart()

static void explain_ExecutorStart ( QueryDesc queryDesc,
int  eflags 
)
static

Definition at line 264 of file auto_explain.c.

265 {
266  /*
267  * At the beginning of each top-level statement, decide whether we'll
268  * sample this statement. If nested-statement explaining is enabled,
269  * either all nested statements will be explained or none will.
270  *
271  * When in a parallel worker, we should do nothing, which we can implement
272  * cheaply by pretending we decided not to sample the current statement.
273  * If EXPLAIN is active in the parent session, data will be collected and
274  * reported back to the parent, and it's no business of ours to interfere.
275  */
276  if (nesting_level == 0)
277  {
280  else
281  current_query_sampled = false;
282  }
283 
284  if (auto_explain_enabled())
285  {
286  /* Enable per-node instrumentation iff log_analyze is required. */
287  if (auto_explain_log_analyze && (eflags & EXEC_FLAG_EXPLAIN_ONLY) == 0)
288  {
290  queryDesc->instrument_options |= INSTRUMENT_TIMER;
291  else
292  queryDesc->instrument_options |= INSTRUMENT_ROWS;
296  queryDesc->instrument_options |= INSTRUMENT_WAL;
297  }
298  }
299 
300  if (prev_ExecutorStart)
301  prev_ExecutorStart(queryDesc, eflags);
302  else
303  standard_ExecutorStart(queryDesc, eflags);
304 
305  if (auto_explain_enabled())
306  {
307  /*
308  * Set up to track total elapsed time in ExecutorRun. Make sure the
309  * space is allocated in the per-query context so it will go away at
310  * ExecutorEnd.
311  */
312  if (queryDesc->totaltime == NULL)
313  {
314  MemoryContext oldcxt;
315 
316  oldcxt = MemoryContextSwitchTo(queryDesc->estate->es_query_cxt);
317  queryDesc->totaltime = InstrAlloc(1, INSTRUMENT_ALL, false);
318  MemoryContextSwitchTo(oldcxt);
319  }
320  }
321 }
void standard_ExecutorStart(QueryDesc *queryDesc, int eflags)
Definition: execMain.c:147
#define EXEC_FLAG_EXPLAIN_ONLY
Definition: executor.h:56
#define IsParallelWorker()
Definition: parallel.h:61
Instrumentation * InstrAlloc(int n, int instrument_options, bool async_mode)
Definition: instrument.c:31
@ INSTRUMENT_ALL
Definition: instrument.h:61
@ INSTRUMENT_TIMER
Definition: instrument.h:57
@ INSTRUMENT_BUFFERS
Definition: instrument.h:58
@ INSTRUMENT_WAL
Definition: instrument.h:60
@ INSTRUMENT_ROWS
Definition: instrument.h:59
double pg_prng_double(pg_prng_state *state)
Definition: pg_prng.c:226
pg_prng_state pg_global_prng_state
Definition: pg_prng.c:28

References auto_explain_enabled, auto_explain_log_analyze, auto_explain_log_buffers, auto_explain_log_min_duration, auto_explain_log_timing, auto_explain_log_wal, auto_explain_sample_rate, current_query_sampled, EState::es_query_cxt, QueryDesc::estate, EXEC_FLAG_EXPLAIN_ONLY, InstrAlloc(), INSTRUMENT_ALL, INSTRUMENT_BUFFERS, QueryDesc::instrument_options, INSTRUMENT_ROWS, INSTRUMENT_TIMER, INSTRUMENT_WAL, IsParallelWorker, MemoryContextSwitchTo(), nesting_level, pg_global_prng_state, pg_prng_double(), prev_ExecutorStart, standard_ExecutorStart(), and QueryDesc::totaltime.

Referenced by _PG_init().

Variable Documentation

◆ auto_explain_log_analyze

bool auto_explain_log_analyze = false
static

Definition at line 28 of file auto_explain.c.

Referenced by _PG_init(), explain_ExecutorEnd(), and explain_ExecutorStart().

◆ auto_explain_log_buffers

bool auto_explain_log_buffers = false
static

Definition at line 30 of file auto_explain.c.

Referenced by _PG_init(), explain_ExecutorEnd(), and explain_ExecutorStart().

◆ auto_explain_log_format

int auto_explain_log_format = EXPLAIN_FORMAT_TEXT
static

Definition at line 35 of file auto_explain.c.

Referenced by _PG_init(), and explain_ExecutorEnd().

◆ auto_explain_log_level

int auto_explain_log_level = LOG
static

Definition at line 36 of file auto_explain.c.

Referenced by _PG_init(), and explain_ExecutorEnd().

◆ auto_explain_log_min_duration

int auto_explain_log_min_duration = -1
static

Definition at line 27 of file auto_explain.c.

Referenced by _PG_init(), explain_ExecutorEnd(), and explain_ExecutorStart().

◆ auto_explain_log_nested_statements

bool auto_explain_log_nested_statements = false
static

Definition at line 37 of file auto_explain.c.

Referenced by _PG_init().

◆ auto_explain_log_settings

bool auto_explain_log_settings = false
static

Definition at line 34 of file auto_explain.c.

Referenced by _PG_init(), and explain_ExecutorEnd().

◆ auto_explain_log_timing

bool auto_explain_log_timing = true
static

Definition at line 33 of file auto_explain.c.

Referenced by _PG_init(), explain_ExecutorEnd(), and explain_ExecutorStart().

◆ auto_explain_log_triggers

bool auto_explain_log_triggers = false
static

Definition at line 32 of file auto_explain.c.

Referenced by _PG_init(), and explain_ExecutorEnd().

◆ auto_explain_log_verbose

bool auto_explain_log_verbose = false
static

Definition at line 29 of file auto_explain.c.

Referenced by _PG_init(), and explain_ExecutorEnd().

◆ auto_explain_log_wal

bool auto_explain_log_wal = false
static

Definition at line 31 of file auto_explain.c.

Referenced by _PG_init(), explain_ExecutorEnd(), and explain_ExecutorStart().

◆ auto_explain_sample_rate

double auto_explain_sample_rate = 1
static

Definition at line 38 of file auto_explain.c.

Referenced by _PG_init(), and explain_ExecutorStart().

◆ current_query_sampled

bool current_query_sampled = false
static

Definition at line 66 of file auto_explain.c.

Referenced by explain_ExecutorStart().

◆ format_options

const struct config_enum_entry format_options[]
static
Initial value:
= {
{"text", EXPLAIN_FORMAT_TEXT, false},
{"xml", EXPLAIN_FORMAT_XML, false},
{"json", EXPLAIN_FORMAT_JSON, false},
{"yaml", EXPLAIN_FORMAT_YAML, false},
{NULL, 0, false}
}
@ EXPLAIN_FORMAT_XML
Definition: explain.h:23
@ EXPLAIN_FORMAT_YAML
Definition: explain.h:25

Definition at line 38 of file auto_explain.c.

Referenced by _PG_init().

◆ loglevel_options

const struct config_enum_entry loglevel_options[]
static
Initial value:
= {
{"debug5", DEBUG5, false},
{"debug4", DEBUG4, false},
{"debug3", DEBUG3, false},
{"debug2", DEBUG2, false},
{"debug1", DEBUG1, false},
{"debug", DEBUG2, true},
{"info", INFO, false},
{"notice", NOTICE, false},
{"warning", WARNING, false},
{"log", LOG, false},
{NULL, 0, false}
}
#define DEBUG3
Definition: elog.h:22
#define WARNING
Definition: elog.h:30
#define DEBUG2
Definition: elog.h:23
#define DEBUG1
Definition: elog.h:24
#define NOTICE
Definition: elog.h:29
#define INFO
Definition: elog.h:28
#define DEBUG5
Definition: elog.h:20
#define DEBUG4
Definition: elog.h:21

Definition at line 38 of file auto_explain.c.

Referenced by _PG_init().

◆ nesting_level

int nesting_level = 0
static

◆ PG_MODULE_MAGIC

PG_MODULE_MAGIC

Definition at line 24 of file auto_explain.c.

◆ prev_ExecutorEnd

ExecutorEnd_hook_type prev_ExecutorEnd = NULL
static

Definition at line 77 of file auto_explain.c.

Referenced by _PG_fini(), _PG_init(), and explain_ExecutorEnd().

◆ prev_ExecutorFinish

ExecutorFinish_hook_type prev_ExecutorFinish = NULL
static

Definition at line 76 of file auto_explain.c.

Referenced by _PG_fini(), _PG_init(), and explain_ExecutorFinish().

◆ prev_ExecutorRun

ExecutorRun_hook_type prev_ExecutorRun = NULL
static

Definition at line 75 of file auto_explain.c.

Referenced by _PG_fini(), _PG_init(), and explain_ExecutorRun().

◆ prev_ExecutorStart

ExecutorStart_hook_type prev_ExecutorStart = NULL
static

Definition at line 74 of file auto_explain.c.

Referenced by _PG_fini(), _PG_init(), and explain_ExecutorStart().