dbTalk Databases Forums  

Poor MDX Query performance with Filter

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


Discuss Poor MDX Query performance with Filter in the microsoft.public.sqlserver.olap forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Marc S.
 
Posts: n/a

Default Poor MDX Query performance with Filter - 04-02-2004 , 03:04 PM






Hi,

I was wondering if anyone had an explination of why this query runs in
under 30sec:

SELECT
{
[VARIABLES].[CURRENT BACK ORDER UNIT],
[VARIABLES].[CURRENT BACK ORDER COST],
[VARIABLES].[CURRENT BACK ORDER RETAIL]
}
ON COLUMNS,
NON EMPTY{[PRODUCT].[FOUR DIGIT].Members} ON ROWS
FROM
[ORVIS MDS]
WHERE
(
[TIME].[WE 2004-04-02],
[CHANNEL].[ALL CHANNELS],
[DEMAND SOURCE].[ALL DEMAND SOURCES],
[VERSION].[TY ACTUAL],
[MEASURES].[VALUE]
)


While this one takes 3+ minutes

SELECT
{
[VARIABLES].[CURRENT BACK ORDER UNIT],
[VARIABLES].[CURRENT BACK ORDER COST],
[VARIABLES].[CURRENT BACK ORDER RETAIL]
}
ON COLUMNS,
{FILTER([PRODUCT].[FOUR DIGIT].Members,[VARIABLES].[CURRENT BACK ORDER
UNIT] >0)} ON ROWS
FROM
[ORVIS MDS]
WHERE
(
[TIME].[WE 2004-04-02],
[CHANNEL].[ALL CHANNELS],
[DEMAND SOURCE].[ALL DEMAND SOURCES],
[VERSION].[TY ACTUAL],
[MEASURES].[VALUE]
)

The [VARIABLES] members are all pre-aggregated, no calculated measures
used.

Thanks.

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

Default Re: Poor MDX Query performance with Filter - 04-03-2004 , 12:41 AM






Looks like there may be a lot of empty [PRODUCT] members in the "Where"
slice. The OLAP server keeps track of pre-aggregated non-empty members,
so the NON EMPTY clause (in this case) is presumably optimized. No
iteration over all
[PRODUCT].[FOUR DIGIT] members may be occurring.

However, the Filter() will require iteration over all
[PRODUCT].[FOUR DIGIT] members, to test for > 0 (which
can't be assumed to be equivalent to NON EMPTY). With a large member
set, this can consume more memory and time.
So, you boost performance by leveraging set sparsity.


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