dbTalk Databases Forums  

Calc member too slow...

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


Discuss Calc member too slow... in the microsoft.public.sqlserver.olap forum.



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

Default Calc member too slow... - 04-06-2004 , 12:00 AM






I am hoping someone can advise me on a more efficient calculation for the
following calc-member.

I have "Time" dimension with levels Hour, Shift, Day, Month, Year.
I have a organizational hierarchy in another dimension (MyHierarchy).
The fact table is a set of events, each with a time-stamp and a field from
the leaf level of MyHierarchy.

The calc-member "Repeater" is to count the number of times where a specific
member of MyHierarchy at the leaf level has an event more than once in an
hour. I created a recursive calc as shown below...

iif([Time].CurrentMember.Level.Name = "Hour",
Count(Filter(Descendants([MyHierarchy].CurrentMember, [MyHierarchy].
[LeafLevel]), [Count] > 1)),
Sum(Descendants([Time].CurrentMember, [Hour]), Repeater)
)

We have a Crystal report that shows the totals for a few months. Each month
has about 120K events and MyHierarchy has about 10K members at the leaf
level.
Opening the cube to browse takes several minutes. Viewing in AS Manager is
also painfully slow.

Any suggestions on a different approach to the MDX to improve performance?

Thanks,

Les M

Reply With Quote
  #2  
Old   
Chris Webb
 
Posts: n/a

Default RE: Calc member too slow... - 04-06-2004 , 04:46 AM






Hi Les

This sounds like one of those calcs which may never perform particularly well; checking that you have all the necessary aggregations built in your cube (use Usage Based Optimisation rather than the Storage Design Wizard, or even build them manually), as well as doing all the other standard cube performance tuning things like partitioning mentioned in the 'AS Performance Guide', would be a good idea

As far as the MDX goes, does the following make any improvement

COUNT
GENERATE
NONEMPTYCROSSJOIN(Descendants([Time].CurrentMember, [Hour])),
FILTER
NONEMPTYCROSSJOIN({TIME.CURRENTMEMBER}, Descendants([MyHierarchy].CurrentMember,[MyHierarchy].[LeafLevel])
, MEASURES.COUNT>1


One other thought: if this is a really important type of analysis for you, can you somehow include a column in your fact table which flags whether this is not the first time this event has happened in this hour and then link a dimension to it? It would make your queries much quicker

HTH

Chri

----- Les McPhee wrote: ----

I am hoping someone can advise me on a more efficient calculation for the
following calc-member

I have "Time" dimension with levels Hour, Shift, Day, Month, Year
I have a organizational hierarchy in another dimension (MyHierarchy)
The fact table is a set of events, each with a time-stamp and a field from
the leaf level of MyHierarchy.

The calc-member "Repeater" is to count the number of times where a specific
member of MyHierarchy at the leaf level has an event more than once in an
hour. I created a recursive calc as shown below..

iif([Time].CurrentMember.Level.Name = "Hour"
Count(Filter(Descendants([MyHierarchy].CurrentMember, [MyHierarchy]
[LeafLevel]), [Count] > 1))
Sum(Descendants([Time].CurrentMember, [Hour]), Repeater


We have a Crystal report that shows the totals for a few months. Each month
has about 120K events and MyHierarchy has about 10K members at the leaf
level
Opening the cube to browse takes several minutes. Viewing in AS Manager is
also painfully slow

Any suggestions on a different approach to the MDX to improve performance

Thanks

Les


Reply With Quote
  #3  
Old   
 
Posts: n/a

Default Calc member too slow... - 04-21-2004 , 01:39 PM



I don't know if this will help, but this formulas counts
the number of store that had inventory greater than zero.
Thsi goes to the level. The 1, SELF, prevents the
calcutation from counting the parent.

The time period is a separate dimension that I slice.

TC

--FREQ - NUM of STORES STOCKED--

IIF(SUM(DESCENDANTS([Organization].[Org Type].
[Store],1,SELF),[Measures].[On Hand Quantity]>0)=0,NULL,
SUM(DESCENDANTS([Organization].[Org Type].[Store],1,SELF),
[Measures].[On Hand Quantity]>0))





Quote:
-----Original Message-----
I am hoping someone can advise me on a more efficient
calculation for the
following calc-member.

I have "Time" dimension with levels Hour, Shift, Day,
Month, Year.
I have a organizational hierarchy in another dimension
(MyHierarchy).
The fact table is a set of events, each with a time-stamp
and a field from
the leaf level of MyHierarchy.

The calc-member "Repeater" is to count the number of
times where a specific
member of MyHierarchy at the leaf level has an event more
than once in an
hour. I created a recursive calc as shown below...

iif([Time].CurrentMember.Level.Name = "Hour",
Count(Filter(Descendants([MyHierarchy].CurrentMember,
[MyHierarchy].
[LeafLevel]), [Count] > 1)),
Sum(Descendants([Time].CurrentMember, [Hour]),
Repeater)
)

We have a Crystal report that shows the totals for a few
months. Each month
has about 120K events and MyHierarchy has about 10K
members at the leaf
level.
Opening the cube to browse takes several minutes. Viewing
in AS Manager is
also painfully slow.

Any suggestions on a different approach to the MDX to
improve performance?

Thanks,

Les M
.


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.