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 168 of file nodeUnique.c.

169 {
171 }
void ExecEndNode(PlanState *node)
Definition: execProcnode.c:562
#define outerPlanState(node)
Definition: execnodes.h:1223

References ExecEndNode(), and outerPlanState.

Referenced by ExecEndNode().

◆ ExecInitUnique()

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

Definition at line 114 of file nodeUnique.c.

115 {
116  UniqueState *uniquestate;
117 
118  /* check for unsupported flags */
119  Assert(!(eflags & (EXEC_FLAG_BACKWARD | EXEC_FLAG_MARK)));
120 
121  /*
122  * create state structure
123  */
124  uniquestate = makeNode(UniqueState);
125  uniquestate->ps.plan = (Plan *) node;
126  uniquestate->ps.state = estate;
127  uniquestate->ps.ExecProcNode = ExecUnique;
128 
129  /*
130  * create expression context
131  */
132  ExecAssignExprContext(estate, &uniquestate->ps);
133 
134  /*
135  * then initialize outer plan
136  */
137  outerPlanState(uniquestate) = ExecInitNode(outerPlan(node), estate, eflags);
138 
139  /*
140  * Initialize result slot and type. Unique nodes do no projections, so
141  * initialize projection info for this node appropriately.
142  */
144  uniquestate->ps.ps_ProjInfo = NULL;
145 
146  /*
147  * Precompute fmgr lookup data for inner loop
148  */
149  uniquestate->eqfunction =
151  node->numCols,
152  node->uniqColIdx,
153  node->uniqOperators,
154  node->uniqCollations,
155  &uniquestate->ps);
156 
157  return uniquestate;
158 }
#define Assert(condition)
Definition: c.h:861
ExprState * execTuplesMatchPrepare(TupleDesc desc, int numCols, const AttrNumber *keyColIdx, const Oid *eqOperators, const Oid *collations, PlanState *parent)
Definition: execGrouping.c:58
PlanState * ExecInitNode(Plan *node, EState *estate, int eflags)
Definition: execProcnode.c:142
void ExecInitResultTupleSlotTL(PlanState *planstate, const TupleTableSlotOps *tts_ops)
Definition: execTuples.c:1886
const TupleTableSlotOps TTSOpsMinimalTuple
Definition: execTuples.c:86
TupleDesc ExecGetResultType(PlanState *planstate)
Definition: execUtils.c:495
void ExecAssignExprContext(EState *estate, PlanState *planstate)
Definition: execUtils.c:485
#define EXEC_FLAG_BACKWARD
Definition: executor.h:68
#define EXEC_FLAG_MARK
Definition: executor.h:69
static TupleTableSlot * ExecUnique(PlanState *pstate)
Definition: nodeUnique.c:46
#define makeNode(_type_)
Definition: nodes.h:155
#define outerPlan(node)
Definition: plannodes.h:183
Plan * plan
Definition: execnodes.h:1127
EState * state
Definition: execnodes.h:1129
ProjectionInfo * ps_ProjInfo
Definition: execnodes.h:1167
ExecProcNodeMtd ExecProcNode
Definition: execnodes.h:1133
PlanState ps
Definition: execnodes.h:2692
ExprState * eqfunction
Definition: execnodes.h:2693
int numCols
Definition: plannodes.h:1118

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 175 of file nodeUnique.c.

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

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

Referenced by ExecReScan().