]> granicus.if.org Git - postgresql/blob - src/include/nodes/execnodes.h
Remove no-longer-used fields in Hash and HashJoin nodes.
[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.28 1999/05/18 21:34:26 tgl 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         ParamExecData *ecxt_param_exec_vals;            /* this is for subselects */
91         List       *ecxt_range_table;
92         Datum      *ecxt_values;        /* precomputed values for aggreg */
93         char       *ecxt_nulls;         /* null flags for aggreg  values */
94 } ExprContext;
95
96 /* ----------------
97  *              ProjectionInfo node information
98  *
99  *              This is all the information needed to preform projections
100  *              on a tuple.  Nodes which need to do projections create one
101  *              of these.  In theory, when a node wants to preform a projection
102  *              it should just update this information as necessary and then
103  *              call ExecProject().  -cim 6/3/91
104  *
105  *              targetlist              target list for projection
106  *              len                             length of target list
107  *              tupValue                array of pointers to projection results
108  *              exprContext             expression context for ExecTargetList
109  *              slot                    slot to place projection result in
110  * ----------------
111  */
112 typedef struct ProjectionInfo
113 {
114         NodeTag         type;
115         List       *pi_targetlist;
116         int                     pi_len;
117         Datum      *pi_tupValue;
118         ExprContext *pi_exprContext;
119         TupleTableSlot *pi_slot;
120 } ProjectionInfo;
121
122 /* ----------------
123  *        JunkFilter
124  *
125  *        this class is used to store information regarding junk attributes.
126  *        A junk attribute is an attribute in a tuple that is needed only for
127  *        storing intermediate information in the executor, and does not belong
128  *        in the tuple proper.  For example, when we do a delete or replace
129  *        query, the planner adds an entry to the targetlist so that the tuples
130  *        returned to ExecutePlan() contain an extra attribute: the t_ctid of
131  *        the tuple to be deleted/replaced.  This is needed for amdelete() and
132  *        amreplace().  In doing a delete this does not make much of a
133  *        difference, but in doing a replace we have to make sure we disgard
134  *        all the junk in a tuple before calling amreplace().  Otherwise the
135  *        inserted tuple will not have the correct schema.      This solves a
136  *        problem with hash-join and merge-sort replace plans.  -cim 10/10/90
137  *
138  *        targetList:           the original target list (including junk attributes).
139  *        length:                       the length of 'targetList'.
140  *        tupType:                      the tuple descriptor for the "original" tuple
141  *                                              (including the junk attributes).
142  *        cleanTargetList:      the "clean" target list (junk attributes removed).
143  *        cleanLength:          the length of 'cleanTargetList'
144  *        cleanTupTyp:          the tuple descriptor of the "clean" tuple (with
145  *                                              junk attributes removed).
146  *        cleanMap:                     A map with the correspondance between the non junk
147  *                                              attributes of the "original" tuple and the
148  *                                              attributes of the "clean" tuple.
149  * ----------------
150  */
151 typedef struct JunkFilter
152 {
153         NodeTag         type;
154         List       *jf_targetList;
155         int                     jf_length;
156         TupleDesc       jf_tupType;
157         List       *jf_cleanTargetList;
158         int                     jf_cleanLength;
159         TupleDesc       jf_cleanTupType;
160         AttrNumber *jf_cleanMap;
161 } JunkFilter;
162
163 /* ----------------
164  *        EState information
165  *
166  *              direction                                               direction of the scan
167  *
168  *              range_table                                             array of scan relation information
169  *
170  *              result_relation_information             for update queries
171  *
172  *              into_relation_descriptor                relation being retrieved "into"
173  *
174  *              param_list_info                                 information needed to transform
175  *                                                                              Param nodes into Const nodes
176  *
177  *              BaseId                                                  during InitPlan(), each node is
178  *                                                                              given a number.  this is the next
179  *                                                                              number to be assigned.
180  *
181  *              tupleTable                                              this is a pointer to an array
182  *                                                                              of pointers to tuples used by
183  *                                                                              the executor at any given moment.
184  *
185  *              junkFilter                                              contains information used to
186  *                                                                              extract junk attributes from a tuple.
187  *                                                                              (see JunkFilter above)
188  *
189  *              refcount                                                local buffer refcounts used in
190  *                                                                              an ExecMain cycle.      this is introduced
191  *                                                                              to avoid ExecStart's unpinning each
192  *                                                                              other's buffers when called recursively
193  * ----------------
194  */
195 typedef struct EState
196 {
197         NodeTag                 type;
198         ScanDirection   es_direction;
199         Snapshot                es_snapshot;
200         List               *es_range_table;
201         RelationInfo   *es_result_relation_info;
202         List              **es_result_relation_constraints;
203         Relation                es_into_relation_descriptor;
204         ParamListInfo   es_param_list_info;
205         ParamExecData  *es_param_exec_vals;     /* this is for subselects */
206         int                             es_BaseId;
207         TupleTable              es_tupleTable;
208         JunkFilter         *es_junkFilter;
209         int                        *es_refcount;
210         uint32                  es_processed;   /* # of tuples processed */
211         Oid                             es_lastoid;             /* last oid processed (by INSERT) */
212         List               *es_rowMark;         /* not good place, but there is no other */
213         /* Below is to re-evaluate plan qual in READ COMMITTED mode */
214         struct Plan        *es_origPlan;
215         Pointer                 es_evalPlanQual;
216         bool               *es_evTupleNull;
217         HeapTuple          *es_evTuple;
218         bool                    es_useEvalPlan;
219 } EState;
220
221 /* ----------------
222  *              Executor Type information needed by plannodes.h
223  *
224  *|             Note: the bogus classes CommonState and CommonScanState exist only
225  *|                       because our inheritance system only allows single inheritance
226  *|                       and we have to have unique slot names.  Hence two or more
227  *|                       classes which want to have a common slot must ALL inherit
228  *|                       the slot from some other class.  (This is a big hack to
229  *|                       allow our classes to share slot names..)
230  *|
231  *|             Example:
232  *|                       the class Result and the class NestLoop nodes both want
233  *|                       a slot called "OuterTuple" so they both have to inherit
234  *|                       it from some other class.  In this case they inherit
235  *|                       it from CommonState.  "CommonState" and "CommonScanState" are
236  *|                       the best names I could come up with for this sort of
237  *|                       stuff.
238  *|
239  *|                       As a result, many classes have extra slots which they
240  *|                       don't use.  These slots are denoted (unused) in the
241  *|                       comment preceeding the class definition.      If you
242  *|                       comes up with a better idea of a way of doing things
243  *|                       along these lines, then feel free to make your idea
244  *|                       known to me.. -cim 10/15/89
245  * ----------------
246  */
247
248 /* ----------------------------------------------------------------
249  *                               Common Executor State Information
250  * ----------------------------------------------------------------
251  */
252
253 /* BaseNode removed -- base_id moved into CommonState           - jolly */
254
255 /* ----------------
256  *       CommonState information
257  *
258  *|             this is a bogus class used to hold slots so other
259  *|             nodes can inherit them...
260  *
261  *              OuterTupleSlot     pointer to slot containing current "outer" tuple
262  *              ResultTupleSlot    pointer to slot in tuple table for projected tuple
263  *              ExprContext                node's current expression context
264  *              ProjInfo                   info this node uses to form tuple projections
265  *              NumScanAttributes  size of ScanAttributes array
266  *              ScanAttributes     attribute numbers of interest in this tuple
267  *
268  * ----------------
269  */
270 typedef struct CommonState
271 {
272         NodeTag         type;                   /* its first field is NodeTag */
273         int                     cs_base_id;
274         TupleTableSlot *cs_OuterTupleSlot;
275         TupleTableSlot *cs_ResultTupleSlot;
276         ExprContext *cs_ExprContext;
277         ProjectionInfo *cs_ProjInfo;
278         bool            cs_TupFromTlist;
279 } CommonState;
280
281
282 /* ----------------------------------------------------------------
283  *                               Control Node State Information
284  * ----------------------------------------------------------------
285  */
286
287 /* ----------------
288  *       ResultState information
289  *
290  *              done                       flag which tells us to quit when we
291  *                                                 have already returned a constant tuple.
292  *
293  *       CommonState information
294  *
295  *              OuterTupleSlot     pointer to slot containing current "outer" tuple
296  *              ResultTupleSlot    pointer to slot in tuple table for projected tuple
297  *              ExprContext                node's current expression context
298  *              ProjInfo                   info this node uses to form tuple projections
299  *              NumScanAttributes  size of ScanAttributes array
300  *              ScanAttributes     attribute numbers of interest in this tuple
301  * ----------------
302  */
303 typedef struct ResultState
304 {
305         CommonState cstate;                     /* its first field is NodeTag */
306         bool            rs_done;
307         bool            rs_checkqual;
308 } ResultState;
309
310 /* ----------------
311  *       AppendState information
312  *
313  *              append nodes have this field "unionplans" which is this
314  *              list of plans to execute in sequence..  these variables
315  *              keep track of things..
316  *
317  *              whichplan               which plan is being executed
318  *              nplans                  how many plans are in the list
319  *              initialized             array of ExecInitNode() results
320  *              rtentries               range table for the current plan
321  *              result_relation_info_list  array of each subplan's result relation info
322  *              junkFilter_list  array of each subplan's junk filter
323  *
324  *       CommonState information
325  *
326  *              OuterTupleSlot     pointer to slot containing current "outer" tuple
327  *              ResultTupleSlot    pointer to slot in tuple table for projected tuple
328  *              ExprContext                node's current expression context
329  *              ProjInfo                   info this node uses to form tuple projections
330  *              NumScanAttributes  size of ScanAttributes array
331  *              ScanAttributes     attribute numbers of interest in this tuple
332  * ----------------
333  */
334 typedef struct AppendState
335 {
336         CommonState cstate;                     /* its first field is NodeTag */
337         int                     as_whichplan;
338         int                     as_nplans;
339         bool       *as_initialized;
340         List       *as_rtentries;
341         List       *as_result_relation_info_list;
342         List       *as_junkFilter_list;
343 } AppendState;
344
345 /* ----------------------------------------------------------------
346  *                               Scan State Information
347  * ----------------------------------------------------------------
348  */
349
350 /* ----------------
351  *       CommonScanState information
352  *
353  *              CommonScanState is a class like CommonState, but is used more
354  *              by the nodes like SeqScan and Sort which want to
355  *              keep track of an underlying relation.
356  *
357  *              currentRelation    relation being scanned
358  *              currentScanDesc    current scan descriptor for scan
359  *              ScanTupleSlot      pointer to slot in tuple table holding scan tuple
360  *
361  *       CommonState information
362  *
363  *              OuterTupleSlot     pointer to slot containing current "outer" tuple
364  *              ResultTupleSlot    pointer to slot in tuple table for projected tuple
365  *              ExprContext                node's current expression context
366  *              ProjInfo                   info this node uses to form tuple projections
367  *              NumScanAttributes  size of ScanAttributes array
368  *              ScanAttributes     attribute numbers of interest in this tuple
369  * ----------------
370  */
371 typedef struct CommonScanState
372 {
373         CommonState cstate;                     /* its first field is NodeTag */
374         Relation        css_currentRelation;
375         HeapScanDesc css_currentScanDesc;
376         TupleTableSlot *css_ScanTupleSlot;
377 } CommonScanState;
378
379 /* ----------------
380  *       IndexScanState information
381  *
382  *|             index scans don't use CommonScanState because
383  *|             the underlying AM abstractions for heap scans and
384  *|             index scans are too different..  It would be nice
385  *|             if the current abstraction was more useful but ... -cim 10/15/89
386  *
387  *              IndexPtr                   current index in use
388  *              NumIndices                 number of indices in this scan
389  *              ScanKeys                   Skey structures to scan index rels
390  *              NumScanKeys                array of no of keys in each Skey struct
391  *              RuntimeKeyInfo     array of array of flags for Skeys evaled at runtime
392  *              RelationDescs      ptr to array of relation descriptors
393  *              ScanDescs                  ptr to array of scan descriptors
394  *
395  *       CommonState information
396  *
397  *              OuterTupleSlot     pointer to slot containing current "outer" tuple
398  *              ResultTupleSlot    pointer to slot in tuple table for projected tuple
399  *              ExprContext                node's current expression context
400  *              ProjInfo                   info this node uses to form tuple projections
401  *              NumScanAttributes  size of ScanAttributes array
402  *              ScanAttributes     attribute numbers of interest in this tuple
403  * ----------------
404  */
405 typedef struct IndexScanState
406 {
407         CommonState             cstate;                 /* its first field is NodeTag */
408         int                                     iss_NumIndices;
409         int                                     iss_IndexPtr;
410         int                                     iss_MarkIndexPtr;
411         ScanKey                    *iss_ScanKeys;
412         int                                *iss_NumScanKeys;
413         Pointer                         iss_RuntimeKeyInfo;
414         RelationPtr                     iss_RelationDescs;
415         IndexScanDescPtr        iss_ScanDescs;
416         HeapTupleData           iss_htup;
417 } IndexScanState;
418
419
420 /* ----------------------------------------------------------------
421  *                               Join State Information
422  * ----------------------------------------------------------------
423  */
424
425 /* ----------------
426  *       JoinState information
427  *
428  *       CommonState information
429  *
430  *              OuterTupleSlot     pointer to slot containing current "outer" tuple
431  *              ResultTupleSlot    pointer to slot in tuple table for projected tuple
432  *              ExprContext                node's current expression context
433  *              ProjInfo                   info this node uses to form tuple projections
434  *              NumScanAttributes  size of ScanAttributes array
435  *              ScanAttributes     attribute numbers of interest in this tuple
436  * ----------------
437  */
438 typedef CommonState JoinState;
439
440 /* ----------------
441  *       NestLoopState information
442  *
443  *              PortalFlag                 Set to enable portals to work.
444  *
445  *       JoinState information
446  *
447  *       CommonState information
448  *
449  *              OuterTupleSlot     pointer to slot containing current "outer" tuple
450  *              ResultTupleSlot    pointer to slot in tuple table for projected tuple
451  *              ExprContext                node's current expression context
452  *              ProjInfo                   info this node uses to form tuple projections
453  *              NumScanAttributes  size of ScanAttributes array
454  *              ScanAttributes     attribute numbers of interest in this tuple
455  * ----------------
456  */
457 typedef struct NestLoopState
458 {
459         JoinState       jstate;                 /* its first field is NodeTag */
460         bool            nl_PortalFlag;
461 } NestLoopState;
462
463 /* ----------------
464  *       MergeJoinState information
465  *
466  *              OuterSkipQual      outerKey1 < innerKey1 ...
467  *              InnerSkipQual      outerKey1 > innerKey1 ...
468  *              JoinState                  current "state" of join. see executor.h
469  *              MarkedTupleSlot    pointer to slot in tuple table for marked tuple
470  *
471  *       JoinState information
472  *
473  *       CommonState information
474  *
475  *              OuterTupleSlot     pointer to slot containing current "outer" tuple
476  *              ResultTupleSlot    pointer to slot in tuple table for projected tuple
477  *              ExprContext                node's current expression context
478  *              ProjInfo                   info this node uses to form tuple projections
479  *              NumScanAttributes  size of ScanAttributes array
480  *              ScanAttributes     attribute numbers of interest in this tuple
481  * ----------------
482  */
483 typedef struct MergeJoinState
484 {
485         JoinState       jstate;                 /* its first field is NodeTag */
486         List       *mj_OuterSkipQual;
487         List       *mj_InnerSkipQual;
488         int                     mj_JoinState;
489         TupleTableSlot *mj_MarkedTupleSlot;
490 } MergeJoinState;
491
492 /* ----------------
493  *       HashJoinState information
494  *
495  *              hj_HashTable                    hash table for the hashjoin
496  *              hj_CurBucketNo                  bucket# for current outer tuple
497  *              hj_CurTuple                             last inner tuple matched to current outer
498  *                                                              tuple, or NULL if starting search
499  *                                                              (CurBucketNo and CurTuple are meaningless
500  *                                                               unless OuterTupleSlot is nonempty!)
501  *              hj_InnerHashKey                 the inner hash key in the hashjoin condition
502  *              hj_OuterTupleSlot               tuple slot for outer tuples
503  *              hj_HashTupleSlot                tuple slot for hashed tuples
504  *
505  *       JoinState information
506  *
507  *       CommonState information
508  *
509  *              OuterTupleSlot     pointer to slot containing current "outer" tuple
510  *              ResultTupleSlot    pointer to slot in tuple table for projected tuple
511  *              ExprContext                node's current expression context
512  *              ProjInfo                   info this node uses to form tuple projections
513  *              NumScanAttributes  size of ScanAttributes array
514  *              ScanAttributes     attribute numbers of interest in this tuple
515  * ----------------
516  */
517 typedef struct HashJoinState
518 {
519         JoinState       jstate;                 /* its first field is NodeTag */
520         HashJoinTable   hj_HashTable;
521         int                             hj_CurBucketNo;
522         HashJoinTuple   hj_CurTuple;
523         Var                        *hj_InnerHashKey;
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_useFirstTuple;              /* first tuple not processed yet */
588         bool            grp_done;
589         HeapTuple       grp_firstTuple;
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 retrieving 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  *              hashtable                       hash table for the hashjoin
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         HashJoinTable hashtable;
673 } HashState;
674
675 #ifdef NOT_USED
676 /* -----------------------
677  *      TeeState information
678  *        leftPlace  :    next item in the queue unseen by the left parent
679  *        rightPlace :    next item in the queue unseen by the right parent
680  *        lastPlace  :    last item in the queue
681  *        bufferRelname :  name of the relation used as the buffer queue
682  *        bufferRel             :  the relation used as the buffer queue
683  *        mcxt                  :  for now, tee's have their own memory context
684  *                                         may be cleaned up later if portals are cleaned up
685  *
686  * initially, a Tee starts with [left/right]Place variables set to      -1.
687  * on cleanup, queue is free'd when both leftPlace and rightPlace = -1
688  * -------------------------
689 */
690 typedef struct TeeState
691 {
692         CommonState      cstate;                        /* its first field is NodeTag */
693         int                                             tee_leftPlace,
694                                                         tee_rightPlace,
695                                                         tee_lastPlace;
696         char                                    *tee_bufferRelname;
697         Relation                                tee_bufferRel;
698         MemoryContext tee_mcxt;
699         HeapScanDesc                    tee_leftScanDesc,
700                                                         tee_rightScanDesc;
701 } TeeState;
702 #endif
703
704 #endif   /* EXECNODES_H */