~ubuntu-branches/ubuntu/oneiric/postgresql-9.1/oneiric-security

« back to all changes in this revision

Viewing changes to src/include/commands/explain.h

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2011-05-11 10:41:53 UTC
  • Revision ID: james.westby@ubuntu.com-20110511104153-psbh2o58553fv1m0
Tags: upstream-9.1~beta1
ImportĀ upstreamĀ versionĀ 9.1~beta1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*-------------------------------------------------------------------------
 
2
 *
 
3
 * explain.h
 
4
 *        prototypes for explain.c
 
5
 *
 
6
 * Portions Copyright (c) 1996-2011, PostgreSQL Global Development Group
 
7
 * Portions Copyright (c) 1994-5, Regents of the University of California
 
8
 *
 
9
 * src/include/commands/explain.h
 
10
 *
 
11
 *-------------------------------------------------------------------------
 
12
 */
 
13
#ifndef EXPLAIN_H
 
14
#define EXPLAIN_H
 
15
 
 
16
#include "executor/executor.h"
 
17
 
 
18
typedef enum ExplainFormat
 
19
{
 
20
        EXPLAIN_FORMAT_TEXT,
 
21
        EXPLAIN_FORMAT_XML,
 
22
        EXPLAIN_FORMAT_JSON,
 
23
        EXPLAIN_FORMAT_YAML
 
24
} ExplainFormat;
 
25
 
 
26
typedef struct ExplainState
 
27
{
 
28
        StringInfo      str;                    /* output buffer */
 
29
        /* options */
 
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 */
 
35
        /* other states */
 
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 */
 
40
} ExplainState;
 
41
 
 
42
/* Hook for plugins to get control in ExplainOneQuery() */
 
43
typedef void (*ExplainOneQuery_hook_type) (Query *query,
 
44
                                                                                                           ExplainState *es,
 
45
                                                                                                         const char *queryString,
 
46
                                                                                                           ParamListInfo params);
 
47
extern PGDLLIMPORT ExplainOneQuery_hook_type ExplainOneQuery_hook;
 
48
 
 
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;
 
52
 
 
53
 
 
54
extern void ExplainQuery(ExplainStmt *stmt, const char *queryString,
 
55
                         ParamListInfo params, DestReceiver *dest);
 
56
 
 
57
extern void ExplainInitState(ExplainState *es);
 
58
 
 
59
extern TupleDesc ExplainResultDesc(ExplainStmt *stmt);
 
60
 
 
61
extern void ExplainOneUtility(Node *utilityStmt, ExplainState *es,
 
62
                                  const char *queryString, ParamListInfo params);
 
63
 
 
64
extern void ExplainOnePlan(PlannedStmt *plannedstmt, ExplainState *es,
 
65
                           const char *queryString, ParamListInfo params);
 
66
 
 
67
extern void ExplainPrintPlan(ExplainState *es, QueryDesc *queryDesc);
 
68
 
 
69
extern void ExplainQueryText(ExplainState *es, QueryDesc *queryDesc);
 
70
 
 
71
extern void ExplainBeginOutput(ExplainState *es);
 
72
extern void ExplainEndOutput(ExplainState *es);
 
73
extern void ExplainSeparatePlans(ExplainState *es);
 
74
 
 
75
extern void ExplainPropertyList(const char *qlabel, List *data,
 
76
                                        ExplainState *es);
 
77
extern void ExplainPropertyText(const char *qlabel, const char *value,
 
78
                                        ExplainState *es);
 
79
extern void ExplainPropertyInteger(const char *qlabel, int value,
 
80
                                           ExplainState *es);
 
81
extern void ExplainPropertyLong(const char *qlabel, long value,
 
82
                                        ExplainState *es);
 
83
extern void ExplainPropertyFloat(const char *qlabel, double value, int ndigits,
 
84
                                         ExplainState *es);
 
85
 
 
86
#endif   /* EXPLAIN_H */