PostgreSQL Source Code git master
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
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 327 of file nodeTidrangescan.c.

328{
330
331 if (scan != NULL)
332 table_endscan(scan);
333}
struct TableScanDescData * ss_currentScanDesc
Definition: execnodes.h:1574
static void table_endscan(TableScanDesc scan)
Definition: tableam.h:1024

References TidRangeScanState::ss, ScanState::ss_currentScanDesc, and table_endscan().

Referenced by ExecEndNode().

◆ ExecInitTidRangeScan()

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

Definition at line 347 of file nodeTidrangescan.c.

348{
349 TidRangeScanState *tidrangestate;
350 Relation currentRelation;
351
352 /*
353 * create state structure
354 */
355 tidrangestate = makeNode(TidRangeScanState);
356 tidrangestate->ss.ps.plan = (Plan *) node;
357 tidrangestate->ss.ps.state = estate;
358 tidrangestate->ss.ps.ExecProcNode = ExecTidRangeScan;
359
360 /*
361 * Miscellaneous initialization
362 *
363 * create expression context for node
364 */
365 ExecAssignExprContext(estate, &tidrangestate->ss.ps);
366
367 /*
368 * mark scan as not in progress, and TID range as not computed yet
369 */
370 tidrangestate->trss_inScan = false;
371
372 /*
373 * open the scan relation
374 */
375 currentRelation = ExecOpenScanRelation(estate, node->scan.scanrelid, eflags);
376
377 tidrangestate->ss.ss_currentRelation = currentRelation;
378 tidrangestate->ss.ss_currentScanDesc = NULL; /* no table scan here */
379
380 /*
381 * get the scan type from the relation descriptor.
382 */
383 ExecInitScanTupleSlot(estate, &tidrangestate->ss,
384 RelationGetDescr(currentRelation),
385 table_slot_callbacks(currentRelation));
386
387 /*
388 * Initialize result type and projection.
389 */
390 ExecInitResultTypeTL(&tidrangestate->ss.ps);
391 ExecAssignScanProjectionInfo(&tidrangestate->ss);
392
393 /*
394 * initialize child expressions
395 */
396 tidrangestate->ss.ps.qual =
397 ExecInitQual(node->scan.plan.qual, (PlanState *) tidrangestate);
398
399 TidExprListCreate(tidrangestate);
400
401 /*
402 * all done.
403 */
404 return tidrangestate;
405}
ExprState * ExecInitQual(List *qual, PlanState *parent)
Definition: execExpr.c:224
void ExecAssignScanProjectionInfo(ScanState *node)
Definition: execScan.c:270
void ExecInitScanTupleSlot(EState *estate, ScanState *scanstate, TupleDesc tupledesc, const TupleTableSlotOps *tts_ops)
Definition: execTuples.c:1998
void ExecInitResultTypeTL(PlanState *planstate)
Definition: execTuples.c:1942
void ExecAssignExprContext(EState *estate, PlanState *planstate)
Definition: execUtils.c:485
Relation ExecOpenScanRelation(EState *estate, Index scanrelid, int eflags)
Definition: execUtils.c:742
static void TidExprListCreate(TidRangeScanState *tidrangestate)
static TupleTableSlot * ExecTidRangeScan(PlanState *pstate)
#define makeNode(_type_)
Definition: nodes.h:155
#define RelationGetDescr(relation)
Definition: rel.h:531
ExprState * qual
Definition: execnodes.h:1146
Plan * plan
Definition: execnodes.h:1125
EState * state
Definition: execnodes.h:1127
ExecProcNodeMtd ExecProcNode
Definition: execnodes.h:1131
Relation ss_currentRelation
Definition: execnodes.h:1573
PlanState ps
Definition: execnodes.h:1572
Index scanrelid
Definition: plannodes.h:390
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 308 of file nodeTidrangescan.c.

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

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

Referenced by ExecReScan().