1. A computer-implemented method for rewriting queries, the method 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; wherein the method is performed by one or more computing devices.