Esempio n. 1
0
        internal static bool Process(System.Data.Entity.Core.Query.PlanCompiler.PlanCompiler compilerState)
        {
            JoinElimination joinElimination = new JoinElimination(compilerState);

            joinElimination.Process();
            return(joinElimination.m_treeModified);
        }
Esempio n. 2
0
        internal static bool Process(System.Data.Entity.Core.Query.PlanCompiler.PlanCompiler compilerState, TransformationRulesGroup rulesGroup)
        {
            ReadOnlyCollection <ReadOnlyCollection <System.Data.Entity.Core.Query.InternalTrees.Rule> > rulesTable = (ReadOnlyCollection <ReadOnlyCollection <System.Data.Entity.Core.Query.InternalTrees.Rule> >)null;

            switch (rulesGroup)
            {
            case TransformationRulesGroup.All:
                rulesTable = TransformationRules.AllRulesTable;
                break;

            case TransformationRulesGroup.Project:
                rulesTable = TransformationRules.ProjectRulesTable;
                break;

            case TransformationRulesGroup.PostJoinElimination:
                rulesTable = TransformationRules.PostJoinEliminationRulesTable;
                break;

            case TransformationRulesGroup.NullSemantics:
                rulesTable = TransformationRules.NullSemanticsRulesTable;
                break;
            }
            bool projectionPruningRequired1;

            if (TransformationRules.Process(compilerState, rulesTable, out projectionPruningRequired1))
            {
                bool projectionPruningRequired2;
                TransformationRules.Process(compilerState, TransformationRules.NullabilityRulesTable, out projectionPruningRequired2);
                projectionPruningRequired1 = projectionPruningRequired1 || projectionPruningRequired2;
            }
            return(projectionPruningRequired1);
        }
Esempio n. 3
0
 internal TransformationRulesContext(System.Data.Entity.Core.Query.PlanCompiler.PlanCompiler compilerState)
     : base(compilerState.Command)
 {
     this.m_compilerState = compilerState;
     this.m_remapper      = new VarRemapper(compilerState.Command);
     this.m_suppressions  = new Dictionary <System.Data.Entity.Core.Query.InternalTrees.Node, System.Data.Entity.Core.Query.InternalTrees.Node>();
     this.m_remappedVars  = compilerState.Command.CreateVarVec();
 }
Esempio n. 4
0
 internal static void Process(
     System.Data.Entity.Core.Query.PlanCompiler.PlanCompiler compilerState,
     out List <ProviderCommandInfo> childCommands,
     out ColumnMap resultColumnMap,
     out int columnCount)
 {
     new CodeGen(compilerState).Process(out childCommands, out resultColumnMap, out columnCount);
 }
Esempio n. 5
0
        private static bool Process(
            System.Data.Entity.Core.Query.PlanCompiler.PlanCompiler compilerState,
            ReadOnlyCollection <ReadOnlyCollection <System.Data.Entity.Core.Query.InternalTrees.Rule> > rulesTable,
            out bool projectionPruningRequired)
        {
            RuleProcessor ruleProcessor = new RuleProcessor();
            TransformationRulesContext transformationRulesContext = new TransformationRulesContext(compilerState);

            compilerState.Command.Root = ruleProcessor.ApplyRulesToSubtree((RuleProcessingContext)transformationRulesContext, rulesTable, compilerState.Command.Root);
            projectionPruningRequired  = transformationRulesContext.ProjectionPrunningRequired;
            return(transformationRulesContext.ReapplyNullabilityRules);
        }
Esempio n. 6
0
 internal static System.Data.Entity.Core.Query.InternalTrees.Node Process(
     System.Data.Entity.Core.Query.PlanCompiler.PlanCompiler compilerState,
     System.Data.Entity.Core.Query.InternalTrees.Node node)
 {
     return(new ProjectionPruner(compilerState).Process(node));
 }
Esempio n. 7
0
 internal static void Process(System.Data.Entity.Core.Query.PlanCompiler.PlanCompiler compilerState)
 {
     compilerState.Command.Root = ProjectionPruner.Process(compilerState, compilerState.Command.Root);
 }
Esempio n. 8
0
 private ProjectionPruner(System.Data.Entity.Core.Query.PlanCompiler.PlanCompiler compilerState)
 {
     this.m_compilerState  = compilerState;
     this.m_referencedVars = compilerState.Command.CreateVarVec();
 }
Esempio n. 9
0
 private JoinElimination(System.Data.Entity.Core.Query.PlanCompiler.PlanCompiler compilerState)
 {
     this.m_compilerState = compilerState;
     this.m_varRemapper   = new VarRemapper(this.m_compilerState.Command);
     this.m_varRefManager = new VarRefManager(this.m_compilerState.Command);
 }
Esempio n. 10
0
 private CodeGen(System.Data.Entity.Core.Query.PlanCompiler.PlanCompiler compilerState)
 {
     this.m_compilerState = compilerState;
 }
Esempio n. 11
0
 protected SubqueryTrackingVisitor(System.Data.Entity.Core.Query.PlanCompiler.PlanCompiler planCompilerState)
 {
     this.m_compilerState = planCompilerState;
 }
 internal static void Process(System.Data.Entity.Core.Query.PlanCompiler.PlanCompiler planCompilerState)
 {
     new AggregatePushdown(planCompilerState.Command).Process();
 }
Esempio n. 13
0
 internal static void Process(System.Data.Entity.Core.Query.PlanCompiler.PlanCompiler planCompilerState)
 {
     new Normalizer(planCompilerState).Process();
 }
Esempio n. 14
0
 private Normalizer(System.Data.Entity.Core.Query.PlanCompiler.PlanCompiler planCompilerState)
     : base(planCompilerState)
 {
 }