A computer-implemented method of using a database management system (DBMS)
for providing an aggregate of a plurality of entities, constructing an
aggregate of said plurality of entities in a memory to provide a result,
and returning the result from the memory. Constructing the aggregate in
memory includes storing in the memory a plurality of intermediate
aggregation results each associated with a unique identifier. The unique
identifier for each intermediate result is stored in the DBMS. Each
unique identifier indicates information identifying a position within a
sequence of generating the intermediate result and a pointer to a
location in the memory where that intermediate result is stored.