PostgreSQL Source Code  git master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
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)
 
TupleTableSlotExecTidScan (TidScanState *node)
 
void ExecEndTidScan (TidScanState *node)
 
void ExecReScanTidScan (TidScanState *node)
 

Function Documentation

void ExecEndTidScan ( TidScanState node)

Definition at line 477 of file nodeTidscan.c.

References ExecClearTuple(), ExecCloseScanRelation(), ExecFreeExprContext(), ScanState::ps, PlanState::ps_ResultTupleSlot, TidScanState::ss, ScanState::ss_currentRelation, and ScanState::ss_ScanTupleSlot.

Referenced by ExecEndNode().

478 {
479  /*
480  * Free the exprcontext
481  */
482  ExecFreeExprContext(&node->ss.ps);
483 
484  /*
485  * clear out tuple table slots
486  */
489 
490  /*
491  * close the heap relation.
492  */
494 }
TupleTableSlot * ExecClearTuple(TupleTableSlot *slot)
Definition: execTuples.c:439
TupleTableSlot * ss_ScanTupleSlot
Definition: execnodes.h:1078
Relation ss_currentRelation
Definition: execnodes.h:1076
void ExecFreeExprContext(PlanState *planstate)
Definition: execUtils.c:516
PlanState ps
Definition: execnodes.h:1075
TupleTableSlot * ps_ResultTupleSlot
Definition: execnodes.h:861
ScanState ss
Definition: execnodes.h:1352
void ExecCloseScanRelation(Relation scanrel)
Definition: execUtils.c:661
TidScanState* ExecInitTidScan ( TidScan node,
EState estate,
int  eflags 
)

Definition at line 508 of file nodeTidscan.c.

References ExecAssignExprContext(), ExecAssignResultTypeFromTL(), ExecAssignScanProjectionInfo(), ExecAssignScanType(), ExecInitQual(), ExecInitResultTupleSlot(), ExecInitScanTupleSlot(), ExecOpenScanRelation(), makeNode, NULL, Scan::plan, PlanState::plan, ScanState::ps, Plan::qual, PlanState::qual, RelationGetDescr, TidScan::scan, Scan::scanrelid, TidScanState::ss, ScanState::ss_currentRelation, ScanState::ss_currentScanDesc, PlanState::state, TidExprListCreate(), TidScanState::tss_NumTids, TidScanState::tss_TidList, and TidScanState::tss_TidPtr.

Referenced by ExecInitNode().

