• Aaron N. Cutshall (2/19/2009)


    I investigated the possibility of parameter sniffing, so I changed the function from an Inline Function to a multi-line function yet the problem persists.

    How?

    Can you, on your prod box, recompile the function (sp_recompile <Function name> ) and then try to run it. See if it comes back any faster.

    Is this a recent occurance or has this always been broken on Production?

    Can you do stats updates on all tables involved and see if that helps?

    You said the plans were different. Can you please post both of those exec plans?

    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