Solved

How to avoid Stored Proc ?

Posted on 2012-03-12
7
328 Views
Last Modified: 2012-04-05
Hi Gicks,

Here I have one scenerio.

There is one Stored Proc which contains 5000 LOC. During Execution of this Stored Proc, MDX query is generated dynamically. Based on this MDX query, SSRS report was built. It takes long time to display report.

- Is there any alternate way to avoid this Performance Issue. ?  
- Is there any alternate method to avoid this Stored Proc.

Regards
Raveen
0
Comment
Question by:Ravee123
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 15

Expert Comment

by:Tim Humphries
ID: 37713556
Hi,

I suspect that if the report takes a long time to run the problem is with the MDX or the cube structure rather than the time taken by the procedure to build the query.

Can you post the MDX generated? Presumably this varies depending on input parameters - a few examples of output from the procedure would be useful.

Thanks

Tim
0
 
LVL 44

Expert Comment

by:AndyAinscow
ID: 37713565
>>Based on this MDX query, SSRS report was built. It takes long time to display report.

If the data for the report doesn't change (or only changes occasionally) then you could store the results into a temporary table and base the report on that table instead of generating the data each time you display the report.
0
 
LVL 40

Expert Comment

by:lcohan
ID: 37714749
What SQL Server version(s)/edition(s) are you using and what service pack levels?
Also, did you tried to manualy excute the stored proc against your SQL server to separate the backend from the front end report? If the stored proc takes long you need to optimize your code and/or add indexes but if the SP execution is reasonable then you need to optimize your SSRS environment(hardware/network/client?)
0
Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

 
LVL 51

Expert Comment

by:Ted Bouskill
ID: 37715452
OMG  No stored procedure should have 5,000 lines of code.  I agree with previous comments that you should consider splitting it up and then optimize each step.
0
 
LVL 25

Expert Comment

by:jogos
ID: 37715995
When having 5000 lines of code my guess it contains a lot of 'the same' but duplicated because of one or two things differ between handling type A, type B .... K .
0
 

Author Comment

by:Ravee123
ID: 37720185
Not Duplicated. It has different scenerios.

Hi,

I suspect that if the report takes a long time to run the problem is with the MDX or the cube structure rather than the time taken by the procedure to build the query.

Can you post the MDX generated? Presumably this varies depending on input parameters - a few examples of output from the procedure would be useful.

Thanks

Tim

Unable to post that SP and MDX is generated within this SP.
0
 
LVL 15

Accepted Solution

by:
Tim Humphries earned 500 total points
ID: 37720268
Hi,

But you can presumably run the sp in isolation and post the MDX that results from it in different scenarios. That may enable the MDX query to be better understood - as well as what the sp is doing and why the solution was implemented in this way in the first place.

If you can't run  the sp in isolation, you can use Profiler to capture the MDX being executed when the report runs.

Thanks

Tim
0

Featured Post

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
A Stored Procedure in Microsoft SQL Server is a powerful feature that it can be used to execute the Data Manipulation Language (DML) or Data Definition Language (DDL). Depending on business requirements, a single Stored Procedure can return differe…
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.

630 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question