《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的优化聚合设计
源码下载:
参考资源:
1、SQL Server Analysis Services 官方教程
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· 开发者必知的日志记录最佳实践
· winform 绘制太阳,地球,月球 运作规律
· AI与.NET技术实操系列(五):向量存储与相似性搜索在 .NET 中的实现
· 超详细:普通电脑也行Windows部署deepseek R1训练数据并当服务器共享给他人
· 【硬核科普】Trae如何「偷看」你的代码?零基础破解AI编程运行原理
· 上周热点回顾(3.3-3.9)