dbTalk Databases Forums  

queries filtering on multiple members and performance

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


Discuss queries filtering on multiple members and performance in the microsoft.public.sqlserver.olap forum.



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

Default queries filtering on multiple members and performance - 08-17-2005 , 08:00 AM






I have a parameterised query, generated by 3rd party tool:

SELECT NON EMPTY { { { DESCENDANTS( [Product].[All Product],
[Product].[1 level from top] ) } * { [Measures].[mymeasure] } } } ON
COLUMNS ,

NON EMPTY { DESCENDANTS( [customers].[All Customers], [customers].[leaf
level] ) } ON ROWS

FROM [my physical cube]

WHERE ( [date].[1 jan 2005] )


where mymeasure is a base measure - not a calculated member and the
cube is a physical cube.

This performs fine. This also works fine when i change the date to 2
jan 2005.

Now if i need to get the results where the filter is for both days at
the same time (ie. not using a slicer), my understanding (i'm not very
literate in MDX) is that i have to create a calculated member to
aggregate both days and use that member on the filter, so my MDX, as
generated by 3rd party tool is:

WITH MEMBER
[date].[Aggregation] AS '
AGGREGATE(
GENERATE( { [date].[1 jan 2005], [date].[2 jan 2005] },
HEAD(
INTERSECT( { [date].[1 jan 2005], [date].[2 jan 2005] },
ASCENDANTS( [date].CURRENTMEMBER ))))) ', SOLVE_ORDER = 0
SELECT
NON EMPTY { { { DESCENDANTS( [Product].[All Product], [Product].[1
level from top] ) } * { [Measures].[mymeasure] } } } ON COLUMNS ,

NON EMPTY { DESCENDANTS( [customers].[All customers],
[customers].[leaf level] ) } ON ROWS

FROM
[fxdistribution]

WHERE
( [date].[Aggregation] )

This performs extremely poorly (~16 minutes compared to <5 seconds for
the day-at-a-time examples above), and a specific aggregation does not
appear to help. I have also tried non-empty-crossjoin function which
reduced the time down to 2 minutes, but this is still a long time.

Users need the date range to be any date range.

Firstly, is there a better way to write this query?

Is anyone else getting this sort of business/performance problem?

other than server execution location, and connection string changes,
what can i do to speed this up?


Reply With Quote
  #2  
Old   
RuiDC
 
Posts: n/a

Default Re: queries filtering on multiple members and performance - 08-17-2005 , 08:20 AM






the following simplified MDX of my problem example in the previous
post, is still a problem...

WITH MEMBER [date].[Aggregation] AS
' AGGREGATE( { [date].[1 jan 2005], [date].[2 jan 2005]})', SOLVE_ORDER
= 0

SELECT
NON EMPTY { { { DESCENDANTS( [Product].[All Product], [Product].[1
level from top] ) } * { [Measures].[mymeasure] } } } ON COLUMNS ,

NON EMPTY { DESCENDANTS( [customer].[All customer], [customer].[leaf
level] ) } ON ROWS

FROM [my physical cube]

WHERE
( [date].[Aggregation] )


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

Default Re: queries filtering on multiple members and performance - 08-17-2005 , 11:37 PM



Does this version show any improvement in performance:

Quote:
WITH
Set [DateRange] as
'{[date].[1 jan 2005], [date].[2 jan 2005]}'
MEMBER [date].[Aggregation] AS
'AGGREGATE([DateRange])', SOLVE_ORDER
= 0

SELECT
NONEMPTYCROSSJOIN(
DESCENDANTS([Product].[All Product],
[Product].[1 level from top]),
{[Measures].[mymeasure]},
[DateRange], 2) ON COLUMNS ,

NONEMPTYCROSSJOIN(
DESCENDANTS([customer].[All customer],
[customer].[leaf level]),
{[Measures].[mymeasure]},
[DateRange], 1) ON ROWS

FROM [my physical cube]

WHERE
([date].[Aggregation])
Quote:

- 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.