PostgreSQL Source Code  git master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
nodeIndexonlyscan.h File Reference
#include "nodes/execnodes.h"
#include "access/parallel.h"
Include dependency graph for nodeIndexonlyscan.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

IndexOnlyScanStateExecInitIndexOnlyScan (IndexOnlyScan *node, EState *estate, int eflags)
 
void ExecEndIndexOnlyScan (IndexOnlyScanState *node)
 
void ExecIndexOnlyMarkPos (IndexOnlyScanState *node)
 
void ExecIndexOnlyRestrPos (IndexOnlyScanState *node)
 
void ExecReScanIndexOnlyScan (IndexOnlyScanState *node)
 
void ExecIndexOnlyScanEstimate (IndexOnlyScanState *node, ParallelContext *pcxt)
 
void ExecIndexOnlyScanInitializeDSM (IndexOnlyScanState *node, ParallelContext *pcxt)
 
void ExecIndexOnlyScanReInitializeDSM (IndexOnlyScanState *node, ParallelContext *pcxt)
 
void ExecIndexOnlyScanInitializeWorker (IndexOnlyScanState *node, shm_toc *toc)
 

Function Documentation

void ExecEndIndexOnlyScan ( IndexOnlyScanState node)

Definition at line 373 of file nodeIndexonlyscan.c.

References ExecClearTuple(), ExecCloseScanRelation(), ExecFreeExprContext(), FreeExprContext(), index_close(), index_endscan(), InvalidBuffer, IndexOnlyScanState::ioss_RelationDesc, IndexOnlyScanState::ioss_RuntimeContext, IndexOnlyScanState::ioss_ScanDesc, IndexOnlyScanState::ioss_VMBuffer, NoLock, ScanState::ps, PlanState::ps_ResultTupleSlot, ReleaseBuffer(), IndexOnlyScanState::ss, ScanState::ss_currentRelation, and ScanState::ss_ScanTupleSlot.

Referenced by ExecEndNode().

374 {
375  Relation indexRelationDesc;
376  IndexScanDesc indexScanDesc;
377  Relation relation;
378 
379  /*
380  * extract information from the node
381  */
382  indexRelationDesc = node->ioss_RelationDesc;
383  indexScanDesc = node->ioss_ScanDesc;
384  relation = node->ss.ss_currentRelation;
385 
386  /* Release VM buffer pin, if any. */
387  if (node->ioss_VMBuffer != InvalidBuffer)
388  {
391  }
392 
393  /*
394  * Free the exprcontext(s) ... now dead code, see ExecFreeExprContext
395  */
396 #ifdef NOT_USED
397  ExecFreeExprContext(&node->ss.ps);
398  if (node->ioss_RuntimeContext)
400 #endif
401 
402  /*
403  * clear out tuple table slots
404  */
407 
408  /*
409  * close the index relation (no-op if we didn't open it)
410  */
411  if (indexScanDesc)
412  index_endscan(indexScanDesc);
413  if (indexRelationDesc)
414  index_close(indexRelationDesc, NoLock);
415 
416  /*
417  * close the heap relation.
418  */
419  ExecCloseScanRelation(relation);
420 }
TupleTableSlot * ExecClearTuple(TupleTableSlot *slot)
Definition: execTuples.c:439
#define InvalidBuffer
Definition: buf.h:25
TupleTableSlot * ss_ScanTupleSlot
Definition: execnodes.h:1104
void ReleaseBuffer(Buffer buffer)
Definition: bufmgr.c:3309
Relation ss_currentRelation
Definition: execnodes.h:1102
void ExecFreeExprContext(PlanState *planstate)
Definition: execUtils.c:521
PlanState ps
Definition: execnodes.h:1101
TupleTableSlot * ps_ResultTupleSlot
Definition: execnodes.h:880
ExprContext * ioss_RuntimeContext
Definition: execnodes.h:1240
#define NoLock
Definition: lockdefs.h:34
IndexScanDesc ioss_ScanDesc
Definition: execnodes.h:1242
void index_endscan(IndexScanDesc scan)
Definition: indexam.c:340
void FreeExprContext(ExprContext *econtext, bool isCommit)
Definition: execUtils.c:354
Relation ioss_RelationDesc
Definition: execnodes.h:1241
void ExecCloseScanRelation(Relation scanrel)
Definition: execUtils.c:666
void index_close(Relation relation, LOCKMODE lockmode)
Definition: indexam.c:176
void ExecIndexOnlyMarkPos ( IndexOnlyScanState node)

