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

Go to the source code of this file.

Functions

TidRangeScanStateExecInitTidRangeScan (TidRangeScan *node, EState *estate, int eflags)
 
void ExecEndTidRangeScan (TidRangeScanState *node)
 
void ExecReScanTidRangeScan (TidRangeScanState *node)
 

Function Documentation

◆ ExecEndTidRangeScan()

void ExecEndTidRangeScan ( TidRangeScanState node)

Definition at line 328 of file nodeTidrangescan.c.

329 {
330  TableScanDesc scan = node->ss.ss_currentScanDesc;
331 
332  if (scan != NULL)
333  table_endscan(scan);
334 
335  /*
336  * Free the exprcontext
337  */
338  ExecFreeExprContext(&node->ss.ps);
339 
340  /*
341  * clear out tuple table slots
342  */
343  if (node->ss.ps.ps_ResultTupleSlot)
346 }
void ExecFreeExprContext(PlanState *planstate)
Definition: execUtils.c:652
TupleTableSlot * ps_ResultTupleSlot
Definition: execnodes.h:1067
TupleTableSlot * ss_ScanTupleSlot
Definition: execnodes.h:1457
PlanState ps
Definition: execnodes.h:1454
struct TableScanDescData * ss_currentScanDesc
Definition: execnodes.h:1456
static void table_endscan(TableScanDesc scan)
Definition: tableam.h:993
static TupleTableSlot * ExecClearTuple(TupleTableSlot *slot)
Definition: tuptable.h:433

References ExecClearTuple(), ExecFreeExprContext(), ScanState::ps, PlanState::ps_ResultTupleSlot, TidRangeScanState::ss, ScanState::ss_currentScanDesc, ScanState::ss_ScanTupleSlot, and table_endscan().

Referenced by ExecEndNode().

◆ ExecInitTidRangeScan()

TidRangeScanState* ExecInitTidRangeScan ( TidRangeScan node,
EState estate,
int  eflags 
)

Definition at line 360 of file nodeTidrangescan.c.

361 {
362  TidRangeScanState *tidrangestate;
363  Relation currentRelation;
364 
365  /*
366  * create state structure
367  */
368  tidrangestate = makeNode(TidRangeScanState);
369  tidrangestate->ss.ps.plan = (Plan *) node;
370  tidrangestate->ss.ps.state = estate;
371  tidrangestate->ss.ps.ExecProcNode = ExecTidRangeScan;
372 
373  /*
374  * Miscellaneous initialization
375  *
376  * create expression context for node
377  */
378  ExecAssignExprContext(estate, &tidrangestate->ss.ps);
379 
380  /*
381  * mark scan as not in progress, and TID range as not computed yet
382  */
383  tidrangestate->trss_inScan = false;
384 
385  /*
386  * open the scan relation
387  */
388  currentRelation = ExecOpenScanRelation(estate, node->scan.scanrelid, eflags);
389 
390  tidrangestate->ss.ss_currentRelation = currentRelation;
391  tidrangestate->ss.ss_currentScanDesc = NULL; /* no table scan here */
392 
393  /*
394  * get the scan type from the relation descriptor.
395  */
396  ExecInitScanTupleSlot(estate, &tidrangestate->ss,
397  RelationGetDescr(currentRelation),
398  table_slot_callbacks(currentRelation));
399 
400  /*
401  * Initialize result type and projection.
402  */
403  ExecInitResultTypeTL(&tidrangestate->ss.ps);
404  ExecAssignScanProjectionInfo(&tidrangestate->ss);
405 
406  /*
407  * initialize child expressions
408  */
409  tidrangestate->ss.ps.qual =
410  ExecInitQual(node->scan.plan.qual, (PlanState *) tidrangestate);
411 
412  TidExprListCreate(tidrangestate);
413 
414  /*
415  * all done.
416  */
417  return tidrangestate;
418 }
ExprState * ExecInitQual(List *qual, PlanState *parent)
Definition: execExpr.c:210
void ExecAssignScanProjectionInfo(ScanState *node)
Definition: execScan.c:272
void ExecInitScanTupleSlot(EState *estate, ScanState *scanstate, TupleDesc tupledesc, const TupleTableSlotOps *tts_ops)
Definition: execTuples.c:1811
void ExecInitResultTypeTL(PlanState *planstate)
Definition: execTuples.c:1755
void ExecAssignExprContext(EState *estate, PlanState *planstate)
Definition: execUtils.c:482
Relation ExecOpenScanRelation(EState *estate, Index scanrelid, int eflags)
Definition: execUtils.c:722
static void TidExprListCreate(TidRangeScanState *tidrangestate)
static TupleTableSlot * ExecTidRangeScan(PlanState *pstate)
#define makeNode(_type_)
Definition: nodes.h:165
#define RelationGetDescr(relation)
Definition: rel.h:527
ExprState * qual
Definition: execnodes.h:1050
Plan * plan
Definition: execnodes.h:1029
EState * state
Definition: execnodes.h:1031
ExecProcNodeMtd ExecProcNode
Definition: execnodes.h:1035
Relation ss_currentRelation
Definition: execnodes.h:1455
Index scanrelid
Definition: plannodes.h:387
const TupleTableSlotOps * table_slot_callbacks(Relation relation)
Definition: tableam.c:58

References ExecAssignExprContext(), ExecAssignScanProjectionInfo(), ExecInitQual(), ExecInitResultTypeTL(), ExecInitScanTupleSlot(), ExecOpenScanRelation(), PlanState::ExecProcNode, ExecTidRangeScan(), makeNode, PlanState::plan, ScanState::ps, PlanState::qual, RelationGetDescr, TidRangeScan::scan, Scan::scanrelid, TidRangeScanState::ss, ScanState::ss_currentRelation, ScanState::ss_currentScanDesc, PlanState::state, table_slot_callbacks(), TidExprListCreate(), and TidRangeScanState::trss_inScan.

Referenced by ExecInitNode().

◆ ExecReScanTidRangeScan()

void ExecReScanTidRangeScan ( TidRangeScanState node)

Definition at line 309 of file nodeTidrangescan.c.

310 {
311  /* mark scan as not in progress, and tid range list as not computed yet */
312  node->trss_inScan = false;
313 
314  /*
315  * We must wait until TidRangeNext before calling table_rescan_tidrange.
316  */
317  ExecScanReScan(&node->ss);
318 }
void ExecScanReScan(ScanState *node)
Definition: execScan.c:299

References ExecScanReScan(), TidRangeScanState::ss, and TidRangeScanState::trss_inScan.

Referenced by ExecReScan().