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

Go to the source code of this file.

Functions

GroupStateExecInitGroup (Group *node, EState *estate, int eflags)
 
void ExecEndGroup (GroupState *node)
 
void ExecReScanGroup (GroupState *node)
 

Function Documentation

◆ ExecEndGroup()

void ExecEndGroup ( GroupState node)

Definition at line 226 of file nodeGroup.c.

227{
229
232}
void ExecEndNode(PlanState *node)
Definition: execProcnode.c:562
#define outerPlanState(node)
Definition: execnodes.h:1249
#define outerPlan(node)
Definition: plannodes.h:238

References ExecEndNode(), outerPlan, and outerPlanState.

Referenced by ExecEndNode().

◆ ExecInitGroup()

GroupState * ExecInitGroup ( Group node,
EState estate,
int  eflags 
)

Definition at line 161 of file nodeGroup.c.

162{
163 GroupState *grpstate;
164 const TupleTableSlotOps *tts_ops;
165
166 /* check for unsupported flags */
168
169 /*
170 * create state structure
171 */
172 grpstate = makeNode(GroupState);
173 grpstate->ss.ps.plan = (Plan *) node;
174 grpstate->ss.ps.state = estate;
175 grpstate->ss.ps.ExecProcNode = ExecGroup;
176 grpstate->grp_done = false;
177
178 /*
179 * create expression context
180 */
181 ExecAssignExprContext(estate, &grpstate->ss.ps);
182
183 /*
184 * initialize child nodes
185 */
186 outerPlanState(grpstate) = ExecInitNode(outerPlan(node), estate, eflags);
187
188 /*
189 * Initialize scan slot and type.
190 */
191 tts_ops = ExecGetResultSlotOps(outerPlanState(&grpstate->ss), NULL);
192 ExecCreateScanSlotFromOuterPlan(estate, &grpstate->ss, tts_ops);
193
194 /*
195 * Initialize result slot, type and projection.
196 */
198 ExecAssignProjectionInfo(&grpstate->ss.ps, NULL);
199
200 /*
201 * initialize child expressions
202 */
203 grpstate->ss.ps.qual =
204 ExecInitQual(node->plan.qual, (PlanState *) grpstate);
205
206 /*
207 * Precompute fmgr lookup data for inner loop
208 */
209 grpstate->eqfunction =
211 node->numCols,
212 node->grpColIdx,
213 node->grpOperators,
214 node->grpCollations,
215 &grpstate->ss.ps);
216
217 return grpstate;
218}
ExprState * ExecInitQual(List *qual, PlanState *parent)
Definition: execExpr.c:229
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
const TupleTableSlotOps TTSOpsVirtual
Definition: execTuples.c:84
void ExecInitResultTupleSlotTL(PlanState *planstate, const TupleTableSlotOps *tts_ops)
Definition: execTuples.c:1986
TupleDesc ExecGetResultType(PlanState *planstate)
Definition: execUtils.c:497
void ExecCreateScanSlotFromOuterPlan(EState *estate, ScanState *scanstate, const TupleTableSlotOps *tts_ops)
Definition: execUtils.c:706
void ExecAssignExprContext(EState *estate, PlanState *planstate)
Definition: execUtils.c:487
void ExecAssignProjectionInfo(PlanState *planstate, TupleDesc inputDesc)
Definition: execUtils.c:585
const TupleTableSlotOps * ExecGetResultSlotOps(PlanState *planstate, bool *isfixed)
Definition: execUtils.c:506
#define EXEC_FLAG_BACKWARD
Definition: executor.h:69
#define EXEC_FLAG_MARK
Definition: executor.h:70
Assert(PointerIsAligned(start, uint64))
static TupleTableSlot * ExecGroup(PlanState *pstate)
Definition: nodeGroup.c:36
#define makeNode(_type_)
Definition: nodes.h:157
ExprState * eqfunction
Definition: execnodes.h:2475
ScanState ss
Definition: execnodes.h:2474
bool grp_done
Definition: execnodes.h:2476
int numCols
Definition: plannodes.h:1111
Plan plan
Definition: plannodes.h:1108
ExprState * qual
Definition: execnodes.h:1174
Plan * plan
Definition: execnodes.h:1153
EState * state
Definition: execnodes.h:1155
ExecProcNodeMtd ExecProcNode
Definition: execnodes.h:1159
List * qual
Definition: plannodes.h:208
PlanState ps
Definition: execnodes.h:1609

References Assert(), GroupState::eqfunction, EXEC_FLAG_BACKWARD, EXEC_FLAG_MARK, ExecAssignExprContext(), ExecAssignProjectionInfo(), ExecCreateScanSlotFromOuterPlan(), ExecGetResultSlotOps(), ExecGetResultType(), ExecGroup(), ExecInitNode(), ExecInitQual(), ExecInitResultTupleSlotTL(), PlanState::ExecProcNode, execTuplesMatchPrepare(), GroupState::grp_done, makeNode, Group::numCols, outerPlan, outerPlanState, PlanState::plan, Group::plan, ScanState::ps, PlanState::qual, Plan::qual, GroupState::ss, PlanState::state, and TTSOpsVirtual.

Referenced by ExecInitNode().

◆ ExecReScanGroup()

void ExecReScanGroup ( GroupState node)

Definition at line 235 of file nodeGroup.c.

236{
238
239 node->grp_done = false;
240 /* must clear first tuple */
242
243 /*
244 * if chgParam of subnode is not null then plan will be re-scanned by
245 * first ExecProcNode.
246 */
247 if (outerPlan->chgParam == NULL)
249}
void ExecReScan(PlanState *node)
Definition: execAmi.c:77
TupleTableSlot * ss_ScanTupleSlot
Definition: execnodes.h:1612
static TupleTableSlot * ExecClearTuple(TupleTableSlot *slot)
Definition: tuptable.h:454

References ExecClearTuple(), ExecReScan(), GroupState::grp_done, outerPlan, outerPlanState, GroupState::ss, and ScanState::ss_ScanTupleSlot.

Referenced by ExecReScan().