AddExistingAggregation

The clsPartitionAnalyzer AddExistingAggregation method adds a specified aggregation to the DesignedAggregations collection and returns the calculated percentage performance gain (dblPercentageBenefit), aggregation storage requirements (dblAccumulatedSize), and total number of aggregations created (lngAggregationsCount) based upon the inclusion of this aggregation.

This method allows you to evaluate the impact of a particular aggregation on query performance. Subsequent analysis steps performed either by adding another existing aggregation or by using the NextAnalysisStep method will include this aggregation.

Syntax

dsoPartAnalyzer. AddExistingAggregation(Aggregation, dblPercentageBenefit, dblAccumulatedSize, lngAggregationsCount)

dsoPartAnalyzer
The object of ClassType clsPartitionAnalyzer used to perform the analysis.
Aggregation
The aggregation you want to add.
dblPercentageBenefit
The estimated percentage performance improvement that would be realized using the current collection of DesignedAggregations as opposed to querying against the underlying fact table. This variable is passed by reference.
dblAccumulatedSize
The estimated hard disk storage requirements (in bytes) for the current collection of DesignedAggregations. This variable is passed by reference.
lngAggregationsCount
The number of aggregations contained in the current collection of DesignedAggregations.
Example

Use the following code to add an aggregation, from an existing partition's MDStores (objects of ClassType clsAggregation) collection, named Agg123 to the DesignedAggregations collection and then run several analysis steps. The analysis continues until one of the following two goals is reached.

For more information, see InitializeDesign.

'Assume an object (dsoCube) of ClassType clsCube exists

'with two partitions referenced by partition objects

'dsoPart1 and dsoPart2

Dim bStopAdding As Boolean

Dim dblPercentageBenefit   As Double

Dim dblAccumulatedSize     As Double

Dim lngAggregationsCount   As Long

'Get existing aggregation "Agg123" from first partition

Dim dsoExistAgg As DSO.MDStore

Set dsoExistAgg = dsoPart1.MDStores("Agg123")

'Add aggregation to second partition

Dim dsoPartAnalyzer As DSO.PartitionAnalyzer

Set dsoPartAnalyzer = dsoPart2.Analyzer

dsoPartAnalyzer.AddExistingAggregation dsoExistAgg, _

  dblPercentageBenefit, dblAccumulatedSize, lngAggregationsCount

dsoPartAnalyzer.InitializeDesign

'Iterate thru analysis until either goal is reached

Do Until bStopAdding 

    If Not dsoPartAnalyzer.NextAnalysisStep(dblPercentageBenefit, _

    dblAccumulatedSize, lngAggregationsCount) Then

        bStopAdding = True 'No New Aggregations Designed

    Else

        bStopAdding = (lngAggregationsCount >= 20) Or _

        (dblAccumulatedSize >= 100000)

    End If

Loop

See Also
clsAggregation clsPartitionAnalyzer
clsPartition Using Decision Support Objects

(c) 1988-1998 Microsoft Corporation. All Rights Reserved.