Search in sources :

Example 1 with PushProjectDownRule

use of org.apache.hyracks.algebricks.rewriter.rules.PushProjectDownRule 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 2 with PushProjectDownRule

use of org.apache.hyracks.algebricks.rewriter.rules.PushProjectDownRule 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 3 with PushProjectDownRule

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

the class RuleCollections method buildPlanCleanupRuleCollection.

public static final List<IAlgebraicRewriteRule> buildPlanCleanupRuleCollection() {
    List<IAlgebraicRewriteRule> planCleanupRules = new LinkedList<>();
    planCleanupRules.add(new SwitchInnerJoinBranchRule());
    planCleanupRules.add(new PushAssignBelowUnionAllRule());
    planCleanupRules.add(new ExtractCommonExpressionsRule());
    planCleanupRules.add(new RemoveRedundantVariablesRule());
    planCleanupRules.add(new PushProjectDownRule());
    planCleanupRules.add(new PushSelectDownRule());
    planCleanupRules.add(new SetClosedRecordConstructorsRule());
    planCleanupRules.add(new IntroduceDynamicTypeCastRule());
    planCleanupRules.add(new IntroduceDynamicTypeCastForExternalFunctionRule());
    planCleanupRules.add(new RemoveUnusedAssignAndAggregateRule());
    planCleanupRules.add(new RemoveCartesianProductWithEmptyBranchRule());
    planCleanupRules.add(new InjectTypeCastForSwitchCaseRule());
    planCleanupRules.add(new InjectTypeCastForUnionRule());
    // Needs to invoke ByNameToByIndexFieldAccessRule as the last logical optimization rule because
    // some rules can push a FieldAccessByName to a place where the name it tries to access is in the closed part.
    // For example, a possible scenario is that a field-access-by-name can be pushed down through UnionAllOperator.
    planCleanupRules.add(new ByNameToByIndexFieldAccessRule());
    return planCleanupRules;
}
Also used : IntroduceDynamicTypeCastRule(org.apache.asterix.optimizer.rules.IntroduceDynamicTypeCastRule) ByNameToByIndexFieldAccessRule(org.apache.asterix.optimizer.rules.ByNameToByIndexFieldAccessRule) PushProjectDownRule(org.apache.hyracks.algebricks.rewriter.rules.PushProjectDownRule) SwitchInnerJoinBranchRule(org.apache.hyracks.algebricks.rewriter.rules.SwitchInnerJoinBranchRule) IntroduceDynamicTypeCastForExternalFunctionRule(org.apache.asterix.optimizer.rules.IntroduceDynamicTypeCastForExternalFunctionRule) ExtractCommonExpressionsRule(org.apache.hyracks.algebricks.rewriter.rules.ExtractCommonExpressionsRule) PushAssignBelowUnionAllRule(org.apache.hyracks.algebricks.rewriter.rules.PushAssignBelowUnionAllRule) LinkedList(java.util.LinkedList) PushSelectDownRule(org.apache.hyracks.algebricks.rewriter.rules.PushSelectDownRule) RemoveCartesianProductWithEmptyBranchRule(org.apache.hyracks.algebricks.rewriter.rules.RemoveCartesianProductWithEmptyBranchRule) IAlgebraicRewriteRule(org.apache.hyracks.algebricks.core.rewriter.base.IAlgebraicRewriteRule) InjectTypeCastForUnionRule(org.apache.asterix.optimizer.rules.InjectTypeCastForUnionRule) SetClosedRecordConstructorsRule(org.apache.asterix.optimizer.rules.SetClosedRecordConstructorsRule) RemoveRedundantVariablesRule(org.apache.hyracks.algebricks.rewriter.rules.RemoveRedundantVariablesRule) RemoveUnusedAssignAndAggregateRule(org.apache.hyracks.algebricks.rewriter.rules.RemoveUnusedAssignAndAggregateRule) InjectTypeCastForSwitchCaseRule(org.apache.asterix.optimizer.rules.InjectTypeCastForSwitchCaseRule)

Example 4 with PushProjectDownRule

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

the class PigletRewriteRuleset method buildOpPushDownRuleCollection.

public static final List<IAlgebraicRewriteRule> buildOpPushDownRuleCollection() {
    List<IAlgebraicRewriteRule> opPushDown = new LinkedList<IAlgebraicRewriteRule>();
    opPushDown.add(new PushProjectDownRule());
    opPushDown.add(new PushSelectDownRule());
    return opPushDown;
}
Also used : PushProjectDownRule(org.apache.hyracks.algebricks.rewriter.rules.PushProjectDownRule) IAlgebraicRewriteRule(org.apache.hyracks.algebricks.core.rewriter.base.IAlgebraicRewriteRule) LinkedList(java.util.LinkedList) PushSelectDownRule(org.apache.hyracks.algebricks.rewriter.rules.PushSelectDownRule)

Aggregations

LinkedList (java.util.LinkedList)4 IAlgebraicRewriteRule (org.apache.hyracks.algebricks.core.rewriter.base.IAlgebraicRewriteRule)4 PushProjectDownRule (org.apache.hyracks.algebricks.rewriter.rules.PushProjectDownRule)4 EnforceStructuralPropertiesRule (org.apache.hyracks.algebricks.rewriter.rules.EnforceStructuralPropertiesRule)2 PullSelectOutOfEqJoin (org.apache.hyracks.algebricks.rewriter.rules.PullSelectOutOfEqJoin)2 PushSelectDownRule (org.apache.hyracks.algebricks.rewriter.rules.PushSelectDownRule)2 RemoveUnusedAssignAndAggregateRule (org.apache.hyracks.algebricks.rewriter.rules.RemoveUnusedAssignAndAggregateRule)2 SetAlgebricksPhysicalOperatorsRule (org.apache.hyracks.algebricks.rewriter.rules.SetAlgebricksPhysicalOperatorsRule)2 AddEquivalenceClassForRecordConstructorRule (org.apache.asterix.optimizer.rules.AddEquivalenceClassForRecordConstructorRule)1 ByNameToByIndexFieldAccessRule (org.apache.asterix.optimizer.rules.ByNameToByIndexFieldAccessRule)1 InjectTypeCastForSwitchCaseRule (org.apache.asterix.optimizer.rules.InjectTypeCastForSwitchCaseRule)1 InjectTypeCastForUnionRule (org.apache.asterix.optimizer.rules.InjectTypeCastForUnionRule)1 IntroduceDynamicTypeCastForExternalFunctionRule (org.apache.asterix.optimizer.rules.IntroduceDynamicTypeCastForExternalFunctionRule)1 IntroduceDynamicTypeCastRule (org.apache.asterix.optimizer.rules.IntroduceDynamicTypeCastRule)1 IntroduceMaterializationForInsertWithSelfScanRule (org.apache.asterix.optimizer.rules.IntroduceMaterializationForInsertWithSelfScanRule)1 RemoveSortInFeedIngestionRule (org.apache.asterix.optimizer.rules.RemoveSortInFeedIngestionRule)1 SetAsterixPhysicalOperatorsRule (org.apache.asterix.optimizer.rules.SetAsterixPhysicalOperatorsRule)1 SetClosedRecordConstructorsRule (org.apache.asterix.optimizer.rules.SetClosedRecordConstructorsRule)1 SetupCommitExtensionOpRule (org.apache.asterix.optimizer.rules.SetupCommitExtensionOpRule)1 ConsolidateAssignsRule (org.apache.hyracks.algebricks.rewriter.rules.ConsolidateAssignsRule)1