SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 Index performance
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

ranvir_2k
Posting Yak Master

United Kingdom
160 Posts

Posted - 10/15/2013 :  07:05:27  Show Profile  Reply with Quote
Hi all,

I have a stored procedure that was taking 4 hours to run. So I used the tuning advisor for some index and stats recommendations. It estimated that the performance improvement would be 90%.

These indexes and stats improved performance drastically, the stored proc only took 7 mins to run.


However it has since gone back to taking 4 hours to run.
If I use the tuning advisor it does not recommend any new indexes on top of the ones I have already used.

So what could be the problem?

Thanks

tkizer
Almighty SQL Goddess

USA
36907 Posts

Posted - 10/15/2013 :  08:13:34  Show Profile  Visit tkizer's Homepage  Reply with Quote
It's likely a bad plan or out of date statistics. Check the execution plan to see if it's using the new index(es). Try updating stats, or you could try recompiling it if it got a bad plan. And if this continues to happen, you could add the WITH RECOMPILE option to the stored procedure, provided it's not run very often (like thousands of times per minute) unless you have the CPU overhead.

Tara Kizer
SQL Server MVP since 2007
http://weblogs.sqlteam.com/tarad/
Go to Top of Page

jackv
Flowing Fount of Yak Knowledge

United Kingdom
2060 Posts

Posted - 10/16/2013 :  01:44:42  Show Profile  Visit jackv's Homepage  Reply with Quote
One consideration , when adding indexes , is the impact it will have on INSERTS , DELETES and index maintenance.

Jack Vamvas
--------------------
http://www.sqlserver-dba.com
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.09 seconds. Powered By: Snitz Forums 2000