| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | #ifndef EXPLAIN_H |
| | #define EXPLAIN_H |
| |
|
| | #include "executor/executor.h" |
| | #include "lib/stringinfo.h" |
| | #include "parser/parse_node.h" |
| |
|
| | typedef enum ExplainSerializeOption |
| | { |
| | EXPLAIN_SERIALIZE_NONE, |
| | EXPLAIN_SERIALIZE_TEXT, |
| | EXPLAIN_SERIALIZE_BINARY, |
| | } ExplainSerializeOption; |
| |
|
| | typedef enum ExplainFormat |
| | { |
| | EXPLAIN_FORMAT_TEXT, |
| | EXPLAIN_FORMAT_XML, |
| | EXPLAIN_FORMAT_JSON, |
| | EXPLAIN_FORMAT_YAML, |
| | } ExplainFormat; |
| |
|
| | typedef struct ExplainWorkersState |
| | { |
| | int num_workers; |
| | bool *worker_inited; |
| | StringInfoData *worker_str; |
| | int *worker_state_save; |
| | StringInfo prev_str; |
| | } ExplainWorkersState; |
| |
|
| | typedef struct ExplainState |
| | { |
| | StringInfo str; |
| | |
| | bool verbose; |
| | bool analyze; |
| | bool costs; |
| | bool buffers; |
| | bool wal; |
| | bool timing; |
| | bool summary; |
| | bool memory; |
| | bool settings; |
| | bool generic; |
| | ExplainSerializeOption serialize; |
| | ExplainFormat format; |
| | |
| | int indent; |
| | List *grouping_stack; |
| | |
| | PlannedStmt *pstmt; |
| | List *rtable; |
| | List *rtable_names; |
| | List *deparse_cxt; |
| | Bitmapset *printed_subplans; |
| | bool hide_workers; |
| | |
| | ExplainWorkersState *workers_state; |
| | } ExplainState; |
| |
|
| | |
| | typedef void (*ExplainOneQuery_hook_type) (Query *query, |
| | int cursorOptions, |
| | IntoClause *into, |
| | ExplainState *es, |
| | const char *queryString, |
| | ParamListInfo params, |
| | QueryEnvironment *queryEnv); |
| | extern PGDLLIMPORT ExplainOneQuery_hook_type ExplainOneQuery_hook; |
| |
|
| | |
| | typedef const char *(*explain_get_index_name_hook_type) (Oid indexId); |
| | extern PGDLLIMPORT explain_get_index_name_hook_type explain_get_index_name_hook; |
| |
|
| |
|
| | extern void ExplainQuery(ParseState *pstate, ExplainStmt *stmt, |
| | ParamListInfo params, DestReceiver *dest); |
| | extern void standard_ExplainOneQuery(Query *query, int cursorOptions, |
| | IntoClause *into, ExplainState *es, |
| | const char *queryString, ParamListInfo params, |
| | QueryEnvironment *queryEnv); |
| |
|
| | extern ExplainState *NewExplainState(void); |
| |
|
| | extern TupleDesc ExplainResultDesc(ExplainStmt *stmt); |
| |
|
| | extern void ExplainOneUtility(Node *utilityStmt, IntoClause *into, |
| | ExplainState *es, const char *queryString, |
| | ParamListInfo params, QueryEnvironment *queryEnv); |
| |
|
| | extern 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); |
| |
|
| | extern void ExplainPrintPlan(ExplainState *es, QueryDesc *queryDesc); |
| | extern void ExplainPrintTriggers(ExplainState *es, QueryDesc *queryDesc); |
| |
|
| | extern void ExplainPrintJITSummary(ExplainState *es, QueryDesc *queryDesc); |
| |
|
| | extern void ExplainQueryText(ExplainState *es, QueryDesc *queryDesc); |
| | extern void ExplainQueryParameters(ExplainState *es, ParamListInfo params, int maxlen); |
| |
|
| | extern void ExplainBeginOutput(ExplainState *es); |
| | extern void ExplainEndOutput(ExplainState *es); |
| | extern void ExplainSeparatePlans(ExplainState *es); |
| |
|
| | extern void ExplainPropertyList(const char *qlabel, List *data, |
| | ExplainState *es); |
| | extern void ExplainPropertyListNested(const char *qlabel, List *data, |
| | ExplainState *es); |
| | extern void ExplainPropertyText(const char *qlabel, const char *value, |
| | ExplainState *es); |
| | extern void ExplainPropertyInteger(const char *qlabel, const char *unit, |
| | int64 value, ExplainState *es); |
| | extern void ExplainPropertyUInteger(const char *qlabel, const char *unit, |
| | uint64 value, ExplainState *es); |
| | extern void ExplainPropertyFloat(const char *qlabel, const char *unit, |
| | double value, int ndigits, ExplainState *es); |
| | extern void ExplainPropertyBool(const char *qlabel, bool value, |
| | ExplainState *es); |
| |
|
| | extern void ExplainOpenGroup(const char *objtype, const char *labelname, |
| | bool labeled, ExplainState *es); |
| | extern void ExplainCloseGroup(const char *objtype, const char *labelname, |
| | bool labeled, ExplainState *es); |
| |
|
| | extern DestReceiver *CreateExplainSerializeDestReceiver(ExplainState *es); |
| |
|
| | #endif |
| |
|