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

Go to the source code of this file.

Functions

BitmapHeapScanStateExecInitBitmapHeapScan (BitmapHeapScan *node, EState *estate, int eflags)
 
void ExecEndBitmapHeapScan (BitmapHeapScanState *node)
 
void ExecReScanBitmapHeapScan (BitmapHeapScanState *node)
 
void ExecBitmapHeapEstimate (BitmapHeapScanState *node, ParallelContext *pcxt)
 
void ExecBitmapHeapInitializeDSM (BitmapHeapScanState *node, ParallelContext *pcxt)
 
void ExecBitmapHeapReInitializeDSM (BitmapHeapScanState *node, ParallelContext *pcxt)
 
void ExecBitmapHeapInitializeWorker (BitmapHeapScanState *node, ParallelWorkerContext *pwcxt)
 

Function Documentation

◆ ExecBitmapHeapEstimate()

void ExecBitmapHeapEstimate ( BitmapHeapScanState node,
ParallelContext pcxt 
)

Definition at line 1020 of file nodeBitmapHeapscan.c.

References add_size(), EState::es_snapshot, EstimateSnapshotSpace(), ParallelContext::estimator, offsetof, ScanState::ps, BitmapHeapScanState::pscan_len, shm_toc_estimate_chunk, shm_toc_estimate_keys, BitmapHeapScanState::ss, and PlanState::state.

Referenced by ExecParallelEstimate().

1022 {
1023  EState *estate = node->ss.ps.state;
1024 
1026  phs_snapshot_data),
1028 
1030  shm_toc_estimate_keys(&pcxt->estimator, 1);
1031 }
shm_toc_estimator estimator
Definition: parallel.h:41
Snapshot es_snapshot
Definition: execnodes.h:478
EState * state
Definition: execnodes.h:914
#define shm_toc_estimate_chunk(e, sz)
Definition: shm_toc.h:51
PlanState ps
Definition: execnodes.h:1192
Size EstimateSnapshotSpace(Snapshot snap)
Definition: snapmgr.c:2044
Size add_size(Size s1, Size s2)
Definition: shmem.c:475
#define shm_toc_estimate_keys(e, cnt)
Definition: shm_toc.h:53
#define offsetof(type, field)
Definition: c.h:622

◆ ExecBitmapHeapInitializeDSM()

void ExecBitmapHeapInitializeDSM ( BitmapHeapScanState node,
ParallelContext pcxt 
)

Definition at line 1040 of file nodeBitmapHeapscan.c.

References BM_INITIAL, ConditionVariableInit(), ParallelBitmapHeapState::cv, EState::es_query_dsa, EState::es_snapshot, ParallelBitmapHeapState::mutex, ParallelBitmapHeapState::phs_snapshot_data, PlanState::plan, Plan::plan_node_id, ParallelBitmapHeapState::prefetch_iterator, ParallelBitmapHeapState::prefetch_pages, ParallelBitmapHeapState::prefetch_target, ScanState::ps, BitmapHeapScanState::pscan_len, BitmapHeapScanState::pstate, SerializeSnapshot(), shm_toc_allocate(), shm_toc_insert(), SpinLockInit, BitmapHeapScanState::ss, PlanState::state, ParallelBitmapHeapState::state, ParallelBitmapHeapState::tbmiterator, and ParallelContext::toc.

Referenced by ExecParallelInitializeDSM().

