Does running a SQL Server 2005 database in compatibility level 80 have a negative impact on performance?

前端 未结 4 1115
半阙折子戏
半阙折子戏 2021-01-04 10:12

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, dat

4条回答
  •  爱一瞬间的悲伤
    2021-01-04 11:04

    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.

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

    1. Parameter Sniffing: When using a stored procedure, sql server will calculate exactly one execution plan at the time, you first call the procedure. The execution plan depends on the parameter values given for that call. In our case, procedures which normally took about 10 seconds are running for hours under mssql 2005. Take a look here and here.

    2. 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.

提交回复
热议问题