PostgreSQL Source Code
git master
|
#include "postgres.h"
#include "access/xact.h"
#include "catalog/pg_type.h"
#include "commands/createas.h"
#include "commands/defrem.h"
#include "commands/prepare.h"
#include "executor/nodeHash.h"
#include "foreign/fdwapi.h"
#include "jit/jit.h"
#include "nodes/extensible.h"
#include "nodes/makefuncs.h"
#include "nodes/nodeFuncs.h"
#include "parser/analyze.h"
#include "parser/parsetree.h"
#include "rewrite/rewriteHandler.h"
#include "storage/bufmgr.h"
#include "tcop/tcopprot.h"
#include "utils/builtins.h"
#include "utils/guc_tables.h"
#include "utils/json.h"
#include "utils/lsyscache.h"
#include "utils/rel.h"
#include "utils/ruleutils.h"
#include "utils/snapmgr.h"
#include "utils/tuplesort.h"
#include "utils/typcache.h"
#include "utils/xml.h"
Go to the source code of this file.
Macros | |
#define | X_OPENING 0 |
#define | X_CLOSING 1 |
#define | X_CLOSE_IMMEDIATE 2 |
#define | X_NOWHITESPACE 4 |
Functions | |
static void | ExplainOneQuery (Query *query, int cursorOptions, IntoClause *into, ExplainState *es, const char *queryString, ParamListInfo params, QueryEnvironment *queryEnv) |
static void | ExplainPrintJIT (ExplainState *es, int jit_flags, JitInstrumentation *ji) |
static void | report_triggers (ResultRelInfo *rInfo, bool show_relname, ExplainState *es) |
static double | elapsed_time (instr_time *starttime) |
static bool | ExplainPreScanNode (PlanState *planstate, Bitmapset **rels_used) |
static void | ExplainNode (PlanState *planstate, List *ancestors, const char *relationship, const char *plan_name, ExplainState *es) |
static void | show_plan_tlist (PlanState *planstate, List *ancestors, ExplainState *es) |
static void | show_expression (Node *node, const char *qlabel, PlanState *planstate, List *ancestors, bool useprefix, ExplainState *es) |
static void | show_qual (List *qual, const char *qlabel, PlanState *planstate, List *ancestors, bool useprefix, ExplainState *es) |
static void | show_scan_qual (List *qual, const char *qlabel, 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_keys (SortState *sortstate, List *ancestors, ExplainState *es) |
static void | show_incremental_sort_keys (IncrementalSortState *incrsortstate, List *ancestors, ExplainState *es) |
static void | show_merge_append_keys (MergeAppendState *mstate, List *ancestors, ExplainState *es) |
static void | show_agg_keys (AggState *astate, List *ancestors, ExplainState *es) |
static void | show_grouping_sets (PlanState *planstate, Agg *agg, List *ancestors, 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_group_keys (GroupState *gstate, List *ancestors, ExplainState *es) |
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_sortorder_options (StringInfo buf, Node *sortexpr, Oid sortOperator, Oid collation, bool nullsFirst) |
static void | show_tablesample (TableSampleClause *tsc, PlanState *planstate, List *ancestors, ExplainState *es) |
static void | show_sort_info (SortState *sortstate, ExplainState *es) |
static void | show_incremental_sort_info (IncrementalSortState *incrsortstate, ExplainState *es) |
static void | show_hash_info (HashState *hashstate, ExplainState *es) |
static void | show_memoize_info (MemoizeState *mstate, List *ancestors, ExplainState *es) |
static void | show_hashagg_info (AggState *aggstate, ExplainState *es) |
static void | show_tidbitmap_info (BitmapHeapScanState *planstate, ExplainState *es) |
static void | show_instrumentation_count (const char *qlabel, int which, PlanState *planstate, ExplainState *es) |
static void | show_foreignscan_info (ForeignScanState *fsstate, ExplainState *es) |
static void | show_eval_params (Bitmapset *bms_params, ExplainState *es) |
static const char * | explain_get_index_name (Oid indexId) |
static void | show_buffer_usage (ExplainState *es, const BufferUsage *usage, bool planning) |
static void | show_wal_usage (ExplainState *es, const WalUsage *usage) |
static void | ExplainIndexScanDetails (Oid indexid, ScanDirection indexorderdir, ExplainState *es) |
static void | ExplainScanTarget (Scan *plan, ExplainState *es) |
static void | ExplainModifyTarget (ModifyTable *plan, ExplainState *es) |
static void | ExplainTargetRel (Plan *plan, Index rti, ExplainState *es) |
static void | show_modifytable_info (ModifyTableState *mtstate, List *ancestors, ExplainState *es) |
static void | ExplainMemberNodes (PlanState **planstates, int nplans, List *ancestors, ExplainState *es) |
static void | ExplainMissingMembers (int nplans, int nchildren, ExplainState *es) |
static void | ExplainSubPlans (List *plans, List *ancestors, const char *relationship, ExplainState *es) |
static void | ExplainCustomChildren (CustomScanState *css, List *ancestors, ExplainState *es) |
static ExplainWorkersState * | ExplainCreateWorkersState (int num_workers) |
static void | ExplainOpenWorker (int n, ExplainState *es) |
static void | ExplainCloseWorker (int n, ExplainState *es) |
static void | ExplainFlushWorkersState (ExplainState *es) |
static void | ExplainProperty (const char *qlabel, const char *unit, const char *value, bool numeric, ExplainState *es) |
static void | ExplainOpenSetAsideGroup (const char *objtype, const char *labelname, bool labeled, int depth, ExplainState *es) |
static void | ExplainSaveGroup (ExplainState *es, int depth, int *state_save) |
static void | ExplainRestoreGroup (ExplainState *es, int depth, int *state_save) |
static void | ExplainDummyGroup (const char *objtype, const char *labelname, ExplainState *es) |
static void | ExplainXMLTag (const char *tagname, int flags, ExplainState *es) |
static void | ExplainIndentText (ExplainState *es) |
static void | ExplainJSONLineEnding (ExplainState *es) |
static void | ExplainYAMLLineStarting (ExplainState *es) |
static void | escape_yaml (StringInfo buf, const char *str) |
void | ExplainQuery (ParseState *pstate, ExplainStmt *stmt, ParamListInfo params, DestReceiver *dest) |
ExplainState * | NewExplainState (void) |
TupleDesc | ExplainResultDesc (ExplainStmt *stmt) |
void | ExplainOneUtility (Node *utilityStmt, IntoClause *into, ExplainState *es, const char *queryString, ParamListInfo params, QueryEnvironment *queryEnv) |
void | ExplainOnePlan (PlannedStmt *plannedstmt, IntoClause *into, ExplainState *es, const char *queryString, ParamListInfo params, QueryEnvironment *queryEnv, const instr_time *planduration, const BufferUsage *bufusage) |
static void | ExplainPrintSettings (ExplainState *es) |
void | ExplainPrintPlan (ExplainState *es, QueryDesc *queryDesc) |
void | ExplainPrintTriggers (ExplainState *es, QueryDesc *queryDesc) |
void | ExplainPrintJITSummary (ExplainState *es, QueryDesc *queryDesc) |
void | ExplainQueryText (ExplainState *es, QueryDesc *queryDesc) |
void | ExplainQueryParameters (ExplainState *es, ParamListInfo params, int maxlen) |
static void | show_incremental_sort_group_info (IncrementalSortGroupInfo *groupInfo, const char *groupLabel, bool indent, ExplainState *es) |
void | ExplainPropertyList (const char *qlabel, List *data, ExplainState *es) |
void | ExplainPropertyListNested (const char *qlabel, List *data, ExplainState *es) |
void | ExplainPropertyText (const char *qlabel, const char *value, ExplainState *es) |
void | ExplainPropertyInteger (const char *qlabel, const char *unit, int64 value, ExplainState *es) |
void | ExplainPropertyUInteger (const char *qlabel, const char *unit, uint64 value, ExplainState *es) |
void | ExplainPropertyFloat (const char *qlabel, const char *unit, double value, int ndigits, ExplainState *es) |
void | ExplainPropertyBool (const char *qlabel, bool value, ExplainState *es) |
void | ExplainOpenGroup (const char *objtype, const char *labelname, bool labeled, ExplainState *es) |
void | ExplainCloseGroup (const char *objtype, const char *labelname, bool labeled, ExplainState *es) |
void | ExplainBeginOutput (ExplainState *es) |
void | ExplainEndOutput (ExplainState *es) |
void | ExplainSeparatePlans (ExplainState *es) |
Variables | |
ExplainOneQuery_hook_type | ExplainOneQuery_hook = NULL |
explain_get_index_name_hook_type | explain_get_index_name_hook = NULL |
|
static |
Definition at line 1092 of file explain.c.
References INSTR_TIME_GET_DOUBLE, INSTR_TIME_SET_CURRENT, and INSTR_TIME_SUBTRACT.
Referenced by ExplainOnePlan(), and IsCheckpointOnSchedule().
|
static |
Definition at line 5059 of file explain.c.
References buf, escape_json(), and generate_unaccent_rules::str.
Referenced by ExplainDummyGroup(), ExplainProperty(), ExplainPropertyList(), and ExplainPropertyListNested().
|
static |
Definition at line 3529 of file explain.c.
References elog(), ERROR, explain_get_index_name_hook, and get_rel_name().
Referenced by ExplainIndexScanDetails(), and ExplainNode().
void ExplainBeginOutput | ( | ExplainState * | es | ) |
Definition at line 4883 of file explain.c.
References appendStringInfoChar(), appendStringInfoString(), EXPLAIN_FORMAT_JSON, EXPLAIN_FORMAT_TEXT, EXPLAIN_FORMAT_XML, EXPLAIN_FORMAT_YAML, ExplainState::format, ExplainState::grouping_stack, ExplainState::indent, lcons_int(), and ExplainState::str.
Referenced by explain_ExecutorEnd(), and ExplainQuery().
void ExplainCloseGroup | ( | const char * | objtype, |
const char * | labelname, | ||
bool | labeled, | ||
ExplainState * | es | ||
) |
Definition at line 4690 of file explain.c.
References appendStringInfoChar(), appendStringInfoSpaces(), EXPLAIN_FORMAT_JSON, EXPLAIN_FORMAT_TEXT, EXPLAIN_FORMAT_XML, EXPLAIN_FORMAT_YAML, ExplainXMLTag(), ExplainState::format, ExplainState::grouping_stack, ExplainState::indent, list_delete_first(), ExplainState::str, and X_CLOSING.
Referenced by ExplainFlushWorkersState(), ExplainNode(), ExplainOnePlan(), ExplainPrintJIT(), ExplainPrintSettings(), ExplainPrintTriggers(), report_triggers(), show_grouping_set_keys(), show_grouping_sets(), show_incremental_sort_group_info(), and show_modifytable_info().
|
static |
Definition at line 4320 of file explain.c.
References Assert(), StringInfoData::data, EXPLAIN_FORMAT_TEXT, ExplainSaveGroup(), ExplainState::format, ExplainState::indent, StringInfoData::len, ExplainWorkersState::prev_str, ExplainState::str, ExplainWorkersState::worker_inited, ExplainWorkersState::worker_state_save, and ExplainState::workers_state.
Referenced by ExplainNode(), show_hashagg_info(), show_incremental_sort_info(), show_memoize_info(), and show_sort_info().
|
static |
Definition at line 4241 of file explain.c.
References ExplainWorkersState::num_workers, palloc(), palloc0(), ExplainWorkersState::worker_inited, ExplainWorkersState::worker_state_save, and ExplainWorkersState::worker_str.
Referenced by ExplainNode().
|
static |
Definition at line 4219 of file explain.c.
References CustomScanState::custom_ps, ExplainNode(), label, lfirst, and list_length().
Referenced by ExplainNode().
|
static |
Definition at line 4837 of file explain.c.
References appendStringInfoSpaces(), appendStringInfoString(), escape_json(), escape_yaml(), EXPLAIN_FORMAT_JSON, EXPLAIN_FORMAT_TEXT, EXPLAIN_FORMAT_XML, EXPLAIN_FORMAT_YAML, ExplainJSONLineEnding(), ExplainXMLTag(), ExplainYAMLLineStarting(), ExplainState::format, ExplainState::indent, ExplainState::str, and X_CLOSE_IMMEDIATE.
Referenced by ExplainOneUtility().
void ExplainEndOutput | ( | ExplainState * | es | ) |
Definition at line 4914 of file explain.c.
References appendStringInfoString(), EXPLAIN_FORMAT_JSON, EXPLAIN_FORMAT_TEXT, EXPLAIN_FORMAT_XML, EXPLAIN_FORMAT_YAML, ExplainState::format, ExplainState::grouping_stack, ExplainState::indent, list_delete_first(), and ExplainState::str.
Referenced by explain_ExecutorEnd(), and ExplainQuery().
|
static |
Definition at line 4356 of file explain.c.
References appendStringInfoString(), StringInfoData::data, ExplainCloseGroup(), ExplainOpenGroup(), i, ExplainWorkersState::num_workers, pfree(), ExplainState::str, ExplainWorkersState::worker_inited, ExplainWorkersState::worker_state_save, ExplainWorkersState::worker_str, and ExplainState::workers_state.
Referenced by ExplainNode().
|
static |
Definition at line 4999 of file explain.c.
References appendStringInfoSpaces(), Assert(), StringInfoData::data, EXPLAIN_FORMAT_TEXT, ExplainState::format, ExplainState::indent, StringInfoData::len, and ExplainState::str.
Referenced by ExplainNode(), ExplainOpenWorker(), ExplainPrintJIT(), ExplainProperty(), ExplainPropertyList(), show_buffer_usage(), show_hash_info(), show_hashagg_info(), show_memoize_info(), show_modifytable_info(), show_sort_info(), show_tablesample(), show_tidbitmap_info(), and show_wal_usage().
|
static |
Definition at line 3751 of file explain.c.
References appendStringInfo(), appendStringInfoString(), BackwardScanDirection, EXPLAIN_FORMAT_TEXT, explain_get_index_name(), ExplainPropertyText(), ExplainState::format, ForwardScanDirection, quote_identifier(), ScanDirectionIsBackward, and ExplainState::str.
Referenced by ExplainNode().
|
static |
Definition at line 5014 of file explain.c.
References appendStringInfoChar(), Assert(), EXPLAIN_FORMAT_JSON, ExplainState::format, ExplainState::grouping_stack, linitial_int, and ExplainState::str.
Referenced by ExplainDummyGroup(), ExplainOpenGroup(), ExplainProperty(), ExplainPropertyList(), and ExplainPropertyListNested().
|
static |
Definition at line 4144 of file explain.c.
References ExplainNode(), and j.
Referenced by ExplainNode().
|
static |
Definition at line 4162 of file explain.c.
References EXPLAIN_FORMAT_TEXT, ExplainPropertyInteger(), and format.
Referenced by ExplainNode().
|
static |
Definition at line 3800 of file explain.c.
References ExplainTargetRel(), and plan.
Referenced by ExplainNode().
|
static |
Definition at line 1186 of file explain.c.
References AGG_HASHED, AGG_MIXED, AGG_PLAIN, AGG_SORTED, Agg::aggsplit, Agg::aggstrategy, ExplainState::analyze, appendStringInfo(), appendStringInfoChar(), appendStringInfoString(), ExplainState::buffers, Instrumentation::bufusage, castNode, CMD_DELETE, CMD_INSERT, CMD_MERGE, CMD_SELECT, CMD_UPDATE, ExplainState::costs, DO_AGGSPLIT_COMBINE, DO_AGGSPLIT_SKIPFINAL, EState::es_jit_flags, EXPLAIN_FORMAT_TEXT, explain_get_index_name(), ExplainCloseGroup(), ExplainCloseWorker(), ExplainCreateWorkersState(), ExplainCustomChildren(), CustomExecMethods::ExplainCustomScan, ExplainFlushWorkersState(), ExplainIndentText(), ExplainIndexScanDetails(), ExplainMemberNodes(), ExplainMissingMembers(), ExplainModifyTarget(), ExplainOpenGroup(), ExplainOpenWorker(), ExplainPrintJIT(), ExplainPropertyBool(), ExplainPropertyFloat(), ExplainPropertyInteger(), ExplainPropertyText(), ExplainScanTarget(), ExplainSubPlans(), ExplainState::format, RangeTblFunction::funcexpr, functions, ExplainState::hide_workers, if(), ExplainState::indent, IndexScan::indexid, IndexOnlyScan::indexid, BitmapIndexScan::indexid, IndexScan::indexorderdir, IndexOnlyScan::indexorderdir, Gather::initParam, GatherMerge::initParam, PlanState::initPlan, innerPlanState, InstrEndLoop(), WorkerInstrumentation::instrument, PlanState::instrument, IsA, SharedJitInstrumentation::jit_instr, JOIN_ANTI, JOIN_FULL, JOIN_INNER, JOIN_LEFT, JOIN_RIGHT, JOIN_RIGHT_ANTI, JOIN_SEMI, lappend(), lcons(), lfirst, list_delete_first(), list_length(), list_make1, make_andclause(), make_orclause(), CustomScanState::methods, NIL, Instrumentation::nloops, nodeTag, Instrumentation::ntuples, Instrumentation::ntuples2, WorkerInstrumentation::num_workers, SharedJitInstrumentation::num_workers, Gather::num_workers, GatherMerge::num_workers, outerPlanState, PlanState::plan, plan, psprintf(), quote_identifier(), SETOP_HASHED, SETOP_SORTED, SETOPCMD_EXCEPT, SETOPCMD_EXCEPT_ALL, SETOPCMD_INTERSECT, SETOPCMD_INTERSECT_ALL, show_agg_keys(), show_buffer_usage(), show_eval_params(), show_expression(), show_foreignscan_info(), show_group_keys(), show_hash_info(), show_hashagg_info(), show_incremental_sort_info(), show_incremental_sort_keys(), show_instrumentation_count(), show_memoize_info(), show_merge_append_keys(), show_modifytable_info(), show_plan_tlist(), show_scan_qual(), show_sort_info(), show_sort_keys(), show_tablesample(), show_tidbitmap_info(), show_upper_qual(), show_wal_usage(), Gather::single_copy, Instrumentation::startup, PlanState::state, ExplainState::str, PlanState::subPlan, ExplainState::timing, Instrumentation::total, ExplainState::verbose, ExplainState::wal, Instrumentation::walusage, PlanState::worker_instrument, PlanState::worker_jit_instrument, and ExplainState::workers_state.
Referenced by ExplainCustomChildren(), ExplainMemberNodes(), ExplainPrintPlan(), and ExplainSubPlans().
void ExplainOnePlan | ( | PlannedStmt * | plannedstmt, |
IntoClause * | into, | ||
ExplainState * | es, | ||
const char * | queryString, | ||
ParamListInfo | params, | ||
QueryEnvironment * | queryEnv, | ||
const instr_time * | planduration, | ||
const BufferUsage * | bufusage | ||
) |
Definition at line 527 of file explain.c.
References ExplainState::analyze, Assert(), ExplainState::buffers, CMD_UTILITY, CommandCounterIncrement(), PlannedStmt::commandType, ExplainState::costs, CreateIntoRelDestReceiver(), CreateQueryDesc(), generate_unaccent_rules::dest, elapsed_time(), EXEC_FLAG_EXPLAIN_GENERIC, EXEC_FLAG_EXPLAIN_ONLY, ExecutorEnd(), ExecutorFinish(), ExecutorRun(), ExecutorStart(), ExplainCloseGroup(), ExplainOpenGroup(), ExplainPrintJITSummary(), ExplainPrintPlan(), ExplainPrintTriggers(), ExplainPropertyFloat(), ForwardScanDirection, FreeQueryDesc(), ExplainState::generic, GetActiveSnapshot(), GetIntoRelEFlags(), INSTR_TIME_GET_DOUBLE, INSTR_TIME_SET_CURRENT, INSTRUMENT_BUFFERS, INSTRUMENT_ROWS, INSTRUMENT_TIMER, INSTRUMENT_WAL, InvalidSnapshot, NoMovementScanDirection, None_Receiver, PopActiveSnapshot(), PushCopiedSnapshot(), show_buffer_usage(), IntoClause::skipData, ExplainState::summary, ExplainState::timing, UpdateActiveSnapshotCommandId(), and ExplainState::wal.
Referenced by ExplainExecuteQuery(), and ExplainOneQuery().
|
static |
Definition at line 376 of file explain.c.
References ExplainState::buffers, BufferUsageAccumDiff(), CMD_UTILITY, Query::commandType, ExplainOnePlan(), ExplainOneQuery_hook, ExplainOneUtility(), INSTR_TIME_SET_CURRENT, INSTR_TIME_SUBTRACT, pg_plan_query(), pgBufferUsage, plan, and Query::utilityStmt.
Referenced by ExplainOneUtility(), and ExplainQuery().
void ExplainOneUtility | ( | Node * | utilityStmt, |
IntoClause * | into, | ||
ExplainState * | es, | ||
const char * | queryString, | ||
ParamListInfo | params, | ||
QueryEnvironment * | queryEnv | ||
) |
Definition at line 437 of file explain.c.
References appendStringInfoString(), Assert(), castNode, copyObject, CreateTableAsRelExists(), CURSOR_OPT_PARALLEL_OK, elog(), ERROR, EXPLAIN_FORMAT_TEXT, ExplainDummyGroup(), ExplainExecuteQuery(), ExplainOneQuery(), ExplainState::format, CreateTableAsStmt::into, IsA, linitial_node, list_length(), OBJECT_MATVIEW, OBJECT_TABLE, CreateTableAsStmt::objtype, DeclareCursorStmt::options, DeclareCursorStmt::query, CreateTableAsStmt::query, QueryRewrite(), and ExplainState::str.
Referenced by ExplainExecuteQuery(), and ExplainOneQuery().
void ExplainOpenGroup | ( | const char * | objtype, |
const char * | labelname, | ||
bool | labeled, | ||
ExplainState * | es | ||
) |
Definition at line 4627 of file explain.c.
References appendStringInfo(), appendStringInfoChar(), appendStringInfoSpaces(), appendStringInfoString(), escape_json(), EXPLAIN_FORMAT_JSON, EXPLAIN_FORMAT_TEXT, EXPLAIN_FORMAT_XML, EXPLAIN_FORMAT_YAML, ExplainJSONLineEnding(), ExplainXMLTag(), ExplainYAMLLineStarting(), ExplainState::format, ExplainState::grouping_stack, ExplainState::indent, lcons_int(), ExplainState::str, and X_OPENING.
Referenced by ExplainFlushWorkersState(), ExplainNode(), ExplainOnePlan(), ExplainPrintJIT(), ExplainPrintSettings(), ExplainPrintTriggers(), report_triggers(), show_grouping_set_keys(), show_grouping_sets(), show_incremental_sort_group_info(), and show_modifytable_info().
|
static |
Definition at line 4737 of file explain.c.
References EXPLAIN_FORMAT_JSON, EXPLAIN_FORMAT_TEXT, EXPLAIN_FORMAT_XML, EXPLAIN_FORMAT_YAML, ExplainState::format, ExplainState::grouping_stack, ExplainState::indent, and lcons_int().
Referenced by ExplainOpenWorker().
|
static |
Definition at line 4258 of file explain.c.
References appendStringInfo(), Assert(), EXPLAIN_FORMAT_TEXT, ExplainIndentText(), ExplainOpenSetAsideGroup(), ExplainPropertyInteger(), ExplainRestoreGroup(), ExplainState::format, ExplainState::indent, initStringInfo(), StringInfoData::len, ExplainWorkersState::prev_str, ExplainState::str, ExplainWorkersState::worker_inited, ExplainWorkersState::worker_state_save, ExplainWorkersState::worker_str, and ExplainState::workers_state.
Referenced by ExplainNode(), show_hashagg_info(), show_incremental_sort_info(), show_memoize_info(), and show_sort_info().
Definition at line 1111 of file explain.c.
References bms_add_member(), bms_add_members(), nodeTag, PlanState::plan, plan, and planstate_tree_walker.
Referenced by ExplainPrintPlan().
|
static |
Definition at line 886 of file explain.c.
References ExplainState::analyze, appendStringInfo(), appendStringInfoString(), JitInstrumentation::created_functions, JitInstrumentation::deform_counter, JitInstrumentation::emission_counter, EXPLAIN_FORMAT_TEXT, ExplainCloseGroup(), ExplainIndentText(), ExplainOpenGroup(), ExplainPropertyBool(), ExplainPropertyFloat(), ExplainPropertyInteger(), ExplainState::format, JitInstrumentation::generation_counter, ExplainState::indent, JitInstrumentation::inlining_counter, INSTR_TIME_ADD, INSTR_TIME_GET_DOUBLE, INSTR_TIME_SET_ZERO, JitInstrumentation::optimization_counter, PGJIT_DEFORM, PGJIT_EXPR, PGJIT_INLINE, PGJIT_OPT3, ExplainState::str, and ExplainState::timing.
Referenced by ExplainNode(), and ExplainPrintJITSummary().
void ExplainPrintJITSummary | ( | ExplainState * | es, |
QueryDesc * | queryDesc | ||
) |
Definition at line 860 of file explain.c.
References EState::es_jit, EState::es_jit_flags, EState::es_jit_worker_instr, QueryDesc::estate, ExplainPrintJIT(), JitContext::instr, InstrJitAgg(), and PGJIT_PERFORM.
Referenced by explain_ExecutorEnd(), and ExplainOnePlan().
void ExplainPrintPlan | ( | ExplainState * | es, |
QueryDesc * | queryDesc | ||
) |
Definition at line 752 of file explain.c.
References Assert(), compute_query_id, COMPUTE_QUERY_ID_REGRESS, deparse_context_for_plan_tree(), ExplainState::deparse_cxt, ExplainNode(), ExplainPreScanNode(), ExplainPrintSettings(), ExplainPropertyInteger(), ExplainState::hide_workers, IsA, NIL, outerPlanState, QueryDesc::plannedstmt, QueryDesc::planstate, ExplainState::printed_subplans, ps, ExplainState::pstmt, PlannedStmt::queryId, ExplainState::rtable, PlannedStmt::rtable, ExplainState::rtable_names, select_rtable_names_for_explain(), and ExplainState::verbose.
Referenced by explain_ExecutorEnd(), and ExplainOnePlan().
|
static |
Definition at line 682 of file explain.c.
References appendStringInfo(), appendStringInfoString(), EXPLAIN_FORMAT_TEXT, ExplainCloseGroup(), ExplainOpenGroup(), ExplainPropertyText(), ExplainState::format, get_explain_guc_options(), GetConfigOptionByName(), i, initStringInfo(), config_generic::name, ExplainState::settings, and generate_unaccent_rules::str.
Referenced by ExplainPrintPlan().
void ExplainPrintTriggers | ( | ExplainState * | es, |
QueryDesc * | queryDesc | ||
) |
Definition at line 817 of file explain.c.
References EState::es_opened_result_relations, EState::es_trig_target_relations, EState::es_tuple_routing_result_relations, QueryDesc::estate, ExplainCloseGroup(), ExplainOpenGroup(), lfirst, list_length(), NIL, and report_triggers().
Referenced by explain_ExecutorEnd(), and ExplainOnePlan().
|
static |
Definition at line 4509 of file explain.c.
References appendStringInfo(), appendStringInfoChar(), appendStringInfoSpaces(), appendStringInfoString(), escape_json(), escape_xml(), escape_yaml(), EXPLAIN_FORMAT_JSON, EXPLAIN_FORMAT_TEXT, EXPLAIN_FORMAT_XML, EXPLAIN_FORMAT_YAML, ExplainIndentText(), ExplainJSONLineEnding(), ExplainXMLTag(), ExplainYAMLLineStarting(), ExplainState::format, ExplainState::indent, pfree(), generate_unaccent_rules::str, ExplainState::str, value, X_CLOSING, X_NOWHITESPACE, and X_OPENING.
Referenced by ExplainPropertyBool(), ExplainPropertyFloat(), ExplainPropertyInteger(), ExplainPropertyText(), and ExplainPropertyUInteger().
void ExplainPropertyBool | ( | const char * | qlabel, |
bool | value, | ||
ExplainState * | es | ||
) |
Definition at line 4612 of file explain.c.
References ExplainProperty(), and value.
Referenced by ExplainNode(), and ExplainPrintJIT().
void ExplainPropertyFloat | ( | const char * | qlabel, |
const char * | unit, | ||
double | value, | ||
int | ndigits, | ||
ExplainState * | es | ||
) |
Definition at line 4598 of file explain.c.
References buf, ExplainProperty(), pfree(), psprintf(), and value.
Referenced by ExplainNode(), ExplainOnePlan(), ExplainPrintJIT(), report_triggers(), show_buffer_usage(), show_instrumentation_count(), and show_modifytable_info().
void ExplainPropertyInteger | ( | const char * | qlabel, |
const char * | unit, | ||
int64 | value, | ||
ExplainState * | es | ||
) |
Definition at line 4571 of file explain.c.
References buf, ExplainProperty(), INT64_FORMAT, snprintf, and value.
Referenced by ExplainMissingMembers(), ExplainNode(), ExplainOpenWorker(), ExplainPrintJIT(), ExplainPrintPlan(), fileExplainForeignScan(), postgresExplainForeignModify(), show_buffer_usage(), show_hash_info(), show_hashagg_info(), show_incremental_sort_group_info(), show_memoize_info(), show_sort_info(), show_tidbitmap_info(), and show_wal_usage().
void ExplainPropertyList | ( | const char * | qlabel, |
List * | data, | ||
ExplainState * | es | ||
) |
Definition at line 4386 of file explain.c.
References appendStringInfo(), appendStringInfoChar(), appendStringInfoSpaces(), appendStringInfoString(), data, escape_json(), escape_xml(), escape_yaml(), EXPLAIN_FORMAT_JSON, EXPLAIN_FORMAT_TEXT, EXPLAIN_FORMAT_XML, EXPLAIN_FORMAT_YAML, ExplainIndentText(), ExplainJSONLineEnding(), ExplainXMLTag(), ExplainYAMLLineStarting(), ExplainState::format, ExplainState::indent, lfirst, pfree(), generate_unaccent_rules::str, ExplainState::str, X_CLOSING, and X_OPENING.
Referenced by ExplainPropertyListNested(), show_eval_params(), show_incremental_sort_group_info(), show_modifytable_info(), show_plan_tlist(), show_sort_group_keys(), and show_tablesample().
void ExplainPropertyListNested | ( | const char * | qlabel, |
List * | data, | ||
ExplainState * | es | ||
) |
Definition at line 4456 of file explain.c.
References appendStringInfoChar(), appendStringInfoSpaces(), appendStringInfoString(), data, escape_json(), escape_yaml(), EXPLAIN_FORMAT_JSON, EXPLAIN_FORMAT_TEXT, EXPLAIN_FORMAT_XML, EXPLAIN_FORMAT_YAML, ExplainJSONLineEnding(), ExplainPropertyList(), ExplainYAMLLineStarting(), ExplainState::format, ExplainState::indent, lfirst, and ExplainState::str.
Referenced by show_grouping_set_keys().
void ExplainPropertyText | ( | const char * | qlabel, |
const char * | value, | ||
ExplainState * | es | ||
) |
Definition at line 4562 of file explain.c.
References ExplainProperty(), and value.
Referenced by ExplainIndexScanDetails(), ExplainNode(), ExplainPrintSettings(), ExplainQueryParameters(), ExplainQueryText(), ExplainTargetRel(), fileExplainForeignScan(), postgresExplainDirectModify(), postgresExplainForeignModify(), postgresExplainForeignScan(), report_triggers(), show_expression(), show_grouping_set_keys(), show_memoize_info(), show_modifytable_info(), show_sort_info(), and show_tablesample().
void ExplainPropertyUInteger | ( | const char * | qlabel, |
const char * | unit, | ||
uint64 | value, | ||
ExplainState * | es | ||
) |
Definition at line 4584 of file explain.c.
References buf, ExplainProperty(), snprintf, UINT64_FORMAT, and value.
Referenced by show_wal_usage().
void ExplainQuery | ( | ParseState * | pstate, |
ExplainStmt * | stmt, | ||
ParamListInfo | params, | ||
DestReceiver * | dest | ||
) |
Definition at line 164 of file explain.c.
References ExplainState::analyze, appendStringInfoString(), Assert(), begin_tup_output_tupdesc(), ExplainState::buffers, castNode, ExplainState::costs, CURSOR_OPT_PARALLEL_OK, StringInfoData::data, defGetBoolean(), defGetString(), DefElem::defname, generate_unaccent_rules::dest, do_text_output_multiline(), do_text_output_oneline, end_tup_output(), ereport, errcode(), errmsg(), ERROR, EXPLAIN_FORMAT_JSON, EXPLAIN_FORMAT_TEXT, EXPLAIN_FORMAT_XML, EXPLAIN_FORMAT_YAML, ExplainBeginOutput(), ExplainEndOutput(), ExplainOneQuery(), ExplainResultDesc(), ExplainSeparatePlans(), ExplainState::format, ExplainState::generic, if(), ExplainState::indent, IsQueryIdEnabled(), JumbleQuery(), lfirst, lfirst_node, lnext(), DefElem::location, NewExplainState(), NIL, ParseState::p_queryEnv, ParseState::p_sourcetext, parser_errposition(), pfree(), post_parse_analyze_hook, QueryRewrite(), ExplainState::settings, stmt, ExplainState::str, ExplainState::summary, ExplainState::timing, TTSOpsVirtual, ExplainState::verbose, and ExplainState::wal.
Referenced by standard_ProcessUtility().
void ExplainQueryParameters | ( | ExplainState * | es, |
ParamListInfo | params, | ||
int | maxlen | ||
) |
Definition at line 1003 of file explain.c.
References BuildParamLogString(), ExplainPropertyText(), ParamListInfoData::numParams, and generate_unaccent_rules::str.
Referenced by explain_ExecutorEnd().
void ExplainQueryText | ( | ExplainState * | es, |
QueryDesc * | queryDesc | ||
) |
Definition at line 988 of file explain.c.
References ExplainPropertyText(), and QueryDesc::sourceText.
Referenced by explain_ExecutorEnd().
|
static |
Definition at line 4806 of file explain.c.
References EXPLAIN_FORMAT_JSON, EXPLAIN_FORMAT_TEXT, EXPLAIN_FORMAT_XML, EXPLAIN_FORMAT_YAML, ExplainState::format, ExplainState::grouping_stack, ExplainState::indent, and lcons_int().
Referenced by ExplainOpenWorker().
TupleDesc ExplainResultDesc | ( | ExplainStmt * | stmt | ) |
Definition at line 337 of file explain.c.
References CreateTemplateTupleDesc(), defGetString(), DefElem::defname, lfirst, stmt, and TupleDescInitEntry().
Referenced by ExplainQuery(), and UtilityTupleDescriptor().
|
static |
Definition at line 4776 of file explain.c.
References EXPLAIN_FORMAT_JSON, EXPLAIN_FORMAT_TEXT, EXPLAIN_FORMAT_XML, EXPLAIN_FORMAT_YAML, ExplainState::format, ExplainState::grouping_stack, ExplainState::indent, linitial_int, and list_delete_first().
Referenced by ExplainCloseWorker().
|
static |
Definition at line 3787 of file explain.c.
References ExplainTargetRel(), and plan.
Referenced by ExplainNode().
void ExplainSeparatePlans | ( | ExplainState * | es | ) |
Definition at line 4943 of file explain.c.
References appendStringInfoChar(), EXPLAIN_FORMAT_JSON, EXPLAIN_FORMAT_TEXT, EXPLAIN_FORMAT_XML, EXPLAIN_FORMAT_YAML, ExplainState::format, and ExplainState::str.
Referenced by ExplainExecuteQuery(), and ExplainQuery().
|
static |
Definition at line 4176 of file explain.c.
References bms_add_member(), bms_is_member(), ExplainNode(), lcons(), lfirst, list_delete_first(), SubPlan::plan_id, SubPlan::plan_name, SubPlanState::planstate, ExplainState::printed_subplans, and SubPlanState::subplan.
Referenced by ExplainNode().
|
static |
Definition at line 3809 of file explain.c.
References Alias::aliasname, appendStringInfo(), appendStringInfoString(), Assert(), RangeTblEntry::eref, EXPLAIN_FORMAT_TEXT, ExplainPropertyText(), ExplainState::format, RangeTblFunction::funcexpr, FuncExpr::funcid, FunctionScan::functions, get_func_name(), get_func_namespace(), get_namespace_name_or_temp(), get_rel_name(), get_rel_namespace(), IsA, linitial, list_length(), list_nth(), nodeTag, plan, quote_identifier(), RangeTblEntry::relid, rt_fetch, ExplainState::rtable, ExplainState::rtable_names, RTE_CTE, RTE_FUNCTION, RTE_NAMEDTUPLESTORE, RTE_RELATION, RTE_TABLEFUNC, RTE_VALUES, RangeTblEntry::rtekind, ExplainState::str, and ExplainState::verbose.
Referenced by ExplainModifyTarget(), ExplainScanTarget(), and show_modifytable_info().
|
static |
Definition at line 4972 of file explain.c.
References appendStringInfoChar(), appendStringInfoCharMacro, appendStringInfoSpaces(), appendStringInfoString(), ExplainState::indent, ExplainState::str, X_CLOSE_IMMEDIATE, X_CLOSING, and X_NOWHITESPACE.
Referenced by ExplainCloseGroup(), ExplainDummyGroup(), ExplainOpenGroup(), ExplainProperty(), and ExplainPropertyList().
|
static |
Definition at line 5034 of file explain.c.
References appendStringInfoChar(), appendStringInfoSpaces(), Assert(), EXPLAIN_FORMAT_YAML, ExplainState::format, ExplainState::grouping_stack, ExplainState::indent, linitial_int, and ExplainState::str.
Referenced by ExplainDummyGroup(), ExplainOpenGroup(), ExplainProperty(), ExplainPropertyList(), and ExplainPropertyListNested().
ExplainState* NewExplainState | ( | void | ) |
Definition at line 320 of file explain.c.
References ExplainState::costs, makeStringInfo(), palloc0(), and ExplainState::str.
Referenced by explain_ExecutorEnd(), and ExplainQuery().
|
static |
Definition at line 1021 of file explain.c.
References appendStringInfo(), appendStringInfoString(), EXPLAIN_FORMAT_TEXT, ExplainCloseGroup(), ExplainOpenGroup(), ExplainPropertyFloat(), ExplainPropertyText(), ExplainState::format, get_constraint_name(), InstrEndLoop(), Instrumentation::ntuples, TriggerDesc::numtriggers, OidIsValid, pfree(), RelationGetRelationName, relname, ResultRelInfo::ri_RelationDesc, ResultRelInfo::ri_TrigDesc, ResultRelInfo::ri_TrigInstrument, ExplainState::str, Trigger::tgconstraint, Trigger::tgname, ExplainState::timing, Instrumentation::total, TriggerDesc::triggers, and ExplainState::verbose.
Referenced by ExplainPrintTriggers().
|
static |
Definition at line 2434 of file explain.c.
References if(), lcons(), list_delete_first(), outerPlanState, PlanState::plan, plan, ScanState::ps, show_grouping_sets(), show_sort_group_keys(), and AggState::ss.
Referenced by ExplainNode().
|
static |
Definition at line 3551 of file explain.c.
References appendStringInfo(), appendStringInfoChar(), appendStringInfoString(), EXPLAIN_FORMAT_TEXT, ExplainIndentText(), ExplainPropertyFloat(), ExplainPropertyInteger(), ExplainState::format, ExplainState::indent, INSTR_TIME_GET_MILLISEC, INSTR_TIME_IS_ZERO, ExplainState::str, track_io_timing, and usage().
Referenced by ExplainNode(), and ExplainOnePlan().
|
static |
Definition at line 3499 of file explain.c.
References Assert(), bms_next_member(), ExplainPropertyList(), lappend(), NIL, pstrdup(), and snprintf.
Referenced by ExplainNode().
|
static |
Definition at line 2314 of file explain.c.
References config_generic::context, ExplainState::deparse_cxt, deparse_expression(), ExplainPropertyText(), PlanState::plan, and set_deparse_context_plan().
Referenced by ExplainNode(), and show_qual().
|
static |
Definition at line 3478 of file explain.c.
References CMD_SELECT, FdwRoutine::ExplainDirectModify, FdwRoutine::ExplainForeignScan, ForeignScanState::fdwroutine, PlanState::plan, ScanState::ps, and ForeignScanState::ss.
Referenced by ExplainNode().
|
static |
Definition at line 2566 of file explain.c.
References lcons(), list_delete_first(), outerPlanState, PlanState::plan, plan, ScanState::ps, show_sort_group_keys(), and GroupState::ss.
Referenced by ExplainNode().
|
static |
Definition at line 2488 of file explain.c.
References AGG_HASHED, AGG_MIXED, Agg::aggstrategy, config_generic::context, deparse_expression(), elog(), ERROR, EXPLAIN_FORMAT_TEXT, ExplainCloseGroup(), ExplainOpenGroup(), ExplainPropertyListNested(), ExplainPropertyText(), TargetEntry::expr, ExplainState::format, get_tle_by_resno(), Agg::groupingSets, i, ExplainState::indent, lappend(), lfirst, lfirst_int, NIL, Sort::numCols, PlanState::plan, plan, and show_sort_group_keys().
Referenced by show_grouping_sets().
|
static |
Definition at line 2457 of file explain.c.
References Agg::chain, config_generic::context, ExplainState::deparse_cxt, ExplainCloseGroup(), ExplainOpenGroup(), Plan::lefttree, lfirst, list_length(), PlanState::plan, Agg::plan, ExplainState::rtable, set_deparse_context_plan(), show_grouping_set_keys(), and ExplainState::verbose.
Referenced by show_agg_keys().
|
static |
Definition at line 3063 of file explain.c.
References appendStringInfo(), EXPLAIN_FORMAT_TEXT, ExplainIndentText(), ExplainPropertyInteger(), ExplainState::format, SharedHashInfo::hinstrument, HashState::hinstrument, i, Max, HashInstrumentation::nbatch, HashInstrumentation::nbatch_original, HashInstrumentation::nbuckets, HashInstrumentation::nbuckets_original, SharedHashInfo::num_workers, HashState::shared_info, HashInstrumentation::space_peak, and ExplainState::str.
Referenced by ExplainNode().
|
static |