PRB: Auto Created Statistics Are Sampled by Using a Specified Sampling Rate (819953)
The information in this article applies to:
- Microsoft SQL Server 2000 (all editions)
SYMPTOMSIf
you update the statistics in a table and specify a sampling rate that is less than 100
percent, the index statistics are updated by using a 100
percent sample, but the auto created statistics are updated by using the
specified sampling rate. You may experience this problem when you run the following Transact-SQL statement: UPDATE STATISTICS <TableName> WITH all, SAMPLE 10 PERCENT
UPDATE STATISTICS <TableName> SAMPLE 25 PERCENT CAUSEIf the SQL Server optimizer determines that sampling the
rows for the indexes at 100 percent instead of at the requested rate may not
add significant costs, it performs a full sampling of the rows in the
table. This full sampling helps the SQL Server optimizer to obtain more accurate information about the
distribution of data. However, the auto created statistics in the table are
sampled by using the specified sampling rate.WORKAROUNDTo work around this problem, make sure that the auto created statistics are sampled
for all the rows in the table. To do so, use one of the following commands: UPDATE STATISTICS <TableName> WITH COLUMNS, SAMPLE 100 PERCENT -or- UPDATE STATISTICS <TableName> WITH FULLSCAN REFERENCESFor more information about the UPDATE STATISTICS statement, visit the
following Microsoft Web site: For more information about the DBCC SHOW_STATISTICS statement, visit
the following Microsoft Web site:
Modification Type: | Major | Last Reviewed: | 7/7/2003 |
---|
Keywords: | kbprb KB819953 kbAudDeveloper |
---|
|