Query runs fast, but runs slow in stored procedure

后端 未结 6 411
遥遥无期
遥遥无期 2020-12-04 16:52

I am doing some tests using the SQL 2005 profiler.

I have a stored procedure which simply runs one SQL query.

When I run the stored procedure, it takes a lon

6条回答
  •  北荒
    北荒 (楼主)
    2020-12-04 17:30

    On my issue I've run:

    exec sp_updatestats 
    

    and this speed up my sp from 120s to just 3s. More info about Updating Statistics can be found here https://msdn.microsoft.com/en-us/library/ms173804.aspx

提交回复
热议问题