|
|
|
Valued Member
      
Group: General Forum Members
Last Login: Friday, June 14, 2013 7:26 AM
Points: 57,
Visits: 383
|
|
Thank you so much to all that have replied. I can't tell you how much I appreciate it.
What are atypical parameters (sorry, I'm kind of a junior DBA)? From what I understand, the SP wasn't ever even updated. It just stopped working one day. When we point the SP at different boxes (without the recompile), the information pulls up fine on the site. However, when we point it at our production box, it does not work unless I add the recompile code.
Does that change the direction of the answers given?
|
|
|
|
|
SSChampion
        
Group: General Forum Members
Last Login: Today @ 10:48 AM
Points: 10,990,
Visits: 10,578
|
|
"Atypical parameters" refers to the fact that SQL Server may cache a plan based on the actual parameter values passed on the first call of a procedure. If those specific parameter values are not typical (of all possible parameter values) the cached plan may not be a good one for other parameter values. Something like that, anyway 
Statistics Used By The Optimizer Compilation and Re-compilation
Paul White SQL Server MVP SQLblog.com @SQL_Kiwi
|
|
|
|
|
Valued Member
      
Group: General Forum Members
Last Login: Friday, June 14, 2013 7:26 AM
Points: 57,
Visits: 383
|
|
I just wanted to thank you guys for all your input. I added "optimize for unknown" to the sproc and the site is currently responding well.
I believe the parameter sniffing was the main issue.
Thanks again, Matt
|
|
|
|
|
SSChampion
        
Group: General Forum Members
Last Login: Today @ 10:48 AM
Points: 10,990,
Visits: 10,578
|
|
|
|
|