《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的连接串。

 

4、不使用聚合向导设计聚合

下面我们不使用聚合设计向导设计聚合。

邀月工作室

邀月工作室

改变Partition Counts

邀月工作室

邀月工作室

邀月工作室

邀月工作室

部署项目。

5-7、使用Usage-Based优化向导

除了使用聚合向导,还可以使用基于Usage-Based优化向导来设计聚合(http://64.4.11.252/zh-cn/library/ms189706(SQL.90).aspx),区别在于:

Usage-Based的优化向导用于为分区设计聚合,设计聚合时所基于的是 Analysis Services 实例查询日志中所记录的特定使用模式的查询。

聚合向导则考虑所有可能的查询。

我们启用查询日志

邀月工作室

邀月工作室

重新切换到vs项目,

邀月工作室

邀月工作室

OLAPQueryLOG数据表的字段如下:

MSOLAP_Database: Name of the Analysis Services database
MSOLAP_ObjectPath Fully qualifed name of the object that was queried in the format ServerName DatabaseName CubeName PartitionName

MSOLAP_User: Name of the user who executed the query
Dataset: A string of zeros and ones indicating the level of each attribute hierarchy used to provide the query results Don’t worry about trying
to interpret this string; the Usage-Based Optimization Wizard will interpret the string and display the names of the attribute hierarchies returned by a query
StartTime Time the query began in Coordinated Universal Time (UTC)
Duration Length of time, in milliseconds, that it took to execute the query

下面我们使用日志进行Usage-Based的优化聚合设计

邀月工作室

邀月工作室

邀月工作室

邀月工作室


邀月工作室

邀月工作室

邀月工作室

邀月工作室

源码下载:

begin13

end13

数据库下载

参考资源:

1、SQL Server Analysis Services 官方教程

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

posted @ 2011-06-05 22:57  邀月  阅读(1850)  评论(2编辑  收藏  举报