Query Execution Time

  • Hi All,

    I need your helps.

    I have a proc .It is runing fast after restart sql server.

    But I try to run second time it is runing slow.

    Have you any idea?

    Is it related with statistics or sql server parameter ?

    But table statistics is ok

    Can you help me.Is it is very urgent..

    Thanks

  • You'll need to provide a bit more info.

    Are you running again with same parameters?

    Are the execution plans the same?

    Is anything happening on that table (large updates/inserts/deletes) in between the two executions of this sp?

    Check for locking/blocking issues?

    What happens in PerfMon when you run it (both times)?

    As usual, it depends. It's hard to say with the little info provided.

  • When you restart SQL Server it clears the buffers, forces a recompile and recreates TempDB.

    Are you noticing a consistent performance gain or is it erratic?

    Have you tried running profiler?

    For better, quicker answers on T-SQL questions, click on the following...
    http://www.sqlservercentral.com/articles/Best+Practices/61537/

    For better answers on performance questions, click on the following...
    http://www.sqlservercentral.com/articles/SQLServerCentral/66909/

  • Thats what I find confusing. He's saying it runs slower the second time after a reboot. You'd expect maybe to run slower the first time due to compilations and empty cache etc and quicker the second time, not the other way around (as he's suggesting)?

    Can you post SP / table definitions / Query plan please?

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

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