]> granicus.if.org Git - postgresql/blob - src/include/executor/execdesc.h
Revise executor APIs so that all per-query state structure is built in
[postgresql] / src / include / executor / execdesc.h
1 /*-------------------------------------------------------------------------
2  *
3  * execdesc.h
4  *        plan and query descriptor accessor macros used by the executor
5  *        and related modules.
6  *
7  *
8  * Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
9  * Portions Copyright (c) 1994, Regents of the University of California
10  *
11  * $Id: execdesc.h,v 1.22 2002/12/15 16:17:54 tgl Exp $
12  *
13  *-------------------------------------------------------------------------
14  */
15 #ifndef EXECDESC_H
16 #define EXECDESC_H
17
18 #include "nodes/parsenodes.h"
19 #include "nodes/execnodes.h"
20 #include "tcop/dest.h"
21
22
23 /* ----------------
24  *              query descriptor:
25  *
26  *      a QueryDesc encapsulates everything that the executor
27  *      needs to execute the query
28  * ---------------------
29  */
30 typedef struct QueryDesc
31 {
32         /* These fields are provided by CreateQueryDesc */
33         CmdType         operation;              /* CMD_SELECT, CMD_UPDATE, etc. */
34         Query      *parsetree;          /* rewritten parsetree */
35         Plan       *plantree;           /* planner's output */
36         CommandDest dest;                       /* the destination output of the execution */
37         const char *portalName;         /* name of portal, or NULL */
38         ParamListInfo params;           /* param values being passed in */
39         bool            doInstrument;   /* TRUE requests runtime instrumentation */
40
41         /* These fields are set by ExecutorStart */
42         TupleDesc       tupDesc;                /* descriptor for result tuples */
43         EState     *estate;                     /* executor's query-wide state */
44         PlanState  *planstate;          /* tree of per-plan-node state */
45 } QueryDesc;
46
47 /* in pquery.c */
48 extern QueryDesc *CreateQueryDesc(Query *parsetree, Plan *plantree,
49                                                                   CommandDest dest, const char *portalName,
50                                                                   ParamListInfo params,
51                                                                   bool doInstrument);
52
53 extern void FreeQueryDesc(QueryDesc *qdesc);
54
55 #endif   /* EXECDESC_H  */