Reasons for difference in query plans

  • Hi..

    I have observed the difference in execution plans when i m trying to execute the same stored procedure on different computers..

    can any one help to find out why it is..??

    [font="Comic Sans MS"]Praveen Goud[/font]

  • The statistics may be out of date one server.

  • In addition to stats it could be

    - indexes

    - CPU/Mem

    But I would lean toward stats...

    Just check that the connection details are the same, I have has issues when thing like "SET

    ARITHABORT ON" is different on each connection.. If you are running it through SSMS then check the "Query Option - Adv"

  • Different volume of data

    Different indexes

    Different hardware

    Different database load

    Different statistics

    Different set options

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • Apart from all the above,

    is there any chances because of change in the service packs releases of sql server..

    [font="Comic Sans MS"]Praveen Goud[/font]

  • Quite likely.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • In addition to Gail's list:

    Different Parameters

    "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

  • Grant Fritchey (8/5/2010)


    In addition to Gail's list:

    Different Parameters

    Hi Fritchey..

    happy to see your post for my topic..

    Nice to meet you in this way..

    And you said that Different Parameters also leads to difference in execution plans..

    just confirm me that whether the difference is in no. of parameters or different input data for the procedure..

    [font="Comic Sans MS"]Praveen Goud[/font]

  • Praveen Goud Kotha (8/5/2010)


    just confirm me that whether the difference is in no. of parameters or different input data for the procedure..

    Yes.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • GilaMonster (8/5/2010)


    Praveen Goud Kotha (8/5/2010)


    just confirm me that whether the difference is in no. of parameters or different input data for the procedure..

    Yes.

    What she said.

    "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

  • GilaMonster (8/5/2010)


    Praveen Goud Kotha (8/5/2010)


    just confirm me that whether the difference is in no. of parameters or different input data for the procedure..

    Yes.

    ??

    [font="Comic Sans MS"]Praveen Goud[/font]

  • Praveen Goud Kotha (8/5/2010)


    GilaMonster (8/5/2010)


    Praveen Goud Kotha (8/5/2010)


    just confirm me that whether the difference is in no. of parameters or different input data for the procedure..

    Yes.

    ??

    She means that yes, the number of parameters can make a difference in the plans created, and, yes, different input data for the procedure can cause different plans to be created.

    "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

  • Thank you all the members for their replies/suggestions who participated in my topic..

    especially for Fritchey..

    If any other reasons for "Reasons for difference in execution plans"..

    Please dont forget to post here..

    what i mean to say is: i have solved my issue(it is because of difference in service packs(2 and 3) )..

    but more answers are welcomed to help others too...

    [font="Comic Sans MS"]Praveen Goud[/font]

  • Praveen Goud Kotha (8/5/2010)


    Thank you all the members for their replies/suggestions who participated in my topic..

    especially for Fritchey..

    If any other reasons for "Reasons for difference in execution plans"..

    Please dont forget to post here..

    what i mean to say is: i have solved my issue(it is because of difference in service packs(2 and 3) )..

    but more answers are welcomed to help others too...

    Not especially me, especially Gail. She had the definitive list.

    "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

Viewing 14 posts - 1 through 13 (of 13 total)

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