Skip to content

Commit cb26e1e

Browse files
committed
Add another WindowFilterPushdown run
1 parent 31e9f1a commit cb26e1e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

presto-main-base/src/main/java/com/facebook/presto/sql/planner/PlanOptimizers.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -654,6 +654,7 @@ public PlanOptimizers(
654654
estimatedExchangesCostCalculator,
655655
ImmutableSet.of(new SimplifyCountOverConstant(metadata.getFunctionAndTypeManager()))),
656656
new LimitPushDown(), // Run LimitPushDown before WindowFilterPushDown
657+
new WindowFilterPushDown(metadata), // This must run after PredicatePushDown and LimitPushDown so that it squashes any successive filter nodes and limits
657658
prefilterForLimitingAggregation,
658659
new IterativeOptimizer(
659660
metadata,
@@ -893,7 +894,7 @@ public PlanOptimizers(
893894
// Run RemoveEmptyDelete and EliminateEmptyJoins after table scan is removed by PickTableLayout/AddExchanges
894895
ImmutableSet.of(new RemoveEmptyDelete())));
895896
builder.add(predicatePushDown); // Run predicate push down one more time in case we can leverage new information from layouts' effective predicate
896-
builder.add(new WindowFilterPushDown(metadata)); // This must run after PredicatePushDown and LimitPushDown so that it squashes any successive filter nodes and limits
897+
builder.add(new WindowFilterPushDown(metadata));
897898
builder.add(new RemoveUnsupportedDynamicFilters(metadata.getFunctionAndTypeManager()));
898899
builder.add(simplifyRowExpressionOptimizer); // Should be always run after PredicatePushDown
899900
builder.add(projectionPushDown);

0 commit comments

Comments
 (0)