dbTalk Databases Forums  

Horrible performance when looping members

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


Discuss Horrible performance when looping members in the microsoft.public.sqlserver.olap forum.



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

Default Horrible performance when looping members - 11-23-2004 , 08:28 AM






When trying to loop through members of a level by an adomd.catalog object
performance takes an incredible hit.
My level has around 25.000 members and it takes about 3 minutes to complete
a loop through them in VB:

For Each mem In Members (adomd.level.members object)
debug.print mem.UniqueName, mem.Caption
Next

It seems like the for each handler loads the entire member collection when
first called. Is there any way to make it behave otherwise? Trying to access
the .count property has the same result, so i cant
for i = 0 to members.count... Anyone have any suggestions on how to stop
adomd from loading the entire members list? What i really want to do is
make a search function that returns the members in a level that match a
passed string. This is very hard to do if this is the performance i have to
live with,


Any help appriciated.




Reply With Quote
  #2  
Old   
Chris Webb
 
Posts: n/a

Default RE: Horrible performance when looping members - 11-23-2004 , 09:41 AM






Hi Peter,

It might be better to abandon the ADOMD approach (which I think is always
going to perform badly), and instead write an MDX query that does what you
want using VBA functions - it's likely to be much faster. For example, here's
a query for Foodmart 2000 returning all Cities with names beginning with 'B':

SELECT MEASURES.MEMBERS ON 0,
FILTER(
[Customers].[City].MEMBERS
, LEFT([Customers].CURRENTMEMBER.NAME, 1)="B"
)
ON 1
FROM SALES

hth,

Chris

"Peter Koller" wrote:

Quote:
When trying to loop through members of a level by an adomd.catalog object
performance takes an incredible hit.
My level has around 25.000 members and it takes about 3 minutes to complete
a loop through them in VB:

For Each mem In Members (adomd.level.members object)
debug.print mem.UniqueName, mem.Caption
Next

It seems like the for each handler loads the entire member collection when
first called. Is there any way to make it behave otherwise? Trying to access
the .count property has the same result, so i cant
for i = 0 to members.count... Anyone have any suggestions on how to stop
adomd from loading the entire members list? What i really want to do is
make a search function that returns the members in a level that match a
passed string. This is very hard to do if this is the performance i have to
live with,


Any help appriciated.





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.