1042 {
1043  ParallelBitmapHeapState *pstate;
1044  EState *estate = node->ss.ps.state;
1045  dsa_area *dsa = node->ss.ps.state->es_query_dsa;
1046 
1047  /* If there's no DSA, there are no workers; initialize nothing. */
1048  if (dsa == NULL)
1049  return;
1050 
1051  pstate = shm_toc_allocate(pcxt->toc, node->pscan_len);
1052 
1053  pstate->tbmiterator = 0;
1054  pstate->prefetch_iterator = 0;
1055 
1056  /* Initialize the mutex */
1057  SpinLockInit(&pstate->mutex);
1058  pstate->prefetch_pages = 0;
1059  pstate->prefetch_target = 0;
1060  pstate->state = BM_INITIAL;
1061 
1062  ConditionVariableInit(&pstate->cv);
1064 
1065  shm_toc_insert(pcxt->toc, node->ss.ps.plan->plan_node_id, pstate);
1066  node->pstate = pstate;
1067 }
struct dsa_area * es_query_dsa
Definition: execnodes.h:565
#define SpinLockInit(lock)
Definition: spin.h:60
int plan_node_id
Definition: plannodes.h:145
Snapshot es_snapshot
Definition: execnodes.h:478
EState * state
Definition: execnodes.h:914
PlanState ps
Definition: execnodes.h:1192
void ConditionVariableInit(ConditionVariable *cv)
ParallelBitmapHeapState * pstate
Definition: execnodes.h:1459
void SerializeSnapshot(Snapshot snapshot, char *start_address)
Definition: snapmgr.c:2068
dsa_pointer tbmiterator
Definition: execnodes.h:1404
Plan * plan
Definition: execnodes.h:912
dsa_pointer prefetch_iterator
Definition: execnodes.h:1405
SharedBitmapState state
Definition: execnodes.h:1409
void * shm_toc_allocate(shm_toc *toc, Size nbytes)
Definition: shm_toc.c:88
char phs_snapshot_data[FLEXIBLE_ARRAY_MEMBER]
Definition: execnodes.h:1411
Definition: dsa.c:354
void shm_toc_insert(shm_toc *toc, uint64 key, void *address)
Definition: shm_toc.c:171
ConditionVariable cv
Definition: execnodes.h:1410
shm_toc * toc
Definition: parallel.h:44

◆ ExecBitmapHeapInitializeWorker()

void ExecBitmapHeapInitializeWorker ( BitmapHeapScanState node,
ParallelWorkerContext pwcxt 
)

Definition at line 1105 of file nodeBitmapHeapscan.c.

References Assert, EState::es_query_dsa, heap_update_snapshot(), ParallelBitmapHeapState::phs_snapshot_data, PlanState::plan, Plan::plan_node_id, ScanState::ps, BitmapHeapScanState::pstate, RestoreSnapshot(), shm_toc_lookup(), BitmapHeapScanState::ss, ScanState::ss_currentScanDesc, PlanState::state, and ParallelWorkerContext::toc.

Referenced by ExecParallelInitializeWorker().

1107 {
1108  ParallelBitmapHeapState *pstate;
1109  Snapshot snapshot;
1110 
1111  Assert(node->ss.ps.state->es_query_dsa != NULL);
1112 
1113  pstate = shm_toc_lookup(pwcxt->toc, node->ss.ps.plan->plan_node_id, false);
1114  node->pstate = pstate;
1115 
1116  snapshot = RestoreSnapshot(pstate->phs_snapshot_data);
1117  heap_update_snapshot(node->ss.ss_currentScanDesc, snapshot);
1118 }
struct dsa_area * es_query_dsa
Definition: execnodes.h:565
Snapshot RestoreSnapshot(char *start_address)
Definition: snapmgr.c:2127
void heap_update_snapshot(HeapScanDesc scan, Snapshot snapshot)
Definition: heapam.c:1801
int plan_node_id
Definition: plannodes.h:145
EState * state
Definition: execnodes.h:914
PlanState ps
Definition: execnodes.h:1192
ParallelBitmapHeapState * pstate
Definition: execnodes.h:1459
Plan * plan
Definition: execnodes.h:912
#define Assert(condition)
Definition: c.h:699
char phs_snapshot_data[FLEXIBLE_ARRAY_MEMBER]
Definition: execnodes.h:1411
HeapScanDesc ss_currentScanDesc
Definition: execnodes.h:1194
void * shm_toc_lookup(shm_toc *toc, uint64 key, bool noError)
Definition: shm_toc.c:232

◆ ExecBitmapHeapReInitializeDSM()

