Search in sources :

Example 1 with IterativeOptimizer

use of io.prestosql.sql.planner.iterative.IterativeOptimizer in project hetu-core by openlookeng.

the class TestEliminateSorts method assertUnitPlan.

private void assertUnitPlan(@Language("SQL") String sql, PlanMatchPattern pattern) {
    List<PlanOptimizer> optimizers = ImmutableList.of(new UnaliasSymbolReferences(getQueryRunner().getMetadata()), new AddExchanges(getQueryRunner().getMetadata(), new TypeAnalyzer(new SqlParser(), getQueryRunner().getMetadata()), true), new PruneUnreferencedOutputs(), new IterativeOptimizer(new RuleStatsRecorder(), getQueryRunner().getStatsCalculator(), getQueryRunner().getCostCalculator(), ImmutableSet.of(new RemoveRedundantIdentityProjections())));
    assertPlan(sql, pattern, optimizers);
}
Also used : RuleStatsRecorder(io.prestosql.sql.planner.RuleStatsRecorder) RemoveRedundantIdentityProjections(io.prestosql.sql.planner.iterative.rule.RemoveRedundantIdentityProjections) SqlParser(io.prestosql.sql.parser.SqlParser) IterativeOptimizer(io.prestosql.sql.planner.iterative.IterativeOptimizer) TypeAnalyzer(io.prestosql.sql.planner.TypeAnalyzer)

Example 2 with IterativeOptimizer

use of io.prestosql.sql.planner.iterative.IterativeOptimizer in project hetu-core by openlookeng.

the class TestOptimizeMixedDistinctAggregations method assertUnitPlan.

private void assertUnitPlan(String sql, PlanMatchPattern pattern) {
    List<PlanOptimizer> optimizers = ImmutableList.of(new UnaliasSymbolReferences(getQueryRunner().getMetadata()), new IterativeOptimizer(new RuleStatsRecorder(), getQueryRunner().getStatsCalculator(), getQueryRunner().getEstimatedExchangesCostCalculator(), ImmutableSet.of(new RemoveRedundantIdentityProjections(), new SingleDistinctAggregationToGroupBy(), new MultipleDistinctAggregationToMarkDistinct())), new IterativeOptimizer(new RuleStatsRecorder(), getQueryRunner().getStatsCalculator(), getQueryRunner().getEstimatedExchangesCostCalculator(), new TranslateExpressions(getQueryRunner().getMetadata(), getQueryRunner().getSqlParser()).rules(getMetadata())), new OptimizeMixedDistinctAggregations(getQueryRunner().getMetadata()), new PruneUnreferencedOutputs());
    assertPlan(sql, pattern, optimizers);
}
Also used : RuleStatsRecorder(io.prestosql.sql.planner.RuleStatsRecorder) RemoveRedundantIdentityProjections(io.prestosql.sql.planner.iterative.rule.RemoveRedundantIdentityProjections) MultipleDistinctAggregationToMarkDistinct(io.prestosql.sql.planner.iterative.rule.MultipleDistinctAggregationToMarkDistinct) IterativeOptimizer(io.prestosql.sql.planner.iterative.IterativeOptimizer) TranslateExpressions(io.prestosql.sql.planner.iterative.rule.TranslateExpressions) SingleDistinctAggregationToGroupBy(io.prestosql.sql.planner.iterative.rule.SingleDistinctAggregationToGroupBy)

Example 3 with IterativeOptimizer

use of io.prestosql.sql.planner.iterative.IterativeOptimizer in project hetu-core by openlookeng.

the class TestSetFlatteningOptimizer method assertPlan.

@Override
protected void assertPlan(String sql, PlanMatchPattern pattern) {
    List<PlanOptimizer> optimizers = ImmutableList.of(new UnaliasSymbolReferences(getQueryRunner().getMetadata()), new PruneUnreferencedOutputs(), new IterativeOptimizer(new RuleStatsRecorder(), getQueryRunner().getStatsCalculator(), getQueryRunner().getEstimatedExchangesCostCalculator(), ImmutableSet.of(new RemoveRedundantIdentityProjections())), new SetFlatteningOptimizer());
    assertPlan(sql, pattern, optimizers);
}
Also used : RuleStatsRecorder(io.prestosql.sql.planner.RuleStatsRecorder) RemoveRedundantIdentityProjections(io.prestosql.sql.planner.iterative.rule.RemoveRedundantIdentityProjections) IterativeOptimizer(io.prestosql.sql.planner.iterative.IterativeOptimizer)

Example 4 with IterativeOptimizer

use of io.prestosql.sql.planner.iterative.IterativeOptimizer in project hetu-core by openlookeng.

