March 16, 2005 at 7:34 am
I had a poor performing proc .. I identified 2 missing indexes. I added the indexes and updated stats. The offending proc is not taking advantage of the new indexes. I've issued a sp_recompile but to no effect. As this is production I can't do much more.
In a test environment I had to physically drop the procedure and recreate it before it used the new indexes.
Even an edit to the procedure did not cause it to change its query plan.
This doesn't quite fit with what I'd expect .. any thoughts ??
[font="Comic Sans MS"]The GrumpyOldDBA[/font]
www.grumpyolddba.co.uk
http://sqlblogcasts.com/blogs/grumpyolddba/
March 16, 2005 at 11:36 am
How about modifying the stored procedure to force it to use the indexes with query hints?
K. Brian Kelley
@kbriankelley
March 16, 2005 at 1:14 pm
you can also try to clear the buffers by executing dbcc freeproccache and see if that helps.
March 16, 2005 at 1:38 pm
This generally isn't recommended in a production system as it will drop execution plans on all objects, not just the one in question.
K. Brian Kelley
@kbriankelley
March 16, 2005 at 2:09 pm
Brian is right. I didn't see that it was production.
March 16, 2005 at 2:14 pm
I have been able to run an ALTER on some production sp (with the same code, of course) and those were recompiled on the spot. What is even more you could see the speed difference in the profiler trace that was running LIVE!
Don't ask me why Profiler was running in production. It was a proof I had to make to the customer at their request
* Noel
March 17, 2005 at 1:43 am
Yes the alter could be a way .. The production system is very controlled ( by the DBA team including me ) I might be able to do that. Generally any change has to be authorised and signed off so I was more than a little annoyed about this proc.
The strange thing is that I added the indexes and the cluster was then failed over to add a new node .. Stats were updated on all tables later on in the night so it was somewhat unusual. Another proc which used the same indexes picked them up fine ( they were only indexes on join columns for the queries too -- don't ask < grin > )
Still life is never boring !!!
[font="Comic Sans MS"]The GrumpyOldDBA[/font]
www.grumpyolddba.co.uk
http://sqlblogcasts.com/blogs/grumpyolddba/
March 17, 2005 at 2:04 am
Can you drop and recreate the proc?
March 17, 2005 at 5:15 am
Maybe these will help (at least something to read )
http://support.microsoft.com/default.aspx?scid=kb;EN-US;243586
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnsql2k/html/statquery.asp
http://www.microsoft.com/sql/techinfo/tips/development/queryopstats.asp
http://www.microsoft.com/technet/prodtechnol/sql/2005/recomp.mspx
Last one is for SQL Server 2005
--
Frank Kalis
Microsoft SQL Server MVP
Webmaster: http://www.insidesql.org/blogs
My blog: http://www.insidesql.org/blogs/frankkalis/[/url]
Viewing 9 posts - 1 through 8 (of 8 total)
You must be logged in to reply to this topic. Login to reply