Monday, May 19, 2008

SSAS 2005 : Aggregation...Important thing to know!

Aggregations are pre-calculated summaries of data. Specifically, an aggregation contains the summarized values of all measures in a measure group by a combination of different attributes.

How aggregations are used ?

To understand aggregations, consider the cube shown in Figure.


This is a small cube consisting of two dimensions, Date and Product, and one measure, Sales Amount.

The cube has three aggregations contributed by different combinations of attribute hierarchies.
  • The all-level aggregation stores the grand total Sales Amount.
  • The intermediate aggregation stores the total Sales Amount for the year 2004 and Road Bikes product subcategories.
  • Finally, assuming that the fact table references Month and Product dimensions, there is also a fact-level aggregation for July 2004 and product Road-42.


Suppose a query asks for the overall Sales Amount value. The server discovers that this query can be satisfied by the all-level aggregation alone. Rather than having to scan the partition data, the server promptly returns the result from the pre-calculated Sales Amount value taken from this aggregation. Even if there isn't a direct aggregation hit, the server may be able to use intermediate aggregations to derive the result. For example, if the query asks for Sales Amount by product category, the server could use the intermediate aggregation, Year 2004 and Subcategory Road Bikes, to derive the total.


Why not create all possible aggregations?


The short answer is that this will be counter-productive because all those aggregations will require enormous storage space and long processing times. The reason is that aggregations are created when the cube is processed.

Last thing, to help the Aggregation Design Wizard make a correct cost/benefit analysis, be sure to keep the EstimatedCount (attribute property) and EstimatedRows (Measure group property) counts up to date.

To make the good estimation you can use a very useful tool named BIDSHelper .

No comments: