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

Function ExecEndMotion

src/backend/executor/nodeMotion.c:925–1026  ·  view source on GitHub ↗

---------------------------------------------------------------- * ExecEndMotion(node) * ---------------------------------------------------------------- */

Source from the content-addressed store, hash-verified

923 * ----------------------------------------------------------------
924 */
925void
926ExecEndMotion(MotionState *node)
927{
928 Motion *motion = (Motion *) node->ps.plan;
929#ifdef MEASURE_MOTION_TIME
930 double otherTimeSec;
931 double motionTimeSec;
932#endif
933
934 ExecFreeExprContext(&node->ps);
935
936 /*
937 * clean out the tuple table
938 */
939 ExecClearTuple(node->ps.ps_ResultTupleSlot);
940
941 /*
942 * Set the slice no for the nodes under this motion.
943 */
944 Assert(node->ps.state != NULL);
945
946 /*
947 * shut down the subplan
948 */
949 ExecEndNode(outerPlanState(node));
950
951#ifdef MEASURE_MOTION_TIME
952 motionTimeSec = (double) node->motionTime.tv_sec + (double) node->motionTime.tv_usec / 1000000.0;
953
954 if (node->mstype == MOTIONSTATE_RECV)
955 {
956 elog(DEBUG1,
957 "Motion Node %d (RECEIVER) Statistics:\n"
958 "Timing: \n"
959 "\t Time receiving the tuple: %f sec\n"
960 "Counters: \n"
961 "\tnumTuplesFromChild: %d\n"
962 "\tnumTuplesFromAMS: %d\n"
963 "\tnumTuplesToAMS: %d\n"
964 "\tnumTuplesToParent: %d\n",
965 motNodeID,
966 motionTimeSec,
967 node->numTuplesFromChild,
968 node->numTuplesFromAMS,
969 node->numTuplesToAMS,
970 node->numTuplesToParent
971 );
972 }
973 else if (node->mstype == MOTIONSTATE_SEND)
974 {
975 otherTimeSec = (double) node->otherTime.tv_sec + (double) node->otherTime.tv_usec / 1000000.0;
976 elog(DEBUG1,
977 "Motion Node %d (SENDER) Statistics:\n"
978 "Timing: \n"
979 "\t Time getting next tuple to send: %f sec \n"
980 "\t Time sending the tuple: %f sec\n"
981 "\t Percentage of time sending: %2.2f%% \n"
982 "Counters: \n"

Callers 1

ExecEndNodeFunction · 0.85

Calls 6

ExecFreeExprContextFunction · 0.85
ExecClearTupleFunction · 0.85
ExecEndNodeFunction · 0.85
binaryheap_freeFunction · 0.85
EndMotionLayerNodeFunction · 0.85
pfreeFunction · 0.50

Tested by

no test coverage detected