1. A method of optimizing a computer for performing queries of a database, the database storing a plurality of metric records in a computer memory, each metric record comprising at least one measure data value and a plurality of hierarchy data values, wherein each hierarchy data value is in a hierarchy dimension, wherein each hierarchy dimension comprises at least one hierarchy level, said at least one hierarchy level including a lowest hierarchy level, wherein each hierarchy level comprises at least one distinct hierarchy member; and wherein each hierarchy data value matches a hierarchy member in the lowest level of the corresponding hierarchy dimension, the method comprising: a) determining the number of distinct members of the lowest hierarchy level of each hierarchy dimension and determining a unique hierarchy identifier (ID) for such distinct member; b) determining the hierarchy dimension having the fewest number of distinct members in its lowest level; c) ranking the hierarchy dimensions by number of distinct members in the respective lowest level; d) generating a first hypergraph tree for the hierarchy dimension having the fewest number of distinct members in its lowest level, wherein the first hypergraph tree comprises a tier for each hierarchy dimension; e) generating an additional hypergraph tree for a hierarchy dimension having more than the fewest number of distinct members in its lowest level, wherein the additional hypergraph tree comprises at least one tier for a hierarchy dimension but the additional hypergraph tree has fewer than the number of tiers in the first hypergraph tree; f) wherein each hypergraph tree comprises a plurality of nodes, and wherein each node corresponds to one of the unique hierarchy IDs, and wherein each node comprises at least one edge weighting comprising a determined measure data value; g) wherein all of the nodes in a tier correspond to the same hierarchy dimension.