示例#1
0
        public static bool RewriteQuery(T_Tile toFill, T_Tile toAvoid, out T_Tile rewriting, List <T_Tile> views, RewritingProcessor <T_Tile> qp)
        {
            RewritingPass <T_Tile> rewritingPass = new RewritingPass <T_Tile>(toFill, toAvoid, views, qp);

            if (rewritingPass.RewriteQuery(out rewriting))
            {
                RewritingSimplifier <T_Tile> .TrySimplifyUnionRewriting(ref rewriting, toFill, toAvoid, qp);

                return(true);
            }
            return(false);
        }
示例#2
0
        private static bool RewriteQueryInternal(T_Tile toFill, T_Tile toAvoid, out T_Tile rewriting, List <T_Tile> views, HashSet <T_Tile> recentlyUsedViews, RewritingProcessor <T_Tile> qp)
        {
            if (qp.REORDER_VIEWS && recentlyUsedViews.Count > 0)
            {
                // move recently used views toward the end
                List <T_Tile> reorderedViews = new List <T_Tile>();
                foreach (T_Tile view in views)
                {
                    if (false == recentlyUsedViews.Contains(view))
                    {
                        reorderedViews.Add(view);
                    }
                }
                reorderedViews.AddRange(recentlyUsedViews);
                views = reorderedViews;
            }

            RewritingPass <T_Tile> rewritingPass = new RewritingPass <T_Tile>(toFill, toAvoid, views, qp);

            return(rewritingPass.RewriteQuery(out rewriting));
        }
示例#3
0
        public bool RewriteQueryOnce(T_Tile toFill, T_Tile toAvoid, IEnumerable <T_Tile> views, out T_Tile rewriting)
        {
            List <T_Tile> viewList = new List <T_Tile>(views);

            return(RewritingPass <T_Tile> .RewriteQuery(toFill, toAvoid, out rewriting, viewList, this));
        }