Query execution

  • Hi Team,

    We have a stored procedure. When we ran that query in development server its executing in 5 sec, but when we are running it on production its taking more than 20 mins.

    So which are the things we need to check ?

    Can you please let me know all the possibilities that we need to check and also appropriate actions.

    Thank You.

    Regards,
    Raghavender Chavva

  • THe main difference is the load on production server such as compiled plans in buffer, user connections and DISK related contention. It could be number of CPUs, memory configuration and disk alignment.

    First things first the development server database size may not be matchable to the size of production database. Say if the Dev. database is restored from production then all the plans may get recomplied with a new query plan for better execution.

    How frequently you are peforming database maintenance activities such as REINDEX/REORG/UPDATE STATISTICS on production instance?

    -Satya SK Jayanty
    SQL Server MVP (Follow me @sqlmaster)
    Author of SQL Server 2008 R2 Administration CookBook
    SQL Server Knowledge Sharing network

  • It would be helpful to give some information about the Dev environment & the Prod environment.

    What is the same between them ? What is different ?

    Do some basic research and investigation so your question can be more meaningful to yourself & others.

  • I agree with homebrew01. It could be any number of things. Please have a careful read through this article and post the actual (not estimated) execution plan from both environments:

    http://www.sqlservercentral.com/articles/SQLServerCentral/66909/%5B/url%5D

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply