且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

为什么存储过程查询有时需要很少的时间来执行

更新时间:2023-09-08 20:08:04

有几种可能性:

正如Amir已经指出的那样,一个原因可能会干扰锁等.使用SSMS检查不同类型的冲突:使用SQL Server进行监视Management Studio [^ ]

如果没有锁定问题,并且您写了刷新应用程序有帮助,那么这听起来也可能是在调用方.检查瓶颈是否存在以及您的连接设置(包括连接池)是否正确.
There are several possibilities:

As Amir already pointed out one reason could interfering locks etc. Use SSMS to check different kinds conflicts: Monitoring with SQL Server Management Studio[^]

If there are no locking issues and you wrote that refreshing application helps, it also sounds that the problem may be on the calling side. Check if the bottleneck is there and that your connection settings including connection pool are correct.


您好,

由于这是限制性最强的隔离级别,它将尝试获取表行范围上的锁.因此可能需要花费一些时间.但是请检查分析器中是否有其他查询正在后台运行.

还检查您是否已全新安装SQL Server?

谢谢
-amit.
Hi,

as this is the most restrictive isolation level , it will try to acquire lock on your table rows range. so it may so happen it takes some time for that. but check in profiler if anyother query is running on background or not.

also check if you have fresh installation of SQL server ?

thanks
-amit.


确保movie_Show_Stack在下面的列中具有正确的索引

row_no
col_No
screen_id
class_id
Show_ID
Movie_ID
movie_ShowDate
Make sure that movie_Show_Stack has proper index on below columns

row_no
col_No
screen_id
class_id
Show_ID
Movie_ID
movie_ShowDate