Execution Plan TEST vs LIVE

  • I have a situation where a script runs in just over 1 Minute in test but in Live it takes nearly 30mins.

    I have identified it to be down to a section of code that is executed 1/2M times in the execution plan. 1 execution for each row returned. This action doesn't happen in test there is only 1 execution.

    Test stats indexing are completely inaccurate, Live is up to date.

    OK test is Virtual Live is Physical. But what could cause it to do 500M executions in Live.

  • Sorry 500K execution in Live.

    Why would it choose such an awful plan in LIVE

  • Could you post both execution plans to have a better idea on what you're talking about?

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • Without seeing the plans, I'm speculating. But, if the data sets are radically different between the two servers, that might explain it. If the cost threshold for parallelism is different. If the ANSI settings are different. And, if the statistics are out of date, they are the primary driver, you can pretty much expect to see differences.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

  • Data is pretty much the same,

    Stats are up to date on LIVE,

    Out of date on Test (this was what confused me).

    Seems like the Environments are too different that is what is causing the issue.

    Virtual vs Physical

    Core difference 4 vs 8

    Mem difference.

    Config = MAxdop, cost threshold etc.

    Thanks for your responses.

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

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