PostgreSQL Source Code
git master
|
Go to the source code of this file.
Data Structures | |
struct | ExplainWorkersState |
struct | ExplainState |
Typedefs | |
typedef enum ExplainSerializeOption | ExplainSerializeOption |
typedef enum ExplainFormat | ExplainFormat |
typedef struct ExplainWorkersState | ExplainWorkersState |
typedef struct ExplainState | ExplainState |
typedef void(* | ExplainOneQuery_hook_type) (Query *query, int cursorOptions, IntoClause *into, ExplainState *es, const char *queryString, ParamListInfo params, QueryEnvironment *queryEnv) |
typedef const char *(* | explain_get_index_name_hook_type) (Oid indexId) |
Enumerations | |
enum | ExplainSerializeOption { EXPLAIN_SERIALIZE_NONE , EXPLAIN_SERIALIZE_TEXT , EXPLAIN_SERIALIZE_BINARY } |
enum | ExplainFormat { EXPLAIN_FORMAT_TEXT , EXPLAIN_FORMAT_XML , EXPLAIN_FORMAT_JSON , EXPLAIN_FORMAT_YAML } |
Variables | |
PGDLLIMPORT ExplainOneQuery_hook_type | ExplainOneQuery_hook |
PGDLLIMPORT explain_get_index_name_hook_type | explain_get_index_name_hook |
typedef const char*(* explain_get_index_name_hook_type) (Oid indexId) |
typedef enum ExplainFormat ExplainFormat |
typedef void(* ExplainOneQuery_hook_type) (Query *query, int cursorOptions, IntoClause *into, ExplainState *es, const char *queryString, ParamListInfo params, QueryEnvironment *queryEnv) |
typedef enum ExplainSerializeOption ExplainSerializeOption |
typedef struct ExplainState ExplainState |
typedef struct ExplainWorkersState ExplainWorkersState |
enum ExplainFormat |
DestReceiver* CreateExplainSerializeDestReceiver | ( | ExplainState * | es | ) |
Definition at line 5865 of file explain.c.
References DestExplainSerialize, palloc0(), serializeAnalyzeDestroy(), serializeAnalyzeReceive(), serializeAnalyzeShutdown(), and serializeAnalyzeStartup().
Referenced by CreateDestReceiver(), and ExplainOnePlan().
void ExplainBeginOutput | ( | ExplainState * | es | ) |
Definition at line 5432 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 5239 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(), ExplainPrintSerialize(), ExplainPrintSettings(), ExplainPrintTriggers(), report_triggers(), show_grouping_set_keys(), show_grouping_sets(), show_incremental_sort_group_info(), and show_modifytable_info().
void ExplainEndOutput | ( | ExplainState * | es | ) |
Definition at line 5463 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().
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 | ||
) |
Definition at line 626 of file explain.c.
References ExplainState::analyze, appendStringInfoString(), Assert, ExplainState::buffers, CMD_UTILITY, CommandCounterIncrement(), PlannedStmt::commandType, ExplainState::costs, CreateExplainSerializeDestReceiver(), CreateIntoRelDestReceiver(), CreateQueryDesc(), generate_unaccent_rules::dest, elapsed_time(), EXEC_FLAG_EXPLAIN_GENERIC, EXEC_FLAG_EXPLAIN_ONLY, ExecutorEnd(), ExecutorFinish(), ExecutorRun(), ExecutorStart(), EXPLAIN_FORMAT_TEXT, EXPLAIN_SERIALIZE_NONE, ExplainCloseGroup(), ExplainIndentText(), ExplainOpenGroup(), ExplainPrintJITSummary(), ExplainPrintPlan(), ExplainPrintSerialize(), ExplainPrintTriggers(), ExplainPropertyFloat(), ExplainState::format, ForwardScanDirection, FreeQueryDesc(), ExplainState::generic, GetActiveSnapshot(), GetIntoRelEFlags(), GetSerializationMetrics(), ExplainState::indent, INSTR_TIME_GET_DOUBLE, INSTR_TIME_SET_CURRENT, INSTRUMENT_BUFFERS, INSTRUMENT_ROWS, INSTRUMENT_TIMER, INSTRUMENT_WAL, InvalidSnapshot, NoMovementScanDirection, None_Receiver, peek_buffer_usage(), PopActiveSnapshot(), PushCopiedSnapshot(), ExplainState::serialize, show_buffer_usage(), show_memory_counters(), IntoClause::skipData, ExplainState::str, ExplainState::summary, ExplainState::timing, UpdateActiveSnapshotCommandId(), and ExplainState::wal.
Referenced by ExplainExecuteQuery(), and standard_ExplainOneQuery().
void ExplainOneUtility | ( | Node * | utilityStmt, |
IntoClause * | into, | ||
ExplainState * | es, | ||
const char * | queryString, | ||
ParamListInfo | params, | ||
QueryEnvironment * | queryEnv | ||
) |
Definition at line 536 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 5176 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(), ExplainPrintSerialize(), ExplainPrintSettings(), ExplainPrintTriggers(), report_triggers(), show_grouping_set_keys(), show_grouping_sets(), show_incremental_sort_group_info(), and show_modifytable_info().
void ExplainPrintJITSummary | ( | ExplainState * | es, |
QueryDesc * | queryDesc | ||
) |
Definition at line 1006 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 886 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, lfirst_node, list_length(), NIL, outerPlanState, QueryDesc::plannedstmt, QueryDesc::planstate, ExplainState::printed_subplans, ps, ExplainState::pstmt, PlannedStmt::queryId, ExplainState::rtable, PlannedStmt::rtable, ExplainState::rtable_names, ExplainState::rtable_size, RTE_GROUP, RangeTblEntry::rtekind, select_rtable_names_for_explain(), and ExplainState::verbose.
Referenced by explain_ExecutorEnd(), and ExplainOnePlan().
void ExplainPrintTriggers | ( | ExplainState * | es, |
QueryDesc * | queryDesc | ||
) |
Definition at line 963 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().
void ExplainPropertyBool | ( | const char * | qlabel, |
bool | value, | ||
ExplainState * | es | ||
) |
Definition at line 5161 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 5147 of file explain.c.
References buf, ExplainProperty(), pfree(), psprintf(), and value.
Referenced by ExplainNode(), ExplainOnePlan(), ExplainPrintJIT(), ExplainPrintSerialize(), 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 5120 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_memory_counters(), show_sort_info(), show_storage_info(), and show_wal_usage().
void ExplainPropertyList | ( | const char * | qlabel, |
List * | data, | ||
ExplainState * | es | ||
) |
Definition at line 4935 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(), ExplainState::str, str, X_CLOSING, and X_OPENING.
Referenced by ExplainPropertyListNested(), 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 5005 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 5111 of file explain.c.
References ExplainProperty(), and value.
Referenced by ExplainIndexScanDetails(), ExplainNode(), ExplainPrintSerialize(), 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(), show_storage_info(), and show_tablesample().
void ExplainPropertyUInteger | ( | const char * | qlabel, |
const char * | unit, | ||
uint64 | value, | ||
ExplainState * | es | ||
) |
Definition at line 5133 of file explain.c.
References buf, ExplainProperty(), snprintf, UINT64_FORMAT, and value.
Referenced by ExplainPrintSerialize(), show_hash_info(), show_tidbitmap_info(), and show_wal_usage().
void ExplainQuery | ( | ParseState * | pstate, |
ExplainStmt * | stmt, | ||
ParamListInfo | params, | ||
DestReceiver * | dest | ||
) |
Definition at line 192 of file explain.c.
References ExplainState::analyze, appendStringInfoString(), DefElem::arg, 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, EXPLAIN_SERIALIZE_BINARY, EXPLAIN_SERIALIZE_NONE, EXPLAIN_SERIALIZE_TEXT, ExplainBeginOutput(), ExplainEndOutput(), ExplainOneQuery(), ExplainResultDesc(), ExplainSeparatePlans(), ExplainState::format, ExplainState::generic, if(), ExplainState::indent, IsQueryIdEnabled(), JumbleQuery(), lfirst, lfirst_node, lnext(), DefElem::location, ExplainState::memory, NewExplainState(), NIL, ParseState::p_queryEnv, ParseState::p_sourcetext, parser_errposition(), pfree(), post_parse_analyze_hook, QueryRewrite(), ExplainState::serialize, 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 1205 of file explain.c.
References BuildParamLogString(), ExplainPropertyText(), ParamListInfoData::numParams, and str.
Referenced by explain_ExecutorEnd().
void ExplainQueryText | ( | ExplainState * | es, |
QueryDesc * | queryDesc | ||
) |
Definition at line 1190 of file explain.c.
References ExplainPropertyText(), and QueryDesc::sourceText.
Referenced by explain_ExecutorEnd().
TupleDesc ExplainResultDesc | ( | ExplainStmt * | stmt | ) |
Definition at line 398 of file explain.c.
References CreateTemplateTupleDesc(), defGetString(), DefElem::defname, lfirst, stmt, and TupleDescInitEntry().
Referenced by ExplainQuery(), and UtilityTupleDescriptor().
void ExplainSeparatePlans | ( | ExplainState * | es | ) |
Definition at line 5492 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().
ExplainState* NewExplainState | ( | void | ) |
Definition at line 381 of file explain.c.
References ExplainState::costs, makeStringInfo(), palloc0(), and ExplainState::str.
Referenced by explain_ExecutorEnd(), and ExplainQuery().
void standard_ExplainOneQuery | ( | Query * | query, |
int | cursorOptions, | ||
IntoClause * | into, | ||
ExplainState * | es, | ||
const char * | queryString, | ||
ParamListInfo | params, | ||
QueryEnvironment * | queryEnv | ||
) |
Definition at line 464 of file explain.c.
References ALLOCSET_DEFAULT_SIZES, AllocSetContextCreate, ExplainState::buffers, BufferUsageAccumDiff(), CurrentMemoryContext, ExplainOnePlan(), INSTR_TIME_SET_CURRENT, INSTR_TIME_SUBTRACT, ExplainState::memory, MemoryContextMemConsumed(), MemoryContextSwitchTo(), pg_plan_query(), pgBufferUsage, and plan.
Referenced by ExplainOneQuery().
|
extern |
Definition at line 49 of file explain.c.
Referenced by explain_get_index_name().
|
extern |
Definition at line 46 of file explain.c.
Referenced by ExplainOneQuery().