`
netxdiy
  • 浏览: 728586 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

《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

邀月注:本文版权由邀月和CSDN共同所有,转载请注明出处。
助人等于自助!
3w@live.cn


分享到:
评论

相关推荐

    Microsoft SQL Server 2008技术内幕:T-SQL查询(第二卷)

    《Microsoft SQL Server 2008技术内幕:T-SQL查询》全面深入地介绍了Microsoft SQL Server 2008中高级T-SQL查询、性能优化等方面的内容,以及SQL Server 2008新增加的一些特性。主要内容包括SQL的基础理论、查询优化...

    wrox professional sql server 2005 integration services

    本书为读者提供了深入浅出的学习指南,旨在帮助读者掌握SQL Server 2005 Integration Services (SSIS) 的强大功能。对于那些希望摆脱复杂脚本逻辑编程任务的开发者来说,这本书将教授他们如何利用一个全功能语言来...

    Beginning T-SQL with Microsoft SQL Server 2005 and 2008

    we recommend Beginning SQL Server 2005 Administration and Beginning SQL Server 2008 Administration from Wrox, co-authored in part by the same authors. This book introduces the T-SQL language and its...

    DFAnet:Deep Feature Aggregation for Real-time Semantic Segmentation.pdf

    本文档主要介绍了DFAnet(Deep Feature Aggregation Network),这是一种专为实时图像语义分割设计的深度学习模型。该模型旨在通过高效的特征聚合策略来提高实时性能,同时保持较高的分割准确性。 #### 关键知识点...

    Microsoft+SQL+Server+2008技术内幕:T-SQL查询_源代码及附录 中文版

    《Microsoft SQL Server 2008技术内幕:T-SQL查询》全面深入地介绍了Microsoft SQL Server 2008中高级T-SQL查询、性能优化等方面的内容,以及SQL Server 2008新增加的一些特性。主要内容包括SQL的基础理论、查询优化...

    SQLServer2008技术内幕T-SQL查询包含源代码及附录A

    《Microsoft SQL Server 2008技术内幕:T-SQL查询》全面深入地介绍了Microsoft SQL Server 2008中高级T-SQL查询、性能优化等方面的内容,以及SQL Server 2008新增加的一些特性。主要内容包括SQL的基础理论、查询优化...

    AdaBatch: Efficient Gradient Aggregation.pdf

    We study a new aggregation operator for gradients coming from a mini-batch for stochastic gradient (SG) methods that allows a significant speed-up in the case of sparse optimization problems. We ...

    Data Cube: A Relational Aggregation Operator

    Data Cube: A Relational Aggregation Operator Generalizing Group-By, Cross-Tab, and Sub-Totals Abstract: Data analysis applications typically aggregate data across many dimensions looking for unusual ...

    SQL Server 7.0 入门

    SQL Server 7.0 是微软开发的一个关系型数据库管理系统,为用户提供了一套强大的工具和语言来管理和处理数据。其中,交互式SQL(Transact SQL,简称TSQL)是SQL Server的主要查询语言,它扩展了标准SQL的功能,允许...

    OLAP多维数据分析与研究

    在SQL Server 2005中,Microsoft提供了强大的OLAP服务,即Analysis Services,使得用户能够进行复杂的业务智能(BI)操作,从而提升决策效率。 SQL Server 2005 Analysis Services是微软为企业级数据仓库和商业智能...

    Beginning Transact-SQL with SQL Server 2000 and 2005 (4 of 5)

    Beginning Transact-SQL with SQL Server 2000 and 2005 byPaul TurleyandDan Wood Wrox Press 2006 (594 pages) ISBN:076457955X Prepare for the ever-increasing demands of programming....

    SQL 2008行列转换的pivot

    ### SQL 2008 行列转换 (Pivot) 的动态实现 #### 知识点一:行列转换(Pivot)的概念与应用场景 在数据库查询中,有时我们需要将数据表中的行转换为列,或者将列转换为行,这种操作被称为行列转换。行列转换在报表...

    sqlserver2005的高级应用

    3. 分组和聚合(Grouping and Aggregation):GROUP BY语句用于按指定列进行分组,而聚合函数(如COUNT, SUM, AVG, MIN, MAX)用于计算每个组的汇总信息。 4. 窗口函数(Window Functions):在SQL Server 2005中...

    Beginning Transact-SQL with SQL Server 2000 and 2005 (2 of 5)

    Beginning Transact-SQL with SQL Server 2000 and 2005 byPaul TurleyandDan Wood Wrox Press 2006 (594 pages) ISBN:076457955X Prepare for the ever-increasing demands of programming. Beginning with an ...

    MongoDB 聚合管道(Aggregation Pipeline)

    首先,从概念上理解,MongoDB的聚合管道可以类比为一个数据处理的“流水线”,每个阶段(Stage)可以看作是流水线上的一个节点,文档会按顺序地通过这些节点进行处理。在每个阶段,可以执行不同的操作,如过滤...

    Beginning Transact-SQL with SQL Server 2000 and 2005 (1 of 5)

    Beginning Transact-SQL with SQL Server 2000 and 2005 byPaul TurleyandDan Wood Wrox Press 2006 (594 pages) ISBN:076457955X Prepare for the ever-increasing demands of programming. Beginning with an ...

    解决字符长度8000限制

    在SQL Server中,默认情况下单条SQL语句的最大长度为8000个字符。当使用动态SQL生成复杂的查询或更新语句时,很容易超出这个限制。例如,在进行分组统计、动态构建复杂查询等情况时,如果涉及大量的字段或条件,可能...

    SQL Server 2012数据库T-SQL查询方法及实例解析.pdf

    Transact-SQL(通常称为T-SQL)是微软SQL Server数据库系统使用的SQL程序设计语言的增强版。它是与SQL Server数据库进行交互的主要语言,提供了包括事务控制、错误处理和可编程性在内的扩展功能,可以用来执行各种...

    2008版链路聚合协议

    本标准旨在定义一种方法来聚合一个或多个物理链接,以形成一个逻辑上的单一链接,这种逻辑链接被称为“链路聚合组”(Link Aggregation Group, LAG)。 #### 链路聚合的基本概念 链路聚合是一种将多个物理链路捆绑在...

    MA5680T链路聚合

    综上所述,通过对MA5680T链路聚合的详细配置步骤分析,我们不仅了解了链路聚合技术的基本原理和优势,还掌握了在华为MA5680T设备上的具体配置方法。这有助于在网络运维过程中更好地利用链路聚合技术来提高网络的稳定...

Global site tag (gtag.js) - Google Analytics