void ExecBitmapHeapReInitializeDSM ( BitmapHeapScanState node,
ParallelContext pcxt 
)

Definition at line 1076 of file nodeBitmapHeapscan.c.

References BM_INITIAL, DsaPointerIsValid, EState::es_query_dsa, InvalidDsaPointer, ParallelBitmapHeapState::prefetch_iterator, ScanState::ps, BitmapHeapScanState::pstate, BitmapHeapScanState::ss, PlanState::state, ParallelBitmapHeapState::state, tbm_free_shared_area(), and ParallelBitmapHeapState::tbmiterator.

Referenced by ExecParallelReInitializeDSM().

1078 {
1079  ParallelBitmapHeapState *pstate = node->pstate;
1080  dsa_area *dsa = node->ss.ps.state->es_query_dsa;
1081 
1082  /* If there's no DSA, there are no workers; do nothing. */
1083  if (dsa == NULL)
1084  return;
1085 
1086  pstate->state = BM_INITIAL;
1087 
1088  if (DsaPointerIsValid(pstate->tbmiterator))
1089  tbm_free_shared_area(dsa, pstate->tbmiterator);
1090 
1091  if (DsaPointerIsValid(pstate->prefetch_iterator))
1093 
1094  pstate->tbmiterator = InvalidDsaPointer;
1096 }
struct dsa_area * es_query_dsa
Definition: execnodes.h:565
#define InvalidDsaPointer
Definition: dsa.h:78
EState * state
Definition: execnodes.h:914
PlanState ps
Definition: execnodes.h:1192
ParallelBitmapHeapState * pstate
Definition: execnodes.h:1459
dsa_pointer tbmiterator
Definition: execnodes.h:1404
void tbm_free_shared_area(dsa_area *dsa, dsa_pointer dp)
Definition: tidbitmap.c:340
dsa_pointer prefetch_iterator
Definition: execnodes.h:1405
SharedBitmapState state
Definition: execnodes.h:1409
#define DsaPointerIsValid(x)
Definition: dsa.h:81
Definition: dsa.c:354

◆ ExecEndBitmapHeapScan()

void ExecEndBitmapHeapScan ( BitmapHeapScanState node)

Definition at line 787 of file nodeBitmapHeapscan.c.

References ExecClearTuple(), ExecCloseScanRelation(), ExecEndNode(), ExecFreeExprContext(), heap_endscan(), InvalidBuffer, outerPlanState, BitmapHeapScanState::prefetch_iterator, ScanState::ps, PlanState::ps_ResultTupleSlot, BitmapHeapScanState::pvmbuffer, ReleaseBuffer(), BitmapHeapScanState::shared_prefetch_iterator, BitmapHeapScanState::shared_tbmiterator, BitmapHeapScanState::ss, ScanState::ss_currentRelation, ScanState::ss_currentScanDesc, ScanState::ss_ScanTupleSlot, BitmapHeapScanState::tbm, tbm_end_iterate(), tbm_end_shared_iterate(), tbm_free(), BitmapHeapScanState::tbmiterator, and BitmapHeapScanState::vmbuffer.

Referenced by ExecEndNode().

