summaryrefslogtreecommitdiff
path: root/src/include/commands/explain.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/include/commands/explain.h')
-rw-r--r--src/include/commands/explain.h38
1 files changed, 23 insertions, 15 deletions
diff --git a/src/include/commands/explain.h b/src/include/commands/explain.h
index e5c61a0dcb..a5cc40367f 100644
--- a/src/include/commands/explain.h
+++ b/src/include/commands/explain.h
@@ -6,7 +6,7 @@
* Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
* Portions Copyright (c) 1994-5, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/commands/explain.h,v 1.39 2009/06/11 14:49:11 momjian Exp $
+ * $PostgreSQL: pgsql/src/include/commands/explain.h,v 1.40 2009/07/26 23:34:18 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -15,12 +15,23 @@
#include "executor/executor.h"
+typedef struct ExplainState
+{
+ StringInfo str; /* output buffer */
+ /* options */
+ bool verbose; /* print plan targetlists */
+ bool analyze; /* print actual times */
+ bool costs; /* print costs */
+ /* other states */
+ PlannedStmt *pstmt; /* top of plan */
+ List *rtable; /* range table */
+} ExplainState;
+
/* Hook for plugins to get control in ExplainOneQuery() */
typedef void (*ExplainOneQuery_hook_type) (Query *query,
- ExplainStmt *stmt,
- const char *queryString,
- ParamListInfo params,
- TupOutputState *tstate);
+ ExplainState *es,
+ const char *queryString,
+ ParamListInfo params);
extern PGDLLIMPORT ExplainOneQuery_hook_type ExplainOneQuery_hook;
/* Hook for plugins to get control in explain_get_index_name() */
@@ -31,19 +42,16 @@ extern PGDLLIMPORT explain_get_index_name_hook_type explain_get_index_name_hook;
extern void ExplainQuery(ExplainStmt *stmt, const char *queryString,
ParamListInfo params, DestReceiver *dest);
+extern void ExplainInitState(ExplainState *es);
+
extern TupleDesc ExplainResultDesc(ExplainStmt *stmt);
-extern void ExplainOneUtility(Node *utilityStmt, ExplainStmt *stmt,
- const char *queryString,
- ParamListInfo params,
- TupOutputState *tstate);
+extern void ExplainOneUtility(Node *utilityStmt, ExplainState *es,
+ const char *queryString, ParamListInfo params);
-extern void ExplainOnePlan(PlannedStmt *plannedstmt, ExplainStmt *stmt,
- const char *queryString,
- ParamListInfo params,
- TupOutputState *tstate);
+extern void ExplainOnePlan(PlannedStmt *plannedstmt, ExplainState *es,
+ const char *queryString, ParamListInfo params);
-extern void ExplainPrintPlan(StringInfo str, QueryDesc *queryDesc,
- bool analyze, bool verbose);
+extern void ExplainPrintPlan(ExplainState *es, QueryDesc *queryDesc);
#endif /* EXPLAIN_H */