Definition at line 427 of file nodeIndexonlyscan.c.

References index_markpos(), and IndexOnlyScanState::ioss_ScanDesc.

Referenced by ExecMarkPos().

428 {
430 }
void index_markpos(IndexScanDesc scan)
Definition: indexam.c:370
IndexScanDesc ioss_ScanDesc
Definition: execnodes.h:1242
void ExecIndexOnlyRestrPos ( IndexOnlyScanState node)

Definition at line 437 of file nodeIndexonlyscan.c.

References index_restrpos(), and IndexOnlyScanState::ioss_ScanDesc.

Referenced by ExecRestrPos().

438 {
440 }
void index_restrpos(IndexScanDesc scan)
Definition: indexam.c:395
IndexScanDesc ioss_ScanDesc
Definition: execnodes.h:1242
void ExecIndexOnlyScanEstimate ( IndexOnlyScanState node,
ParallelContext pcxt 
)

Definition at line 611 of file nodeIndexonlyscan.c.

References EState::es_snapshot, ParallelContext::estimator, index_parallelscan_estimate(), IndexOnlyScanState::ioss_PscanLen, IndexOnlyScanState::ioss_RelationDesc, ScanState::ps, shm_toc_estimate_chunk, shm_toc_estimate_keys, IndexOnlyScanState::ss, and PlanState::state.

Referenced by ExecParallelEstimate().

613 {
614  EState *estate = node->ss.ps.state;
615 
617  estate->es_snapshot);
619  shm_toc_estimate_keys(&pcxt->estimator, 1);
620 }
shm_toc_estimator estimator
Definition: parallel.h:41
Snapshot es_snapshot
Definition: execnodes.h:429
EState * state
Definition: execnodes.h:849
#define shm_toc_estimate_chunk(e, sz)
Definition: shm_toc.h:51
Size index_parallelscan_estimate(Relation indexRelation, Snapshot snapshot)
Definition: indexam.c:417
PlanState ps
Definition: execnodes.h:1101
Relation ioss_RelationDesc
Definition: execnodes.h:1241
#define shm_toc_estimate_keys(e, cnt)
Definition: shm_toc.h:53
void ExecIndexOnlyScanInitializeDSM ( IndexOnlyScanState node,
ParallelContext pcxt 
)

Definition at line 629 of file nodeIndexonlyscan.c.

References EState::es_snapshot, index_beginscan_parallel(), index_parallelscan_initialize(), index_rescan(), InvalidBuffer, IndexOnlyScanState::ioss_NumOrderByKeys, IndexOnlyScanState::ioss_NumRuntimeKeys, IndexOnlyScanState::ioss_NumScanKeys, IndexOnlyScanState::ioss_OrderByKeys, IndexOnlyScanState::ioss_PscanLen, IndexOnlyScanState::ioss_RelationDesc, IndexOnlyScanState::ioss_RuntimeKeysReady, IndexOnlyScanState::ioss_ScanDesc, IndexOnlyScanState::ioss_ScanKeys, IndexOnlyScanState::ioss_VMBuffer, PlanState::plan, Plan::plan_node_id, ScanState::ps, shm_toc_allocate(), shm_toc_insert(), IndexOnlyScanState::ss, ScanState::ss_currentRelation, PlanState::state, ParallelContext::toc, and IndexScanDescData::xs_want_itup.

Referenced by ExecParallelInitializeDSM().

