Skip to main content
5 events
when toggle format what by license comment
Oct 3, 2011 at 16:31 comment added Jimbo Get the query plan for the entire proc.
Oct 3, 2011 at 15:42 comment added atommc I'm having difficulty figuring out how I'm going to get the good plan of a query that is embedded in a proc. When I extract the proc queries and run it in Query Analyzer it reverts back to its poor plan and long runtime.
Oct 3, 2011 at 15:39 comment added atommc Restarting has no effect. Once the query starts running well then it stays that way. The only way to make it perform poorly again is to do an ALTER on it. The smallest ALTER Proc will cause the query to go back to 24 hour execution.
Oct 3, 2011 at 13:00 comment added datagod Caching may also play a part. If SQL is restarted, the cache will be cleared, which may explain why it takes so long at first. Also tempdb expansion will have to re-occur, and if you are on a single disk this will add to the time at first as well.
Oct 3, 2011 at 12:14 history answered Jimbo CC BY-SA 3.0