Home > SSRS > Speed up MDX query preparation in Reporting Services

 

Speed up MDX query preparation in Reporting Services

January 21st, 2009

We often need to build some advanced functionality into our reports and since the Reporting Services query designer does not provide a very advanced way to create MDX statements, our only option is to get our hands dirty and write some code ourselves. One of the things we must consider is the time that the query designer needs to validate our syntax, execute the query and determine what fields to be created based on the data set it receives from Analysis Services.

When we specify a number of query parameters, we have the option to give them default values:

image

If we do not do this, the query will be executed with the default dimension member instead of the a specific value as a parameter, which can be slow and unnecessary in the usual case where the default member is the (All) member. Instead, we should always specify a value which is to be used for limiting the sample data set. Ideally, is should be small but not empty. If the parameter is too limiting and the MDX query does not return any values the data fields will not be populated.

Specifying default values speeds up development time, especially when using complex cubes, where Reporting Services queries can be slow as its dimension cross joins can be very big.

Chris Webb also blogged in regards to this issue. I strongly recommend you read his post.

If you enjoyed this post, make sure you subscribe to my RSS feed!

Related posts:

  1. Reporting Services Styles in a Database Table
  2. Passing unCONSTRAINED Set and Member parameters between reports in Reporting Services
  3. Advanced javascript in Reporting Services

 

SSRS ,

  1. Ozziemedes
    January 4th, 2010 at 23:45 | #1

    Hi Boyan,

    Quick one on this… I use this approach myself, and thought I'd add a refinement that I've discovered in SSRS 2005. When you first create the default value, SSRS will produce a data set to fetch the default member from the SSAS DB. When you're over-riding the default parameter value in the MDX designer with a default parameter specified by the report shell itself, you can just delete the autogenerated data-set.

    I've found that deleting the dataset increases report performance considerably when you're passing a member unique name to a StrToMember function in your MDX report query.

    As I said – haven't checked this out in SQL 2008 yet, but I'd be willing to bet it's the same.

  2. Boyan Penev
  3. Anonymous
    February 12th, 2010 at 21:09 | #3

    The best solution is it add true in the report XML file. It works well.

Comments are closed.

Switch to our mobile site