Browse by Tags

23 February 2011
Slow in the app, fast in SSMS
Users complain about a timeout but when you run the exact same query in SSMS it runs in a flash. Sounds familiar? I've been baffled by this before. I worked out that I was getting a different query plan in SSMS because of different SET OPTIONS but, having dealt with that, I was then stuck with parameter... Read More...
Filed under:
14 July 2010
Be careful with table variables
I just looked into a poorly performing stored procedure and brought it down from over 4 minutes to under 4 seconds by making one simple change: converting a table variable into a temporary table. What's interesting is that there were only about 20,000 rows of about 1,100 bytes each in the table variable... Read More...
18 March 2010
Have you really fixed that problem?
The day before yesterday I saw our main live server's CPU go up to constantly 100% with just the occasional short drop to a lower level. The exact opposite of what you'd want to see. We're log shipping every 15 minutes and part of that involves calling WinRAR to compress the log backups before... Read More...
16 February 2010
Cursor bad, set-based good
I just had another reminder, as if one was needed, that a cursor should be your last resort to get something done. I was looking to shave some time off my data warehouse build job and noticed a step that looked like it was taking a lot longer than I would expect. I found it was doing 12 cursors in a... Read More...
Filed under: