dbTalk Databases Forums  

Odd ChildCount behavior

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


Discuss Odd ChildCount behavior in the microsoft.public.sqlserver.olap forum.



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

Default Odd ChildCount behavior - 02-01-2006 , 05:37 PM






I've noticed an odd behavior that I first thought was a performance
optimization but now appears to be a bug.

To reproduce, I created a simple MDX listing of the descendants of France in
the Adventure Works DW cube.

select { [January 2004] } on columns, {
Descendants(Geography.Geography.France) } on rows from [adventure works]

Next I set an AdomdClient member variable to the first member in the first
and second tuples returned.

If I ask the first member (France) its ChildCount it returns 1000. If I ask
the second member (Charente-Maritime) its parent's ChildCount, it properly
returns 17. Both operations took 0 ticks of time. In order to get the first
member to tell me the proper ChildCount, I need to use the GetChildren()
function which took almost 18 million ticks to return.

Here is a summary:

m1 and m2 are AdomdClient.Member objects. Values were retrieved in the order
displayed.

m1.Caption: France
m2.Caption: Charente-Maritime
m2.Parent.Caption: France

m1.ChildCount: 1000 took 0 ticks
m2.Parent.ChildCount: 17 took 0 ticks
m1.GetChildren.Count: 17 took 17831506 ticks

Why does m1.ChildCount return 1000 if it apparently already knows its
ChildCount is 17?



Reply With Quote
  #2  
Old   
Zoltan Grose
 
Posts: n/a

Default Re: Odd ChildCount behavior - 02-01-2006 , 06:05 PM






Also, the DrilledDown documentation appears to be in error. It says
"Indicates whether no children immediately follow the member on the axis. "
but m1.DrilledDown == True but m2 (its child) immediately follows the
member.

-zoltan

"Zoltan Grose" <zgrose (AT) mac (DOT) com> wrote

Quote:
I've noticed an odd behavior that I first thought was a performance
optimization but now appears to be a bug.

To reproduce, I created a simple MDX listing of the descendants of France
in the Adventure Works DW cube.

select { [January 2004] } on columns, {
Descendants(Geography.Geography.France) } on rows from [adventure works]

Next I set an AdomdClient member variable to the first member in the first
and second tuples returned.

If I ask the first member (France) its ChildCount it returns 1000. If I
ask the second member (Charente-Maritime) its parent's ChildCount, it
properly returns 17. Both operations took 0 ticks of time. In order to get
the first member to tell me the proper ChildCount, I need to use the
GetChildren() function which took almost 18 million ticks to return.

Here is a summary:

m1 and m2 are AdomdClient.Member objects. Values were retrieved in the
order displayed.

m1.Caption: France
m2.Caption: Charente-Maritime
m2.Parent.Caption: France

m1.ChildCount: 1000 took 0 ticks
m2.Parent.ChildCount: 17 took 0 ticks
m1.GetChildren.Count: 17 took 17831506 ticks

Why does m1.ChildCount return 1000 if it apparently already knows its
ChildCount is 17?




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.