631 {
632  EState *estate = node->ss.ps.state;
633  ParallelIndexScanDesc piscan;
634 
635  piscan = shm_toc_allocate(pcxt->toc, node->ioss_PscanLen);
637  node->ioss_RelationDesc,
638  estate->es_snapshot,
639  piscan);
640  shm_toc_insert(pcxt->toc, node->ss.ps.plan->plan_node_id, piscan);
641  node->ioss_ScanDesc =
643  node->ioss_RelationDesc,
644  node->ioss_NumScanKeys,
645  node->ioss_NumOrderByKeys,
646  piscan);
647  node->ioss_ScanDesc->xs_want_itup = true;
649 
650  /*
651  * If no run-time keys to calculate or they are ready, go ahead and pass
652  * the scankeys to the index AM.
653  */
654  if (node->ioss_NumRuntimeKeys == 0 || node->ioss_RuntimeKeysReady)
656  node->ioss_ScanKeys, node->ioss_NumScanKeys,
658 }
bool ioss_RuntimeKeysReady
Definition: execnodes.h:1239
IndexScanDesc index_beginscan_parallel(Relation heaprel, Relation indexrel, int nkeys, int norderbys, ParallelIndexScanDesc pscan)
Definition: indexam.c:496
int plan_node_id
Definition: plannodes.h:143
#define InvalidBuffer
Definition: buf.h:25
void index_rescan(IndexScanDesc scan, ScanKey keys, int nkeys, ScanKey orderbys, int norderbys)
Definition: indexam.c:310
Snapshot es_snapshot
Definition: execnodes.h:429
Relation ss_currentRelation
Definition: execnodes.h:1102
EState * state
Definition: execnodes.h:849
PlanState ps
Definition: execnodes.h:1101
ScanKey ioss_ScanKeys
Definition: execnodes.h:1233
IndexScanDesc ioss_ScanDesc
Definition: execnodes.h:1242
ScanKey ioss_OrderByKeys
Definition: execnodes.h:1235
Plan * plan
Definition: execnodes.h:847
Relation ioss_RelationDesc
Definition: execnodes.h:1241
bool xs_want_itup
Definition: relscan.h:96
void * shm_toc_allocate(shm_toc *toc, Size nbytes)
Definition: shm_toc.c:88
void shm_toc_insert(shm_toc *toc, uint64 key, void *address)
Definition: shm_toc.c:171
void index_parallelscan_initialize(Relation heapRelation, Relation indexRelation, Snapshot snapshot, ParallelIndexScanDesc target)
Definition: indexam.c:450
shm_toc * toc
Definition: parallel.h:44
void ExecIndexOnlyScanInitializeWorker ( IndexOnlyScanState node,
shm_toc toc 
)

Definition at line 680 of file nodeIndexonlyscan.c.

References index_beginscan_parallel(), index_rescan(), IndexOnlyScanState::ioss_NumOrderByKeys, IndexOnlyScanState::ioss_NumRuntimeKeys, IndexOnlyScanState::ioss_NumScanKeys, IndexOnlyScanState::ioss_OrderByKeys, IndexOnlyScanState::ioss_RelationDesc, IndexOnlyScanState::ioss_RuntimeKeysReady, IndexOnlyScanState::ioss_ScanDesc, IndexOnlyScanState::ioss_ScanKeys, PlanState::plan, Plan::plan_node_id, ScanState::ps, shm_toc_lookup(), IndexOnlyScanState::ss, ScanState::ss_currentRelation, and IndexScanDescData::xs_want_itup.

Referenced by ExecParallelInitializeWorker().

681 {
682  ParallelIndexScanDesc piscan;
683 
684  piscan = shm_toc_lookup(toc, node->ss.ps.plan->plan_node_id, false);
685  node->ioss_ScanDesc =
687  node->ioss_RelationDesc,
688  node->ioss_NumScanKeys,
689  node->ioss_NumOrderByKeys,
690  piscan);
691  node->ioss_ScanDesc->xs_want_itup = true;
692 
693  /*
694  * If no run-time keys to calculate or they are ready, go ahead and pass
695  * the scankeys to the index AM.
696  */
697  if (node->ioss_NumRuntimeKeys == 0 || node->ioss_RuntimeKeysReady)
699  node->ioss_ScanKeys, node->ioss_NumScanKeys,
701 }
bool ioss_RuntimeKeysReady
Definition: execnodes.h:1239
IndexScanDesc index_beginscan_parallel(Relation heaprel, Relation indexrel, int nkeys, int norderbys, ParallelIndexScanDesc pscan)
Definition: indexam.c:496
int plan_node_id
Definition: plannodes.h:143
void index_rescan(IndexScanDesc scan, ScanKey keys, int nkeys, ScanKey orderbys, int norderbys)
Definition: indexam.c:310
Relation ss_currentRelation
Definition: execnodes.h:1102
PlanState ps
Definition: execnodes.h:1101
ScanKey ioss_ScanKeys
Definition: execnodes.h:1233
IndexScanDesc ioss_ScanDesc
Definition: execnodes.h:1242
ScanKey ioss_OrderByKeys
Definition: execnodes.h:1235
Plan * plan
Definition: execnodes.h:847
Relation ioss_RelationDesc
Definition: execnodes.h:1241
bool xs_want_itup
Definition: relscan.h:96
void * shm_toc_lookup(shm_toc *toc, uint64 key, bool noError)
Definition: shm_toc.c:232
void ExecIndexOnlyScanReInitializeDSM ( IndexOnlyScanState node,
ParallelContext pcxt 
)

