FIX: Suboptimal Performance Using a Cursor to Update a Heap Involved in an Indexed View

This article was previously published under Q282982
This article has been archived. It is offered "as is" and will no longer be updated.
BUG #: 351566 (SHILOH_bugs)
SYMPTOMS
Using a cursor to update a table may result in a long execution time under the following circumstances:
  • There is an indexed view that involves the table being updated.
  • The table being updated does not have a clustered index.
  • A cursor is used to perform the update.
CAUSE
An incorrect join order is chosen during the optimization phase.
RESOLUTION
To resolve this problem, obtain the latest service pack for SQL Server 2000. For additional information, click the following article number to view the article in theMicrosoft Knowledge Base:
290211 INF: How to Obtain the Latest SQL Server 2000 Service Pack
WORKAROUND
Any of the following changes will reduce the changes of encountering the problem:
  • Rewrite the update query to avoid cursor use.
  • Add a clustered index on all underlying tables.
  • Remove any unnecessary indexes on the view.
STATUS
Microsoft has confirmed that this is a problem in SQL Server 2000. This problem was first corrected in SQL Server 2000 Service Pack 1.
heap performance response time speed
Properties

Article ID: 282982 - Last Review: 01/16/2015 21:21:22 - Revision: 3.2

Microsoft SQL Server 2000 Standard Edition

  • kbnosurvey kbarchive kbbug kbfix kbsqlserv2000sp1fix KB282982
Feedback