MCPcopy Create free account
hub / github.com/apache/cloudberry / ExecEndIndexScan

Function ExecEndIndexScan

src/backend/executor/nodeIndexscan.c:787–828  ·  view source on GitHub ↗

---------------------------------------------------------------- * ExecEndIndexScan * ---------------------------------------------------------------- */

Source from the content-addressed store, hash-verified

785 * ----------------------------------------------------------------
786 */
787void
788ExecEndIndexScan(IndexScanState *node)
789{
790 Relation indexRelationDesc;
791 IndexScanDesc indexScanDesc;
792
793 /*
794 * extract information from the node
795 */
796 indexRelationDesc = node->iss_RelationDesc;
797 indexScanDesc = node->iss_ScanDesc;
798
799 /*
800 * Free the exprcontext(s) ... now dead code, see ExecFreeExprContext
801 *
802 * GPDB: This is not dead code in GPDB, because we don't want to leak
803 * exprcontexts in a dynamic index scan.
804 */
805#if 1
806 ExecFreeExprContext(&node->ss.ps);
807 if (node->iss_RuntimeContext)
808 {
809 FreeExprContext(node->iss_RuntimeContext, true);
810 node->iss_RuntimeContext = NULL;
811 }
812#endif
813
814 /*
815 * clear out tuple table slots
816 */
817 if (node->ss.ps.ps_ResultTupleSlot)
818 ExecClearTuple(node->ss.ps.ps_ResultTupleSlot);
819 ExecClearTuple(node->ss.ss_ScanTupleSlot);
820
821 /*
822 * close the index relation (no-op if we didn't open it)
823 */
824 if (indexScanDesc)
825 index_endscan(node->iss_ScanDesc);
826 if (indexRelationDesc)
827 index_close(indexRelationDesc, NoLock);
828}
829
830/* ----------------------------------------------------------------
831 * ExecIndexMarkPos

Callers 3

endCurrentIndexScanFunction · 0.85
ExecReScanDynamicIndexFunction · 0.85
ExecEndNodeFunction · 0.85

Calls 5

ExecFreeExprContextFunction · 0.85
FreeExprContextFunction · 0.85
ExecClearTupleFunction · 0.85
index_endscanFunction · 0.85
index_closeFunction · 0.85

Tested by

no test coverage detected