1 /*-------------------------------------------------------------------------
4 * prototypes for explain.c
6 * Portions Copyright (c) 1996-2011, PostgreSQL Global Development Group
7 * Portions Copyright (c) 1994-5, Regents of the University of California
9 * src/include/commands/explain.h
11 *-------------------------------------------------------------------------
16 #include "executor/executor.h"
18 typedef enum ExplainFormat
26 typedef struct ExplainState
28 StringInfo str; /* output buffer */
30 bool verbose; /* be verbose */
31 bool analyze; /* print actual times */
32 bool costs; /* print costs */
33 bool buffers; /* print buffer usage */
34 ExplainFormat format; /* output format */
36 PlannedStmt *pstmt; /* top of plan */
37 List *rtable; /* range table */
38 int indent; /* current indentation level */
39 List *grouping_stack; /* format-specific grouping state */
42 /* Hook for plugins to get control in ExplainOneQuery() */
43 typedef void (*ExplainOneQuery_hook_type) (Query *query,
45 const char *queryString,
46 ParamListInfo params);
47 extern PGDLLIMPORT ExplainOneQuery_hook_type ExplainOneQuery_hook;
49 /* Hook for plugins to get control in explain_get_index_name() */
50 typedef const char *(*explain_get_index_name_hook_type) (Oid indexId);
51 extern PGDLLIMPORT explain_get_index_name_hook_type explain_get_index_name_hook;
54 extern void ExplainQuery(ExplainStmt *stmt, const char *queryString,
55 ParamListInfo params, DestReceiver *dest);
57 extern void ExplainInitState(ExplainState *es);
59 extern TupleDesc ExplainResultDesc(ExplainStmt *stmt);
61 extern void ExplainOneUtility(Node *utilityStmt, ExplainState *es,
62 const char *queryString, ParamListInfo params);
64 extern void ExplainOnePlan(PlannedStmt *plannedstmt, ExplainState *es,
65 const char *queryString, ParamListInfo params);
67 extern void ExplainPrintPlan(ExplainState *es, QueryDesc *queryDesc);
69 extern void ExplainQueryText(ExplainState *es, QueryDesc *queryDesc);
71 extern void ExplainBeginOutput(ExplainState *es);
72 extern void ExplainEndOutput(ExplainState *es);
73 extern void ExplainSeparatePlans(ExplainState *es);
75 extern void ExplainPropertyList(const char *qlabel, List *data,
77 extern void ExplainPropertyText(const char *qlabel, const char *value,
79 extern void ExplainPropertyInteger(const char *qlabel, int value,
81 extern void ExplainPropertyLong(const char *qlabel, long value,
83 extern void ExplainPropertyFloat(const char *qlabel, double value, int ndigits,
86 #endif /* EXPLAIN_H */