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

Go to the source code of this file.

Functions

TidScanStateExecInitTidScan (TidScan *node, EState *estate, int eflags)
 
void ExecEndTidScan (TidScanState *node)
 
void ExecReScanTidScan (TidScanState *node)
 

Function Documentation

◆ ExecEndTidScan()

void ExecEndTidScan ( TidScanState node)

Definition at line 481 of file nodeTidscan.c.

482{
483 if (node->ss.ss_currentScanDesc)
485}
struct TableScanDescData * ss_currentScanDesc
Definition: execnodes.h:1623
ScanState ss
Definition: execnodes.h:1918
static void table_endscan(TableScanDesc scan)
Definition: tableam.h:985

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

Referenced by ExecEndNode().

◆ ExecInitTidScan()

TidScanState * ExecInitTidScan ( TidScan node,
EState estate,
int  eflags 
)

Definition at line 499 of file nodeTidscan.c.

500{
501 TidScanState *tidstate;
502 Relation currentRelation;
503
504 /*
505 * create state structure
506 */
507 tidstate = makeNode(TidScanState);
508 tidstate->ss.ps.plan = (Plan *) node;
509 tidstate->ss.ps.state = estate;
510 tidstate->ss.ps.ExecProcNode = ExecTidScan;
511
512 /*
513 * Miscellaneous initialization
514 *
515 * create expression context for node
516 */
517 ExecAssignExprContext(estate, &tidstate->ss.ps);
518
519 /*
520 * mark tid list as not computed yet
521 */
522 tidstate->tss_TidList = NULL;
523 tidstate->tss_NumTids = 0;
524 tidstate->tss_TidPtr = -1;
525
526 /*
527 * open the scan relation
528 */
529 currentRelation = ExecOpenScanRelation(estate, node->scan.scanrelid, eflags);
530
531 tidstate->ss.ss_currentRelation = currentRelation;
532 tidstate->ss.ss_currentScanDesc = NULL; /* no heap scan here */
533
534 /*
535 * get the scan type from the relation descriptor.
536 */
537 ExecInitScanTupleSlot(estate, &tidstate->ss,
538 RelationGetDescr(currentRelation),
539 table_slot_callbacks(currentRelation));
540
541 /*
542 * Initialize result type and projection.
543 */
544 ExecInitResultTypeTL(&tidstate->ss.ps);
546
547 /*
548 * initialize child expressions
549 */
550 tidstate->ss.ps.qual =
551 ExecInitQual(node->scan.plan.qual, (PlanState *) tidstate);
552
553 TidExprListCreate(tidstate);
554
555 /*
556 * all done.
557 */
558 return tidstate;
559}
ExprState * ExecInitQual(List *qual, PlanState *parent)
Definition: execExpr.c:229
void ExecAssignScanProjectionInfo(ScanState *node)
Definition: execScan.c:81
void ExecInitScanTupleSlot(EState *estate, ScanState *scanstate, TupleDesc tupledesc, const TupleTableSlotOps *tts_ops)
Definition: execTuples.c:2000
void ExecInitResultTypeTL(PlanState *planstate)
Definition: execTuples.c:1944
void ExecAssignExprContext(EState *estate, PlanState *planstate)
Definition: execUtils.c:485
Relation ExecOpenScanRelation(EState *estate, Index scanrelid, int eflags)
Definition: execUtils.c:742
static TupleTableSlot * ExecTidScan(PlanState *pstate)
Definition: nodeTidscan.c:444
static void TidExprListCreate(TidScanState *tidstate)
Definition: nodeTidscan.c:70
#define makeNode(_type_)
Definition: nodes.h:161
#define RelationGetDescr(relation)
Definition: rel.h:541
ExprState * qual
Definition: execnodes.h:1186
Plan * plan
Definition: execnodes.h:1165
EState * state
Definition: execnodes.h:1167
ExecProcNodeMtd ExecProcNode
Definition: execnodes.h:1171
Relation ss_currentRelation
Definition: execnodes.h:1622
PlanState ps
Definition: execnodes.h:1621
Index scanrelid
Definition: plannodes.h:523
ItemPointerData * tss_TidList
Definition: execnodes.h:1923
Scan scan
Definition: plannodes.h:706
const TupleTableSlotOps * table_slot_callbacks(Relation relation)
Definition: tableam.c:59

References ExecAssignExprContext(), ExecAssignScanProjectionInfo(), ExecInitQual(), ExecInitResultTypeTL(), ExecInitScanTupleSlot(), ExecOpenScanRelation(), PlanState::ExecProcNode, ExecTidScan(), makeNode, PlanState::plan, ScanState::ps, PlanState::qual, RelationGetDescr, TidScan::scan, Scan::scanrelid, TidScanState::ss, ScanState::ss_currentRelation, ScanState::ss_currentScanDesc, PlanState::state, table_slot_callbacks(), TidExprListCreate(), TidScanState::tss_NumTids, TidScanState::tss_TidList, and TidScanState::tss_TidPtr.

Referenced by ExecInitNode().

◆ ExecReScanTidScan()

void ExecReScanTidScan ( TidScanState node)

Definition at line 458 of file nodeTidscan.c.

459{
460 if (node->tss_TidList)
461 pfree(node->tss_TidList);
462 node->tss_TidList = NULL;
463 node->tss_NumTids = 0;
464 node->tss_TidPtr = -1;
465
466 /* not really necessary, but seems good form */
467 if (node->ss.ss_currentScanDesc)
469
470 ExecScanReScan(&node->ss);
471}
void ExecScanReScan(ScanState *node)
Definition: execScan.c:108
void pfree(void *pointer)
Definition: mcxt.c:1594
static void table_rescan(TableScanDesc scan, ScanKeyData *key)
Definition: tableam.h:994

References ExecScanReScan(), pfree(), TidScanState::ss, ScanState::ss_currentScanDesc, table_rescan(), TidScanState::tss_NumTids, TidScanState::tss_TidList, and TidScanState::tss_TidPtr.

Referenced by ExecReScan().