Definition at line 667 of file nodeIndexonlyscan.c.

References index_parallelrescan(), and IndexOnlyScanState::ioss_ScanDesc.

Referenced by ExecParallelReInitializeDSM().

669 {
671 }
void index_parallelrescan(IndexScanDesc scan)
Definition: indexam.c:481
IndexScanDesc ioss_ScanDesc
Definition: execnodes.h:1242
IndexOnlyScanState* ExecInitIndexOnlyScan ( IndexOnlyScan node,
EState estate,
int  eflags 
)

Definition at line 454 of file nodeIndexonlyscan.c.

References AccessShareLock, EXEC_FLAG_EXPLAIN_ONLY, ExecAssignExprContext(), ExecAssignResultTypeFromTL(), ExecAssignScanProjectionInfoWithVarno(), ExecAssignScanType(), ExecIndexBuildScanKeys(), ExecIndexOnlyScan(), ExecInitQual(), ExecInitResultTupleSlot(), ExecInitScanTupleSlot(), ExecOpenScanRelation(), PlanState::ExecProcNode, ExecRelationIsTargetRelation(), ExecTypeFromTL(), index_open(), INDEX_VAR, IndexOnlyScan::indexid, IndexOnlyScan::indexorderby, IndexOnlyScan::indexqual, IndexOnlyScanState::indexqual, IndexOnlyScan::indextlist, IndexOnlyScanState::ioss_HeapFetches, IndexOnlyScanState::ioss_NumOrderByKeys, IndexOnlyScanState::ioss_NumRuntimeKeys, IndexOnlyScanState::ioss_NumScanKeys, IndexOnlyScanState::ioss_OrderByKeys, IndexOnlyScanState::ioss_RelationDesc, IndexOnlyScanState::ioss_RuntimeContext, IndexOnlyScanState::ioss_RuntimeKeys, IndexOnlyScanState::ioss_RuntimeKeysReady, IndexOnlyScanState::ioss_ScanKeys, makeNode, NoLock, Scan::plan, PlanState::plan, ScanState::ps, PlanState::ps_ExprContext, Plan::qual, PlanState::qual, IndexOnlyScan::scan, Scan::scanrelid, IndexOnlyScanState::ss, ScanState::ss_currentRelation, ScanState::ss_currentScanDesc, and PlanState::state.

Referenced by ExecInitNode().

