A server running SQL Server 2005 was converted into a virtual machine. The original server had 16 logical cores. The new virtual server only has 4 cores, but is supposed to be faster.
Some stored procedures (that may call views or UDFs) are taking longer to run. This could be due to less parallelism. But, could the query plans still be optimized for 16 cores or do they automatically re-optimize after a hardware change?
If I need to force all plans to be recalculated, what is the best way? Other thoughts?
Parallel Query Processing shows that the saved query plans allow for parallel processing, but are not specifically tied a particular number of threads.
There may be other reasons to periodically compile new query plans, e.g. after updating statistics. A stored procedure can be scheduled to mark all stored procedures for recompilation. I’ve had some success with the following: