Abstract. Rewriting of conjunctive queries using views has many applications in database and data integration. We investigate ways to improve performance of rewriting and propose a new algorithm which has two phases. In the first phase, similar to Minicon, we find mapping information, which we call coverages, from subgoals in the query to subgoals in view, and assign positive integers (< 2n ) as identifiers to these coverages, where n is the number of subgoals in the query. In the rewriting phase, based on the available identifiers and partitions of the set {1, ..., 2n-1 }, we define patterns and use them to encode the buckets and the coverages they contain. This breaks the cartesian product of a set of large buckets into several cartesian products on sets of smaller buckets. In other words, an expensive cartesian product could be broken into a maximum of B(n) small cartesian products, where B is the Bell number. Our numerous experiments using different query types and sizes indicat...