Search in sources :

Example 1 with SetAlgebricksPhysicalOperatorsRule

use of org.apache.hyracks.algebricks.rewriter.rules.SetAlgebricksPhysicalOperatorsRule in project asterixdb by apache.

the class PigletRewriteRuleset method buildPhysicalRewritesAllLevelsRuleCollection.

public static final List<IAlgebraicRewriteRule> buildPhysicalRewritesAllLevelsRuleCollection() {
    List<IAlgebraicRewriteRule> physicalPlanRewrites = new LinkedList<IAlgebraicRewriteRule>();
    physicalPlanRewrites.add(new PullSelectOutOfEqJoin());
    physicalPlanRewrites.add(new SetAlgebricksPhysicalOperatorsRule());
    physicalPlanRewrites.add(new EnforceStructuralPropertiesRule());
    physicalPlanRewrites.add(new PushProjectDownRule());
    physicalPlanRewrites.add(new CopyLimitDownRule());
    return physicalPlanRewrites;
}
Also used : PushProjectDownRule(org.apache.hyracks.algebricks.rewriter.rules.PushProjectDownRule) CopyLimitDownRule(org.apache.hyracks.algebricks.rewriter.rules.CopyLimitDownRule) IAlgebraicRewriteRule(org.apache.hyracks.algebricks.core.rewriter.base.IAlgebraicRewriteRule) EnforceStructuralPropertiesRule(org.apache.hyracks.algebricks.rewriter.rules.EnforceStructuralPropertiesRule) LinkedList(java.util.LinkedList) PullSelectOutOfEqJoin(org.apache.hyracks.algebricks.rewriter.rules.PullSelectOutOfEqJoin) SetAlgebricksPhysicalOperatorsRule(org.apache.hyracks.algebricks.rewriter.rules.SetAlgebricksPhysicalOperatorsRule)

Example 2 with SetAlgebricksPhysicalOperatorsRule

use of org.apache.hyracks.algebricks.rewriter.rules.SetAlgebricksPhysicalOperatorsRule in project asterixdb by apache.

the class RuleCollections method buildPhysicalRewritesAllLevelsRuleCollection.

