《Microsoft SQL Server 2008 Analysis Services Step by Step》学习笔记十四:设计聚合(Aggregation)(上)

SQL Server 2008中SQL应用系列及BI笔记系列--目录索引

导读:本文介绍Analysis Services中与聚合(Aggregations)相关的设计

本文将包括以下内容:

■1、使用Aggregation设计向导设计Aggregation

■2、通过创建属性关联和用户自定义层次来改善Aggregation

■3、使用AggregationUsage特性控制一个属性的聚合

■4、设计一个独立的Aggregation

■5、通过长期的数据量的估算改善Aggregation(Improve aggregation design by using long-term estimates of data volume)

■6、启用Analysis Services查询日志

■7、基于使用Usage-Based的优化向导的日志查询设计Aggregation

本文末尾提供两个项目源码:AdventureWorks_BI_Begin13和AdventureWorks_BI_End13,顾名思义,开始和完成。另外,包括数据库文件SSAS2008SBS_Data,请读者自行修改数据源ds的连接串。

 

1、使用聚合向导设计聚合

下面我们使用聚合设计向导在Reseller Sales度量组中设计聚合。

邀月工作室

邀月工作室

邀月工作室

其中Aggregation Usage的选项如下:

①默认值(Default) 选择此选项可以将属性的聚合使用情况设置设为默认值。 使用此设置后,设计器将根据属性和维度的类型应用默认规则。
②完全(Full) 选择此选项可以将属性的聚合使用情况设置设置为 Full。 使用此设置后,多维数据集的每个聚合都必须包含此属性或属性链中较低的相关属性。 如果属性包含有多个成员,则应避免使用 Full 聚合使用情况设置。 如果为多个属性或具有多个成员的属性指定了此设置,则此设置可能会以尺寸过大为由,阻止设计聚合。
③无(None)选择此选项可以将属性的聚合使用情况设置设置为 None。 使用此设置后,多维数据集的聚合中将不会包含此属性。
④无限制(Unrestricted)选择此选项可以将属性的聚合使用情况设置设置为 Unrestricted。 使用此设置后,聚合设计器将不会受到任何限制,但是仍必须估算属性以确定它是否是一个有价值的聚合候选项。

全部设为默认值(Set All to Default) 选择此选项可以将所有属性的聚合使用情况设置设为默认值。来自MSDN(http://msdn.microsoft.com/en-us/library/bb934053.aspx

邀月工作室

邀月工作室

邀月工作室

邀月工作室


2-3、属性关系、自定义层次、聚合设计

下面我们在Product维度中修改属性关联,并提示Analysis Services,由Category,Subcategory,Product, Product ID组成一个自然层次。

Analysis Services不能充分利用已经存在于Product维度的自然层次关系,例如,Analysis Services想要提取一个category,必须聚合所有Product ID

现在Analysis Services能直接从SubCategory聚合得到Category,从Product聚合得到SubCategory

 邀月工作室

邀月工作室

邀月工作室

邀月工作室

邀月工作室

邀月工作室

邀月工作室

下面我们自定义Product by Category自然层次和Size by Color非自然层次,我们来看看这两个自定义层次如何影响aggregation的可选属性池。

邀月工作室

邀月工作室

邀月工作室

邀月工作室

邀月工作室

我们添加一个新的聚合

邀月工作室

邀月工作室

邀月工作室

邀月工作室

重要提示:When you change the AggregationUsage property on the Review Aggregation Usage page, the value of the property is changed for the attribute for the cube If you only want to change the value of the property for the aggregation design that you are currently creating, you must change it back after you complete the wizard

邀月工作室

邀月工作室

邀月工作室

邀月工作室

邀月工作室

邀月工作室

邀月工作室

注意: that because they were added to the pool of eligible attributes, there are aggregations containing the leaf level members of the Product, Color, Size, and Subcategory attribute hierarchies. Just because an attribute is eligible for aggregation does not mean it will used The Category attribute is in the pool of eligible attributes, but it is not used in any aggregations.

下文将继续Aggregations设计。

源码下载:

begin13

end13,在下篇提供下载

数据库下载

参考资源:

1、SQL Server Analysis Services 官方教程

http://technet.microsoft.com/zh-cn/library/ms170208.aspx

posted @ 2011-06-04 20:51  邀月  阅读(2848)  评论(14编辑  收藏  举报