static bool IsMemoryIntensiveOperator(Node *node, PlannedStmt *stmt) { Assert(is_plan_node(node)); switch(nodeTag(node)) { case T_Material: case T_Sort: case T_ShareInputScan: case T_Hash: case T_BitmapIndexScan: case T_WindowAgg: case T_TableFunctionScan: case T_FunctionScan: return true; case T_Agg: { Agg *agg = (Agg *) node; return IsAggMemoryIntensive(agg); } case T_Result: { Result *res = (Result *) node; return IsResultMemoryIntensive(res); } default: return false; } }