We had a report which ran “forever”. Seriously it was a long time. After restoring production backups on to a test instance, I ran the same sql. Not good. I could have grown the coconuts whose water I was drinking. There were some indexing opportunities and that made a difference on my test sql server, though on the production box, when running the stored procedure on the newly indexed tables, the wait was not acceptable. What was interesting is that in profilier for the production procedure execution, even stopping the after a few minutes (test was down to a few seconds at this point), the reads were over 10x what I saw on test for a properly completed run. On the other hand, running the procedure innards resulted in a good execution time and same reads as test. This made me think about parameter sniffing. Sure enough, after adding local variables which were set to the input parameter values we had a speedy execution.
-
Recent Posts
Recent Comments
- paulwinans on Hard Coded Values
- Dejan on Hard Coded Values
- paulwinans on SQL Licensing and the Cluster
- paulwinans on Leadership
- paulwinans on Where Are All The People Who Want to be a DBA?
Archives
- February 2018
- July 2017
- July 2016
- May 2016
- October 2015
- September 2015
- August 2015
- July 2015
- May 2015
- April 2015
- March 2015
- February 2015
- January 2015
- December 2014
- November 2014
- October 2014
- September 2014
- August 2014
- July 2014
- June 2014
- March 2014
- February 2014
- January 2014
- December 2013
- November 2013
- October 2013
- April 2013
- March 2013
- October 2012
- August 2012
- July 2012
- June 2012
- May 2012
- April 2012
- February 2012
- January 2012
- July 2010
- June 2010
- May 2010
- April 2010
- March 2010
- February 2010
- December 2009
- November 2009
- October 2009
- September 2009
- August 2009
- July 2009
- May 2009
Categories
Meta