64#define BYTES_TO_KILOBYTES(b) (((b) + 1023) / 1024)
196 (*post_parse_analyze_hook) (pstate, query,
jstate);
263 foreach(
lc,
stmt->options)
271 if (
strcmp(p,
"xml") == 0)
273 else if (
strcmp(p,
"json") == 0)
309 (*ExplainOneQuery_hook) (query, cursorOptions, into, es,
346 "explain analyze planner context",
396 if (utilityStmt ==
NULL)
421 elog(
ERROR,
"unexpected object type: %d",
422 (
int)
ctas->objtype);
478 "Utility statements have no plan structure\n");
506 double totaltime = 0;
596 dest->rDestroy(dest);
653 (*explain_per_plan_hook) (plannedstmt, into, es, queryString,
708 for (
int i = 0;
i < num;
i++)
730 for (
int i = 0;
i < num;
i++)
909 if (!
ji ||
ji->created_functions == 0)
933 "Inlining", jit_flags &
PGJIT_INLINE ?
"true" :
"false",
934 "Optimization", jit_flags &
PGJIT_OPT3 ?
"true" :
"false",
935 "Expressions", jit_flags &
PGJIT_EXPR ?
"true" :
"false",
936 "Deforming", jit_flags &
PGJIT_DEFORM ?
"true" :
"false");
942 "Timing: %s %.3f ms (%s %.3f ms), %s %.3f ms, %s %.3f ms, %s %.3f ms, %s %.3f ms\n",
1082 if (params ==
NULL || params->
numParams <= 0 || maxlen == 0)
1086 if (
str &&
str[0] !=
'\0')
1099 if (!
rInfo->ri_TrigDesc || !
rInfo->ri_TrigInstrument)
1101 for (
nt = 0;
nt <
rInfo->ri_TrigDesc->numtriggers;
nt++)
1106 char *conname =
NULL;
1225 if (
plan->targetlist)
1260 if (
plan->disabled_nodes == 0)
1279 foreach(
lc,
aplan->appendplans)
1367 const char *strategy =
NULL;
1369 const char *operation =
NULL;
1395 sname =
"ModifyTable";
1399 pname = operation =
"Insert";
1402 pname = operation =
"Update";
1405 pname = operation =
"Delete";
1408 pname = operation =
"Merge";
1435 sname =
"Merge Join";
1439 sname =
"Hash Join";
1493 sname =
"Foreign Scan";
1497 pname =
"Foreign Scan";
1498 operation =
"Select";
1501 pname =
"Foreign Insert";
1502 operation =
"Insert";
1505 pname =
"Foreign Update";
1506 operation =
"Update";
1509 pname =
"Foreign Delete";
1510 operation =
"Delete";
1518 sname =
"Custom Scan";
1544 sname =
"Aggregate";
1545 switch (
agg->aggstrategy)
1548 pname =
"Aggregate";
1552 pname =
"GroupAggregate";
1553 strategy =
"Sorted";
1556 pname =
"HashAggregate";
1557 strategy =
"Hashed";
1560 pname =
"MixedAggregate";
1564 pname =
"Aggregate ???";
1595 strategy =
"Sorted";
1598 pname =
"HashSetOp";
1599 strategy =
"Hashed";
1602 pname =
"SetOp ???";
1639 if (
plan->parallel_aware)
1641 if (
plan->async_capable)
1682 if (((
Scan *)
plan)->scanrelid > 0)
1708 const char *indexname =
1725 const char *jointype;
1748 jointype =
"Right Semi";
1751 jointype =
"Right Anti";
1809 plan->startup_cost,
plan->total_cost,
1810 plan->plan_rows,
plan->plan_width);
1901 double nloops = instrument->
nloops;
1910 rows = instrument->
ntuples / nloops;
1967 "Index Cond", planstate, ancestors, es);
1972 "Order By", planstate, ancestors, es);
1981 "Index Cond", planstate, ancestors, es);
1986 "Order By", planstate, ancestors, es);
1998 "Index Cond", planstate, ancestors, es);
2003 "Recheck Cond", planstate, ancestors, es);
2015 planstate, ancestors, es);
2040 gather->num_workers, es);
2046 nworkers = ((
GatherState *) planstate)->nworkers_launched;
2064 gm->num_workers, es);
2090 "Function Call", planstate, ancestors,
2104 "Table Function Call", planstate, ancestors,
2163 if (
css->methods->ExplainCustomScan)
2164 css->methods->ExplainCustomScan(
css, ancestors, es);
2169 "Join Filter", planstate, ancestors, es);
2180 "Merge Cond", planstate, ancestors, es);
2182 "Join Filter", planstate, ancestors, es);
2193 "Hash Cond", planstate, ancestors, es);
2195 "Join Filter", planstate, ancestors, es);
2215 "Run Condition", planstate, ancestors, es);
2246 "One-Time Filter", planstate, ancestors, es);
2308 double nloops = instrument->
nloops;
2329 (*explain_per_node_hook) (planstate, ancestors,
relationship,
2414 "Subquery",
NULL, es);
2489 foreach(
lc,
plan->targetlist)
2583 plan->numCols, 0,
plan->sortColIdx,
2584 plan->sortOperators,
plan->collations,
2599 plan->sort.numCols,
plan->nPresortedCols,
2600 plan->sort.sortColIdx,
2601 plan->sort.sortOperators,
plan->sort.collations,
2602 plan->sort.nullsFirst,
2616 plan->numCols, 0,
plan->sortColIdx,
2617 plan->sortOperators,
plan->collations,
2631 if (
plan->numCols > 0 ||
plan->groupingSets)
2636 if (
plan->groupingSets)
2667 foreach(
lc,
agg->chain)
2709 sortnode->
numCols, 0, sortnode->sortColIdx,
2710 sortnode->sortOperators, sortnode->collations,
2711 sortnode->nullsFirst,
2802 for (keyno = 0; keyno < nkeys; keyno++)
2818 if (sortOperators !=
NULL)
2821 sortOperators[keyno],
2844 bool reverse =
false;
2861 if (collname ==
NULL)
2862 elog(
ERROR,
"cache lookup failed for collation %u", collation);
2867 if (sortOperator == typentry->
gt_opr)
2872 else if (sortOperator != typentry->
lt_opr)
2877 elog(
ERROR,
"cache lookup failed for operator %u", sortOperator);
2909 if (
wagg->partNumCols > 0)
2913 wagg->partNumCols,
wagg->partColIdx,
2917 if (
wagg->ordNumCols > 0)
2975 for (
int keyno = 0; keyno < nkeys; keyno++)
3048 foreach(
lc,
tsc->args)
3056 if (
tsc->repeatable)
3103 const char *sortMethod;
3104 const char *spaceType;
3116 sortMethod, spaceType, spaceUsed);
3142 const char *sortMethod;
3143 const char *spaceType;
3161 sortMethod, spaceType, spaceUsed);
3196 if (
groupInfo->sortMethods & sortMethod)
3305 fullsortGroupInfo = &
incrsortstate->incsort_info.fullsortGroupInfo;
3322 prefixsortGroupInfo = &
incrsortstate->incsort_info.prefixsortGroupInfo;
3338 for (n = 0; n <
incrsortstate->shared_info->num_workers; n++)
3432 if (hinstrument.
nbatch > 0)
3454 "Buckets: %d (originally %d) Batches: %d (originally %d) Memory Usage: " UINT64_FORMAT "kB\n",
3465 "Buckets: %d Batches: %d Memory Usage: " UINT64_FORMAT "kB\n",
3616 foreach(
lc,
mplan->param_exprs)
3637 appendStringInfo(es->
str,
"Estimates: capacity=%u distinct keys=%.0f lookups=%.0f hit percent=%.2f%%\n",
3639 mplan->est_calls,
mplan->est_hit_ratio * 100.0);
3653 if (
mstate->stats.cache_misses > 0)
3659 if (
mstate->stats.mem_peak > 0)
3677 mstate->stats.cache_hits,
3678 mstate->stats.cache_misses,
3679 mstate->stats.cache_evictions,
3680 mstate->stats.cache_overflows,
3689 for (
int n = 0; n <
mstate->shared_info->num_workers; n++)
3693 si = &
mstate->shared_info->sinstrument[n];
3699 if (
si->cache_misses == 0)
3718 si->cache_hits,
si->cache_misses,
3719 si->cache_evictions,
si->cache_overflows,
3725 si->cache_hits, es);
3727 si->cache_misses, es);
3729 si->cache_evictions, es);
3731 si->cache_overflows, es);
3758 aggstate->hash_planned_partitions, es);
3782 aggstate->hash_planned_partitions);
3803 if (
aggstate->hash_batches_used > 1)
3817 for (
int n = 0; n <
aggstate->shared_info->num_workers; n++)
3821 int hash_batches_used;
3823 sinstrument = &
aggstate->shared_info->sinstrument[n];
3842 if (hash_batches_used > 1)
3850 hash_batches_used, es);
3958 if (
si->exact_pages == 0 &&
si->lossy_pages == 0)
3968 if (
si->exact_pages > 0)
3970 if (
si->lossy_pages > 0)
3977 si->exact_pages, es);
3979 si->lossy_pages, es);
4056 result = (*explain_get_index_name_hook) (
indexId);
4091 usage->shared_blks_read > 0 ||
4092 usage->shared_blks_dirtied > 0 ||
4093 usage->shared_blks_written > 0);
4095 usage->local_blks_read > 0 ||
4096 usage->local_blks_dirtied > 0 ||
4097 usage->local_blks_written > 0);
4099 usage->temp_blks_written > 0);
4120 usage->shared_blks_read > 0 ||
4121 usage->shared_blks_dirtied > 0 ||
4122 usage->shared_blks_written > 0);
4124 usage->local_blks_read > 0 ||
4125 usage->local_blks_dirtied > 0 ||
4126 usage->local_blks_written > 0);
4128 usage->temp_blks_written > 0);
4145 if (
usage->shared_blks_hit > 0)
4147 usage->shared_blks_hit);
4148 if (
usage->shared_blks_read > 0)
4150 usage->shared_blks_read);
4151 if (
usage->shared_blks_dirtied > 0)
4153 usage->shared_blks_dirtied);
4154 if (
usage->shared_blks_written > 0)
4156 usage->shared_blks_written);
4163 if (
usage->local_blks_hit > 0)
4165 usage->local_blks_hit);
4166 if (
usage->local_blks_read > 0)
4168 usage->local_blks_read);
4169 if (
usage->local_blks_dirtied > 0)
4171 usage->local_blks_dirtied);
4172 if (
usage->local_blks_written > 0)
4174 usage->local_blks_written);
4181 if (
usage->temp_blks_read > 0)
4183 usage->temp_blks_read);
4184 if (
usage->temp_blks_written > 0)
4186 usage->temp_blks_written);
4237 usage->shared_blks_hit, es);
4239 usage->shared_blks_read, es);
4241 usage->shared_blks_dirtied, es);
4243 usage->shared_blks_written, es);
4245 usage->local_blks_hit, es);
4247 usage->local_blks_read, es);
4249 usage->local_blks_dirtied, es);
4251 usage->local_blks_written, es);
4253 usage->temp_blks_read, es);
4255 usage->temp_blks_written, es);
4289 if ((
usage->wal_records > 0) || (
usage->wal_fpi > 0) ||
4290 (
usage->wal_bytes > 0) || (
usage->wal_buffers_full > 0) ||
4291 (
usage->wal_fpi_bytes > 0))
4296 if (
usage->wal_records > 0)
4298 usage->wal_records);
4299 if (
usage->wal_fpi > 0)
4302 if (
usage->wal_bytes > 0)
4305 if (
usage->wal_fpi_bytes > 0)
4307 usage->wal_fpi_bytes);
4308 if (
usage->wal_buffers_full > 0)
4310 usage->wal_buffers_full);
4317 usage->wal_records, es);
4319 usage->wal_fpi, es);
4321 usage->wal_bytes, es);
4323 usage->wal_fpi_bytes, es);
4325 usage->wal_buffers_full, es);
4374 switch (indexorderdir)
4420 char *
namespace =
NULL;
4427 if (refname ==
NULL)
4428 refname =
rte->eref->aliasname;
4493 elog(
ERROR,
"invalid TableFunc type %d",
4528 if (
namespace !=
NULL)
4540 if (
namespace !=
NULL)
4559 const char *operation;
4569 operation =
"Insert";
4573 operation =
"Update";
4577 operation =
"Delete";
4581 operation =
"Merge";
4644 fdwroutine !=
NULL &&
4719 &mtstate->
ps, ancestors, es);
4859 if (refname ==
NULL)
4860 refname =
rte->eref->aliasname;
4904 for (
j = 0;
j < nplans;
j++)
4906 "Member",
NULL, es);
4962 ancestors =
lcons(
sp, ancestors);
4971 else if (
sp->isInitPlan)
4993 foreach(cell,
css->custom_ps)
5014 wstate->num_workers = num_workers;
5015 wstate->worker_inited = (
bool *)
palloc0(num_workers *
sizeof(
bool));
5018 wstate->worker_state_save = (
int *)
palloc(num_workers *
sizeof(
int));
5036 if (!
wstate->worker_inited[n])
5056 wstate->worker_inited[n] =
true;
5129 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
LockClauseStrength onConflictLockStrength
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 TupleDescFinalize(TupleDesc tupdesc)
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)