the class BasePlanTest method assertMinimallyOptimizedPlan.

protected void assertMinimallyOptimizedPlan(@Language("SQL") String sql, PlanMatchPattern pattern) {
    List<PlanOptimizer> optimizers = ImmutableList.of(new UnaliasSymbolReferences(queryRunner.getMetadata()), new PruneUnreferencedOutputs(), new IterativeOptimizer(new RuleStatsRecorder(), queryRunner.getStatsCalculator(), queryRunner.getCostCalculator(), ImmutableSet.of(new RemoveRedundantIdentityProjections())));
    assertPlan(sql, LogicalPlanner.Stage.OPTIMIZED, pattern, optimizers);
}
Also used : PlanOptimizer(io.prestosql.sql.planner.optimizations.PlanOptimizer) RuleStatsRecorder(io.prestosql.sql.planner.RuleStatsRecorder) RemoveRedundantIdentityProjections(io.prestosql.sql.planner.iterative.rule.RemoveRedundantIdentityProjections) PruneUnreferencedOutputs(io.prestosql.sql.planner.optimizations.PruneUnreferencedOutputs) IterativeOptimizer(io.prestosql.sql.planner.iterative.IterativeOptimizer) UnaliasSymbolReferences(io.prestosql.sql.planner.optimizations.UnaliasSymbolReferences)

Example 5 with IterativeOptimizer

use of io.prestosql.sql.planner.iterative.IterativeOptimizer in project hetu-core by openlookeng.

the class TestMergeWindows method assertUnitPlan.

private void assertUnitPlan(@Language("SQL") String sql, PlanMatchPattern pattern) {
    List<PlanOptimizer> optimizers = ImmutableList.of(new UnaliasSymbolReferences(getQueryRunner().getMetadata()), new IterativeOptimizer(new RuleStatsRecorder(), getQueryRunner().getStatsCalculator(), getQueryRunner().getCostCalculator(), new TranslateExpressions(getMetadata(), getQueryRunner().getSqlParser()).rules(getMetadata())), new IterativeOptimizer(new RuleStatsRecorder(), getQueryRunner().getStatsCalculator(), getQueryRunner().getEstimatedExchangesCostCalculator(), ImmutableSet.<Rule<?>>builder().add(new RemoveRedundantIdentityProjections()).addAll(GatherAndMergeWindows.rules()).build()), new PruneUnreferencedOutputs());
    assertPlan(sql, pattern, optimizers);
}
Also used : RuleStatsRecorder(io.prestosql.sql.planner.RuleStatsRecorder) RemoveRedundantIdentityProjections(io.prestosql.sql.planner.iterative.rule.RemoveRedundantIdentityProjections) IterativeOptimizer(io.prestosql.sql.planner.iterative.IterativeOptimizer) TranslateExpressions(io.prestosql.sql.planner.iterative.rule.TranslateExpressions)

Aggregations

IterativeOptimizer (io.prestosql.sql.planner.iterative.IterativeOptimizer)7 RuleStatsRecorder (io.prestosql.sql.planner.RuleStatsRecorder)6 RemoveRedundantIdentityProjections (io.prestosql.sql.planner.iterative.rule.RemoveRedundantIdentityProjections)6 TypeAnalyzer (io.prestosql.sql.planner.TypeAnalyzer)3 TranslateExpressions (io.prestosql.sql.planner.iterative.rule.TranslateExpressions)3 Cache (com.google.common.cache.Cache)1 Session (io.prestosql.Session)1 SystemSessionProperties (io.prestosql.SystemSessionProperties)1 SystemSessionProperties.isExecutionPlanCacheEnabled (io.prestosql.SystemSessionProperties.isExecutionPlanCacheEnabled)1 InformationSchemaTransactionHandle (io.prestosql.connector.informationschema.InformationSchemaTransactionHandle)1 GlobalSystemTransactionHandle (io.prestosql.connector.system.GlobalSystemTransactionHandle)1 SystemTransactionHandle (io.prestosql.connector.system.SystemTransactionHandle)1 CostCalculator (io.prestosql.cost.CostCalculator)1 StatsCalculator (io.prestosql.cost.StatsCalculator)1 CubeManager (io.prestosql.cube.CubeManager)1 DynamicFilterService (io.prestosql.dynamicfilter.DynamicFilterService)1 LocationFactory (io.prestosql.execution.LocationFactory)1 NodeTaskMap (io.prestosql.execution.NodeTaskMap)1 QueryPreparer (io.prestosql.execution.QueryPreparer)1 QueryStateMachine (io.prestosql.execution.QueryStateMachine)1