public static final List<IAlgebraicRewriteRule> buildPhysicalRewritesAllLevelsRuleCollection() {
    List<IAlgebraicRewriteRule> physicalRewritesAllLevels = new LinkedList<>();
    physicalRewritesAllLevels.add(new PullSelectOutOfEqJoin());
    //Turned off the following rule for now not to change OptimizerTest results.
    physicalRewritesAllLevels.add(new SetupCommitExtensionOpRule());
    physicalRewritesAllLevels.add(new SetAlgebricksPhysicalOperatorsRule());
    physicalRewritesAllLevels.add(new SetAsterixPhysicalOperatorsRule());
    physicalRewritesAllLevels.add(new AddEquivalenceClassForRecordConstructorRule());
    physicalRewritesAllLevels.add(new EnforceStructuralPropertiesRule());
    physicalRewritesAllLevels.add(new RemoveSortInFeedIngestionRule());
    physicalRewritesAllLevels.add(new RemoveUnnecessarySortMergeExchange());
    physicalRewritesAllLevels.add(new PushProjectDownRule());
    physicalRewritesAllLevels.add(new InsertProjectBeforeUnionRule());
    physicalRewritesAllLevels.add(new IntroduceMaterializationForInsertWithSelfScanRule());
    physicalRewritesAllLevels.add(new InlineSingleReferenceVariablesRule());
    physicalRewritesAllLevels.add(new RemoveUnusedAssignAndAggregateRule());
    physicalRewritesAllLevels.add(new ConsolidateAssignsRule());
    // After adding projects, we may need need to set physical operators again.
    physicalRewritesAllLevels.add(new SetAlgebricksPhysicalOperatorsRule());
    return physicalRewritesAllLevels;
}
Also used : PushProjectDownRule(org.apache.hyracks.algebricks.rewriter.rules.PushProjectDownRule) ConsolidateAssignsRule(org.apache.hyracks.algebricks.rewriter.rules.ConsolidateAssignsRule) InsertProjectBeforeUnionRule(org.apache.hyracks.algebricks.rewriter.rules.InsertProjectBeforeUnionRule) SetAsterixPhysicalOperatorsRule(org.apache.asterix.optimizer.rules.SetAsterixPhysicalOperatorsRule) InlineSingleReferenceVariablesRule(org.apache.hyracks.algebricks.rewriter.rules.InlineSingleReferenceVariablesRule) LinkedList(java.util.LinkedList) RemoveUnnecessarySortMergeExchange(org.apache.hyracks.algebricks.rewriter.rules.RemoveUnnecessarySortMergeExchange) IntroduceMaterializationForInsertWithSelfScanRule(org.apache.asterix.optimizer.rules.IntroduceMaterializationForInsertWithSelfScanRule) SetupCommitExtensionOpRule(org.apache.asterix.optimizer.rules.SetupCommitExtensionOpRule) IAlgebraicRewriteRule(org.apache.hyracks.algebricks.core.rewriter.base.IAlgebraicRewriteRule) AddEquivalenceClassForRecordConstructorRule(org.apache.asterix.optimizer.rules.AddEquivalenceClassForRecordConstructorRule) RemoveSortInFeedIngestionRule(org.apache.asterix.optimizer.rules.RemoveSortInFeedIngestionRule) EnforceStructuralPropertiesRule(org.apache.hyracks.algebricks.rewriter.rules.EnforceStructuralPropertiesRule) RemoveUnusedAssignAndAggregateRule(org.apache.hyracks.algebricks.rewriter.rules.RemoveUnusedAssignAndAggregateRule) PullSelectOutOfEqJoin(org.apache.hyracks.algebricks.rewriter.rules.PullSelectOutOfEqJoin) SetAlgebricksPhysicalOperatorsRule(org.apache.hyracks.algebricks.rewriter.rules.SetAlgebricksPhysicalOperatorsRule)

Example 3 with SetAlgebricksPhysicalOperatorsRule

use of org.apache.hyracks.algebricks.rewriter.rules.SetAlgebricksPhysicalOperatorsRule in project asterixdb by apache.

the class RuleCollections method buildPhysicalRewritesTopLevelRuleCollection.

public static final List<IAlgebraicRewriteRule> buildPhysicalRewritesTopLevelRuleCollection(ICcApplicationContext appCtx) {
    List<IAlgebraicRewriteRule> physicalRewritesTopLevel = new LinkedList<>();
    physicalRewritesTopLevel.add(new PushNestedOrderByUnderPreSortedGroupByRule());
    physicalRewritesTopLevel.add(new CopyLimitDownRule());
    // CopyLimitDownRule may generates non-topmost limits with numeric_adds functions.
    // We are going to apply a constant folding rule again for this case.
    physicalRewritesTopLevel.add(new ConstantFoldingRule(appCtx));
    physicalRewritesTopLevel.add(new PushLimitIntoOrderByRule());
    physicalRewritesTopLevel.add(new IntroduceProjectsRule());
    physicalRewritesTopLevel.add(new SetAlgebricksPhysicalOperatorsRule());
    physicalRewritesTopLevel.add(new IntroduceRapidFrameFlushProjectAssignRule());
    physicalRewritesTopLevel.add(new SetExecutionModeRule());
    physicalRewritesTopLevel.add(new IntroduceRandomPartitioningFeedComputationRule());
    return physicalRewritesTopLevel;
}
Also used : PushNestedOrderByUnderPreSortedGroupByRule(org.apache.hyracks.algebricks.rewriter.rules.PushNestedOrderByUnderPreSortedGroupByRule) ConstantFoldingRule(org.apache.asterix.optimizer.rules.ConstantFoldingRule) CopyLimitDownRule(org.apache.hyracks.algebricks.rewriter.rules.CopyLimitDownRule) PushLimitIntoOrderByRule(org.apache.asterix.optimizer.rules.PushLimitIntoOrderByRule) IntroduceRandomPartitioningFeedComputationRule(org.apache.asterix.optimizer.rules.IntroduceRandomPartitioningFeedComputationRule) SetExecutionModeRule(org.apache.hyracks.algebricks.rewriter.rules.SetExecutionModeRule) IAlgebraicRewriteRule(org.apache.hyracks.algebricks.core.rewriter.base.IAlgebraicRewriteRule) IntroduceProjectsRule(org.apache.hyracks.algebricks.rewriter.rules.IntroduceProjectsRule) LinkedList(java.util.LinkedList) SetAlgebricksPhysicalOperatorsRule(org.apache.hyracks.algebricks.rewriter.rules.SetAlgebricksPhysicalOperatorsRule) IntroduceRapidFrameFlushProjectAssignRule(org.apache.asterix.optimizer.rules.IntroduceRapidFrameFlushProjectAssignRule)

