We consider the problem of selecting views and indexes that minimize the evaluation costs of the important queries under an upper bound on the disk space available for storing the views/indexes selected to be materialized. We propose a novel end-to-end approach that focuses on systematic exploration of plans for evaluating the queries. Specifically, we propose a framework (architecture) and algorithms that enable selection of views/indexes that contribute to the most efficient plans for the input queries, subject to the space bound. We present strong optimality guarantees on our architecture. Our algorithms search for sets of competitive plans for queries expressed in the language of conjunctive queries with arithmetic comparisons. This language captures the full expressive power of SQL select-project-join queries, which are common in practical database systems. Our experimental results demonstrate the competitiveness and scalability of our approach.