12. A computer-readable volatile or non-volatile medium storing one or more sequences of instructions that comprise instructions for rewriting queries, which instructions when executed by one or more processors cause the one or more processors to perform steps comprising: storing a plurality of materialized views, wherein a definition of each materialized view of the plurality of materialized views includes a set of aggregate expressions, and wherein storing said each materialized view comprises: identifying first one or more disjuncts in the set of aggregate expressions; wherein each of the set of aggregate expressions is an expression that specifies, in the definition of said each materialized view, computation of aggregated data; wherein each of the first one or more disjuncts is an expression block, included within one or more of the set of aggregate expressions, that identifies at least one column and at least one algebraic operator; and generating, based on the first one or more disjuncts, a set of disjunct trees that represent the set of aggregate expressions; storing the set of disjunct trees in computer data storage; receiving a query that requests particular aggregated data, wherein the query comprises an aggregate expression that specifies how the particular aggregated data is to be computed; identifying second one or more disjuncts in the aggregate expression; generating, based on the second one or more disjuncts, a disjunct tree that represents the aggregate expression; based on the disjunct tree and on the set of disjunct trees associated with said each materialized view of the plurality of materialized views, determining a particular materialized view from the plurality of materialized views that stores the particular aggregated data specified by the aggregate expression; and rewriting the query into an equivalent query that references the particular materialized view, wherein the equivalent query when executed would retrieve the particular aggregated data from the particular materialized view.
12. A computer-readable volatile or non-volatile medium storing one or more sequences of instructions that comprise instructions for rewriting queries, which instructions when executed by one or more processors cause the one or more processors to perform steps comprising: storing a plurality of materialized views, wherein a definition of each materialized view of the plurality of materialized views includes a set of aggregate expressions, and wherein storing said each materialized view comprises: identifying first one or more disjuncts in the set of aggregate expressions; wherein each of the set of aggregate expressions is an expression that specifies, in the definition of said each materialized view, computation of aggregated data; wherein each of the first one or more disjuncts is an expression block, included within one or more of the set of aggregate expressions, that identifies at least one column and at least one algebraic operator; and generating, based on the first one or more disjuncts, a set of disjunct trees that represent the set of aggregate expressions; storing the set of disjunct trees in computer data storage; receiving a query that requests particular aggregated data, wherein the query comprises an aggregate expression that specifies how the particular aggregated data is to be computed; identifying second one or more disjuncts in the aggregate expression; generating, based on the second one or more disjuncts, a disjunct tree that represents the aggregate expression; based on the disjunct tree and on the set of disjunct trees associated with said each materialized view of the plurality of materialized views, determining a particular materialized view from the plurality of materialized views that stores the particular aggregated data specified by the aggregate expression; and rewriting the query into an equivalent query that references the particular materialized view, wherein the equivalent query when executed would retrieve the particular aggregated data from the particular materialized view. 13. The computer-readable volatile or non-volatile medium of claim 12 , wherein each disjunct tree of the set of disjunct trees includes one or more leaf nodes, wherein each of the one or more leaf nodes is associated with one disjunct of the first one or more disjuncts, and wherein all of the one or more leaf nodes are arranged at the same depth level in said each disjunct tree.