PostgreSQL Source Code
git master
|
Go to the source code of this file.
Data Structures | |
struct | ExplainWorkersState |
struct | ExplainState |
Typedefs | |
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 | 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 struct ExplainState ExplainState |
typedef struct ExplainWorkersState ExplainWorkersState |
enum ExplainFormat |
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().
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().
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().
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().
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().
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().
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().
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().
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().
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().
|
extern |
Definition at line 48 of file explain.c.
Referenced by explain_get_index_name().
|
extern |
Definition at line 45 of file explain.c.
Referenced by ExplainOneQuery().