Microsoft KB Archive/922063

From BetaArchive Wiki

Article ID: 922063

Article Last Modified on 7/24/2007



APPLIES TO

  • Microsoft SQL Server 2005 Service Pack 1



Bug #: 984 (SQL Hotfix)
Bug #: 441938 (SQLBUDT)


Notice

Microsoft distributes Microsoft SQL Server 2005 fixes as one downloadable file. Because the fixes are cumulative, each new release contains all the hotfixes and all the security fixes that were included with the previous SQL Server 2005 fix release.

This article describes the following about this hotfix release:

  • The issues that are fixed by this hotfix package
  • The prerequisites for installing the hotfix package
  • Information about whether you must restart the computer after you install the hotfix package
  • Information about whether the hotfix package is replaced by any other hotfix package
  • Information about whether you must make any registry changes
  • The files that are contained in the hotfix package


SYMPTOMS

Consider the following scenario. You are running SQL Server 2005 Service Pack 1 (SP1). You enable trace flags 2389 and 2390 to enable automatically generated quick statistics for ascending keys. In this scenario, you may experience the following behavior:

  • You notice a large increase in compile time.
  • SQL Server does not generate an efficient query plan because the correct maximum value for the column cannot be determined.


CAUSE

This problem occurs because SQL Server performs a scan of the appropriate column. This scan takes extra compile time.

RESOLUTION

A supported hotfix is now available from Microsoft. However, this hotfix is intended to correct only the problem that is described in this article. Apply this hotfix only to systems that are experiencing this specific problem. This hotfix might receive additional testing. Therefore, if you are not severely affected by this problem, we recommend that you wait for the next service pack that contains this hotfix.

To resolve this problem, submit a request to Microsoft Online Customer Services to obtain the hotfix. To submit an online request to obtain the hotfix, visit the following Microsoft Web site:

Note If additional issues occur or any troubleshooting is required, you might have to create a separate service request. The usual support costs will apply to additional support questions and issues that do not qualify for this specific hotfix. To create a separate service request, visit the following Microsoft Web site:

Prerequisites

You must have SQL Server 2005 Service Pack 1 (SP1) installed to apply this hotfix.

For more information about how to obtain SQL Server 2005 SP1, click the following article number to view the article in the Microsoft Knowledge Base:

913089 How to obtain the latest service pack for SQL Server 2005


Restart information

You do not have to restart the computer after you apply this hotfix.

Registry information

You do not have to change the registry.

Hotfix file information

This hotfix contains only those files that are required to correct the issues that this article lists. This hotfix may not contain of all the files that you must have to fully update a product to the latest build.

The English version of this hotfix has the file attributes (or later file attributes) that are listed in the following table. The dates and times for these files are listed in Coordinated Universal Time (UTC). When you view the file information, it is converted to local time. To find the difference between UTC and local time, use the Time Zone tab in the Date and Time item in Control Panel.

