Quantcast
Channel: SQL Server Analysis Services Forum
Viewing all articles
Browse latest Browse all 2472

DESCENDANTS SELF_AND_AFTER performance

$
0
0

Hi,

Navigating using hierarchies is considered to be the best practice, and I was going to hide attributes used in the hierarchy, but somehow I cannot achive same perfomance with it.

Sample [Dimension] attributes:

  • [Trade Owner]
  • [Trade Area Level 1]
  • [Trade Area Level 2]

And [Hierarchy] within it:

  • * [Trade Owner]
  • ** [Trade Area Level 1]
  • *** [Trade Area Level 2]

Original MDX - takes 20 sec  (returns Children + All):

 SELECT   {[Dimension].[Trade Area Level 2].members} ON ROWS
         ,{[Measures].[Member]} ON COLUMNS
  FROM [Cube]
  WHERE 
       [Dimension].[Trade Area Level 1].&[123]


New MDX - takes 1 min 40 sec (returns Children + itself)

  SELECT  {DESCENDANTS([Dimension].[Hierarchy].[Trade Area Level 1].&[123],,SELF_AND_AFTER)}    ON ROWS
         ,{[Measures].[Member]}     ON COLUMNS
  FROM [Cube]

Though this 

DESCENDANTS([Dimension].[Hierarchy].[Trade Area Level 1].&[123],,AFTER) only takes 14 sec

and

DESCENDANTS([Dimension].[Hierarchy].[Trade Area Level 1].&[123],,SELF) only takes 9 sec

if executed separately (Cache is cleared after each exec).

Why SELF_AND_AFTER is slower and can I do anything if I need to return children + ALL (or children + itself)?

Thanks


Viewing all articles
Browse latest Browse all 2472

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>