Example #1
0
        /// <summary>
        ///     Creates a transitively generated join edge
        /// </summary>
        /// <param name="left"> the left table </param>
        /// <param name="right"> the right table </param>
        /// <param name="joinKind"> the join kind </param>
        /// <param name="leftVars"> left equijoin vars </param>
        /// <param name="rightVars"> right equijoin vars </param>
        /// <returns> the join edge </returns>
        internal static JoinEdge CreateTransitiveJoinEdge(
            AugmentedTableNode left, AugmentedTableNode right, JoinKind joinKind,
            List <ColumnVar> leftVars, List <ColumnVar> rightVars)
        {
            var joinEdge = new JoinEdge(left, right, null, joinKind, leftVars, rightVars);

            return(joinEdge);
        }
Example #2
0
 internal AugmentedTableNode(int id, Node node)
     : base(id, node)
 {
     this.m_table            = ((ScanTableBaseOp)node.Op).Table;
     this.LastVisibleId      = id;
     this.m_replacementTable = this;
     this.m_newLocationId    = id;
 }
        // List of columns of this table that are nullable (and must have nulls pruned out)

        #endregion

        #region constructors

        /// <summary>
        /// Basic constructor
        /// </summary>
        /// <param name="id">node id</param>
        /// <param name="node">scan table node</param>
        internal AugmentedTableNode(int id, Node node)
            : base(id, node)
        {
            var scanTableOp = (ScanTableOp)node.Op;
            m_table = scanTableOp.Table;
            LastVisibleId = id;
            m_replacementTable = this;
            m_newLocationId = id;
        }
Example #4
0
 internal static JoinEdge CreateTransitiveJoinEdge(
     AugmentedTableNode left,
     AugmentedTableNode right,
     JoinKind joinKind,
     List <ColumnVar> leftVars,
     List <ColumnVar> rightVars)
 {
     return(new JoinEdge(left, right, (AugmentedJoinNode)null, joinKind, leftVars, rightVars));
 }
        // List of columns of this table that are nullable (and must have nulls pruned out)

        #endregion

        #region constructors

        /// <summary>
        ///     Basic constructor
        /// </summary>
        /// <param name="id"> node id </param>
        /// <param name="node"> scan table node </param>
        internal AugmentedTableNode(int id, Node node)
            : base(id, node)
        {
            var scanTableOp = (ScanTableOp)node.Op;

            m_table            = scanTableOp.Table;
            LastVisibleId      = id;
            m_replacementTable = this;
            m_newLocationId    = id;
        }
Example #6
0
 private JoinEdge(
     AugmentedTableNode left, AugmentedTableNode right,
     AugmentedJoinNode joinNode, JoinKind joinKind,
     List <ColumnVar> leftVars, List <ColumnVar> rightVars)
 {
     m_left      = left;
     m_right     = right;
     JoinKind    = joinKind;
     m_joinNode  = joinNode;
     m_leftVars  = leftVars;
     m_rightVars = rightVars;
     PlanCompiler.Assert(m_leftVars.Count == m_rightVars.Count, "Count mismatch: " + m_leftVars.Count + "," + m_rightVars.Count);
 }
Example #7
0
 private JoinEdge(
     AugmentedTableNode left, AugmentedTableNode right,
     AugmentedJoinNode joinNode, JoinKind joinKind,
     List<ColumnVar> leftVars, List<ColumnVar> rightVars)
 {
     m_left = left;
     m_right = right;
     JoinKind = joinKind;
     m_joinNode = joinNode;
     m_leftVars = leftVars;
     m_rightVars = rightVars;
     PlanCompiler.Assert(m_leftVars.Count == m_rightVars.Count, "Count mismatch: " + m_leftVars.Count + "," + m_rightVars.Count);
 }