SQL Server 2005 32-bit version
File name File version File size Date Time Platform
Msgprox.dll 2005.90.2174.0 197,920 17-Jul-2006 20:03 x86
Msmdlocal.dll 9.0.2174.0 15,701,792 17-Jul-2006 20:04 x86
Msmdredir.dll 9.0.2174.0 3,967,776 17-Jul-2006 20:03 x86
Replprov.dll 2005.90.2174.0 547,616 17-Jul-2006 20:05 x86
Replrec.dll 2005.90.2174.0 782,112 17-Jul-2006 20:02 x86
Sqlaccess.dll 2005.90.2174.0 347,936 17-Jul-2006 20:03 x86
Sqlservr.exe 2005.90.2174.0 28,951,896 17-Jul-2006 20:04 x86
Xpstar90.dll 2005.90.2174.0 292,128 17-Jul-2006 20:03 x86
SQL Server 2005 x64-based version
File name File version File size Date Time Platform
Msgprox.dll 2005.90.2174.0 259,360 18-Jul-2006 08:05 x64
Msmdlocal.dll 9.0.2174.0 15,701,792 17-Jul-2006 20:04 x86
Msmdredir.dll 9.0.2174.0 3,967,776 17-Jul-2006 20:03 x86
Replprov.dll 2005.90.2174.0 745,248 18-Jul-2006 08:06 x64
Replrec.dll 2005.90.2174.0 1,008,416 18-Jul-2006 08:04 x64
Sqlaccess.dll 2005.90.2174.0 355,104 18-Jul-2006 08:05 x86
Sqlservr.exe 2005.90.2174.0 39,351,072 18-Jul-2006 08:05 x64
Xpstar90.dll 2005.90.2174.0 539,936 18-Jul-2006 08:05 x64
SQL Server 2005 Itanium architecture version
File name File version File size Date Time Platform
Msgprox.dll 2005.90.2174.0 542,496 17-Jul-2006 22:38 IA-64
Msmdlocal.dll 9.0.2174.0 48,828,704 17-Jul-2006 22:39 IA-64
Msmdredir.dll 9.0.2174.0 6,154,016 17-Jul-2006 22:39 IA-64
Replprov.dll 2005.90.2174.0 1,617,184 17-Jul-2006 22:39 IA-64
Replrec.dll 2005.90.2174.0 2,141,472 17-Jul-2006 22:39 IA-64
Sqlaccess.dll 2005.90.2174.0 349,472 17-Jul-2006 22:38 x86
Sqlservr.exe 2005.90.2174.0 72,235,296 17-Jul-2006 22:40 IA-64
Xpstar90.dll 2005.90.2174.0 950,048 17-Jul-2006 22:36 IA-64


STATUS

Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.

MORE INFORMATION

Ascending key columns can cause inaccurate statistics in tables that have frequent insert operations. These key columns may be IDENTITY columns or datetime columns that represent real-world time stamps. A common problem for some SQL Server applications are cases in which data typically ascends. For example, you have a table that contains a datetime column, and the column represents a current date. SQL Server builds statistics that assume that data will be mostly similar in the future. However, when data typically ascends, most new insertions are out of the previously found range. This behavior may cause poorly performing plans to be created. Filters that select recent data may exclude the whole relation even though a significant number of rows are included.

Trace flags 2389 and 2390 are both new in SQL Server 2005 SP1. These trace flags can help address this problem. SQL Server 2005 SP1 tracks the nature of columns by subsequent statistics updates. When SQL Server determines that the statistics increase three times, the column is branded ascending. The statistics will be updated automatically at query compile time if the following conditions are true:

  • Trace flag 2389 is set.
  • A column is branded ascending.
  • A covering index exists with the ascending column as the leading key.

A statement is compiled to find the highest value, and a new step is added at the end of the existing histogram to model the recently added data.

Trace flag 2390 enables the same behavior as trace flag 2389, even if the ascending nature of the column is not known. As long as the column is a leading column in an index, the optimizer updates the statistics that have the highest value at query compile time. Never use trace flag 2390 alone because this logic would be disabled as soon as the ascending nature of the column is known.

To enable automatically generated quick statistics for known ascending keys, run the following statement:

DBCC TRACEON ( 2389, -1 )

To enable automatically generated quick statistics for all columns that include known ascending keys or unknown ascending keys, run the following statement:

DBCC TRACEON ( 2389, 2390, -1 )

You can also use the -T command-line switch for Sqlservr.exe to enable these two trace flags server-wide . For more information, visit the following Microsoft Developer Network (MSDN) Web site:

For more information about the naming schema for Microsoft SQL Server updates, click the following article number to view the article in the Microsoft Knowledge Base:

822499 New naming schema for Microsoft SQL Server software update packages


For more information about software update terminology, click the following article number to view the article in the Microsoft Knowledge Base:

824684 Description of the standard terminology that is used to describe Microsoft software updates


Keywords: kbexpertiseadvanced kbtshoot kbfix kbsql2005engine kbhotfixserver kbqfe kbpubtypekc KB922063