I guess one JOIN + two PROJECTs work faster than two JOINS:

	EXPORT RndFeatSelPartitionGIBased(DATASET(gNode) nodes, t_Count nTrees, t_Count kFeatSel, t_Count mTotFeats, t_Count p_level, REAL Purity=1.0):= FUNCTION
		this_set_all := DISTRIBUTE(nodes(level = p_level), group_id); // Distribute current level nodes by group_id
	  	node_base := MAX(this_set_all, node_id);           // Start allocating new node-ids from the highest previous
		featSet:= NxKoutofM(nTrees, kFeatSel, mTotFeats);  // generating list of features selected for each tree
		minFeats := TABLE(featSet, {gNum, minNumber := MIN(GROUP, number)}, gNum, FEW); // chose the min feature number from the sample
		this_minFeats:= JOIN(this_set_all, minFeats, LEFT.group_id = RIGHT.gNum AND LEFT.number= RIGHT.minNumber, LEFT ONLY, LOOKUP, LOCAL);
		Purities := ML.Utils.Gini(this_minFeats, node_id, depend); // Compute the purities for each node
		PureEnough := Purities(1-Purity >= gini);
		pureNodes := JOIN(this_set_all, PureEnough, LEFT.node_id=RIGHT.node_id, TRANSFORM({gNode, BOOLEAN pure:= FALSE}, SELF.pure:=RIGHT.node_id>0, SELF:=LEFT, ), LEFT OUTER, LOOKUP, LOCAL);
		pass_thru := PROJECT(pureNodes(pure = TRUE), gNode, LOCAL);
		this_set_out := PROJECT(pureNodes(pure = FALSE), gNode, LOCAL);