Aggregations

LinkedList (java.util.LinkedList)3 IAlgebraicRewriteRule (org.apache.hyracks.algebricks.core.rewriter.base.IAlgebraicRewriteRule)3 SetAlgebricksPhysicalOperatorsRule (org.apache.hyracks.algebricks.rewriter.rules.SetAlgebricksPhysicalOperatorsRule)3 CopyLimitDownRule (org.apache.hyracks.algebricks.rewriter.rules.CopyLimitDownRule)2 EnforceStructuralPropertiesRule (org.apache.hyracks.algebricks.rewriter.rules.EnforceStructuralPropertiesRule)2 PullSelectOutOfEqJoin (org.apache.hyracks.algebricks.rewriter.rules.PullSelectOutOfEqJoin)2 PushProjectDownRule (org.apache.hyracks.algebricks.rewriter.rules.PushProjectDownRule)2 AddEquivalenceClassForRecordConstructorRule (org.apache.asterix.optimizer.rules.AddEquivalenceClassForRecordConstructorRule)1 ConstantFoldingRule (org.apache.asterix.optimizer.rules.ConstantFoldingRule)1 IntroduceMaterializationForInsertWithSelfScanRule (org.apache.asterix.optimizer.rules.IntroduceMaterializationForInsertWithSelfScanRule)1 IntroduceRandomPartitioningFeedComputationRule (org.apache.asterix.optimizer.rules.IntroduceRandomPartitioningFeedComputationRule)1 IntroduceRapidFrameFlushProjectAssignRule (org.apache.asterix.optimizer.rules.IntroduceRapidFrameFlushProjectAssignRule)1 PushLimitIntoOrderByRule (org.apache.asterix.optimizer.rules.PushLimitIntoOrderByRule)1 RemoveSortInFeedIngestionRule (org.apache.asterix.optimizer.rules.RemoveSortInFeedIngestionRule)1 SetAsterixPhysicalOperatorsRule (org.apache.asterix.optimizer.rules.SetAsterixPhysicalOperatorsRule)1 SetupCommitExtensionOpRule (org.apache.asterix.optimizer.rules.SetupCommitExtensionOpRule)1 ConsolidateAssignsRule (org.apache.hyracks.algebricks.rewriter.rules.ConsolidateAssignsRule)1 InlineSingleReferenceVariablesRule (org.apache.hyracks.algebricks.rewriter.rules.InlineSingleReferenceVariablesRule)1 InsertProjectBeforeUnionRule (org.apache.hyracks.algebricks.rewriter.rules.InsertProjectBeforeUnionRule)1 IntroduceProjectsRule (org.apache.hyracks.algebricks.rewriter.rules.IntroduceProjectsRule)1