NextAnalysisStep (clsPartitionAnalyzer)
The NextAnalysisStep method of an object of ClassType clsPartitionAnalyzer adds a set of aggregations to the DesignedAggregations collection. It calculates the improved query performance and the storage requirements for the new aggregations.
Syntax
bRet = object. NextAnalysisStep(PercentageBenefit As Double, AccumulatedSize As Double, AggregationsCount As Long)
bRet
This value is True if the method completed successfully, False otherwise.
object
The object of ClassType clsPartitionAnalyzer used to perform the analysis.
PercentageBenefit
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 is an output parameter.
AccumulatedSize
The estimated hard disk storage requirements (in bytes) for the current collection of DesignedAggregations. This is an output parameter.
AggregationsCount
The number of aggregations contained in the current collection of DesignedAggregations. This is an output parameter.
Remarks
NextAnalysisStep analyzes the schema of a partition and generates a collection of aggregations that improves query performance. You can run the analysis without constraints. If no constraints are specified, the analysis yields a generalized optimization. For more information, see AddGoalQuery and PrepareGoalQueries.
Example
Use the following code to run a series of analyses until either of the following two goals is reached:
- Twenty or more aggregations are designed.
- The storage requirements for the designed aggregations exceed 100,000 bytes.
For more information, see CloseAggregationsAnalysis and InitializeDesign.
Place the following code in your form's Declarations section:
' Assume the existence of an object (dsoPartAnalyzer) of ClassType
' clsPartitionAnalyzer.
Private blnStopAdding As Boolean
Private dblPercentageBenefit As Double
Private dblAccumulatedSize As Double
Private lngAggregationsCount As Long
' Iterate through analysis until either goal is reached.
Do Until blnStopAdding
If Not dsoPartAnalyzer.NextAnalysisStep(dblPercentageBenefit, _
dblAccumulatedSize, lngAggregationsCount) Then
blnStopAdding = True 'No new aggregations designed.
Else
blnStopAdding = (lngAggregationsCount >= 20) Or _
(dblAccumulatedSize >= 100000)
End If
Loop