509 {
510  TidScanState *tidstate;
511  Relation currentRelation;
512 
513  /*
514  * create state structure
515  */
516  tidstate = makeNode(TidScanState);
517  tidstate->ss.ps.plan = (Plan *) node;
518  tidstate->ss.ps.state = estate;
519 
520  /*
521  * Miscellaneous initialization
522  *
523  * create expression context for node
524  */
525  ExecAssignExprContext(estate, &tidstate->ss.ps);
526 
527  /*
528  * initialize child expressions
529  */
530  tidstate->ss.ps.qual =
531  ExecInitQual(node->scan.plan.qual, (PlanState *) tidstate);
532 
533  TidExprListCreate(tidstate);
534 
535  /*
536  * tuple table initialization
537  */
538  ExecInitResultTupleSlot(estate, &tidstate->ss.ps);
539  ExecInitScanTupleSlot(estate, &tidstate->ss);
540 
541  /*
542  * mark tid list as not computed yet
543  */
544  tidstate->tss_TidList = NULL;
545  tidstate->tss_NumTids = 0;
546  tidstate->tss_TidPtr = -1;
547 
548  /*
549  * open the base relation and acquire appropriate lock on it.
550  */
551  currentRelation = ExecOpenScanRelation(estate, node->scan.scanrelid, eflags);
552 
553  tidstate->ss.ss_currentRelation = currentRelation;
554  tidstate->ss.ss_currentScanDesc = NULL; /* no heap scan here */
555 
556  /*
557  * get the scan type from the relation descriptor.
558  */
559  ExecAssignScanType(&tidstate->ss, RelationGetDescr(currentRelation));
560 
561  /*
562  * Initialize result tuple type and projection info.
563  */
564  ExecAssignResultTypeFromTL(&tidstate->ss.ps);
565  ExecAssignScanProjectionInfo(&tidstate->ss);
566 
567  /*
568  * all done.
569  */
570  return tidstate;
571 }
List * qual
Definition: plannodes.h:145
Plan plan
Definition: plannodes.h:328
void ExecInitScanTupleSlot(EState *estate, ScanState *scanstate)
Definition: execTuples.c:842
Index scanrelid
Definition: plannodes.h:329
#define RelationGetDescr(relation)
Definition: rel.h:428
Relation ss_currentRelation
Definition: execnodes.h:1076
EState * state
Definition: execnodes.h:834
ExprState * ExecInitQual(List *qual, PlanState *parent)
Definition: execExpr.c:160
void ExecAssignResultTypeFromTL(PlanState *planstate)
Definition: execUtils.c:440
PlanState ps
Definition: execnodes.h:1075
ScanState ss
Definition: execnodes.h:1352
void ExecAssignScanProjectionInfo(ScanState *node)
Definition: execScan.c:235
void ExecInitResultTupleSlot(EState *estate, PlanState *planstate)
Definition: execTuples.c:832
Relation ExecOpenScanRelation(EState *estate, Index scanrelid, int eflags)
Definition: execUtils.c:603
ItemPointerData * tss_TidList
Definition: execnodes.h:1357
static void TidExprListCreate(TidScanState *tidstate)
Definition: nodeTidscan.c:63
Plan * plan
Definition: execnodes.h:832
#define makeNode(_type_)
Definition: nodes.h:557
#define NULL
Definition: c.h:229
Scan scan
Definition: plannodes.h:475
void ExecAssignExprContext(EState *estate, PlanState *planstate)
Definition: execUtils.c:418
ExprState * qual
Definition: execnodes.h:846
HeapScanDesc ss_currentScanDesc
Definition: execnodes.h:1077
void ExecAssignScanType(ScanState *scanstate, TupleDesc tupDesc)
Definition: execUtils.c:540
void ExecReScanTidScan ( TidScanState node)

Definition at line 458 of file nodeTidscan.c.

References ExecScanReScan(), NULL, pfree(), TidScanState::ss, TidScanState::tss_NumTids, TidScanState::tss_TidList, and TidScanState::tss_TidPtr.

Referenced by ExecReScan().

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  ExecScanReScan(&node->ss);
467 }
void pfree(void *pointer)
Definition: mcxt.c:950
ScanState ss
Definition: execnodes.h:1352
ItemPointerData * tss_TidList
Definition: execnodes.h:1357
#define NULL
Definition: c.h:229
void ExecScanReScan(ScanState *node)
Definition: execScan.c:327
TupleTableSlot* ExecTidScan ( TidScanState node)

Definition at line 446 of file nodeTidscan.c.

References ExecScan(), TidScanState::ss, TidNext(), and TidRecheck().

Referenced by ExecProcNode().

447 {
448  return ExecScan(&node->ss,
451 }
static TupleTableSlot * TidNext(TidScanState *node)
Definition: nodeTidscan.c:302
TupleTableSlot * ExecScan(ScanState *node, ExecScanAccessMtd accessMtd, ExecScanRecheckMtd recheckMtd)
Definition: execScan.c:121
static bool TidRecheck(TidScanState *node, TupleTableSlot *slot)
Definition: nodeTidscan.c:416
TupleTableSlot *(* ExecScanAccessMtd)(ScanState *node)
Definition: executor.h:389
bool(* ExecScanRecheckMtd)(ScanState *node, TupleTableSlot *slot)
Definition: executor.h:390
ScanState ss
Definition: execnodes.h:1352