MDX Query/Caching/Performance Questions
I am having trouble trying to improve processing speed for an MDX Query.This one is driving me bonkers so I’m hoping someone can help me.
Here is my MDX Query:
SELECTCROSSJOIN([Year],{[Measures].[Quick Ratio]})ONCOLUMNS,CROSSJOIN(DESCENDANTS([Department]),DESCENDANTS([GL Company]))ONROWSFROM [GLRatios]
Year Count: 9
Department Count: 33
GL Company Count: 41
GL Summary Category ID.Category Count: 25
Quick Ratio is a Calculated Member calculated as follows:
'IIF(([GL Summary Category ID].[Category].&[Current Liabilities],[Measures].[Balance]) <> 0,(
(([GL Summary Category ID].[Category].&[Cash],[Measures].[Balance])
+([GL Summary Category ID].[Category].&[Accounts Receivable],[Measures].[Balance]))
/([GL Summary Category ID].[Category].&[Current Liabilities],[Measures].[Balance])) ,0)
'
The Result Cell set consists of 1430 rows and 11 columns.
Storage Method is MOLAP.I have designed aggregations.
1) When I run this query from the SQL Server Management Studio, it takes 23 seconds to run it the first time.The second time I run this MDX Query from SQL Server Management Studio, it takes 2 seconds to run.I would assume this is the result of caching.The first time I run the query after the cube has been processed, I see over 73,000 Query SubCube entries in SQL Profiler that look something like this:
EventClassQuery Subcube
EventSubClass1 - Cache data
TextData0000000000000000000000000000000000000001000000000,1,10,1
I would say over 99% of all of the entries in SQL Profiler contain the same TextData.Why is the MDX Query generating these entries, and why is it generating so many entries with that appear to be identical TextData values?Is it caused by something I have done when defining my dimensions, or a design flaw made while defining my Data Source View?Is this caused by using a Calculated Member as measure?
2) I have a C# web service that uses theExecuteXmlReader method of theMicrosoft.AnalysisServices.AdomdClient.AdomdCommand class to execute the same MDX query on the server and return it to the client as Xml.In other words I am rolling my own web service instead of calling the XMLA web service from the client.
When my web service call executes the MDX query, it uses ASPNET as user. Each time the MDX Query is executed via the web service it also generates >73,000 Query Subcube entries in SQL Profiler and takes 23 seconds to run.The MDX query generates the same SQL Profiler entries each time it is executed from the web service.It does not cache.
Is there something about the use of the ASPNET user that prevents caching of the data on the server? Is it a case of each ASPNET session having its’ own cached data?
Thanks in advance for your help.
Wendell G.

