1. A method, comprising: for a temporal hierarchy of aggregation statistics associated with a plurality of database records, wherein the temporal hierarchy comprises two or more aggregation statistics levels and each level has a different temporal granularity associated therewith, iteratively modifying the temporal hierarchy to at least one of: (a) minimize a storage usage cost while satisfying a temporal hierarchy update constraint and a query response time constraint by removing one or more levels of the temporal hierarchy; (b) reduce a temporal hierarchy update time and a query response time while satisfying a storage usage constraint by adding one or more levels to the temporal hierarchy; and (c) minimize a query response time for frequently applied queries that do not shift in time while satisfying the storage usage constraint by adding one or more nodes to the temporal hierarchy, wherein the resulting temporal hierarchy that achieves at least one of (a), (b) and (c) is identified as an optimal temporal hierarchy; wherein the temporal hierarchy is stored in a memory and the iterative modifying of the temporal hierarchy is performed by a processor device.