执行以下查询需要 1 或 2 秒:
SELECT { [Measures].[Premium], [Measures].[Revenue] }
ON COLUMNS, NON EMPTY { (
[Insured].[PK Insured].[PK Insured].ALLMEMBERS
* [Insured].[Named Insured].[Named Insured].ALLMEMBERS
* [Producer].[Name].[Name].ALLMEMBERS
* [Producer].[PK Producer].[PK Producer].ALLMEMBERS
* [Coverage Category].[Name].[Name].ALLMEMBERS
* [Company].[Name].[Name].ALLMEMBERS
* [Company].[PK Company].[PK Company].ALLMEMBERS
* [Market Ownership Group].[PK Market Ownership Group].[PK Market Ownership Group].ALLMEMBERS
* [Agency Ownership Group].[PK Agency Ownership Group].[PK Agency Ownership Group].ALLMEMBERS
* [Company].[Type].[Type].ALLMEMBERS
) }
ON ROWS FROM ( SELECT ( { [Marketing Rep].[PK Non Broker].&[820676] } )
ON COLUMNS FROM ( SELECT ( [Expiration Date].[Date Hierarchy].[Date].&[2013-08-27T00:00:00] : [Expiration Date].[Date Hierarchy].[Date].&[2013-11-25T00:00:00] )
ON COLUMNS FROM ( SELECT ( { [Policy].[Status].&[PIF], [Policy].[Status].&[BIF] } )
ON COLUMNS FROM [CrumpCRC])))
WHERE ( [Policy].[Status].CurrentMember, [Marketing Rep].[PK Non Broker].&[820676] )
如果我添加日期维度 ( Expiration Date
),则查询需要几分钟才能执行,有时甚至会返回内存过载错误。这是一个问题:
SELECT { [Measures].[Premium], [Measures].[Revenue] }
ON COLUMNS, NON EMPTY { (
[Insured].[PK Insured].[PK Insured].ALLMEMBERS
* [Insured].[Named Insured].[Named Insured].ALLMEMBERS
* [Producer].[Name].[Name].ALLMEMBERS
* [Producer].[PK Producer].[PK Producer].ALLMEMBERS
* [Coverage Category].[Name].[Name].ALLMEMBERS
* [Company].[Name].[Name].ALLMEMBERS
* [Company].[PK Company].[PK Company].ALLMEMBERS
* [Market Ownership Group].[PK Market Ownership Group].[PK Market Ownership Group].ALLMEMBERS
* [Agency Ownership Group].[PK Agency Ownership Group].[PK Agency Ownership Group].ALLMEMBERS
* [Company].[Type].[Type].ALLMEMBERS
* [Expiration Date].[Date Hierarchy].[Date].ALLMEMBERS
) }
ON ROWS FROM ( SELECT ( { [Marketing Rep].[PK Non Broker].&[820676] } )
ON COLUMNS FROM ( SELECT ( [Expiration Date].[Date Hierarchy].[Date].&[2013-08-27T00:00:00] : [Expiration Date].[Date Hierarchy].[Date].&[2013-11-25T00:00:00] )
ON COLUMNS FROM ( SELECT ( { [Policy].[Status].&[PIF], [Policy].[Status].&[BIF] } )
ON COLUMNS FROM [CrumpCRC])))
WHERE ( [Policy].[Status].CurrentMember, [Marketing Rep].[PK Non Broker].&[820676] )
我在任务管理器中监视内存行为:当第一个查询运行时,内存没有什么特别的事情发生,但是当我运行第二个查询(包括日期暗淡)时,内存从 2GB 跳到 8GB。我还注意到,当我开始删除列(包括日期)时,查询开始执行得更快,内存消耗也开始下降。我有一种感觉,添加每个新列都会增加执行查询所需的一些操作。
日期和其他暗淡之间的区别在于日期设置为层次结构。我还包含一条警告消息,我在悬停时看到年/月属性
知道我做错了什么吗?