PostgreSQL Source Code  git master
nodeUnique.h File Reference
#include "nodes/execnodes.h"
Include dependency graph for nodeUnique.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

UniqueStateExecInitUnique (Unique *node, EState *estate, int eflags)
 
void ExecEndUnique (UniqueState *node)
 
void ExecReScanUnique (UniqueState *node)
 

Function Documentation

◆ ExecEndUnique()

void ExecEndUnique ( UniqueState node)

Definition at line 169 of file nodeUnique.c.

170 {
172 }
void ExecEndNode(PlanState *node)
Definition: execProcnode.c:557
#define outerPlanState(node)
Definition: execnodes.h:1132

References ExecEndNode(), and outerPlanState.

Referenced by ExecEndNode().

◆ ExecInitUnique()

UniqueState* ExecInitUnique ( Unique node,
EState estate,
int  eflags 
)

Definition at line 115 of file nodeUnique.c.

116 {
117  UniqueState *uniquestate;
118 
119  /* check for unsupported flags */
120  Assert(!(eflags & (EXEC_FLAG_BACKWARD | EXEC_FLAG_MARK)));
121 
122  /*
123  * create state structure
124  */
125  uniquestate = makeNode(UniqueState);
126  uniquestate->ps.plan = (Plan *) node;
127  uniquestate->ps.state = estate;
128  uniquestate->ps.ExecProcNode = ExecUnique;
129 
130  /*
131  * create expression context
132  */
133  ExecAssignExprContext(estate, &uniquestate->ps);
134 
135  /*
136  * then initialize outer plan
137  */
138  outerPlanState(uniquestate) = ExecInitNode(outerPlan(node), estate, eflags);
139 
140  /*
141  * Initialize result slot and type. Unique nodes do no projections, so
142  * initialize projection info for this node appropriately.
143  */
145  uniquestate->ps.ps_ProjInfo = NULL;
146 
147  /*
148  * Precompute fmgr lookup data for inner loop
149  */
150  uniquestate->eqfunction =
152  node->numCols,
153  node->uniqColIdx,
154  node->uniqOperators,
155  node->uniqCollations,
156  &uniquestate->ps);
157 
158  return uniquestate;
159 }
ExprState * execTuplesMatchPrepare(TupleDesc desc, int numCols, const AttrNumber *keyColIdx, const Oid *eqOperators, const Oid *collations, PlanState *parent)
Definition: execGrouping.c:59
PlanState * ExecInitNode(Plan *node, EState *estate, int eflags)
Definition: execProcnode.c:142
void ExecInitResultTupleSlotTL(PlanState *planstate, const TupleTableSlotOps *tts_ops)
Definition: execTuples.c:1800
const TupleTableSlotOps TTSOpsMinimalTuple
Definition: execTuples.c:85
TupleDesc ExecGetResultType(PlanState *planstate)
Definition: execUtils.c:498
void ExecAssignExprContext(EState *estate, PlanState *planstate)
Definition: execUtils.c:488
#define EXEC_FLAG_BACKWARD
Definition: executor.h:68
#define EXEC_FLAG_MARK
Definition: executor.h:69
Assert(fmt[strlen(fmt) - 1] !='\n')
static TupleTableSlot * ExecUnique(PlanState *pstate)
Definition: nodeUnique.c:47
#define makeNode(_type_)
Definition: nodes.h:176
#define outerPlan(node)
Definition: plannodes.h:182
Plan * plan
Definition: execnodes.h:1036
EState * state
Definition: execnodes.h:1038
ProjectionInfo * ps_ProjInfo
Definition: execnodes.h:1076
ExecProcNodeMtd ExecProcNode
Definition: execnodes.h:1042
PlanState ps
Definition: execnodes.h:2572
ExprState * eqfunction
Definition: execnodes.h:2573
int numCols
Definition: plannodes.h:1115

References Assert(), UniqueState::eqfunction, EXEC_FLAG_BACKWARD, EXEC_FLAG_MARK, ExecAssignExprContext(), ExecGetResultType(), ExecInitNode(), ExecInitResultTupleSlotTL(), PlanState::ExecProcNode, execTuplesMatchPrepare(), ExecUnique(), makeNode, Unique::numCols, outerPlan, outerPlanState, PlanState::plan, UniqueState::ps, PlanState::ps_ProjInfo, PlanState::state, and TTSOpsMinimalTuple.

Referenced by ExecInitNode().

◆ ExecReScanUnique()

void ExecReScanUnique ( UniqueState node)

Definition at line 176 of file nodeUnique.c.

177 {
179 
180  /* must clear result tuple so first input tuple is returned */
182 
183  /*
184  * if chgParam of subnode is not null then plan will be re-scanned by
185  * first ExecProcNode.
186  */
187  if (outerPlan->chgParam == NULL)
189 }
void ExecReScan(PlanState *node)
Definition: execAmi.c:78
TupleTableSlot * ps_ResultTupleSlot
Definition: execnodes.h:1074
static TupleTableSlot * ExecClearTuple(TupleTableSlot *slot)
Definition: tuptable.h:432

References ExecClearTuple(), ExecReScan(), outerPlan, outerPlanState, UniqueState::ps, and PlanState::ps_ResultTupleSlot.

Referenced by ExecReScan().