dbTalk Databases Forums  

"with set" - Optimization

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


Discuss "with set" - Optimization in the microsoft.public.sqlserver.olap forum.



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

Default "with set" - Optimization - 08-04-2004 , 04:46 PM






Hi,

I have a question regarding the way AS generates a "set". Shown below is
snippet 1, part of a query that aims to generate the ranking of reps based
on monthly sales and/or revenue.

Snippet 1.
....
SET [SetRepsWithMonthSales] AS '(FILTER([Rep].[RepName].Members, (Time.[All
Time].[2004].[January], [Measures].[Sales]) > 0))'

SET [SalesOrderedReps] AS '(ORDER([SetRepsWithMonthSales], (Time.[All
Time].[2004].[January], [SalesAmount]), BDESC))'
SET [RevenueOrderedReps] AS '(ORDER([SetRepsWithMonthSales], (Time.[All
Time].[2004].[January], [Revenue]), BDESC))'
......

My question about the statement is:

- When [SetRepsWithMonthSales] is generated (the first line), is the
resulting set "cached" (stored in the memory)? If no, does that mean that
in the statement that generates [SalesOrderedReps] and [RevenueOrderedReps]
sets still has to do the "FILTERing".

- Is there an alternative to the filter function, any statement that offers
performance boost.

FYI. Whenever I run the query, the counter AS:Agg Cache - Misses/sec just
goes high up the perf chart.

TYIA.
Wolve





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

Default Re: "with set" - Optimization - 08-04-2004 , 07:42 PM






If the intent of the Filter() is to select [RepName] members that have
Sales data in [2004].[January], then NonEmptyCrossJoin() should enhance
performance:

Quote:
SET [SetRepsWithMonthSales] AS 'NonEmptyCrossJoin(
[Rep].[RepName].Members,
{Time.[All Time].[2004].[January]},
{[Measures].[Sales]}, 1)'
Quote:

- Deepak

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


Reply With Quote
  #3  
Old   
Wolverine
 
Posts: n/a

Default Re: "with set" - Optimization - 08-05-2004 , 12:42 AM



DP, thanks so much. I really appreciate your response and I will certainly
try it.

BTW, I forgot to mention that I am generating the result from a virtual cube

Flashback, snippet 1.
....
SET [SetRepsWithMonthSales] AS
'NonEmptyCrossJoin([Rep].[RepName].Members,{Time.[All
Time].[2004].[January]}, {[Measures].[Sales]}, 1)'

SET [SalesOrderedReps] AS '(ORDER([SetRepsWithMonthSales], (Time.[All
Time].[2004].[January], [Sales]), BDESC))'

SET [RevenueOrderedReps] AS '(ORDER([SetRepsWithMonthSales], (Time.[All
Time].[2004].[January], [Revenue]), BDESC))'
....

Since the Sales measure comes from a different source cube (Sales cube) than
the Revenue measure (Revenue cube), do you think that this could also be a
factor in the slowness of the query? Note that when [RevenueOrderedReps] is
generated, it has to "cross" to get the reps with Sales (for January) from
the Sales cube, OR does it?

Again, TYIA.
Wolve

"Deepak Puri" <deepak_puri (AT) progressive (DOT) com> wrote

Quote:
If the intent of the Filter() is to select [RepName] members that have
Sales data in [2004].[January], then NonEmptyCrossJoin() should enhance
performance:


SET [SetRepsWithMonthSales] AS 'NonEmptyCrossJoin(
[Rep].[RepName].Members,
{Time.[All Time].[2004].[January]},
{[Measures].[Sales]}, 1)'



- Deepak

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



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

Default Re: "with set" - Optimization - 08-07-2004 , 02:02 AM



To allow for a virtual cube, I explicitly specified [Measures].[Sales]
in the NonEmptyCrossJoin(). Of course, the resultant set is then also
ordered by a measure from the other cube, namely [Revenue]; and I'm not
sure whether every RepName with [Sales] data also has [Revenue] data.

I suspect that the speed of the query will depend on the performance of
each physical cube, for the respective ordered set. But it should not be
adversely affected by their combination into a virtual cube.


- Deepak

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

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.