788 {
789  Relation relation;
790  HeapScanDesc scanDesc;
791 
792  /*
793  * extract information from the node
794  */
795  relation = node->ss.ss_currentRelation;
796  scanDesc = node->ss.ss_currentScanDesc;
797 
798  /*
799  * Free the exprcontext
800  */
801  ExecFreeExprContext(&node->ss.ps);
802 
803  /*
804  * clear out tuple table slots
805  */
808 
809  /*
810  * close down subplans
811  */
813 
814  /*
815  * release bitmaps and buffers if any
816  */
817  if (node->tbmiterator)
819  if (node->prefetch_iterator)
821  if (node->tbm)
822  tbm_free(node->tbm);
823  if (node->shared_tbmiterator)
825  if (node->shared_prefetch_iterator)
827  if (node->vmbuffer != InvalidBuffer)
828  ReleaseBuffer(node->vmbuffer);
829  if (node->pvmbuffer != InvalidBuffer)
830  ReleaseBuffer(node->pvmbuffer);
831 
832  /*
833  * close heap scan
834  */
835  heap_endscan(scanDesc);
836 
837  /*
838  * close the heap relation.
839  */
840  ExecCloseScanRelation(relation);
841 }
void tbm_end_iterate(TBMIterator *iterator)
Definition: tidbitmap.c:1145
void heap_endscan(HeapScanDesc scan)
Definition: heapam.c:1572
void ExecEndNode(PlanState *node)
Definition: execProcnode.c:538
TIDBitmap * tbm
Definition: execnodes.h:1442
TupleTableSlot * ExecClearTuple(TupleTableSlot *slot)
Definition: execTuples.c:475
#define InvalidBuffer
Definition: buf.h:25
TupleTableSlot * ss_ScanTupleSlot
Definition: execnodes.h:1195
void ReleaseBuffer(Buffer buffer)
Definition: bufmgr.c:3309
Relation ss_currentRelation
Definition: execnodes.h:1193
void ExecFreeExprContext(PlanState *planstate)
Definition: execUtils.c:566
PlanState ps
Definition: execnodes.h:1192
TupleTableSlot * ps_ResultTupleSlot
Definition: execnodes.h:946
#define outerPlanState(node)
Definition: execnodes.h:966
void tbm_free(TIDBitmap *tbm)
Definition: tidbitmap.c:321
void ExecCloseScanRelation(Relation scanrel)
Definition: execUtils.c:701
TBMSharedIterator * shared_tbmiterator
Definition: execnodes.h:1457
TBMIterator * tbmiterator
Definition: execnodes.h:1443
HeapScanDesc ss_currentScanDesc
Definition: execnodes.h:1194
TBMIterator * prefetch_iterator
Definition: execnodes.h:1451
TBMSharedIterator * shared_prefetch_iterator
Definition: execnodes.h:1458
void tbm_end_shared_iterate(TBMSharedIterator *iterator)
Definition: tidbitmap.c:1157

◆ ExecInitBitmapHeapScan()

BitmapHeapScanState* ExecInitBitmapHeapScan ( BitmapHeapScan node,
EState estate,
int  eflags 
)

Definition at line 850 of file nodeBitmapHeapscan.c.

References Assert, BitmapHeapScan::bitmapqualorig, BitmapHeapScanState::can_skip_fetch, ComputeIoConcurrency(), effective_io_concurrency, EState::es_snapshot, BitmapHeapScanState::exact_pages, EXEC_FLAG_BACKWARD, EXEC_FLAG_MARK, ExecAssignExprContext(), ExecAssignScanProjectionInfo(), ExecBitmapHeapScan(), ExecInitNode(), ExecInitQual(), ExecInitResultTupleSlotTL(), ExecInitScanTupleSlot(), ExecOpenScanRelation(), PlanState::ExecProcNode, get_tablespace_io_concurrency(), heap_beginscan_bm(), BitmapHeapScanState::initialized, InvalidBuffer, IsMVCCSnapshot, BitmapHeapScanState::lossy_pages, makeNode, NIL, outerPlan, outerPlanState, Scan::plan, PlanState::plan, BitmapHeapScanState::prefetch_iterator, BitmapHeapScanState::prefetch_maximum, BitmapHeapScanState::prefetch_pages, BitmapHeapScanState::prefetch_target, ScanState::ps, BitmapHeapScanState::pscan_len, BitmapHeapScanState::pstate, BitmapHeapScanState::pvmbuffer, Plan::qual, PlanState::qual, RelationData::rd_rel, RelationGetDescr, rint(), BitmapHeapScan::scan, Scan::scanrelid, BitmapHeapScanState::shared_prefetch_iterator, BitmapHeapScanState::shared_tbmiterator, BitmapHeapScanState::skip_fetch, BitmapHeapScanState::ss, PlanState::state, target_prefetch_pages, Plan::targetlist, BitmapHeapScanState::tbm, BitmapHeapScanState::tbmiterator, BitmapHeapScanState::tbmres, and BitmapHeapScanState::vmbuffer.

