Hello everybody!
I made a query to find the first buy that each client made by each product category. The query works, but it takes over 2 minutes to execute.
In comparison, I made a small store procedure that brings the same result in less than 3 seconds!
I would like to know if there is something very terrible in my cube design, or if there's a better way to query for the same result, or if there's nothing that I can do to make the cube work faster.
My MDX Query:
WITH MEMBER [Measures].[First Activity] AS FILTER( [Time].[Date].[Date].MEMBERS, [Measures].[FAT] ).ITEM(0).NAME SELECT { [Measures].[FAT], [Measures].[First Activity] } ON 0, NON EMPTY {( [CLIENTE].[Cliente].[Cliente].ALLMEMBERS * [PRODUTO].[Classe].[Classe].ALLMEMBERS )} ON 1 FROM [SCA]
(I create a calculated member in the cube too, actually, this query runs in over 3 minutes. The calculated member that runs in over 2)
This is my cube design(DataSource, Dim Time, Dim Product and Dim Client):
I'm still learning about cubes and analysis services, so it's probable that there is something very wrong with my design. If anyone could point the error, it'll help me a lot.
Thanks for your time.
ps.: I know that the database design is not the best, but that's what I got from the client, and I can't change it much because of the data import mechanism.