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