31 .
name =
"auto_explain",
91 {
"info",
INFO,
false},
104#define auto_explain_enabled() \
105 (auto_explain_log_min_duration >= 0 && \
106 (nesting_level == 0 || auto_explain_log_nested_statements) && \
107 current_query_sampled)
130 int maxoptions,
char **
errmsg);
140 "Sets the minimum execution time above which plans will be logged.",
141 "-1 disables logging plans. 0 means log all plans.",
152 "Sets the maximum length of query parameter values to log.",
153 "-1 means log values in full.",
164 "Use EXPLAIN ANALYZE for plan logging.",
175 "Log modified configuration parameters affecting query planning.",
186 "Use EXPLAIN VERBOSE for plan logging.",
197 "Log buffers usage.",
208 "Log I/O statistics.",
230 "Include trigger statistics in plans.",
231 "This has no effect unless log_analyze is also set.",
241 "EXPLAIN format to be used for plan logging.",
253 "Log level for the plan.",
265 "Log nested statements.",
276 "Collect timing data, not just row counts.",
287 "Extension EXPLAIN options to be added.",
298 "Fraction of queries to process.",
488 (
errmsg(
"duration: %.3f ms plan:\n%s",
563 for (
int i = 0;
i <
result->noptions;
i++)
631 if ((*
endp)[1] !=
'\'')
690 *
errmsg =
"option name missing or empty";
711 *
errmsg =
"unterminated single-quoted string";
745 if (
errno == 0 && *endptr ==
'\0' && endptr !=
value &&
746 intval == (
int) intval)
755 *
errmsg =
"invalid numeric value";
778 *
errmsg =
"unterminated double-quoted string";
796 *
errmsg =
"trailing comma in option list";
800 else if (*
nextp ==
'\0')
804 *
errmsg =
"expected comma or end of option list";
static ExecutorRun_hook_type prev_ExecutorRun
static int auto_explain_log_min_duration
static bool auto_explain_log_analyze
static void explain_ExecutorEnd(QueryDesc *queryDesc)
static bool check_log_extension_options(char **newval, void **extra, GucSource source)
static auto_explain_extension_options * extension_options
static bool auto_explain_log_wal
#define auto_explain_enabled()
static int auto_explain_split_options(char *rawstring, auto_explain_option *options, int maxoptions, char **errmsg)
static double auto_explain_sample_rate
static bool auto_explain_log_nested_statements
static int auto_explain_log_parameter_max_length
static void assign_log_extension_options(const char *newval, void *extra)
static bool auto_explain_log_io
static bool auto_explain_log_verbose
static void apply_extension_options(ExplainState *es, auto_explain_extension_options *ext)
static void explain_ExecutorFinish(QueryDesc *queryDesc)
static bool current_query_sampled
static void explain_ExecutorRun(QueryDesc *queryDesc, ScanDirection direction, uint64 count)
static void explain_ExecutorStart(QueryDesc *queryDesc, int eflags)
static char * auto_explain_scan_literal(char **endp, char **nextp)
static ExecutorStart_hook_type prev_ExecutorStart
static const struct config_enum_entry loglevel_options[]
static bool auto_explain_log_timing
static int auto_explain_log_format
static bool auto_explain_log_buffers
static bool auto_explain_log_triggers
static const struct config_enum_entry format_options[]
static char * auto_explain_log_extension_options
static ExecutorEnd_hook_type prev_ExecutorEnd
static int auto_explain_log_level
static ExecutorFinish_hook_type prev_ExecutorFinish
static bool auto_explain_log_settings
#define FLEXIBLE_ARRAY_MEMBER
memcpy(sums, checksumBaseOffsets, sizeof(checksumBaseOffsets))
int int errhidestmt(bool hide_stmt)
#define ereport(elevel,...)
ExecutorEnd_hook_type ExecutorEnd_hook
ExecutorFinish_hook_type ExecutorFinish_hook
ExecutorStart_hook_type ExecutorStart_hook
void standard_ExecutorStart(QueryDesc *queryDesc, int eflags)
ExecutorRun_hook_type ExecutorRun_hook
void standard_ExecutorRun(QueryDesc *queryDesc, ScanDirection direction, uint64 count)
void standard_ExecutorEnd(QueryDesc *queryDesc)
void standard_ExecutorFinish(QueryDesc *queryDesc)
void(* ExecutorFinish_hook_type)(QueryDesc *queryDesc)
void(* ExecutorRun_hook_type)(QueryDesc *queryDesc, ScanDirection direction, uint64 count)
void(* ExecutorStart_hook_type)(QueryDesc *queryDesc, int eflags)
void(* ExecutorEnd_hook_type)(QueryDesc *queryDesc)
#define EXEC_FLAG_EXPLAIN_ONLY
void ExplainPrintJITSummary(ExplainState *es, QueryDesc *queryDesc)
void ExplainQueryText(ExplainState *es, QueryDesc *queryDesc)
explain_per_plan_hook_type explain_per_plan_hook
void ExplainPrintPlan(ExplainState *es, QueryDesc *queryDesc)
void ExplainQueryParameters(ExplainState *es, ParamListInfo params, int maxlen)
void ExplainPrintTriggers(ExplainState *es, QueryDesc *queryDesc)
ExplainState * NewExplainState(void)
bool GUCCheckExplainExtensionOption(const char *option_name, const char *option_value, NodeTag option_type)
bool ApplyExtensionExplainOption(ExplainState *es, DefElem *opt, ParseState *pstate)
#define PG_MODULE_MAGIC_EXT(...)
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)
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)
void DefineCustomStringVariable(const char *name, const char *short_desc, const char *long_desc, char **valueAddr, const char *bootValue, GucContext context, int flags, GucStringCheckHook check_hook, GucStringAssignHook assign_hook, GucShowHook show_hook)
void * guc_malloc(int elevel, size_t size)
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)
void MarkGUCPrefixReserved(const char *className)
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)
#define GUC_check_errdetail
#define IsParallelWorker()
#define INSTR_TIME_GET_MILLISEC(t)
DefElem * makeDefElem(char *name, Node *arg, int location)
static MemoryContext MemoryContextSwitchTo(MemoryContext context)
double pg_prng_double(pg_prng_state *state)
pg_prng_state pg_global_prng_state
static rewind_source * source
bool scanner_isspace(char ch)
QueryEnvironment * es_queryEnv
MemoryContext es_query_cxt
PlannedStmt * plannedstmt
struct Instrumentation * query_instr
auto_explain_option options[FLEXIBLE_ARRAY_MEMBER]
Integer * makeInteger(int i)
String * makeString(char *str)
Float * makeFloat(char *numericStr)
char * scan_identifier(char **endp, char **nextp, char separator, bool downcase_unquoted)