Referenced by ExecInitNode().

851 {
852  BitmapHeapScanState *scanstate;
853  Relation currentRelation;
854  int io_concurrency;
855 
856  /* check for unsupported flags */
857  Assert(!(eflags & (EXEC_FLAG_BACKWARD | EXEC_FLAG_MARK)));
858 
859  /*
860  * Assert caller didn't ask for an unsafe snapshot --- see comments at
861  * head of file.
862  */
864 
865  /*
866  * create state structure
867  */
868  scanstate = makeNode(BitmapHeapScanState);
869  scanstate->ss.ps.plan = (Plan *) node;
870  scanstate->ss.ps.state = estate;
871  scanstate->ss.ps.ExecProcNode = ExecBitmapHeapScan;
872 
873  scanstate->tbm = NULL;
874  scanstate->tbmiterator = NULL;
875  scanstate->tbmres = NULL;
876  scanstate->skip_fetch = false;
877  scanstate->vmbuffer = InvalidBuffer;
878  scanstate->pvmbuffer = InvalidBuffer;
879  scanstate->exact_pages = 0;
880  scanstate->lossy_pages = 0;
881  scanstate->prefetch_iterator = NULL;
882  scanstate->prefetch_pages = 0;
883  scanstate->prefetch_target = 0;
884  /* may be updated below */
886  scanstate->pscan_len = 0;
887  scanstate->initialized = false;
888  scanstate->shared_tbmiterator = NULL;
889  scanstate->shared_prefetch_iterator = NULL;
890  scanstate->pstate = NULL;
891 
892  /*
893  * We can potentially skip fetching heap pages if we do not need any
894  * columns of the table, either for checking non-indexable quals or for
895  * returning data. This test is a bit simplistic, as it checks the
896  * stronger condition that there's no qual or return tlist at all. But in
897  * most cases it's probably not worth working harder than that.
898  */
899  scanstate->can_skip_fetch = (node->scan.plan.qual == NIL &&
900  node->scan.plan.targetlist == NIL);
901 
902  /*
903  * Miscellaneous initialization
904  *
905  * create expression context for node
906  */
907  ExecAssignExprContext(estate, &scanstate->ss.ps);
908 
909  /*
910  * open the base relation and acquire appropriate lock on it.
911  */
912  currentRelation = ExecOpenScanRelation(estate, node->scan.scanrelid, eflags);
913 
914  /*
915  * initialize child nodes
916  *
917  * We do this after ExecOpenScanRelation because the child nodes will open
918  * indexscans on our relation's indexes, and we want to be sure we have
919  * acquired a lock on the relation first.
920  */
921  outerPlanState(scanstate) = ExecInitNode(outerPlan(node), estate, eflags);
922 
923  /*
924  * get the scan type from the relation descriptor.
925  */
926  ExecInitScanTupleSlot(estate, &scanstate->ss,
927  RelationGetDescr(currentRelation));
928 
929 
930  /*
931  * Initialize result slot, type and projection.
932  */
933  ExecInitResultTupleSlotTL(estate, &scanstate->ss.ps);
934  ExecAssignScanProjectionInfo(&scanstate->ss);
935 
936  /*
937  * initialize child expressions
938  */
939  scanstate->ss.ps.qual =
940  ExecInitQual(node->scan.plan.qual, (PlanState *) scanstate);
941  scanstate->bitmapqualorig =
942  ExecInitQual(node->bitmapqualorig, (PlanState *) scanstate);
943 
944  /*
945  * Determine the maximum for prefetch_target. If the tablespace has a
946  * specific IO concurrency set, use that to compute the corresponding
947  * maximum value; otherwise, we already initialized to the value computed
948  * by the GUC machinery.
949  */
950  io_concurrency =
951  get_tablespace_io_concurrency(currentRelation->rd_rel->reltablespace);
952  if (io_concurrency != effective_io_concurrency)
953  {
954  double maximum;
955 
956  if (ComputeIoConcurrency(io_concurrency, &maximum))
957  scanstate->prefetch_maximum = rint(maximum);
958  }
959 
960  scanstate->ss.ss_currentRelation = currentRelation;
961 
962  /*
963  * Even though we aren't going to do a conventional seqscan, it is useful
964  * to create a HeapScanDesc --- most of the fields in it are usable.
965  */
966  scanstate->ss.ss_currentScanDesc = heap_beginscan_bm(currentRelation,
967  estate->es_snapshot,
968  0,
969  NULL);
970 
971  /*
972  * all done.
973  */
974  return scanstate;
975 }
#define NIL
Definition: pg_list.h:69
List * qual
Definition: plannodes.h:147
int target_prefetch_pages
Definition: bufmgr.c:129
Plan plan
Definition: plannodes.h:342
ExprState * bitmapqualorig
Definition: execnodes.h:1441
Index scanrelid
Definition: plannodes.h:343
#define RelationGetDescr(relation)
Definition: rel.h:433
TIDBitmap * tbm
Definition: execnodes.h:1442
#define InvalidBuffer
Definition: buf.h:25
int get_tablespace_io_concurrency(Oid spcid)
Definition: spccache.c:215
Snapshot es_snapshot
Definition: execnodes.h:478
Relation ss_currentRelation
Definition: execnodes.h:1193
EState * state
Definition: execnodes.h:914
Form_pg_class rd_rel
Definition: rel.h:84
int effective_io_concurrency
Definition: bufmgr.c:112
ExprState * ExecInitQual(List *qual, PlanState *parent)
Definition: execExpr.c:205
bool ComputeIoConcurrency(int io_concurrency, double *target)
Definition: bufmgr.c:467
PlanState ps
Definition: execnodes.h:1192
static TupleTableSlot * ExecBitmapHeapScan(PlanState *pstate)
void ExecAssignScanProjectionInfo(ScanState *node)
Definition: execScan.c:235
ParallelBitmapHeapState * pstate
Definition: execnodes.h:1459
Relation ExecOpenScanRelation(EState *estate, Index scanrelid, int eflags)
Definition: execUtils.c:643
#define EXEC_FLAG_BACKWARD
Definition: executor.h:60
#define outerPlanState(node)
Definition: execnodes.h:966
double rint(double x)
Definition: rint.c:22
List * bitmapqualorig
Definition: plannodes.h:477
TBMIterateResult * tbmres
Definition: execnodes.h:1444
#define outerPlan(node)
Definition: plannodes.h:176
HeapScanDesc heap_beginscan_bm(Relation relation, Snapshot snapshot, int nkeys, ScanKey key)
Definition: heapam.c:1432
ExecProcNodeMtd ExecProcNode
Definition: execnodes.h:918
void ExecInitResultTupleSlotTL(EState *estate, PlanState *planstate)
Definition: execTuples.c:890
Plan * plan
Definition: execnodes.h:912
#define makeNode(_type_)
Definition: nodes.h:565
#define Assert(condition)
Definition: c.h:699
#define IsMVCCSnapshot(snapshot)
Definition: tqual.h:31
#define EXEC_FLAG_MARK
Definition: executor.h:61
void ExecAssignExprContext(EState *estate, PlanState *planstate)
Definition: execUtils.c:428
TBMSharedIterator * shared_tbmiterator
Definition: execnodes.h:1457
TBMIterator * tbmiterator
Definition: execnodes.h:1443
List * targetlist
Definition: plannodes.h:146
ExprState * qual
Definition: execnodes.h:930
HeapScanDesc ss_currentScanDesc
Definition: execnodes.h:1194
TBMIterator * prefetch_iterator
Definition: execnodes.h:1451
void ExecInitScanTupleSlot(EState *estate, ScanState *scanstate, TupleDesc tupledesc)
Definition: execTuples.c:915
PlanState * ExecInitNode(Plan *node, EState *estate, int eflags)
Definition: execProcnode.c:139
TBMSharedIterator * shared_prefetch_iterator
Definition: execnodes.h:1458

