Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 performance issue

Author  Topic 

nextaxtion
Yak Posting Veteran

54 Posts

Posted - 2013-09-20 : 01:44:13
hi team,

i have a procedure that do multiple calculation , insert, update , select data from tables, execute other procedures.
My problen is that it is taking too much time to complete but i am not able to find which part of procedure is taking time.
Is ther any way to get know the exact part of whole proc. I tried various method like profler and long rnning queries finding an activity monitor
but that help nothing.

Kindly suggest me correct approach.

prithvi nath pandey

waterduck
Aged Yak Warrior

982 Posts

Posted - 2013-09-20 : 03:02:39
The debug button?
Go to Top of Page

James K
Master Smack Fu Yak Hacker

3873 Posts

Posted - 2013-09-20 : 08:32:20
quote:
Originally posted by nextaxtion

hi team,

i have a procedure that do multiple calculation , insert, update , select data from tables, execute other procedures.
My problen is that it is taking too much time to complete but i am not able to find which part of procedure is taking time.
Is ther any way to get know the exact part of whole proc. I tried various method like profler and long rnning queries finding an activity monitor
but that help nothing.

Kindly suggest me correct approach.

prithvi nath pandey

You can turn on "Query->Include Actual Execution Plan" option (Control-M), run the query and look at the execution plan. It will show you the relative costs of various parts in the stored procedure to help you narrow down where the bottlenecks are. Once you find those, you will get some clues.

Another possibility is to insert debug statements within the stored procedure that prints out the elapsed time, so you can zero in on the parts that are consuming most time.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-09-22 : 02:30:36
You should also be able to find out time taken by individual parts through profiler. which template/counters were you using in profiler?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page

jackv
Master Smack Fu Yak Hacker

2179 Posts

Posted - 2013-09-23 : 10:44:15
As suggested - grabb the queries , with a tool such as Profiler - analyse the Exceution Plans.


There are also some other approaches - such as using DMVs - looking for high impact queries - http://www.sqlserver-dba.com/2012/11/sql-server-find-high-impact-queries-with-sysdm_exec_query_stats.html

Jack Vamvas
--------------------
http://www.sqlserver-dba.com
Go to Top of Page
   

- Advertisement -