A method, apparatus, and article of manufacture for optimizing database
queries using subsumption tests between the query and at least one summary
table that comprises a cube index to determine whether an expression in
the query can be subsumed in the summary table. The summary table stores
at least one materialized view involving at least one GROUP BY operation
that computes at least one of the following: (1) a cube, (2) a rollup, (3)
a grouping set, and (4) a concatenation of cubes, rollups, grouping sets,
and one or more grouping items. When the expression in the query can be
subsumed in the summary table, the query is rewritten to use the summary
table.