SSAS 2012扫描所有度量值组分区,如果我在轴上放置一组超过16个成员。 如果我放15或更少,则只扫描一个分区。
要检查此问题,我创建了一个非常简单的多维数据集,其中包含Sales measure和Dates维度。
这是一个示例查询(它是虚拟的,所以它只为“1”轴上的每个成员返回相同的“VAL”):
with
member val as aggregate
(
[Dates].[Calendar].[DateId].&[20100101]:[Dates].[Calendar].[DateId].&[20100102],
[Measures].[Amount]
)
select
val on 0,
head([Dates].[Calendar].[DateId].members, 16) on 1
from [SSDDB]
他的核心功能是AGGREGATE 2天(在实际查询中,你可以期待看到MTD而不是静态范围)。轴坐标甚至不会严重影响“val”成员,它们只是一些虚拟值的范围。
当我使用 15 作为 HEAD 函数参数运行此查询时,我在分析器中有以下跟踪:
Started reading data from the 'Sales 2010' partition.
Finished reading data from the 'Sales 2010' partition.
并跟随查询子多维数据集详细:
Dimension 1 [Dates] (+ * *) [DateId]:+ [Years]:* [Months]:*
但如果将 15 更改为 16 或更多,那么一切都会发生变化:
Started reading data from the 'Sales 2005' partition.
Started reading data from the 'Sales 2006' partition.
Started reading data from the 'Sales 2007' partition.
Started reading data from the 'Sales 2008' partition.
Started reading data from the 'Sales 2009' partition.
Started reading data from the 'Sales 2010' partition.
Finished reading data from the 'Sales 2007' partition.
Finished reading data from the 'Sales 2006' partition.
Started reading data from the 'Sales 2011' partition.
Finished reading data from the 'Sales 2005' partition.
Finished reading data from the 'Sales 2008' partition.
Finished reading data from the 'Sales 2009' partition.
Finished reading data from the 'Sales 2010' partition.
Finished reading data from the 'Sales 2011' partition.
现在“DateId”的详细信息为“all”;
Dimension 1 [Dates] (* * *) [DateId]:* [Years]:* [Months]:*
我试图使用:
当aggregate-function为SUM时 - 不是什么大问题,但是DISTINCT COUNT会使所有查询的运行时间延长3倍。当您点击EXCEL中的“+”按钮,并希望查看一个月中每天的MTD(非重复计数度量)时,这是性能杀手。
如何停止过度扫描?