PostgreSQL Source Code git master
|
#include "postgres.h"
#include "commands/explain.h"
#include "commands/explain_format.h"
#include "commands/explain_state.h"
#include "utils/json.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 | ExplainJSONLineEnding (ExplainState *es) |
static void | ExplainXMLTag (const char *tagname, int flags, ExplainState *es) |
static void | ExplainYAMLLineStarting (ExplainState *es) |
static void | escape_yaml (StringInfo buf, const char *str) |
void | ExplainPropertyList (const char *qlabel, List *data, ExplainState *es) |
void | ExplainPropertyListNested (const char *qlabel, List *data, ExplainState *es) |
static void | ExplainProperty (const char *qlabel, const char *unit, const char *value, bool numeric, 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 | ExplainOpenSetAsideGroup (const char *objtype, const char *labelname, bool labeled, int depth, ExplainState *es) |
void | ExplainSaveGroup (ExplainState *es, int depth, int *state_save) |
void | ExplainRestoreGroup (ExplainState *es, int depth, int *state_save) |
void | ExplainDummyGroup (const char *objtype, const char *labelname, ExplainState *es) |
void | ExplainBeginOutput (ExplainState *es) |
void | ExplainEndOutput (ExplainState *es) |
void | ExplainSeparatePlans (ExplainState *es) |
void | ExplainIndentText (ExplainState *es) |
#define X_CLOSE_IMMEDIATE 2 |
Definition at line 25 of file explain_format.c.
#define X_CLOSING 1 |
Definition at line 24 of file explain_format.c.
#define X_NOWHITESPACE 4 |
Definition at line 26 of file explain_format.c.
#define X_OPENING 0 |
Definition at line 23 of file explain_format.c.
|
static |
Definition at line 711 of file explain_format.c.
References buf, escape_json(), and str.
Referenced by ExplainDummyGroup(), ExplainProperty(), ExplainPropertyList(), and ExplainPropertyListNested().
void ExplainBeginOutput | ( | ExplainState * | es | ) |
Definition at line 535 of file explain_format.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 342 of file explain_format.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(), overexplain_debug(), overexplain_range_table(), report_triggers(), show_grouping_set_keys(), show_grouping_sets(), show_incremental_sort_group_info(), and show_modifytable_info().
void ExplainDummyGroup | ( | const char * | objtype, |
const char * | labelname, | ||
ExplainState * | es | ||
) |
Definition at line 489 of file explain_format.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 566 of file explain_format.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 ExplainIndentText | ( | ExplainState * | es | ) |
Definition at line 651 of file explain_format.c.
References appendStringInfoSpaces(), Assert(), StringInfoData::data, EXPLAIN_FORMAT_TEXT, ExplainState::format, ExplainState::indent, StringInfoData::len, and ExplainState::str.
Referenced by ExplainNode(), ExplainOnePlan(), ExplainOpenWorker(), ExplainPrintJIT(), ExplainPrintSerialize(), ExplainProperty(), ExplainPropertyList(), overexplain_debug(), overexplain_range_table(), show_buffer_usage(), show_hash_info(), show_hashagg_info(), show_memoize_info(), show_memory_counters(), show_modifytable_info(), show_sort_info(), show_storage_info(), show_tablesample(), show_tidbitmap_info(), and show_wal_usage().
|
static |
Definition at line 666 of file explain_format.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().
void ExplainOpenGroup | ( | const char * | objtype, |
const char * | labelname, | ||
bool | labeled, | ||
ExplainState * | es | ||
) |
Definition at line 279 of file explain_format.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(), overexplain_debug(), overexplain_range_table(), report_triggers(), show_grouping_set_keys(), show_grouping_sets(), show_incremental_sort_group_info(), and show_modifytable_info().
void ExplainOpenSetAsideGroup | ( | const char * | objtype, |
const char * | labelname, | ||
bool | labeled, | ||
int | depth, | ||
ExplainState * | es | ||
) |
Definition at line 389 of file explain_format.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 161 of file explain_format.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(), ExplainState::str, 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 264 of file explain_format.c.
References ExplainProperty(), and value.
Referenced by ExplainNode(), ExplainPrintJIT(), overexplain_per_node_hook(), and overexplain_range_table().
void ExplainPropertyFloat | ( | const char * | qlabel, |
const char * | unit, | ||
double | value, | ||
int | ndigits, | ||
ExplainState * | es | ||
) |
Definition at line 250 of file explain_format.c.
References buf, ExplainProperty(), pfree(), psprintf(), and value.
Referenced by ExplainNode(), ExplainOnePlan(), ExplainPrintJIT(), ExplainPrintSerialize(), overexplain_range_table(), 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 223 of file explain_format.c.
References buf, ExplainProperty(), INT64_FORMAT, snprintf, and value.
Referenced by ExplainMissingMembers(), ExplainNode(), ExplainOpenWorker(), ExplainPrintJIT(), ExplainPrintPlan(), fileExplainForeignScan(), overexplain_per_node_hook(), overexplain_range_table(), 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 38 of file explain_format.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 108 of file explain_format.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 214 of file explain_format.c.
References ExplainProperty(), and value.
Referenced by ExplainIndexScanDetails(), ExplainNode(), ExplainPrintSerialize(), ExplainPrintSettings(), ExplainQueryParameters(), ExplainQueryText(), ExplainTargetRel(), fileExplainForeignScan(), overexplain_alias(), overexplain_bitmapset(), overexplain_debug(), overexplain_intlist(), overexplain_range_table(), postgresExplainDirectModify(), postgresExplainForeignModify(), postgresExplainForeignScan(), report_triggers(), show_expression(), show_grouping_set_keys(), show_memoize_info(), show_modifytable_info(), show_sort_info(), show_storage_info(), show_tablesample(), and show_window_def().
void ExplainPropertyUInteger | ( | const char * | qlabel, |
const char * | unit, | ||
uint64 | value, | ||
ExplainState * | es | ||
) |
Definition at line 236 of file explain_format.c.
References buf, ExplainProperty(), snprintf, UINT64_FORMAT, and value.
Referenced by ExplainPrintSerialize(), overexplain_range_table(), show_hash_info(), show_indexsearches_info(), show_tidbitmap_info(), and show_wal_usage().
void ExplainRestoreGroup | ( | ExplainState * | es, |
int | depth, | ||
int * | state_save | ||
) |
Definition at line 458 of file explain_format.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().
void ExplainSaveGroup | ( | ExplainState * | es, |
int | depth, | ||
int * | state_save | ||
) |
Definition at line 428 of file explain_format.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().
void ExplainSeparatePlans | ( | ExplainState * | es | ) |
Definition at line 595 of file explain_format.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 624 of file explain_format.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 686 of file explain_format.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().