![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
|
Thread-Topic: MDX function AGGREGATE very slow, please help thread-index: AcSJ0KG92cmD6tZ8QAGkLVoz4BJBEA== X-WBNR-Posting-Host: 80.132.76.26 From: "=?Utf-8?B?SmFtZXM=?=" <news (AT) att (DOT) com Subject: MDX function AGGREGATE very slow, please help Date: Tue, 24 Aug 2004 04:51:03 -0700 Lines: 52 Message-ID: <369B4FE7-2C60-4219-92B3-E61A2DB667DE (AT) microsoft (DOT) com MIME-Version: 1.0 Content-Type: text/plain; charset="Utf-8" Content-Transfer-Encoding: 7bit X-Newsreader: Microsoft CDO for Windows 2000 Content-Class: urn:content-classes:message Importance: normal Priority: normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0 Newsgroups: microsoft.public.sqlserver.olap NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.1.29 Path: cpmsftngxa10.phx.gbl!TK2MSFTNGXA03.phx.gbl Xref: cpmsftngxa10.phx.gbl microsoft.public.sqlserver.olap:52962 X-Tomcat-NG: microsoft.public.sqlserver.olap I have the same MDX query in 2 different versions: The Aggregate version, which takes 10 seconds to run: with member Store.Standard.AllowedStores as 'Aggregate(descendants([Store].Standard.[Southwest],Store))' select {[Measures].[Units], [Measures].[Net Sales]} on columns, { TopCount(crossjoin({[Product Style].members},{[Product Division].[Drinks]}), 20,[Measures].[Units]), TopCount(crossjoin({[Product Style].members},{[Product Division].[Snacks]}), 20,[Measures].[Units]), TopCount(crossjoin({[Product Style].members},{[Product Division].[Food]}), 20,[Measures].[Units]) } on rows from [Sale] where ( [Store].[Standard].AllowedStores , [Time].[Marketing].[Week].&[05-Jul-04]) The "without aggregate version" is as follows. Please note that the "with member" is still there, but the member isn't used in the query. The only difference is in the WHERE slice. This version gives exactly the same results but runs in less than a second: with member Store.Standard.AllowedStores as 'Aggregate(descendants([Store].Standard.[Southwest],Store))' select {[Measures].[Units], [Measures].[Net Sales]} on columns, { TopCount(crossjoin({[Product Style].members},{[Product Division].[Drinks]}), 20,[Measures].[Units]), TopCount(crossjoin({[Product Style].members},{[Product Division].[Snacks]}), 20,[Measures].[Units]), TopCount(crossjoin({[Product Style].members},{[Product Division].[Food]}), 20,[Measures].[Units]) } on rows from [Sale] where ( [Store].[Standard].Southwest, [Time].[Marketing].[Week].&[05-Jul-04]) I need to use the Aggregate (I believe) because in a next version of the query, I will intersect the descendants of Southwest with the stores that the user is allowed to see, like in: with member Store.Standard.AllowedStores as 'Aggregate(Intersect(descendants([Store].Standard.[Southwest],Store), {descendants([Store].Standard.[SFO],Store)}))' for the manager of the SFO shop. Am I doing something wrong? How could I improve performance? How does the Aggregate version takes 10 times more processing? Is there a way to slice on a set of stores without using the Aggregate function? |
#2
| |||
| |||
|
#3
| |||
| |||
|
![]() |
| Thread Tools | |
| Display Modes | |
| |