An approach for processing a query in a database system is disclosed. An
original query is determined to be partially satisfied by a materialized
view. The original query is transformed using a set operation (i.e.,
union and intersection) on the materialized view and either another
materialized view or a base table.