]> granicus.if.org Git - postgresql/blob - src/include/nodes/execnodes.h
another pass through.
[postgresql] / src / include / nodes / execnodes.h
1 /*-------------------------------------------------------------------------
2  *
3  * execnodes.h--
4  *    definitions for executor state nodes
5  *
6  *
7  * Copyright (c) 1994, Regents of the University of California
8  *
9  * $Id: execnodes.h,v 1.6 1996/11/04 08:52:54 scrappy Exp $
10  *
11  *-------------------------------------------------------------------------
12  */
13 #ifndef EXECNODES_H
14 #define EXECNODES_H
15
16 #include <nodes/memnodes.h>
17 #include <nodes/primnodes.h>
18 #include <executor/hashjoin.h>
19 #include <access/relscan.h>
20 #include <access/sdir.h>
21 #include <nodes/params.h>
22 #include <executor/tuptable.h>
23 #include <access/funcindex.h>
24
25 /* ----------------
26  *    IndexInfo information
27  *
28  *      this class holds the information saying what attributes
29  *      are the key attributes for this index. -cim 10/15/89
30  *
31  *      NumKeyAttributes        number of key attributes for this index
32  *      KeyAttributeNumbers     array of attribute numbers used as keys
33  *      Predicate               partial-index predicate for this index
34  * ----------------
35  */
36 typedef struct IndexInfo {
37     NodeTag             type;
38     int                 ii_NumKeyAttributes;
39     AttrNumber          *ii_KeyAttributeNumbers;
40     FuncIndexInfoPtr    ii_FuncIndexInfo;
41     Node                *ii_Predicate;
42 } IndexInfo;
43
44 /* ----------------
45  *    RelationInfo information
46  *
47  *      whenever we update an existing relation, we have to
48  *      update indices on the relation.  The RelationInfo class
49  *      is used to hold all the information on result relations,
50  *      including indices.. -cim 10/15/89
51  *
52  *      RangeTableIndex         result relation's range table index
53  *      RelationDesc            relation descriptor for result relation
54  *      NumIndices              number indices existing on result relation
55  *      IndexRelationDescs      array of relation descriptors for indices
56  *      IndexRelationInfo       array of key/attr info for indices
57  * ----------------
58  */
59 typedef struct RelationInfo {
60     NodeTag             type;
61     Index               ri_RangeTableIndex;
62     Relation            ri_RelationDesc;
63     int                 ri_NumIndices;
64     RelationPtr         ri_IndexRelationDescs;
65     IndexInfo           **ri_IndexRelationInfo;
66 } RelationInfo;
67
68 /* ----------------
69  *    ExprContext
70  *
71  *      This class holds the "current context" information
72  *      needed to evaluate expressions for doing tuple qualifications
73  *      and tuple projections.  For example, if an expression refers
74  *      to an attribute in the current inner tuple then we need to know
75  *      what the current inner tuple is and so we look at the expression
76  *      context.
77  * ----------------
78  */
79 typedef struct ExprContext {
80     NodeTag        type;
81     TupleTableSlot *ecxt_scantuple;
82     TupleTableSlot *ecxt_innertuple;
83     TupleTableSlot *ecxt_outertuple;
84     Relation       ecxt_relation;
85     Index          ecxt_relid;
86     ParamListInfo  ecxt_param_list_info;
87     List           *ecxt_range_table;
88     Datum          *ecxt_values;        /* precomputed values for aggreg */
89     char           *ecxt_nulls;         /* null flags for aggreg  values */
90 } ExprContext;
91
92 /* ----------------
93  *      ProjectionInfo node information
94  *
95  *      This is all the information needed to preform projections
96  *      on a tuple.  Nodes which need to do projections create one
97  *      of these.  In theory, when a node wants to preform a projection
98  *      it should just update this information as necessary and then
99  *      call ExecProject().  -cim 6/3/91
100  *
101  *      targetlist      target list for projection
102  *      len             length of target list
103  *      tupValue        array of pointers to projection results
104  *      exprContext     expression context for ExecTargetList
105  *      slot            slot to place projection result in
106  * ----------------
107  */
108 typedef struct ProjectionInfo {
109     NodeTag             type;
110     List                *pi_targetlist;
111     int                 pi_len;
112     Datum               *pi_tupValue;
113     ExprContext         *pi_exprContext;
114     TupleTableSlot      *pi_slot;
115 } ProjectionInfo;
116
117 /* ----------------
118  *    JunkFilter
119  *
120  *    this class is used to store information regarding junk attributes.
121  *    A junk attribute is an attribute in a tuple that is needed only for
122  *    storing intermediate information in the executor, and does not belong
123  *    in the tuple proper.  For example, when we do a delete or replace
124  *    query, the planner adds an entry to the targetlist so that the tuples
125  *    returned to ExecutePlan() contain an extra attribute: the t_ctid of
126  *    the tuple to be deleted/replaced.  This is needed for amdelete() and
127  *    amreplace().  In doing a delete this does not make much of a
128  *    difference, but in doing a replace we have to make sure we disgard
129  *    all the junk in a tuple before calling amreplace().  Otherwise the
130  *    inserted tuple will not have the correct schema.  This solves a
131  *    problem with hash-join and merge-sort replace plans.  -cim 10/10/90
132  *
133  *    targetList:       the original target list (including junk attributes).
134  *    length:           the length of 'targetList'.
135  *    tupType:          the tuple descriptor for the "original" tuple
136  *                      (including the junk attributes).
137  *    cleanTargetList:  the "clean" target list (junk attributes removed).
138  *    cleanLength:      the length of 'cleanTargetList'
139  *    cleanTupTyp:      the tuple descriptor of the "clean" tuple (with
140  *                      junk attributes removed).
141  *    cleanMap:         A map with the correspondance between the non junk
142  *                      attributes of the "original" tuple and the 
143  *                      attributes of the "clean" tuple.
144  * ----------------
145  */
146 typedef struct JunkFilter {
147     NodeTag             type;
148     List                *jf_targetList;
149     int                 jf_length;
150     TupleDesc           jf_tupType;
151     List                *jf_cleanTargetList;
152     int                 jf_cleanLength;
153     TupleDesc           jf_cleanTupType;
154     AttrNumber          *jf_cleanMap;
155 } JunkFilter;
156
157 /* ----------------
158  *    EState information
159  *
160  *      direction                       direction of the scan
161  *
162  *      range_table                     array of scan relation information
163  *
164  *      result_relation_information     for update queries
165  *
166  *      into_relation_descriptor        relation being retrieved "into"
167  *
168  *      param_list_info                 information needed to transform
169  *                                      Param nodes into Const nodes
170  *
171  *      BaseId                          during InitPlan(), each node is
172  *                                      given a number.  this is the next
173  *                                      number to be assigned.
174  *
175  *      tupleTable                      this is a pointer to an array
176  *                                      of pointers to tuples used by
177  *                                      the executor at any given moment.
178  *
179  *      junkFilter                      contains information used to
180  *                                      extract junk attributes from a tuple.
181  *                                      (see JunkFilter above)
182  *
183  *      refcount                        local buffer refcounts used in
184  *                                      an ExecMain cycle.  this is introduced
185  *                                      to avoid ExecStart's unpinning each
186  *                                      other's buffers when called recursively
187  * ----------------     
188  */
189 typedef struct EState {
190     NodeTag             type;
191     ScanDirection       es_direction;
192     List                *es_range_table;
193     RelationInfo        *es_result_relation_info;
194     Relation            es_into_relation_descriptor;
195     ParamListInfo       es_param_list_info;
196     int                 es_BaseId;
197     TupleTable          es_tupleTable;
198     JunkFilter          *es_junkFilter;
199     int                 *es_refcount;
200 } EState;
201
202 /* ----------------
203  *      Executor Type information needed by plannodes.h
204  *
205  *|     Note: the bogus classes CommonState and CommonScanState exist only
206  *|           because our inheritance system only allows single inheritance
207  *|           and we have to have unique slot names.  Hence two or more
208  *|           classes which want to have a common slot must ALL inherit
209  *|           the slot from some other class.  (This is a big hack to
210  *|           allow our classes to share slot names..)
211  *|
212  *|     Example:
213  *|           the class Result and the class NestLoop nodes both want
214  *|           a slot called "OuterTuple" so they both have to inherit
215  *|           it from some other class.  In this case they inherit
216  *|           it from CommonState.  "CommonState" and "CommonScanState" are
217  *|           the best names I could come up with for this sort of
218  *|           stuff.
219  *|
220  *|           As a result, many classes have extra slots which they
221  *|           don't use.  These slots are denoted (unused) in the
222  *|           comment preceeding the class definition.  If you
223  *|           comes up with a better idea of a way of doing things
224  *|           along these lines, then feel free to make your idea
225  *|           known to me.. -cim 10/15/89
226  * ----------------
227  */
228
229 /* ----------------------------------------------------------------
230  *               Common Executor State Information
231  * ----------------------------------------------------------------
232  */
233
234 /* BaseNode removed -- base_id moved into CommonState       - jolly */
235
236 /* ----------------
237  *   CommonState information
238  *
239  *|     this is a bogus class used to hold slots so other
240  *|     nodes can inherit them...
241  *
242  *      OuterTupleSlot     pointer to slot containing current "outer" tuple
243  *      ResultTupleSlot    pointer to slot in tuple table for projected tuple
244  *      ExprContext        node's current expression context
245  *      ProjInfo           info this node uses to form tuple projections
246  *      NumScanAttributes  size of ScanAttributes array
247  *      ScanAttributes     attribute numbers of interest in this tuple
248  *
249  * ----------------
250  */
251 typedef struct CommonState {
252     NodeTag             type;             /* its first field is NodeTag */ 
253     int                 cs_base_id; 
254     TupleTableSlot      *cs_OuterTupleSlot;
255     TupleTableSlot      *cs_ResultTupleSlot;
256     ExprContext         *cs_ExprContext;
257     ProjectionInfo      *cs_ProjInfo;
258     bool                cs_TupFromTlist;
259 } CommonState;
260
261
262 /* ----------------------------------------------------------------
263  *               Control Node State Information
264  * ----------------------------------------------------------------
265  */
266
267 /* ----------------
268  *   ResultState information
269  *
270  *      done               flag which tells us to quit when we
271  *                         have already returned a constant tuple.
272  *
273  *   CommonState information
274  *
275  *      OuterTupleSlot     pointer to slot containing current "outer" tuple
276  *      ResultTupleSlot    pointer to slot in tuple table for projected tuple
277  *      ExprContext        node's current expression context
278  *      ProjInfo           info this node uses to form tuple projections
279  *      NumScanAttributes  size of ScanAttributes array
280  *      ScanAttributes     attribute numbers of interest in this tuple
281  * ----------------
282  */
283 typedef struct ResultState {
284     CommonState         cstate;         /* its first field is NodeTag */
285     int                 rs_done;
286 } ResultState;
287
288 /* ----------------
289  *   AppendState information
290  *
291  *      append nodes have this field "unionplans" which is this
292  *      list of plans to execute in sequence..  these variables
293  *      keep track of things..
294  *
295  *      whichplan       which plan is being executed
296  *      nplans          how many plans are in the list
297  *      initialized     array of ExecInitNode() results
298  *      rtentries       range table for the current plan
299  *      result_relation_info_list  array of each subplan's result relation info
300  *      junkFilter_list  array of each subplan's junk filter
301  *
302  *   CommonState information
303  *
304  *      OuterTupleSlot     pointer to slot containing current "outer" tuple
305  *      ResultTupleSlot    pointer to slot in tuple table for projected tuple
306  *      ExprContext        node's current expression context
307  *      ProjInfo           info this node uses to form tuple projections
308  *      NumScanAttributes  size of ScanAttributes array
309  *      ScanAttributes     attribute numbers of interest in this tuple
310  * ----------------
311  */
312 typedef struct AppendState {
313     CommonState         cstate;         /* its first field is NodeTag */
314     int                 as_whichplan;
315     int                 as_nplans;
316     bool                *as_initialized;
317     List                *as_rtentries;
318     List                *as_result_relation_info_list;
319     List                *as_junkFilter_list;
320 } AppendState;
321
322 /* ----------------------------------------------------------------
323  *               Scan State Information
324  * ----------------------------------------------------------------
325  */
326
327 /* ----------------
328  *   CommonScanState information
329  *
330  *      CommonScanState is a class like CommonState, but is used more
331  *      by the nodes like SeqScan and Sort which want to
332  *      keep track of an underlying relation.
333  *
334  *      currentRelation    relation being scanned
335  *      currentScanDesc    current scan descriptor for scan
336  *      ScanTupleSlot      pointer to slot in tuple table holding scan tuple
337  *
338  *   CommonState information
339  *
340  *      OuterTupleSlot     pointer to slot containing current "outer" tuple
341  *      ResultTupleSlot    pointer to slot in tuple table for projected tuple
342  *      ExprContext        node's current expression context
343  *      ProjInfo           info this node uses to form tuple projections
344  *      NumScanAttributes  size of ScanAttributes array
345  *      ScanAttributes     attribute numbers of interest in this tuple
346  * ----------------
347  */
348 typedef struct CommonScanState {
349     CommonState         cstate;         /* its first field is NodeTag */
350     Relation            css_currentRelation;
351     HeapScanDesc        css_currentScanDesc;
352     TupleTableSlot      *css_ScanTupleSlot;
353 } CommonScanState;
354
355 /* ----------------
356  *   IndexScanState information
357  *
358  *|     index scans don't use CommonScanState because
359  *|     the underlying AM abstractions for heap scans and
360  *|     index scans are too different..  It would be nice
361  *|     if the current abstraction was more useful but ... -cim 10/15/89
362  *
363  *      IndexPtr           current index in use
364  *      NumIndices         number of indices in this scan
365  *      ScanKeys           Skey structures to scan index rels
366  *      NumScanKeys        array of no of keys in each Skey struct
367  *      RuntimeKeyInfo     array of array of flags for Skeys evaled at runtime
368  *      RelationDescs      ptr to array of relation descriptors
369  *      ScanDescs          ptr to array of scan descriptors
370  *
371  *   CommonState information
372  *
373  *      OuterTupleSlot     pointer to slot containing current "outer" tuple
374  *      ResultTupleSlot    pointer to slot in tuple table for projected tuple
375  *      ExprContext        node's current expression context
376  *      ProjInfo           info this node uses to form tuple projections
377  *      NumScanAttributes  size of ScanAttributes array
378  *      ScanAttributes     attribute numbers of interest in this tuple
379  * ----------------
380  */
381 typedef struct IndexScanState {
382     CommonState         cstate;         /* its first field is NodeTag */
383     int                 iss_NumIndices;
384     int                 iss_IndexPtr;
385     ScanKey             *iss_ScanKeys;
386     int                 *iss_NumScanKeys;
387     Pointer             iss_RuntimeKeyInfo;
388     RelationPtr         iss_RelationDescs;
389     IndexScanDescPtr    iss_ScanDescs;
390 } IndexScanState;
391
392
393 /* ----------------------------------------------------------------
394  *               Join State Information
395  * ----------------------------------------------------------------
396  */
397
398 /* ----------------
399  *   JoinState information
400  *
401  *   CommonState information
402  *
403  *      OuterTupleSlot     pointer to slot containing current "outer" tuple
404  *      ResultTupleSlot    pointer to slot in tuple table for projected tuple
405  *      ExprContext        node's current expression context
406  *      ProjInfo           info this node uses to form tuple projections
407  *      NumScanAttributes  size of ScanAttributes array
408  *      ScanAttributes     attribute numbers of interest in this tuple
409  * ----------------
410  */
411 typedef CommonState     JoinState;
412
413 /* ----------------
414  *   NestLoopState information
415  *
416  *      PortalFlag         Set to enable portals to work.
417  *
418  *   JoinState information
419  *
420  *   CommonState information
421  *
422  *      OuterTupleSlot     pointer to slot containing current "outer" tuple
423  *      ResultTupleSlot    pointer to slot in tuple table for projected tuple
424  *      ExprContext        node's current expression context
425  *      ProjInfo           info this node uses to form tuple projections
426  *      NumScanAttributes  size of ScanAttributes array
427  *      ScanAttributes     attribute numbers of interest in this tuple
428  * ----------------
429  */
430 typedef struct NestLoopState {
431     JoinState   jstate;         /* its first field is NodeTag */
432     bool        nl_PortalFlag;
433 } NestLoopState;
434
435 /* ----------------
436  *   MergeJoinState information
437  *
438  *      OSortopI           outerKey1 sortOp innerKey1 ...
439  *      ISortopO           innerkey1 sortOp outerkey1 ...
440  *      JoinState          current "state" of join. see executor.h
441  *      MarkedTupleSlot    pointer to slot in tuple table for marked tuple
442  *
443  *   JoinState information
444  *
445  *   CommonState information
446  *
447  *      OuterTupleSlot     pointer to slot containing current "outer" tuple
448  *      ResultTupleSlot    pointer to slot in tuple table for projected tuple
449  *      ExprContext        node's current expression context
450  *      ProjInfo           info this node uses to form tuple projections
451  *      NumScanAttributes  size of ScanAttributes array
452  *      ScanAttributes     attribute numbers of interest in this tuple
453  * ----------------
454  */
455 typedef struct MergeJoinState {
456     JoinState      jstate;              /* its first field is NodeTag */
457     List           *mj_OSortopI;
458     List           *mj_ISortopO;
459     int            mj_JoinState;
460     TupleTableSlot *mj_MarkedTupleSlot;
461 } MergeJoinState;
462
463 /* ----------------
464  *   HashJoinState information
465  *
466  *      hj_HashTable            address of the hash table for the hashjoin
467  *      hj_HashTableShmId       shared memory id of hash table
468  *      hj_CurBucket            the current hash bucket that we are searching
469  *                              for matches of the current outer tuple
470  *      hj_CurTuple             the current matching inner tuple in the
471  *                              current hash bucket
472  *      hj_CurOTuple            the current matching inner tuple in the
473  *                              current hash overflow chain
474  *      hj_InnerHashKey         the inner hash key in the hashjoin condition
475  *      hj_OuterBatches         file descriptors for outer batches
476  *      hj_InnerBatches         file descriptors for inner batches
477  *      hj_OuterReadPos         current read position of outer batch
478  *      hj_OuterReadBlk         current read block of outer batch
479  *      hj_OuterTupleSlot       tuple slot for outer tuples
480  *      hj_HashTupleSlot        tuple slot for hashed tuples
481  *
482  *      
483  *
484  *   JoinState information
485  *
486  *   CommonState information
487  *
488  *      OuterTupleSlot     pointer to slot containing current "outer" tuple
489  *      ResultTupleSlot    pointer to slot in tuple table for projected tuple
490  *      ExprContext        node's current expression context
491  *      ProjInfo           info this node uses to form tuple projections
492  *      NumScanAttributes  size of ScanAttributes array
493  *      ScanAttributes     attribute numbers of interest in this tuple
494  * ----------------
495  */
496 typedef struct HashJoinState {
497     JoinState           jstate;         /* its first field is NodeTag */
498     HashJoinTable       hj_HashTable;
499     IpcMemoryId         hj_HashTableShmId;
500     HashBucket          hj_CurBucket;
501     HeapTuple           hj_CurTuple;
502     OverflowTuple       hj_CurOTuple;
503     Var                 *hj_InnerHashKey;
504     File                *hj_OuterBatches;
505     File                *hj_InnerBatches;
506     char                *hj_OuterReadPos;
507     int                 hj_OuterReadBlk;
508     TupleTableSlot      *hj_OuterTupleSlot;
509     TupleTableSlot      *hj_HashTupleSlot;
510 } HashJoinState;
511
512
513 /* ----------------------------------------------------------------
514  *               Materialization State Information
515  * ----------------------------------------------------------------
516  */
517
518 /* ----------------
519  *   MaterialState information
520  *
521  *      materialize nodes are used to materialize the results
522  *      of a subplan into a temporary relation.
523  *
524  *      Flag            indicated whether subplan has been materialized
525  *      TempRelation    temporary relation containing result of executing
526  *                      the subplan.
527  *
528  *   CommonScanState information
529  *
530  *      currentRelation    relation descriptor of sorted relation
531  *      currentScanDesc    current scan descriptor for scan
532  *      ScanTupleSlot      pointer to slot in tuple table holding scan tuple
533  *
534  *   CommonState information
535  *
536  *      OuterTupleSlot     pointer to slot containing current "outer" tuple
537  *      ResultTupleSlot    pointer to slot in tuple table for projected tuple
538  *      ExprContext        node's current expression context
539  *      ProjInfo           info this node uses to form tuple projections
540  *      NumScanAttributes  size of ScanAttributes array
541  *      ScanAttributes     attribute numbers of interest in this tuple
542  * ----------------
543  */
544 typedef struct MaterialState {
545     CommonScanState     csstate;        /* its first field is NodeTag */
546     bool                mat_Flag;
547     Relation            mat_TempRelation;
548 } MaterialState;
549
550 /* ---------------------
551  *  AggregateState information
552  *
553  *      done            indicated whether aggregate has been materialized
554  * -------------------------
555  */
556 typedef struct AggState {
557     CommonScanState     csstate;        /* its first field is NodeTag */
558     bool                agg_done;
559 } AggState;
560
561 /* ---------------------
562  *  GroupState information
563  *
564  * -------------------------
565  */
566 typedef struct GroupState {
567     CommonScanState     csstate;        /* its first field is NodeTag */
568     bool                grp_useLastTuple; /* last tuple not processed yet */
569     bool                grp_done;
570     TupleTableSlot      *grp_lastSlot;
571 } GroupState;
572
573 /* ----------------
574  *   SortState information
575  *
576  *|     sort nodes are really just a kind of a scan since
577  *|     we implement sorts by retrieveing the entire subplan
578  *|     into a temp relation, sorting the temp relation into
579  *|     another sorted relation, and then preforming a simple
580  *|     unqualified sequential scan on the sorted relation..
581  *|     -cim 10/15/89
582  *
583  *      Flag            indicated whether relation has been sorted
584  *      Keys            scan key structures used to keep info on sort keys
585  *      TempRelation    temporary relation containing result of executing
586  *                      the subplan.
587  *
588  *   CommonScanState information
589  *
590  *      currentRelation    relation descriptor of sorted relation
591  *      currentScanDesc    current scan descriptor for scan
592  *      ScanTupleSlot      pointer to slot in tuple table holding scan tuple
593  *
594  *   CommonState information
595  *
596  *      OuterTupleSlot     pointer to slot containing current "outer" tuple
597  *      ResultTupleSlot    pointer to slot in tuple table for projected tuple
598  *      ExprContext        node's current expression context
599  *      ProjInfo           info this node uses to form tuple projections
600  *      NumScanAttributes  size of ScanAttributes array
601  *      ScanAttributes     attribute numbers of interest in this tuple
602  * ----------------
603  */
604 typedef struct SortState {
605     CommonScanState     csstate;        /* its first field is NodeTag */
606     bool                sort_Flag;
607     ScanKey             sort_Keys;
608     Relation            sort_TempRelation;
609 } SortState;
610
611 /* ----------------
612  *   UniqueState information
613  *
614  *      Unique nodes are used "on top of" sort nodes to discard
615  *      duplicate tuples returned from the sort phase.  Basically
616  *      all it does is compare the current tuple from the subplan
617  *      with the previously fetched tuple stored in OuterTuple and
618  *      if the two are identical, then we just fetch another tuple
619  *      from the sort and try again.
620  *
621  *   CommonState information
622  *
623  *      OuterTupleSlot     pointer to slot containing current "outer" tuple
624  *      ResultTupleSlot    pointer to slot in tuple table for projected tuple
625  *      ExprContext        node's current expression context
626  *      ProjInfo           info this node uses to form tuple projections
627  *      NumScanAttributes  size of ScanAttributes array
628  *      ScanAttributes     attribute numbers of interest in this tuple
629  * ----------------
630  */
631 typedef CommonState     UniqueState;
632
633
634 /* ----------------
635  *   HashState information
636  *
637  *      hashBatches        file descriptors for the batches
638  *
639  *   CommonState information
640  *
641  *      OuterTupleSlot     pointer to slot containing current "outer" tuple
642  *      ResultTupleSlot    pointer to slot in tuple table for projected tuple
643  *      ExprContext        node's current expression context
644  *      ProjInfo           info this node uses to form tuple projections
645  *      NumScanAttributes  size of ScanAttributes array
646  *      ScanAttributes     attribute numbers of interest in this tuple
647  * ----------------
648  */
649 typedef struct HashState {
650     CommonState         cstate; /* its first field is NodeTag */
651     File                *hashBatches;
652 } HashState;
653
654 /* -----------------------
655  *  TeeState information
656  *    leftPlace  :    next item in the queue unseen by the left parent
657  *    rightPlace :    next item in the queue unseen by the right parent
658  *    lastPlace  :    last item in the queue 
659  *    bufferRelname :  name of the relation used as the buffer queue
660  *    bufferRel     :  the relation used as the buffer queue
661  *    mcxt          :  for now, tee's have their own memory context
662  *                     may be cleaned up later if portals are cleaned up
663  *  
664  * initially, a Tee starts with [left/right]Place variables set to  -1.
665  * on cleanup, queue is free'd when both leftPlace and rightPlace = -1
666  * ------------------------- 
667 */
668 typedef struct TeeState {
669     CommonState          cstate; /* its first field is NodeTag */
670     int                  tee_leftPlace;
671     int                  tee_rightPlace;
672     int                  tee_lastPlace;
673     char                 *tee_bufferRelname;
674     Relation             tee_bufferRel;
675     MemoryContext        tee_mcxt;                                  
676     HeapScanDesc         tee_leftScanDesc;
677     HeapScanDesc         tee_rightScanDesc;
678 } TeeState;
679
680 #endif /* EXECNODES_H */