SSAS 度量值组 EstimatedSize EstimatedRows

SSAS Measure Group EstimatedSize EstimatedRows

SSDS 中度量值组的属性面板有两个我想详细了解的属性:EstimatedRows 和 EstimatedSize。关于这两者的文档似乎很少。

我确实发现我可以 运行 聚合设计向导,它不仅会计算行数,还会自动填充每个度量组中的 EstimatedRows 属性。那么问题 #1,SSAS 如何使用这个 属性 并且在任何地方都有记录?

在我的测试立方体中,度量组的 EstimatedSize 属性 是只读的(变灰)。我发现的少量文档暗示我 can/should 设置了这个 属性。问题 #2,为什么这是只读的,有没有关于它的使用的文档?

(我正在使用 SQL Server 2016)

"Microsoft SQL Server 2008 Analysis Services Unleashed" 书上说:

EstimatedSize - 定义您希望加载到分区中的数据量(以字节为单位)。这 属性 有助于 Analysis Services 确定在分区处理期间使用的最佳策略。

EstimatedRows - 定义您希望加载到分区中的记录数。与 EstimatedSize 属性 类似,此 属性 可帮助 Analysis Services 确定在分区处理期间使用的最佳策略。

EstimatedRows - ...如果您知道事实中存在的行数,则可以帮助系统在为数据选择内部数据结构时做出更好的决策用于处理它们的存储和算法。

我同意你的看法,这些属性缺少文档,但我会尝试提供一些关于它们的信息:

SSAS 如何使用这个 属性 并且在任何地方都有记录?

参考SQL Server Analysis 2005 Performance Guide,这是微软发布的白皮书:

Once the aggregation design algorithm has identified the aggregation candidates, it performs a cost/benefit analysis of each aggregation. In order to make intelligent assessments of aggregation costs, the design algorithm analyzes statistics about the cube for each aggregation candidate. Examples of this metadata include member counts and fact table record counts. Ensuring that your metadata is up-to-date can improve the effectiveness of your aggregation design. You can define the fact table source record count in the EstimatedRows property of each measure group, and you can define attribute member count in the EstimatedCount property of each attribute.

为什么这是只读的,有没有关于它的使用的文档?

我没有找到官方文档,但在搜索该主题时,我发现 following answer 提到:

The estimated row count (of each partition) is used by SSAS to determine the necessary storage space of your aggregation design.

也就是说EstimatedSize是根据EstimatedRows属性计算出来的,这就可以解释为什么EstimatedSize是只读的了。

另一方面,following documentation 提到 MeasureGroup.EstimatedSize 属性 用于:

Gets or sets the estimated size of a MeasureGroup

此外,如您所述,此 属性 在 Visual studio 中不符合条件。

据此,我们可以说这个 属性 在 Microsoft.AnalysisServices.dll 程序集中不是只读的,但在 Visual studio 中没有启用,因为它是根据 EstimatedRows 属性。您可以在使用 AMO 程序集或以编程方式构建 SSAS 项目时设置它的值。