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 323 of file nodeTidrangescan.c.

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

Referenced by ExecEndNode().

324 {
325  TableScanDesc scan = node->ss.ss_currentScanDesc;
326 
327  if (scan != NULL)
328  table_endscan(scan);
329 
330  /*
331  * Free the exprcontext
332  */
333  ExecFreeExprContext(&node->ss.ps);
334 
335  /*
336  * clear out tuple table slots
337  */
338  if (node->ss.ps.ps_ResultTupleSlot)
341 }
static TupleTableSlot * ExecClearTuple(TupleTableSlot *slot)
Definition: tuptable.h:425
struct TableScanDescData * ss_currentScanDesc
Definition: execnodes.h:1379
TupleTableSlot * ss_ScanTupleSlot
Definition: execnodes.h:1380
void ExecFreeExprContext(PlanState *planstate)
Definition: execUtils.c:650
PlanState ps
Definition: execnodes.h:1377
TupleTableSlot * ps_ResultTupleSlot
Definition: execnodes.h:1004
static void table_endscan(TableScanDesc scan)
Definition: tableam.h:991

◆ ExecInitTidRangeScan()

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

Definition at line 355 of file nodeTidrangescan.c.

References ExecAssignExprContext(), ExecAssignScanProjectionInfo(), ExecInitQual(), ExecInitResultTypeTL(), ExecInitScanTupleSlot(), ExecOpenScanRelation(), PlanState::ExecProcNode, ExecTidRangeScan(), makeNode, Scan::plan, PlanState::plan, ScanState::ps, Plan::qual, 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().

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

◆ ExecReScanTidRangeScan()

void ExecReScanTidRangeScan ( TidRangeScanState node)

Definition at line 304 of file nodeTidrangescan.c.

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

Referenced by ExecReScan().

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