Link to home
Start Free TrialLog in
Avatar of gvamsimba
gvamsimbaFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Stored Procedures Performance Tuning in SQL Server

Hi, I am new to performance tuning of stored procedures. I got to improve the performance
of a particular stored procedure which is making application to load the page slowly.
The front end application is .net and DB is SQL Server 2008.

Can any one please let me know how do I debug the stored proc to see which part of the stored proc
is taking too much time ? do i need to use any execution plans ?

Many Thanks
Avatar of didnthaveaname
didnthaveaname

I would run a profiler trace while you hit the page making the request. Hopefully there's a specific app name created in the connection string for the webapp so you can filter your results for that. Otherwise, it should default to .net something rather. The things you're interested in are how long the query takes to complete and the actual query being executed. I usually like to copy/paste out the query and execute it in ssms to see if it runs faster or not. From there, I absolutely recommend looking at the actual execution plan to see where the heaviest lifting is going on and then focus in on that. Ssms may even be kind enough to recommend missing indexes that can support the query.
Avatar of gvamsimba

ASKER

Many thanks, can you please let me know how to use the execution plans in an effective manner ?
How do we know if any indexes are to be added or modified ?
Thanks
ASKER CERTIFIED SOLUTION
Avatar of didnthaveaname
didnthaveaname

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Brian Crowe
if you can, post your stored procedure text here and we can look for any obvious issues.