455 {
456  IndexOnlyScanState *indexstate;
457  Relation currentRelation;
458  bool relistarget;
459  TupleDesc tupDesc;
460 
461  /*
462  * create state structure
463  */
464  indexstate = makeNode(IndexOnlyScanState);
465  indexstate->ss.ps.plan = (Plan *) node;
466  indexstate->ss.ps.state = estate;
467  indexstate->ss.ps.ExecProcNode = ExecIndexOnlyScan;
468  indexstate->ioss_HeapFetches = 0;
469 
470  /*
471  * Miscellaneous initialization
472  *
473  * create expression context for node
474  */
475  ExecAssignExprContext(estate, &indexstate->ss.ps);
476 
477  /*
478  * initialize child expressions
479  *
480  * Note: we don't initialize all of the indexorderby expression, only the
481  * sub-parts corresponding to runtime keys (see below).
482  */
483  indexstate->ss.ps.qual =
484  ExecInitQual(node->scan.plan.qual, (PlanState *) indexstate);
485  indexstate->indexqual =
486  ExecInitQual(node->indexqual, (PlanState *) indexstate);
487 
488  /*
489  * tuple table initialization
490  */
491  ExecInitResultTupleSlot(estate, &indexstate->ss.ps);
492  ExecInitScanTupleSlot(estate, &indexstate->ss);
493 
494  /*
495  * open the base relation and acquire appropriate lock on it.
496  */
497  currentRelation = ExecOpenScanRelation(estate, node->scan.scanrelid, eflags);
498 
499  indexstate->ss.ss_currentRelation = currentRelation;
500  indexstate->ss.ss_currentScanDesc = NULL; /* no heap scan here */
501 
502  /*
503  * Build the scan tuple type using the indextlist generated by the
504  * planner. We use this, rather than the index's physical tuple
505  * descriptor, because the latter contains storage column types not the
506  * types of the original datums. (It's the AM's responsibility to return
507  * suitable data anyway.)
508  */
509  tupDesc = ExecTypeFromTL(node->indextlist, false);
510  ExecAssignScanType(&indexstate->ss, tupDesc);
511 
512  /*
513  * Initialize result tuple type and projection info. The node's
514  * targetlist will contain Vars with varno = INDEX_VAR, referencing the
515  * scan tuple.
516  */
517  ExecAssignResultTypeFromTL(&indexstate->ss.ps);
519 
520  /*
521  * If we are just doing EXPLAIN (ie, aren't going to run the plan), stop
522  * here. This allows an index-advisor plugin to EXPLAIN a plan containing
523  * references to nonexistent indexes.
524  */
525  if (eflags & EXEC_FLAG_EXPLAIN_ONLY)
526  return indexstate;
527 
528  /*
529  * Open the index relation.
530  *
531  * If the parent table is one of the target relations of the query, then
532  * InitPlan already opened and write-locked the index, so we can avoid
533  * taking another lock here. Otherwise we need a normal reader's lock.
534  */
535  relistarget = ExecRelationIsTargetRelation(estate, node->scan.scanrelid);
536  indexstate->ioss_RelationDesc = index_open(node->indexid,
537  relistarget ? NoLock : AccessShareLock);
538 
539  /*
540  * Initialize index-specific scan state
541  */
542  indexstate->ioss_RuntimeKeysReady = false;
543  indexstate->ioss_RuntimeKeys = NULL;
544  indexstate->ioss_NumRuntimeKeys = 0;
545 
546  /*
547  * build the index scan keys from the index qualification
548  */
549  ExecIndexBuildScanKeys((PlanState *) indexstate,
550  indexstate->ioss_RelationDesc,
551  node->indexqual,
552  false,
553  &indexstate->ioss_ScanKeys,
554  &indexstate->ioss_NumScanKeys,
555  &indexstate->ioss_RuntimeKeys,
556  &indexstate->ioss_NumRuntimeKeys,
557  NULL, /* no ArrayKeys */
558  NULL);
559 
560  /*
561  * any ORDER BY exprs have to be turned into scankeys in the same way
562  */
563  ExecIndexBuildScanKeys((PlanState *) indexstate,
564  indexstate->ioss_RelationDesc,
565  node->indexorderby,
566  true,
567  &indexstate->ioss_OrderByKeys,
568  &indexstate->ioss_NumOrderByKeys,
569  &indexstate->ioss_RuntimeKeys,
570  &indexstate->ioss_NumRuntimeKeys,
571  NULL, /* no ArrayKeys */
572  NULL);
573 
574  /*
575  * If we have runtime keys, we need an ExprContext to evaluate them. The
576  * node's standard context won't do because we want to reset that context
577  * for every tuple. So, build another context just like the other one...
578  * -tgl 7/11/00
579  */
580  if (indexstate->ioss_NumRuntimeKeys != 0)
581  {
582  ExprContext *stdecontext = indexstate->ss.ps.ps_ExprContext;
583 
584  ExecAssignExprContext(estate, &indexstate->ss.ps);
585  indexstate->ioss_RuntimeContext = indexstate->ss.ps.ps_ExprContext;
586  indexstate->ss.ps.ps_ExprContext = stdecontext;
587  }
588  else
589  {
590  indexstate->ioss_RuntimeContext = NULL;
591  }
592 
593  /*
594  * all done.
595  */
596  return indexstate;
597 }
bool ioss_RuntimeKeysReady
Definition: execnodes.h:1239
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
ExprContext * ps_ExprContext
Definition: execnodes.h:881
#define AccessShareLock
Definition: lockdefs.h:36
IndexRuntimeKeyInfo * ioss_RuntimeKeys
Definition: execnodes.h:1237
Relation ss_currentRelation
Definition: execnodes.h:1102
EState * state
Definition: execnodes.h:849
ExprState * ExecInitQual(List *qual, PlanState *parent)
Definition: execExpr.c:160
void ExecAssignResultTypeFromTL(PlanState *planstate)
Definition: execUtils.c:445
void ExecAssignScanProjectionInfoWithVarno(ScanState *node, Index varno)
Definition: execScan.c:249
PlanState ps
Definition: execnodes.h:1101
ScanKey ioss_ScanKeys
Definition: execnodes.h:1233
void ExecInitResultTupleSlot(EState *estate, PlanState *planstate)
Definition: execTuples.c:832
Relation ExecOpenScanRelation(EState *estate, Index scanrelid, int eflags)
Definition: execUtils.c:608
ExprContext * ioss_RuntimeContext
Definition: execnodes.h:1240
#define NoLock
Definition: lockdefs.h:34
ScanKey ioss_OrderByKeys
Definition: execnodes.h:1235
TupleDesc ExecTypeFromTL(List *targetList, bool hasoid)
Definition: execTuples.c:888
ExecProcNodeMtd ExecProcNode
Definition: execnodes.h:853
Plan * plan
Definition: execnodes.h:847
Relation ioss_RelationDesc
Definition: execnodes.h:1241
List * indextlist
Definition: plannodes.h:421
List * indexorderby
Definition: plannodes.h:420
#define makeNode(_type_)
Definition: nodes.h:558
static TupleTableSlot * ExecIndexOnlyScan(PlanState *pstate)
void ExecAssignExprContext(EState *estate, PlanState *planstate)
Definition: execUtils.c:423
void ExecIndexBuildScanKeys(PlanState *planstate, Relation index, List *quals, bool isorderby, ScanKey *scanKeys, int *numScanKeys, IndexRuntimeKeyInfo **runtimeKeys, int *numRuntimeKeys, IndexArrayKeyInfo **arrayKeys, int *numArrayKeys)
List * indexqual
Definition: plannodes.h:419
ExprState * indexqual
Definition: execnodes.h:1232
ExprState * qual
Definition: execnodes.h:865
HeapScanDesc ss_currentScanDesc
Definition: execnodes.h:1103
void ExecAssignScanType(ScanState *scanstate, TupleDesc tupDesc)
Definition: execUtils.c:545
#define INDEX_VAR
Definition: primnodes.h:155
#define EXEC_FLAG_EXPLAIN_ONLY
Definition: executor.h:58
Relation index_open(Oid relationId, LOCKMODE lockmode)
Definition: indexam.c:151
bool ExecRelationIsTargetRelation(EState *estate, Index scanrelid)
Definition: execUtils.c:582
void ExecReScanIndexOnlyScan ( IndexOnlyScanState node)

