My Analysis Services database is responsing really slow after processing. The problem can be reproduced also by clearing cache with the ClearCache XMLA -command. I understand that after clearing the cache, the query performance is slower but I’m seeing slow performance also when using Microsoft.AnalysisServices.AdomdClient library.
I made a small timing test.
DateTime start = DateTime.Now;
int dc = cube.Dimensions.Count; // cube = Microsoft.AnalysisServices.AdomdClient.CubeDef
DateTime end = DateTime.Now;
Debug.WriteLine("Start: " + start.ToLongTimeString());
Debug.WriteLine("Dimensions count: " + dc.ToString());
Debug.WriteLine("End: " + end.ToLongTimeString());
For example this will give the following result
Start: 8:41:53
Dimensions count: 18
End: 8:43:15
So it takes almost 1.5 minutes to get the count for the dimensions. Same performance if I get the measures (which there are only few).
After the first operation all the following operations and queries are fast. My question is that how can I work around this issue? It’s a real problem when the database comes almost non-responsive after every database processing. I could do something to automatically “fire up” the database after processing but wouldn’t that just move the waiting time from one place to another?
Update:
I’ve found out the problem. The reason why the performance was different with Management Studio and with AdomdClient was that with AdomdClient I had different connection string to the Analysis Services database. I have some custom stuff at the database which fired with that connectionstring. Anyway, the problem is now solved and wasn’t directly related to the actual Analysis Services.
Lesson learned: Make sure you’re testing with the correct connectionstring 🙂
The answer is in the question update – the culprit is an incorrect connection string.