FIX: SQL Server Optimizer Ignores Index Hint for UPDATE If One or More Non-Clustered Indexes Exist (308760)



The information in this article applies to:

  • Microsoft SQL Server 2000 (all editions)

This article was previously published under Q308760
BUG #: 354950 (SHILOH_BUGS)

SYMPTOMS

If index hints force the use of an index, the SQL Server query optimizer may ignore the index hints under the following circumstances:
  • You use the index hint in an UPDATE statement.
  • The table that you are updating contains one or more non-clustered indexes.

RESOLUTION

To resolve this problem, obtain the latest service pack for Microsoft SQL Server 2000. For additional information, click the following article number to view the article in the Microsoft Knowledge Base:

290211 INF: How to Obtain the Latest SQL Server 2000 Service Pack

STATUS

Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article. This problem was first corrected in Microsoft SQL Server 2000 Service Pack 2.

MORE INFORMATION

The following query reproduces this behavior:
USE pubs
go
SET STATISTICS PROFILE ON
go
UPDATE  authors set au_lname = 'Smith' 
FROM    authors with (index(aunmind))
go
SET STATISTICS PROFILE OFF
				
Instead of using the aunmind index, the optimizer uses the UPKCL_auidind clustered index.

REFERENCES

For information about how to interpret the output of the plan, refer to the "SET SHOWPLAN_ALL" topic in the SQL Server Books Online documentation.

Modification Type:MajorLast Reviewed:10/16/2003
Keywords:kbbug kbfix KB308760