]> granicus.if.org Git - postgresql/blob - src/include/commands/explain.h
Include a pointer to the query's source text in QueryDesc structs. This is
[postgresql] / src / include / commands / explain.h
1 /*-------------------------------------------------------------------------
2  *
3  * explain.h
4  *        prototypes for explain.c
5  *
6  * Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
7  * Portions Copyright (c) 1994-5, Regents of the University of California
8  *
9  * $PostgreSQL: pgsql/src/include/commands/explain.h,v 1.38 2009/01/02 20:42:00 tgl Exp $
10  *
11  *-------------------------------------------------------------------------
12  */
13 #ifndef EXPLAIN_H
14 #define EXPLAIN_H
15
16 #include "executor/executor.h"
17
18 /* Hook for plugins to get control in ExplainOneQuery() */
19 typedef void (*ExplainOneQuery_hook_type) (Query *query,
20                                                                                                            ExplainStmt *stmt,
21                                                                                                          const char *queryString,
22                                                                                                            ParamListInfo params,
23                                                                                                          TupOutputState *tstate);
24 extern PGDLLIMPORT ExplainOneQuery_hook_type ExplainOneQuery_hook;
25
26 /* Hook for plugins to get control in explain_get_index_name() */
27 typedef const char *(*explain_get_index_name_hook_type) (Oid indexId);
28 extern PGDLLIMPORT explain_get_index_name_hook_type explain_get_index_name_hook;
29
30
31 extern void ExplainQuery(ExplainStmt *stmt, const char *queryString,
32                          ParamListInfo params, DestReceiver *dest);
33
34 extern TupleDesc ExplainResultDesc(ExplainStmt *stmt);
35
36 extern void ExplainOneUtility(Node *utilityStmt, ExplainStmt *stmt,
37                                   const char *queryString,
38                                   ParamListInfo params,
39                                   TupOutputState *tstate);
40
41 extern void ExplainOnePlan(PlannedStmt *plannedstmt, ExplainStmt *stmt,
42                                                    const char *queryString,
43                                                    ParamListInfo params,
44                                                    TupOutputState *tstate);
45
46 extern void ExplainPrintPlan(StringInfo str, QueryDesc *queryDesc,
47                                                          bool analyze, bool verbose);
48
49 #endif   /* EXPLAIN_H */