dbTalk Databases Forums  

MDX query - prime the AS cache?

microsoft.public.sqlserver.olap microsoft.public.sqlserver.olap


Discuss MDX query - prime the AS cache? in the microsoft.public.sqlserver.olap forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Dean
 
Posts: n/a

Default MDX query - prime the AS cache? - 06-02-2006 , 07:36 AM






Hello everyone....thanks in advance for your feedback.

I've got a few MDX queries that take into account a mixture of
calculated members, basic dimensions, and basic facts. The cube is not
'big', the dimensions are not 'large' - in fact the largest dimension I
have is the time dimension. But, the query below, for example runs in
about 4 seconds. (dual proc, 8GB RAM, 3GB switch on, etc.)

I think the calculated members in the query, in combination with the
'where' clause are causing the problem, so I was hoping that I could
'prime' the cache in AS to get some of this ready prior to query time.
I've read some things about subcube, scope, etc. but didn't quite feel
they were applicable - maybe they are. Does it make sense in this case
to execute 'something' that will at least get the dimensions into
memory prior to query time? Would that help? Or maybe be query is
just written ultra-inefficiently.



WITH
MEMBER [Measures].[Median] AS 'iif(([Dim KPI].[KPI
Name].currentmember, [Measures].[Is Corp Measure]) = 0,Median([Dim
Date].[Short Date].members, [KPI Actual DASHBOARD]), 1)'
SET [Dim DateShort Date(All)] As 'StrtoSet("[Dim Date].[Short
Date].&[" + cstr(DateDiff("d", "01/01/1997", Now())-32) + "]: [Dim
Date].[Short Date].&[" + cstr(DateDiff("d", "01/01/1997", Now()+31)) +
"]")'
SELECT
NON EMPTY {[Measures].[GraphKPI],[Measures].[Median]} ON COLUMNS,
NON EMPTY {[Dim DateShort Date(All)]} ON ROWS
FROM
[db]
WHERE
([Dim KPI].[KPI Name].&[No % CHK],[Dim
Location].[LocationFilter].[Region].&[02 - REGION],[Dim
Date].[DateFilter].[Year].&[2006].&[2].&[5],[Dim
Product].[PR-SubPr].[All])

Thanks,
Dean


Reply With Quote
  #2  
Old   
Deepak Puri
 
Posts: n/a

Default Re: MDX query - prime the AS cache? - 06-02-2006 , 11:53 PM






Hi Dean,

Not knowing the complete context of your cube, I'm assuming that
[Measures].[Is Corp Measure] is being used to determine whether the
current KPI falls in the corporate category. If so, you'd be better off
defining a Dim KPI attribute for that purpose. If you can make
[Measures].[Median] a cube calculated measure, then you could possibly
scope on such an attribute in the cube MDX script, rather than using
iif().

Also, though I'm not sure exactly how [Measures].[Median] works, it
looks like it should return the same value across all members of [Dim
DateShort Date(All)]. But maybe the iif() condition is preventing the
caching of this value - someone with deeper knowledge of AS 2005 caching
could perhaps confirm this?


- Deepak

Deepak Puri
Microsoft MVP - SQL Server

*** Sent via Developersdex http://www.developersdex.com ***

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.