- First of all, you connect to the cube that your query runs against
- Then you enter your query in the text box at the top of the screen and hit ‘Run Query’
- This then starts the following process:
- The tool reads the cube’s MDX Script and splits it up into its constituent statements, storing them in an array
- It executes a Clear Cache command to ensure that all queries are run on a cold cache
- It executes a Clear Calculations command so that for the current session the cube appears as though its MDX Script contains no commands
- For each statement in the array of statements from the MDX Script, it then:
- Executes the first statement in the MDX Script within the session, so that the cube now acts as though its MDX Script contains only this statement and all previously executed statements
- Runs the query you entered in the textbox
- Stores how long the query took to run, plus other interesting metrics
- Once the query has run on the equivalent of the entire MDX Script in the cube, a report is generated which contains graphs and charts illustrating the data captured earlier
As a result you get to see how much each calculation has contributed to the overall time taken by the query; when you see a big jump upwards in the query time graph (that isn’t followed by a big fall subsequently – which could happen with scoped assignments) then at that point in the MDX Script there’s an expensive calculation.
As you’ll see if you download the source code it is in a very basic state at the moment, but it works most of the time for me and has come in very handy on a number of occasions. There are a lot of changes and improvements that I’d like to make (such as recording the total number of cells returned by the query, the total number of non-empty cells and the number of Query Subcube events at each step) and if anybody out there has other suggestions or would like to sign up as a developer I’d be only too happy to hear from you.
I also need to thank Greg Galloway for making some invaluable contributions to the code and for fixing at least one critical bug for me. This is probably also a good point to mention another project on Codeplex that Greg and Darren Gosbell have been working on over the last few months, BIDS Helper:
http://www.codeplex.com/bidshelper
… which contains some really useful extra functionality for people working with AS in BI Development Studio.
Hi Chris,Thanks for the script. I will have to try it out. Can it be used in AS 2000?
No, I\’m afraid this is AS2005 only.
Hi.. My script portuguess?
Hi Chris , Query execution time is more also the drop-down for the DB’s to select needs re-sizing.
I’ve added txtIters, for iterations, to smooth out the graph a bit, with a default of 4. Also, based on popular demand (from Ramesh), I’ve widened the text boxes. Here’s my “fork” on github:
https://github.com/tallpeak/mdxscriptperf
Wow, thanks for doing this! I didn’t realise anyone used this any more – I certainly haven’t used it for years. I’m pleased to see it has made the journey over to GitHub and it has received some love from someone…
I’m afraid download link is no longer available. Pretty disappointed since I was looking forward to try out this tool. Would you please provide another link?