SQL表响应偶尔会很糟糕...... [英] SQL table response is sporadically bad...
本文介绍了SQL表响应偶尔会很糟糕......的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
嗨朋友们,
我有一个非常简单的查询 -
从[dbo]中选择COUNT(1)。[table1] with(nolock)
当我运行查询时 - 有时需要1秒,有时需要30秒。有人可以帮助我,为什么响应时间有时会更长,而且有时会很好。可能的原因是什么 - 可以请任何人帮助我吗?
Hi Friends,
I have a very simple query-
select COUNT(1) from [dbo].[table1] with (nolock)
When i run the query- sometime it takes 1 second and sometime 30 seconds. Can someone help me why the response time is sometime longer ans sometime good. What may be the possible reason- can please anyone help me?
推荐答案
这可能有很多原因 - 其中一些在本文中讨论过 - 性能 - SQL Server语句在SQL Server 2008 R2上间歇性地变慢 - 数据库管理员堆栈交换 [ ^ ]
适用于SQL 2008,但大多数(如果不是全部)内容也适用于更高版本
如果这没有帮助那么大约39k 要查看的其他内容 [ ^ ]
我们总是习惯于freeproccache - SQL SERVER– Plan Cache–检索并删除–一个简单的脚本|使用Pinal Dave访问SQL权限 [ ^ ]
It could be for a number of reasons - some of which are discussed on this post - performance - SQL Server statements intermittently slow on SQL Server 2008 R2 - Database Administrators Stack Exchange[^]
It's for SQL 2008 but most, if not all, of the stuff applies to later versions too
If that doesn't help then there around 39k other things to look at[^]
We always used to "freeproccache" - SQL SERVER – Plan Cache – Retrieve and Remove – A Simple Script | Journey to SQL Authority with Pinal Dave[^]
这篇关于SQL表响应偶尔会很糟糕......的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文