在兼容级别80中运行SQL Server 2005数据库对性能有负面影响吗? [英] Does running a SQL Server 2005 database in compatibility level 80 have a negative impact on performance?

查看:514
本文介绍了在兼容级别80中运行SQL Server 2005数据库对性能有负面影响吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们的软件必须能够在SQL Server 2000和2005上运行。为了简化开发,我们在兼容级别80中运行我们的SQL Server 2005数据库。但是,SQL 2005的数据库性能比SQL 2000的慢(我们还没有使用基准确认这一点)。将兼容性级别升级到90可以提高SQL 2005服务器上的性能。

Our software must be able to run on SQL Server 2000 and 2005. To simplify development, we're running our SQL Server 2005 databases in compatibility level 80. However, database performance seems slower on SQL 2005 than on SQL 2000 in some cases (we have not confirmed this using benchmarks yet). Would upgrading the compatibility level to 90 improve performance on the SQL 2005 servers?

推荐答案

我认为我在某处读到SQL Server 2005数据库引擎应该比SQL Server 2000引擎快大约30%。可能是,你必须在兼容模式下运行你的数据库90以获得这些好处。

I think i read somewhere, that the SQL Server 2005 database engine should be about 30% faster than the SQL Server 2000 engine. It might be, that you have to run your database in compatibility mode 90 to get these benefits.

但是我偶然发现了两种情况,其中性能可以显着下降,当使用mssql 2005与mssql 2000相比:

But i stumbled on two scenarios, where performance can drop dramatically when using mssql 2005 compared to mssql 2000:


  1. 参数嗅探:当使用存储过程时,sql server将只计算一个执行计划时间,首先调用过程。执行计划取决于为该调用提供的参数值。在我们的例子中,通常需要大约10秒的过程在mssql 2005下运行了几个小时。看看此处此处

当使用分布式查询时,mssql 2005在关于远程服务器上的排序顺序的假设方面表现不同。默认行为是,服务器将查询中涉及的所有远程表复制到本地tempdb,然后在本地执行连接。解决方法是使用OPENQUERY,您可以在其中精确控制从远程服务器传输的结果集。

When using distributed queries, mssql 2005 behaves different concerning assumptions about the sort order on the remote server. Default behavior is, that the server copies the whole remote tables involved in a query to the local tempdb and then execute the joins locally. Workaround is to use OPENQUERY, where you can control exactly which resultset is transferred from the remote server.

这篇关于在兼容级别80中运行SQL Server 2005数据库对性能有负面影响吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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