Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8082193
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T17:00:18+00:00 2026-06-05T17:00:18+00:00

A server running SQL Server 2005 was converted into a virtual machine. The original

  • 0

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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T17:00:19+00:00Added an answer on June 5, 2026 at 5:00 pm

    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:

    create procedure [dbo].[INUpdateStatistics]
    as
      set nocount on
    
      create table #Tables ( Table_Qualifier sysname, Table_Owner sysname, Table_Name sysname, Table_Type VarChar(32), Remarks VarChar(254) )
    
      declare CTable cursor local for select Table_Name, Table_Owner, Table_Type from #Tables order by Table_Name
      declare @TableName as sysname
      declare @TableOwner as sysname
      declare @TableType as sysname
    
      -- Get the list of tables in the database.
      insert into #Tables exec sp_tables
      open CTable
      fetch next from CTable into @TableName, @TableOwner, @TableType
      -- For each table ... .
      while @@Fetch_Status = 0
        begin
        if @TableOwner = 'dbo' and @TableType = 'TABLE'
          begin
          -- Update statistics for all user tables.
          execute( 'update statistics [' + @TableName + '] with fullscan, all' )
          -- Recompile all stored procedures and triggers when they are next executed.
          exec sp_recompile @objname = @TableName
          -- Throttle the loop.
          waitfor delay '00:00:01'
          end
        fetch next from CTable into @TableName, @TableOwner, @TableType
        end
    
      -- Houseclean.
      close CTable
      deallocate CTable
      drop table #Tables
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to use sqlcmd on a windows machine running SQL Server 2005 to
I've successfully migrated a website running a SQL Server 2005 db to a new
We have a Windows machine running SQL Server 2005, and we need to be
I'm running SQL Server 2005 Express. And I'm trying to do a bulk insert/import
I have sql 2000 server and sql 2005 server running on the same box
I've got a table ItemValue full of data on a SQL 2005 Server running
For one of my applications, I'm running SQL Server 2005, and I'm running it
I have a job on SQL Server 2005 running a ssis package. The package
How can I know which stored procedure is running in SQL Server 2005. And
I have a SQL Server 2005 instance running and a client of mine deleted

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.