63#define BYTES_TO_KILOBYTES(b) (((b) + 1023) / 1024)
195 (*post_parse_analyze_hook) (pstate, query,
jstate);
262 foreach(
lc,
stmt->options)
270 if (
strcmp(p,
"xml") == 0)
272 else if (
strcmp(p,
"json") == 0)
307 (*ExplainOneQuery_hook) (query, cursorOptions, into, es,
344 "explain analyze planner context",
394 if (utilityStmt ==
NULL)
419 elog(
ERROR,
"unexpected object type: %d",
420 (
int)
ctas->objtype);
476 "Utility statements have no plan structure\n");
504 double totaltime = 0;
594 dest->rDestroy(dest);
651 (*explain_per_plan_hook) (plannedstmt, into, es, queryString,
706 for (
int i = 0;
i < num;
i++)
728 for (
int i = 0;
i < num;
i++)
907 if (!
ji ||
ji->created_functions == 0)
931 "Inlining", jit_flags &
PGJIT_INLINE ?
"true" :
"false",
932 "Optimization", jit_flags &
PGJIT_OPT3 ?
"true" :
"false",
933 "Expressions", jit_flags &
PGJIT_EXPR ?
"true" :
"false",
934 "Deforming", jit_flags &
PGJIT_DEFORM ?
"true" :
"false");
940 "Timing: %s %.3f ms (%s %.3f ms), %s %.3f ms, %s %.3f ms, %s %.3f ms, %s %.3f ms\n",
1080 if (params ==
NULL || params->
numParams <= 0 || maxlen == 0)
1084 if (
str &&
str[0] !=
'\0')
1097 if (!
rInfo->ri_TrigDesc || !
rInfo->ri_TrigInstrument)
1099 for (
nt = 0;
nt <
rInfo->ri_TrigDesc->numtriggers;
nt++)
1104 char *conname =
NULL;
1223 if (
plan->targetlist)
1258 if (
plan->disabled_nodes == 0)
1277 foreach(
lc,
aplan->appendplans)
1365 const char *strategy =
NULL;
1367 const char *operation =
NULL;
1393 sname =
"ModifyTable";
1397 pname = operation =
"Insert";
1400 pname = operation =
"Update";
1403 pname = operation =
"Delete";
1406 pname = operation =
"Merge";
1433 sname =
"Merge Join";
1437 sname =
"Hash Join";
1491 sname =
"Foreign Scan";
1495 pname =
"Foreign Scan";
1496 operation =
"Select";
1499 pname =
"Foreign Insert";
1500 operation =
"Insert";
1503 pname =
"Foreign Update";
1504 operation =
"Update";
1507 pname =
"Foreign Delete";
1508 operation =
"Delete";
1516 sname =
"Custom Scan";
1542 sname =
"Aggregate";
1543 switch (
agg->aggstrategy)
1546 pname =
"Aggregate";
1550 pname =
"GroupAggregate";
1551 strategy =
"Sorted";
1554 pname =
"HashAggregate";
1555 strategy =
"Hashed";
1558 pname =
"MixedAggregate";
1562 pname =
"Aggregate ???";
1593 strategy =
"Sorted";
1596 pname =
"HashSetOp";
1597 strategy =
"Hashed";
1600 pname =
"SetOp ???";
1637 if (
plan->parallel_aware)
1639 if (
plan->async_capable)
1680 if (((
Scan *)
plan)->scanrelid > 0)
1706 const char *indexname =
1723 const char *jointype;
1746 jointype =
"Right Semi";
1749 jointype =
"Right Anti";
1807 plan->startup_cost,
plan->total_cost,
1808 plan->plan_rows,
plan->plan_width);
1899 double nloops = instrument->
nloops;
1908 rows = instrument->
ntuples / nloops;
1965 "Index Cond", planstate, ancestors, es);
1970 "Order By", planstate, ancestors, es);
1979 "Index Cond", planstate, ancestors, es);
1984 "Order By", planstate, ancestors, es);
1996 "Index Cond", planstate, ancestors, es);
2001 "Recheck Cond", planstate, ancestors, es);
2013 planstate, ancestors, es);
2038 gather->num_workers, es);
2044 nworkers = ((
GatherState *) planstate)->nworkers_launched;
2062 gm->num_workers, es);
2088 "Function Call", planstate, ancestors,
2102 "Table Function Call", planstate, ancestors,
2161 if (
css->methods->ExplainCustomScan)
2162 css->methods->ExplainCustomScan(
css, ancestors, es);
2167 "Join Filter", planstate, ancestors, es);
2178 "Merge Cond", planstate, ancestors, es);
2180 "Join Filter", planstate, ancestors, es);
2191 "Hash Cond", planstate, ancestors, es);
2193 "Join Filter", planstate, ancestors, es);
2213 "Run Condition", planstate, ancestors, es);
2244 "One-Time Filter", planstate, ancestors, es);
2306 double nloops = instrument->
nloops;
2327 (*explain_per_node_hook) (planstate, ancestors,
relationship,
2412 "Subquery",
NULL, es);
2487 foreach(
lc,
plan->targetlist)
2581 plan->numCols, 0,
plan->sortColIdx,
2582 plan->sortOperators,
plan->collations,
2597 plan->sort.numCols,
plan->nPresortedCols,
2598 plan->sort.sortColIdx,
2599 plan->sort.sortOperators,
plan->sort.collations,
2600 plan->sort.nullsFirst,
2614 plan->numCols, 0,
plan->sortColIdx,
2615 plan->sortOperators,
plan->collations,
2629 if (
plan->numCols > 0 ||
plan->groupingSets)
2634 if (
plan->groupingSets)
2665 foreach(
lc,
agg->chain)
2707 sortnode->
numCols, 0, sortnode->sortColIdx,
2708 sortnode->sortOperators, sortnode->collations,
2709 sortnode->nullsFirst,
2800 for (keyno = 0; keyno < nkeys; keyno++)
2816 if (sortOperators !=
NULL)
2819 sortOperators[keyno],
2842 bool reverse =
false;
2859 if (collname ==
NULL)
2860 elog(
ERROR,
"cache lookup failed for collation %u", collation);
2865 if (sortOperator == typentry->
gt_opr)
2870 else if (sortOperator != typentry->
lt_opr)
2875 elog(
ERROR,
"cache lookup failed for operator %u", sortOperator);
2907 if (
wagg->partNumCols > 0)
2911 wagg->partNumCols,
wagg->partColIdx,
2915 if (
wagg->ordNumCols > 0)
2973 for (
int keyno = 0; keyno < nkeys; keyno++)
3046 foreach(
lc,
tsc->args)
3054 if (
tsc->repeatable)
3101 const char *sortMethod;
3102 const char *spaceType;
3114 sortMethod, spaceType, spaceUsed);
3140 const char *sortMethod;
3141 const char *spaceType;
3159 sortMethod, spaceType, spaceUsed);
3194 if (
groupInfo->sortMethods & sortMethod)
3303 fullsortGroupInfo = &
incrsortstate->incsort_info.fullsortGroupInfo;
3320 prefixsortGroupInfo = &
incrsortstate->incsort_info.prefixsortGroupInfo;
3336 for (n = 0; n <
incrsortstate->shared_info->num_workers; n++)
3430 if (hinstrument.
nbatch > 0)
3452 "Buckets: %d (originally %d) Batches: %d (originally %d) Memory Usage: " UINT64_FORMAT "kB\n",
3463 "Buckets: %d Batches: %d Memory Usage: " UINT64_FORMAT "kB\n",
3614 foreach(
lc,
mplan->param_exprs)
3635 appendStringInfo(es->
str,
"Estimates: capacity=%u distinct keys=%.0f lookups=%.0f hit percent=%.2f%%\n",
3637 mplan->est_calls,
mplan->est_hit_ratio * 100.0);
3651 if (
mstate->stats.cache_misses > 0)
3657 if (
mstate->stats.mem_peak > 0)
3675 mstate->stats.cache_hits,
3676 mstate->stats.cache_misses,
3677 mstate->stats.cache_evictions,
3678 mstate->stats.cache_overflows,
3687 for (
int n = 0; n <
mstate->shared_info->num_workers; n++)
3691 si = &
mstate->shared_info->sinstrument[n];
3697 if (
si->cache_misses == 0)
3716 si->cache_hits,
si->cache_misses,
3717 si->cache_evictions,
si->cache_overflows,
3723 si->cache_hits, es);
3725 si->cache_misses, es);
3727 si->cache_evictions, es);
3729 si->cache_overflows, es);
3756 aggstate->hash_planned_partitions, es);
3780 aggstate->hash_planned_partitions);
3801 if (
aggstate->hash_batches_used > 1)
3815 for (
int n = 0; n <
aggstate->shared_info->num_workers; n++)
3819 int hash_batches_used;
3821 sinstrument = &
aggstate->shared_info->sinstrument[n];
3840 if (hash_batches_used > 1)
3848 hash_batches_used, es);
3956 if (
si->exact_pages == 0 &&
si->lossy_pages == 0)
3966 if (
si->exact_pages > 0)
3968 if (
si->lossy_pages > 0)
3975 si->exact_pages, es);
3977 si->lossy_pages, es);
4054 result = (*explain_get_index_name_hook) (
indexId);
4089 usage->shared_blks_read > 0 ||
4090 usage->shared_blks_dirtied > 0 ||
4091 usage->shared_blks_written > 0);
4093 usage->local_blks_read > 0 ||
4094 usage->local_blks_dirtied > 0 ||
4095 usage->local_blks_written > 0);
4097 usage->temp_blks_written > 0);
4118 usage->shared_blks_read > 0 ||
4119 usage->shared_blks_dirtied > 0 ||
4120 usage->shared_blks_written > 0);
4122 usage->local_blks_read > 0 ||
4123 usage->local_blks_dirtied > 0 ||
4124 usage->local_blks_written > 0);
4126 usage->temp_blks_written > 0);
4143 if (
usage->shared_blks_hit > 0)
4145 usage->shared_blks_hit);
4146 if (
usage->shared_blks_read > 0)
4148 usage->shared_blks_read);
4149 if (
usage->shared_blks_dirtied > 0)
4151 usage->shared_blks_dirtied);
4152 if (
usage->shared_blks_written > 0)
4154 usage->shared_blks_written);
4161 if (
usage->local_blks_hit > 0)
4163 usage->local_blks_hit);
4164 if (
usage->local_blks_read > 0)
4166 usage->local_blks_read);
4167 if (
usage->local_blks_dirtied > 0)
4169 usage->local_blks_dirtied);
4170 if (
usage->local_blks_written > 0)
4172 usage->local_blks_written);
4179 if (
usage->temp_blks_read > 0)
4181 usage->temp_blks_read);
4182 if (
usage->temp_blks_written > 0)
4184 usage->temp_blks_written);
4235 usage->shared_blks_hit, es);
4237 usage->shared_blks_read, es);
4239 usage->shared_blks_dirtied, es);
4241 usage->shared_blks_written, es);
4243 usage->local_blks_hit, es);
4245 usage->local_blks_read, es);
4247 usage->local_blks_dirtied, es);
4249 usage->local_blks_written, es);
4251 usage->temp_blks_read, es);
4253 usage->temp_blks_written, es);
4287 if ((
usage->wal_records > 0) || (
usage->wal_fpi > 0) ||
4288 (
usage->wal_bytes > 0) || (
usage->wal_buffers_full > 0) ||
4289 (
usage->wal_fpi_bytes > 0))
4294 if (
usage->wal_records > 0)
4296 usage->wal_records);
4297 if (
usage->wal_fpi > 0)
4300 if (
usage->wal_bytes > 0)
4303 if (
usage->wal_fpi_bytes > 0)
4305 usage->wal_fpi_bytes);
4306 if (
usage->wal_buffers_full > 0)
4308 usage->wal_buffers_full);
4315 usage->wal_records, es);
4317 usage->wal_fpi, es);
4319 usage->wal_bytes, es);
4321 usage->wal_fpi_bytes, es);
4323 usage->wal_buffers_full, es);
4372 switch (indexorderdir)
4418 char *
namespace =
NULL;
4425 if (refname ==
NULL)
4426 refname =
rte->eref->aliasname;
4491 elog(
ERROR,
"invalid TableFunc type %d",
4526 if (
namespace !=
NULL)
4538 if (
namespace !=
NULL)
4557 const char *operation;
4567 operation =
"Insert";
4571 operation =
"Update";
4575 operation =
"Delete";
4579 operation =
"Merge";
4642 fdwroutine !=
NULL &&
4677 "NOTHING" :
"UPDATE",
4691 &mtstate->
ps, ancestors, es);
4831 if (refname ==
NULL)
4832 refname =
rte->eref->aliasname;
4876 for (
j = 0;
j < nplans;
j++)
4878 "Member",
NULL, es);
4934 ancestors =
lcons(
sp, ancestors);
4943 else if (
sp->isInitPlan)
4965 foreach(cell,
css->custom_ps)
4986 wstate->num_workers = num_workers;
4987 wstate->worker_inited = (
bool *)
palloc0(num_workers *
sizeof(
bool));
4990 wstate->worker_state_save = (
int *)
palloc(num_workers *
sizeof(
int));
5008 if (!
wstate->worker_inited[n])
5028 wstate->worker_inited[n] =
true;
5101 for (
int i = 0;
i <
wstate->num_workers;
i++)
void ExplainExecuteQuery(ExecuteStmt *execstmt, IntoClause *into, ExplainState *es, ParseState *pstate, ParamListInfo params)
int bms_next_member(const Bitmapset *a, int prevbit)
bool bms_is_member(int x, const Bitmapset *a)
Bitmapset * bms_add_member(Bitmapset *a, int x)
Bitmapset * bms_add_members(Bitmapset *a, const Bitmapset *b)
#define unconstify(underlying_type, expr)
#define Assert(condition)
#define OidIsValid(objectId)
bool CreateTableAsRelExists(CreateTableAsStmt *ctas)
int GetIntoRelEFlags(IntoClause *intoClause)
DestReceiver * CreateIntoRelDestReceiver(IntoClause *intoClause)
char * defGetString(DefElem *def)
DestReceiver * None_Receiver
void ExecutorEnd(QueryDesc *queryDesc)
void ExecutorFinish(QueryDesc *queryDesc)
void ExecutorStart(QueryDesc *queryDesc, int eflags)
void ExecutorRun(QueryDesc *queryDesc, ScanDirection direction, uint64 count)
const TupleTableSlotOps TTSOpsVirtual
void end_tup_output(TupOutputState *tstate)
void do_text_output_multiline(TupOutputState *tstate, const char *txt)
TupOutputState * begin_tup_output_tupdesc(DestReceiver *dest, TupleDesc tupdesc, const TupleTableSlotOps *tts_ops)
#define outerPlanState(node)
#define innerPlanState(node)
#define EXEC_FLAG_EXPLAIN_GENERIC
#define do_text_output_oneline(tstate, str_to_emit)
#define EXEC_FLAG_EXPLAIN_ONLY
static void show_modifytable_info(ModifyTableState *mtstate, List *ancestors, ExplainState *es)
#define BYTES_TO_KILOBYTES(b)
static void show_plan_tlist(PlanState *planstate, List *ancestors, ExplainState *es)
static void show_memoize_info(MemoizeState *mstate, List *ancestors, ExplainState *es)
static void show_group_keys(GroupState *gstate, List *ancestors, ExplainState *es)
static void ExplainModifyTarget(ModifyTable *plan, ExplainState *es)
static void show_window_def(WindowAggState *planstate, List *ancestors, ExplainState *es)
static void show_result_replacement_info(Result *result, ExplainState *es)
static void show_agg_keys(AggState *astate, List *ancestors, ExplainState *es)
static void show_hashagg_info(AggState *aggstate, ExplainState *es)
static void show_scan_qual(List *qual, const char *qlabel, PlanState *planstate, List *ancestors, ExplainState *es)
static const char * explain_get_index_name(Oid indexId)
static void ExplainIndexScanDetails(Oid indexid, ScanDirection indexorderdir, ExplainState *es)
void ExplainOnePlan(PlannedStmt *plannedstmt, IntoClause *into, ExplainState *es, const char *queryString, ParamListInfo params, QueryEnvironment *queryEnv, const instr_time *planduration, const BufferUsage *bufusage, const MemoryContextCounters *mem_counters)
ExplainOneQuery_hook_type ExplainOneQuery_hook
static void show_instrumentation_count(const char *qlabel, int which, PlanState *planstate, ExplainState *es)
static void ExplainNode(PlanState *planstate, List *ancestors, const char *relationship, const char *plan_name, ExplainState *es)
static void show_incremental_sort_group_info(IncrementalSortGroupInfo *groupInfo, const char *groupLabel, bool indent, ExplainState *es)
static void ExplainMemberNodes(PlanState **planstates, int nplans, List *ancestors, ExplainState *es)
static void show_ctescan_info(CteScanState *ctescanstate, ExplainState *es)
explain_get_index_name_hook_type explain_get_index_name_hook
static bool ExplainPreScanNode(PlanState *planstate, Bitmapset **rels_used)
static void ExplainPrintJIT(ExplainState *es, int jit_flags, JitInstrumentation *ji)
static void show_recursive_union_info(RecursiveUnionState *rstate, ExplainState *es)
void ExplainQuery(ParseState *pstate, ExplainStmt *stmt, ParamListInfo params, DestReceiver *dest)
static void show_incremental_sort_info(IncrementalSortState *incrsortstate, ExplainState *es)
static void show_tablesample(TableSampleClause *tsc, PlanState *planstate, List *ancestors, ExplainState *es)
static void show_upper_qual(List *qual, const char *qlabel, PlanState *planstate, List *ancestors, ExplainState *es)
static void show_sort_info(SortState *sortstate, ExplainState *es)
static void show_window_keys(StringInfo buf, PlanState *planstate, int nkeys, AttrNumber *keycols, List *ancestors, ExplainState *es)
static void ExplainMissingMembers(int nplans, int nchildren, ExplainState *es)
explain_per_node_hook_type explain_per_node_hook
TupleDesc ExplainResultDesc(ExplainStmt *stmt)
static void ExplainFlushWorkersState(ExplainState *es)
static bool peek_buffer_usage(ExplainState *es, const BufferUsage *usage)
void ExplainPrintJITSummary(ExplainState *es, QueryDesc *queryDesc)
static void show_hash_info(HashState *hashstate, ExplainState *es)
static void show_sortorder_options(StringInfo buf, Node *sortexpr, Oid sortOperator, Oid collation, bool nullsFirst)
static void show_table_func_scan_info(TableFuncScanState *tscanstate, ExplainState *es)
static void show_indexsearches_info(PlanState *planstate, ExplainState *es)
static void show_expression(Node *node, const char *qlabel, PlanState *planstate, List *ancestors, bool useprefix, ExplainState *es)
static double elapsed_time(instr_time *starttime)
void ExplainQueryText(ExplainState *es, QueryDesc *queryDesc)
explain_per_plan_hook_type explain_per_plan_hook
static bool plan_is_disabled(Plan *plan)
static void show_sort_group_keys(PlanState *planstate, const char *qlabel, int nkeys, int nPresortedKeys, AttrNumber *keycols, Oid *sortOperators, Oid *collations, bool *nullsFirst, List *ancestors, ExplainState *es)
static void show_tidbitmap_info(BitmapHeapScanState *planstate, ExplainState *es)
static void show_windowagg_info(WindowAggState *winstate, ExplainState *es)
static void show_memory_counters(ExplainState *es, const MemoryContextCounters *mem_counters)
static void ExplainSubPlans(List *plans, List *ancestors, const char *relationship, ExplainState *es)
static void show_foreignscan_info(ForeignScanState *fsstate, ExplainState *es)
static void ExplainScanTarget(Scan *plan, ExplainState *es)
void ExplainPrintPlan(ExplainState *es, QueryDesc *queryDesc)
static void show_merge_append_keys(MergeAppendState *mstate, List *ancestors, ExplainState *es)
static void report_triggers(ResultRelInfo *rInfo, bool show_relname, ExplainState *es)
void ExplainQueryParameters(ExplainState *es, ParamListInfo params, int maxlen)
static void ExplainPrintSerialize(ExplainState *es, SerializeMetrics *metrics)
static void show_grouping_sets(PlanState *planstate, Agg *agg, List *ancestors, ExplainState *es)
static void ExplainPrintSettings(ExplainState *es)
static void ExplainCloseWorker(int n, ExplainState *es)
static void ExplainOpenWorker(int n, ExplainState *es)
static void ExplainOneQuery(Query *query, int cursorOptions, IntoClause *into, ExplainState *es, ParseState *pstate, ParamListInfo params)
static void ExplainTargetRel(Plan *plan, Index rti, ExplainState *es)
void ExplainOneUtility(Node *utilityStmt, IntoClause *into, ExplainState *es, ParseState *pstate, ParamListInfo params)
static void show_wal_usage(ExplainState *es, const WalUsage *usage)
static void show_storage_info(char *maxStorageType, int64 maxSpaceUsed, ExplainState *es)
static void show_grouping_set_keys(PlanState *planstate, Agg *aggnode, Sort *sortnode, List *context, bool useprefix, List *ancestors, ExplainState *es)
static void show_qual(List *qual, const char *qlabel, PlanState *planstate, List *ancestors, bool useprefix, ExplainState *es)
static void show_material_info(MaterialState *mstate, ExplainState *es)
static void show_sort_keys(SortState *sortstate, List *ancestors, ExplainState *es)
static ExplainWorkersState * ExplainCreateWorkersState(int num_workers)
void ExplainPrintTriggers(ExplainState *es, QueryDesc *queryDesc)
void standard_ExplainOneQuery(Query *query, int cursorOptions, IntoClause *into, ExplainState *es, const char *queryString, ParamListInfo params, QueryEnvironment *queryEnv)
static void show_buffer_usage(ExplainState *es, const BufferUsage *usage)
static void show_incremental_sort_keys(IncrementalSortState *incrsortstate, List *ancestors, ExplainState *es)
static void ExplainCustomChildren(CustomScanState *css, List *ancestors, ExplainState *es)
const char *(* explain_get_index_name_hook_type)(Oid indexId)
void(* explain_per_plan_hook_type)(PlannedStmt *plannedstmt, IntoClause *into, ExplainState *es, const char *queryString, ParamListInfo params, QueryEnvironment *queryEnv)
void(* explain_per_node_hook_type)(PlanState *planstate, List *ancestors, const char *relationship, const char *plan_name, ExplainState *es)
void(* ExplainOneQuery_hook_type)(Query *query, int cursorOptions, IntoClause *into, ExplainState *es, const char *queryString, ParamListInfo params, QueryEnvironment *queryEnv)
SerializeMetrics GetSerializationMetrics(DestReceiver *dest)
DestReceiver * CreateExplainSerializeDestReceiver(ExplainState *es)
ExplainState * NewExplainState(void)
void ParseExplainOptionList(ExplainState *es, List *options, ParseState *pstate)
@ EXPLAIN_SERIALIZE_BINARY
#define palloc_object(type)
char * GetConfigOptionByName(const char *name, const char **varname, bool missing_ok)
struct config_generic ** get_explain_guc_options(int *num)
#define INSTR_TIME_SET_CURRENT(t)
#define INSTR_TIME_ADD(x, y)
#define INSTR_TIME_IS_ZERO(t)
#define INSTR_TIME_GET_DOUBLE(t)
#define INSTR_TIME_SUBTRACT(x, y)
#define INSTR_TIME_GET_MILLISEC(t)
#define INSTR_TIME_SET_ZERO(t)
void InstrEndLoop(Instrumentation *instr)
BufferUsage pgBufferUsage
void BufferUsageAccumDiff(BufferUsage *dst, const BufferUsage *add, const BufferUsage *sub)
#define NUM_TUPLESORTMETHODS
@ SORT_TYPE_STILL_IN_PROGRESS
void InstrJitAgg(JitInstrumentation *dst, JitInstrumentation *add)
List * lappend(List *list, void *datum)
List * list_delete_first(List *list)
List * lcons(void *datum, List *list)
char * get_rel_name(Oid relid)
char * get_opname(Oid opno)
Oid get_equality_op_for_ordering_op(Oid opno, bool *reverse)
Oid get_rel_namespace(Oid relid)
Oid get_typcollation(Oid typid)
char * get_collation_name(Oid colloid)
char * get_namespace_name_or_temp(Oid nspid)
char * get_constraint_name(Oid conoid)
char * get_func_name(Oid funcid)
Oid get_func_namespace(Oid funcid)
Expr * make_orclause(List *orclauses)
Expr * make_ands_explicit(List *andclauses)
Expr * make_andclause(List *andclauses)
void MemoryContextMemConsumed(MemoryContext context, MemoryContextCounters *consumed)
char * pstrdup(const char *in)
void pfree(void *pointer)
void * palloc0(Size size)
MemoryContext CurrentMemoryContext
#define AllocSetContextCreate
#define ALLOCSET_DEFAULT_SIZES
Oid exprType(const Node *expr)
#define planstate_tree_walker(ps, w, c)
#define DO_AGGSPLIT_SKIPFINAL(as)
#define IsA(nodeptr, _type_)
#define DO_AGGSPLIT_COMBINE(as)
#define castNode(_type_, nodeptr)
static MemoryContext MemoryContextSwitchTo(MemoryContext context)
char * BuildParamLogString(ParamListInfo params, char **knownTextValues, int maxlen)
TargetEntry * get_tle_by_resno(List *tlist, AttrNumber resno)
#define CURSOR_OPT_PARALLEL_OK
#define FRAMEOPTION_NONDEFAULT
post_parse_analyze_hook_type post_parse_analyze_hook
#define rt_fetch(rangetable_index, rangetable)
#define lfirst_node(type, lc)
static int list_length(const List *l)
#define linitial_node(type, l)
#define foreach_current_index(var_or_cell)
static void * list_nth(const List *list, int n)
static ListCell * lnext(const List *l, const ListCell *c)
static char buf[DEFAULT_XLOG_SEG_SIZE]
PlannedStmt * pg_plan_query(Query *querytree, const char *query_string, int cursorOptions, ParamListInfo boundParams, ExplainState *es)
void FreeQueryDesc(QueryDesc *qdesc)
QueryDesc * CreateQueryDesc(PlannedStmt *plannedstmt, const char *sourceText, Snapshot snapshot, Snapshot crosscheck_snapshot, DestReceiver *dest, ParamListInfo params, QueryEnvironment *queryEnv, int instrument_options)
char * psprintf(const char *fmt,...)
@ COMPUTE_QUERY_ID_REGRESS
static bool IsQueryIdEnabled(void)
JumbleState * JumbleQuery(Query *query)
static const struct fns functions
#define RelationGetRelationName(relation)
List * QueryRewrite(Query *parsetree)
List * deparse_context_for_plan_tree(PlannedStmt *pstmt, List *rtable_names)
List * set_deparse_context_plan(List *dpcontext, Plan *plan, List *ancestors)
const char * quote_identifier(const char *ident)
List * select_rtable_names_for_explain(List *rtable, Bitmapset *rels_used)
char * get_window_frame_options_for_explain(int frameOptions, Node *startOffset, Node *endOffset, List *dpcontext, bool forceprefix)
char * deparse_expression(Node *expr, List *dpcontext, bool forceprefix, bool showimplicit)
#define ScanDirectionIsBackward(direction)
@ NoMovementScanDirection
void UpdateActiveSnapshotCommandId(void)
void PopActiveSnapshot(void)
void PushCopiedSnapshot(Snapshot snapshot)
Snapshot GetActiveSnapshot(void)
void resetStringInfo(StringInfo str)
void appendStringInfo(StringInfo str, const char *fmt,...)
void appendStringInfoSpaces(StringInfo str, int count)
void appendStringInfoString(StringInfo str, const char *s)
void appendStringInfoChar(StringInfo str, char ch)
void initStringInfo(StringInfo str)
ParallelBitmapHeapState * pstate
BitmapHeapScanInstrumentation stats
SharedBitmapHeapInstrumentation * sinstrument
IndexScanInstrumentation biss_Instrument
List * es_tuple_routing_result_relations
struct JitContext * es_jit
struct JitInstrumentation * es_jit_worker_instr
Bitmapset * es_unpruned_relids
List * es_trig_target_relations
List * es_opened_result_relations
Bitmapset * printed_subplans
ExplainWorkersState * workers_state
ExplainSerializeOption serialize
ExplainForeignScan_function ExplainForeignScan
ExplainForeignModify_function ExplainForeignModify
ExplainDirectModify_function ExplainDirectModify
struct FdwRoutine * fdwroutine
IncrementalSortGroupInfo prefixsortGroupInfo
IncrementalSortGroupInfo fullsortGroupInfo
IndexScanInstrumentation ioss_Instrument
IndexScanInstrumentation iss_Instrument
ResultRelInfo * resultRelInfo
OnConflictAction onConflictAction
QueryEnvironment * p_queryEnv
const char * p_sourcetext
struct SharedJitInstrumentation * worker_jit_instrument
Instrumentation * instrument
WorkerInstrumentation * worker_instrument
PlannedStmt * plannedstmt
Tuplestorestate * working_table
Tuplestorestate * intermediate_table
struct FdwRoutine * ri_FdwRoutine
bool ri_usesFdwDirectModify
BitmapHeapScanInstrumentation sinstrument[FLEXIBLE_ARRAY_MEMBER]
HashInstrumentation hinstrument[FLEXIBLE_ARRAY_MEMBER]
JitInstrumentation jit_instr[FLEXIBLE_ARRAY_MEMBER]
TuplesortInstrumentation sinstrument[FLEXIBLE_ARRAY_MEMBER]
SharedSortInfo * shared_info
TuplesortMethod sortMethod
TuplesortSpaceType spaceType
Instrumentation instrument[FLEXIBLE_ARRAY_MEMBER]
TupleDesc CreateTemplateTupleDesc(int natts)
void TupleDescInitEntry(TupleDesc desc, AttrNumber attributeNumber, const char *attributeName, Oid oidtypeid, int32 typmod, int attdim)
void tuplesort_get_stats(Tuplesortstate *state, TuplesortInstrumentation *stats)
const char * tuplesort_space_type_name(TuplesortSpaceType t)
const char * tuplesort_method_name(TuplesortMethod m)
void tuplestore_get_stats(Tuplestorestate *state, char **max_storage_type, int64 *max_space)
TypeCacheEntry * lookup_type_cache(Oid type_id, int flags)
Datum bit(PG_FUNCTION_ARGS)
void CommandCounterIncrement(void)