Do one more pass of output symbols pruning before rewriting subqueries
@@ -275,6 +275,11 @@ public class PlanOptimizers
new LimitPushDown(), // Run the LimitPushDown after flattening set operators to make it easier to do the set flattening
new PruneUnreferencedOutputs(),
inlineProjections,
+ new IterativeOptimizer(
+ stats,
+ statsCalculator,
+ estimatedExchangesCostCalculator,
+ columnPruningRules),
new IterativeOptimizer(
stats,
statsCalculator,