Definition at line 338 of file nodeIndexonlyscan.c.

References ExecIndexEvalRuntimeKeys(), ExecScanReScan(), index_rescan(), IndexOnlyScanState::ioss_NumOrderByKeys, IndexOnlyScanState::ioss_NumRuntimeKeys, IndexOnlyScanState::ioss_NumScanKeys, IndexOnlyScanState::ioss_OrderByKeys, IndexOnlyScanState::ioss_RuntimeContext, IndexOnlyScanState::ioss_RuntimeKeys, IndexOnlyScanState::ioss_RuntimeKeysReady, IndexOnlyScanState::ioss_ScanDesc, IndexOnlyScanState::ioss_ScanKeys, ResetExprContext, and IndexOnlyScanState::ss.

Referenced by ExecReScan().

339 {
340  /*
341  * If we are doing runtime key calculations (ie, any of the index key
342  * values weren't simple Consts), compute the new key values. But first,
343  * reset the context so we don't leak memory as each outer tuple is
344  * scanned. Note this assumes that we will recalculate *all* runtime keys
345  * on each call.
346  */
347  if (node->ioss_NumRuntimeKeys != 0)
348  {
349  ExprContext *econtext = node->ioss_RuntimeContext;
350 
351  ResetExprContext(econtext);
352  ExecIndexEvalRuntimeKeys(econtext,
353  node->ioss_RuntimeKeys,
354  node->ioss_NumRuntimeKeys);
355  }
356  node->ioss_RuntimeKeysReady = true;
357 
358  /* reset index scan */
359  if (node->ioss_ScanDesc)
361  node->ioss_ScanKeys, node->ioss_NumScanKeys,
363 
364  ExecScanReScan(&node->ss);
365 }
bool ioss_RuntimeKeysReady
Definition: execnodes.h:1239
void index_rescan(IndexScanDesc scan, ScanKey keys, int nkeys, ScanKey orderbys, int norderbys)
Definition: indexam.c:310
IndexRuntimeKeyInfo * ioss_RuntimeKeys
Definition: execnodes.h:1237
ScanKey ioss_ScanKeys
Definition: execnodes.h:1233
ExprContext * ioss_RuntimeContext
Definition: execnodes.h:1240
IndexScanDesc ioss_ScanDesc
Definition: execnodes.h:1242
ScanKey ioss_OrderByKeys
Definition: execnodes.h:1235
void ExecIndexEvalRuntimeKeys(ExprContext *econtext, IndexRuntimeKeyInfo *runtimeKeys, int numRuntimeKeys)
void ExecScanReScan(ScanState *node)
Definition: execScan.c:329
#define ResetExprContext(econtext)
Definition: executor.h:471