sp_tables 调用花费更多时间导致阻塞
我们可以看到,在我们的perl程序运行期间,基本上连接到SQLserver来插入/删除/更新数据,下面的调用非常频繁 sp_tables @table_name='NOXXTABLE'
。我们看到对于许多 SPID 来说,调用发生了很多次。
在 SQLserver 中运行 sp_tables @table_name='NOXXTABLE'
时,我们可以看到它没有返回任何行。它通常在几毫秒内完成。
但在分析之后,当我们检查阻塞 SPID 的特定 SQLText(sp_tables @table_name='NOXXTABLE')
的运行时时,它的运行时间从 0 秒到 1 分钟不等,并且被调用非常非常经常在同一个 SPID 内。许多 SPID 也会发生同样的情况,它们再次多次调用 sp_tables
,每次调用都会花费大量时间。
有什么解决办法可以摆脱这种情况吗?
We could see that during our perl program runs which basically connects to SQLserver to insert/delete/update data, the below is called very frequentlysp_tables @table_name='NOXXTABLE'
. We see that for many SPID's the call happens a lot of times.
On running sp_tables @table_name='NOXXTABLE'
in SQLserver we can see that it returns no rows. It usually completes in milliseconds.
But after profiling, when we checked the runtime of the particular SQLText(sp_tables @table_name='NOXXTABLE')
for the blocking SPID's, it was varying from between 0 seconds to 1 minute and was getting called very very frequently within the same SPID. The same is happening for many SPID's which again have multiple calls to sp_tables
each taking a lot of time.
Is there any solution to get out of this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
NOXXTABLE 由 DBD::ODBC 的 ping 方法使用。如果您使用 DBD::ODBC 调用 DBI 的 ping 方法,它会执行表('', '', 'NOXXTABLE', '')。如果您想减少调用 ping less 或使用更适合您的系统的其他代码覆盖 DBD::ODBC 的 ping 方法。
The NOXXTABLE is used by DBD::ODBC's ping method. If you call DBI's ping method with DBD::ODBC it does a tables('', '', 'NOXXTABLE', ''). If you want to do it less call ping less or override DBD::ODBC's ping method with other code more appropriate for your system.