Systems, methods and computer program products for optimization of query
evaluation using materialized views in a database management system
(DBMS) are described herein. During a pre-optimization phase, building
blocks are generated that can be used to generate valid partial execution
plans, where at least one of the building blocks can be a materialized
view. During an enumeration phase, a plurality of execution plans for the
query are generated using the building blocks. Some of the execution
plans may include materialized views.