Example #8
0
 private JoinEdge(
     AugmentedTableNode left,
     AugmentedTableNode right,
     AugmentedJoinNode joinNode,
     JoinKind joinKind,
     List <ColumnVar> leftVars,
     List <ColumnVar> rightVars)
 {
     this.m_left      = left;
     this.m_right     = right;
     this.JoinKind    = joinKind;
     this.m_joinNode  = joinNode;
     this.m_leftVars  = leftVars;
     this.m_rightVars = rightVars;
     System.Data.Entity.Core.Query.PlanCompiler.PlanCompiler.Assert((this.m_leftVars.Count == this.m_rightVars.Count ? 1 : 0) != 0, "Count mismatch: " + (object)this.m_leftVars.Count + "," + (object)this.m_rightVars.Count);
 }
Example #9
0
        internal static JoinEdge CreateJoinEdge(
            AugmentedTableNode left,
            AugmentedTableNode right,
            AugmentedJoinNode joinNode,
            ColumnVar leftVar,
            ColumnVar rightVar)
        {
            List <ColumnVar> leftVars  = new List <ColumnVar>();
            List <ColumnVar> rightVars = new List <ColumnVar>();

            leftVars.Add(leftVar);
            rightVars.Add(rightVar);
            OpType opType = joinNode.Node.Op.OpType;

            System.Data.Entity.Core.Query.PlanCompiler.PlanCompiler.Assert(opType == OpType.LeftOuterJoin || opType == OpType.InnerJoin, "Unexpected join type for join edge: " + (object)opType);
            JoinKind joinKind = opType == OpType.LeftOuterJoin ? JoinKind.LeftOuter : JoinKind.Inner;

            return(new JoinEdge(left, right, joinNode, joinKind, leftVars, rightVars));
        }
Example #10
0
        internal static JoinEdge CreateJoinEdge(
            AugmentedTableNode left, AugmentedTableNode right,
            AugmentedJoinNode joinNode,
            ColumnVar leftVar, ColumnVar rightVar)
        {
            var leftVars  = new List <ColumnVar>();
            var rightVars = new List <ColumnVar>();

            leftVars.Add(leftVar);
            rightVars.Add(rightVar);

            var joinOpType = joinNode.Node.Op.OpType;

            PlanCompiler.Assert(
                (joinOpType == OpType.LeftOuterJoin || joinOpType == OpType.InnerJoin),
                "Unexpected join type for join edge: " + joinOpType);

            var joinKind = joinOpType == OpType.LeftOuterJoin ? JoinKind.LeftOuter : JoinKind.Inner;

            var joinEdge = new JoinEdge(left, right, joinNode, joinKind, leftVars, rightVars);

            return(joinEdge);
        }
Example #11
0
 // <summary>
 // Creates a transitively generated join edge
 // </summary>
 // <param name="left"> the left table </param>
 // <param name="right"> the right table </param>
 // <param name="joinKind"> the join kind </param>
 // <param name="leftVars"> left equijoin vars </param>
 // <param name="rightVars"> right equijoin vars </param>
 // <returns> the join edge </returns>
 internal static JoinEdge CreateTransitiveJoinEdge(
     AugmentedTableNode left, AugmentedTableNode right, JoinKind joinKind,
     List<ColumnVar> leftVars, List<ColumnVar> rightVars)
 {
     var joinEdge = new JoinEdge(left, right, null, joinKind, leftVars, rightVars);
     return joinEdge;
 }
Example #12
0
        internal static JoinEdge CreateJoinEdge(
            AugmentedTableNode left, AugmentedTableNode right,
            AugmentedJoinNode joinNode,
            ColumnVar leftVar, ColumnVar rightVar)
        {
            var leftVars = new List<ColumnVar>();
            var rightVars = new List<ColumnVar>();
            leftVars.Add(leftVar);
            rightVars.Add(rightVar);

            var joinOpType = joinNode.Node.Op.OpType;
            PlanCompiler.Assert(
                (joinOpType == OpType.LeftOuterJoin || joinOpType == OpType.InnerJoin),
                "Unexpected join type for join edge: " + joinOpType);

            var joinKind = joinOpType == OpType.LeftOuterJoin ? JoinKind.LeftOuter : JoinKind.Inner;

            var joinEdge = new JoinEdge(left, right, joinNode, joinKind, leftVars, rightVars);
            return joinEdge;
        }