仅在我的机器上缓慢运行查询 [英] Slow running query on my machine only

查看:27
本文介绍了仅在我的机器上缓慢运行查询的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在针对 Microsoft SQL Server 2005 运行一个简单的 select * from table 查询.该表有大约 41000 条记录,带有 PK 聚集索引,我正在使用Windows 集成身份验证.

I'm running a simple select * from table query against Microsoft SQL Server 2005. The table has about 41000 records with a PK clustered index and I'm using windows integrated authentication.

  • 当我使用 Microsoft SQL Server Management Studio 在我的机器上运行它时,查询在大约 1 小时 45 分钟内完成.我试过从网格切换到文本输出,使用 SQLCMD 从命令行运行它也试过 ececuting DBCC USEROPTIONS, DBCC DROPCLEANBUFFERS, DBCC FREEPROCCACHE 在查询之前......没有任何改变查询的速度.

  • When I run this on my machine using Microsoft SQL Server Management Studio the query completes in about 1h45m. I have tried swithing from grid to text output, running it from command line using SQLCMD also tried ececuting DBCC USEROPTIONS, DBCC DROPCLEANBUFFERS, DBCC FREEPROCCACHE prior the query... nothing changed the speed of the query.

当我使用我的凭据从同事的工作站运行它时,查询立即正常完成.如果同事使用他们的凭据在我的工作站上运行查询,则查询速度会非常慢,如上所述.

When I run it from colleague's workstation using my credentials the query completes normally in no time. If a colleague runs the query on my workstation using their credentials the query is very slow as described above.

我已经没有办法解决这个问题了.不知何故,问题似乎与我的机器有关,但我无法理解.还请考虑以下事项:

I'm running out of ideas how to troubleshoot this problem. Somehow the problem seem to be linked to my machine, but I can not make sense out of it. Please also consider the following:

  • 我检查并确保我的机器(Win7-64 位)上没有启用 ODBC 跟踪.我已经使用 Microsoft Management Studio 2008 R2 安装了 SQL Server 客户端工具,这就是我用来查询数据库的工具.
  • 我也使用 VS2010 运行相同的 sql 查询,结果完全相同.
  • 我针对同一表/数据库但在不同服务器上的副本运行查询,但问题仍然存在.
  • 当我运行 select count(*) from table - 查询正常完成,没有延迟.
  • 当我使用 SQL Server Profiler 运行跟踪时,查询只是一个长时间运行的查询 - 我看不到任何异常.
  • 当我使用文本输出在 MS SQL Server Management Studio 中运行查询时,我可以看到在大约 85 条记录的初始缓冲区之后,后续记录一次到达大约 400 条记录.例如85 -> 407 -> 804 -> 1210 -> 1605 -> 1897 -> 2161 -> 2753 -> 3051 -> 3342 -> 3676 -> 4002 等等.对比同事工作站,可以看到记录数据到达时绘制为连续流!???
  • 我还比较了我的机器上的实际查询执行计划和查询正常运行的另一台机器上的实际查询执行计划 - 它们看起来是相同的.

有人能理解这里出了什么问题吗?为什么在我的机器上运行它很慢,但它可以从另一个工作站正常执行?...是否有任何建议的操作步骤来解决此问题?

Could anyone make sense what could be going wrong here? Why running this from my machine is very slow but it executes normally from another workstation?... Any suggested actions steps to troubleshoot this problem?

提前感谢大家!

推荐答案

我发现了问题 - 这是网络适配器驱动程序更新.一旦我回滚驱动程序,查询就会按预期执行,没有延迟!

I found the problem - it was a network adapter driver update. Once I rolled back the driver the query executed as expected no delays!

我花了很长时间才确定下来.作为记录,我的网卡是Intel(R) 82579LM Gigabit Network Connection",流氓网络驱动程序来自 Windows 更新.我的工作站是 HP 8200 Elite.驱动程序回滚后,我从 HP 支持站点下载安装了最新的网络驱动程序,这似乎是解决方案 - 到目前为止,我没有遇到运行缓慢的 SQL 查询的问题:)

It took me quite a while to nail this down. For the record my network card is "Intel(R) 82579LM Gigabit Network Connection" the rogue network driver came through windows update. My workstation is HP 8200 Elite. After the driver roll back, I downloaded installed the latest network driver from the HP support site and it seems this is the solution - so far I do not have issues with slow running SQL queries :)

这篇关于仅在我的机器上缓慢运行查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