1. A method of optimizing evaluation of queries in a database management system, comprising: determining building blocks that can be used to generate valid partial execution plans, wherein at least one of said building blocks is a materialized view; and generating a plurality of execution plans for a query using said building blocks, wherein at least one of said execution plans includes a materialized view.