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, wherein said generating step comprises: adding a table to an access plan when said materialized view using said table is not already represented in said access plan; and adding said materialized view to said access plan when said access plan does not already contain any table referenced by said materialized view, wherein said determining, said generating and said adding steps are implemented on one or more processors.