◆ ExecReScanBitmapHeapScan()

void ExecReScanBitmapHeapScan ( BitmapHeapScanState node)

Definition at line 740 of file nodeBitmapHeapscan.c.

References PlanState::chgParam, ExecReScan(), ExecScanReScan(), heap_rescan(), BitmapHeapScanState::initialized, InvalidBuffer, outerPlan, outerPlanState, BitmapHeapScanState::prefetch_iterator, BitmapHeapScanState::pvmbuffer, ReleaseBuffer(), BitmapHeapScanState::shared_prefetch_iterator, BitmapHeapScanState::shared_tbmiterator, BitmapHeapScanState::ss, ScanState::ss_currentScanDesc, BitmapHeapScanState::tbm, tbm_end_iterate(), tbm_end_shared_iterate(), tbm_free(), BitmapHeapScanState::tbmiterator, BitmapHeapScanState::tbmres, and BitmapHeapScanState::vmbuffer.

Referenced by ExecReScan().

741 {
743 
744  /* rescan to release any page pin */
745  heap_rescan(node->ss.ss_currentScanDesc, NULL);
746 
747  /* release bitmaps and buffers if any */
748  if (node->tbmiterator)
750  if (node->prefetch_iterator)
752  if (node->shared_tbmiterator)
754  if (node->shared_prefetch_iterator)
756  if (node->tbm)
757  tbm_free(node->tbm);
758  if (node->vmbuffer != InvalidBuffer)
759  ReleaseBuffer(node->vmbuffer);
760  if (node->pvmbuffer != InvalidBuffer)
761  ReleaseBuffer(node->pvmbuffer);
762  node->tbm = NULL;
763  node->tbmiterator = NULL;
764  node->tbmres = NULL;
765  node->prefetch_iterator = NULL;
766  node->initialized = false;
767  node->shared_tbmiterator = NULL;
768  node->shared_prefetch_iterator = NULL;
769  node->vmbuffer = InvalidBuffer;
770  node->pvmbuffer = InvalidBuffer;
771 
772  ExecScanReScan(&node->ss);
773 
774  /*
775  * if chgParam of subnode is not null then plan will be re-scanned by
776  * first ExecProcNode.
777  */
778  if (outerPlan->chgParam == NULL)
779  ExecReScan(outerPlan);
780 }
void tbm_end_iterate(TBMIterator *iterator)
Definition: tidbitmap.c:1145
TIDBitmap * tbm
Definition: execnodes.h:1442
void ExecReScan(PlanState *node)
Definition: execAmi.c:76
#define InvalidBuffer
Definition: buf.h:25
void ReleaseBuffer(Buffer buffer)
Definition: bufmgr.c:3309
#define outerPlanState(node)
Definition: execnodes.h:966
void tbm_free(TIDBitmap *tbm)
Definition: tidbitmap.c:321
void heap_rescan(HeapScanDesc scan, ScanKey key)
Definition: heapam.c:1528
TBMIterateResult * tbmres
Definition: execnodes.h:1444
Bitmapset * chgParam
Definition: execnodes.h:941
#define outerPlan(node)
Definition: plannodes.h:176
TBMSharedIterator * shared_tbmiterator
Definition: execnodes.h:1457
TBMIterator * tbmiterator
Definition: execnodes.h:1443
HeapScanDesc ss_currentScanDesc
Definition: execnodes.h:1194
TBMIterator * prefetch_iterator
Definition: execnodes.h:1451
void ExecScanReScan(ScanState *node)
Definition: execScan.c:262
TBMSharedIterator * shared_prefetch_iterator
Definition: execnodes.h:1458
void tbm_end_shared_iterate(TBMSharedIterator *iterator)
Definition: tidbitmap.c:1157