FIX: Prefetching of Rows by Bookmark Lookup May Not Release Locks in Read Committed Isolation

ID: Q250345


The information in this article applies to:
  • Microsoft SQL Server version 7.0

BUG #: 57204 (SQLBUG_70)

SYMPTOMS

Under the Read Committed isolation level, if the execution plan of a SELECT statement chooses to do a Bookmark Lookup, Intent Shared (IS) or Shared (S) locks may not be released after the execution of the SELECT statement has completed.

For this behavior to occur, the following three conditions must be true:

  • The base table must have a clustered index and a non-clustered index.


  • Selected columns must include at least one column that does not have an index.


  • The SELECT statement must elect to return the data through the non-clustered index bookmark. This commonly occurs with the use of ORDER BY and LIKE clauses.



CAUSE

While prefetching rows from the base table, the Bookmark Lookup does not release the locks held on the base table.


RESOLUTION

A supported fix that corrects this problem is now available from Microsoft, but it has not been fully regression tested and should be applied only to systems experiencing this specific problem. If you are not severely affected by this specific problem, Microsoft recommends that you wait for the next SQL Server service pack that contains this fix.

To resolve this problem immediately, contact Microsoft Product Support Services to obtain the fix. For a complete list of Microsoft Product Support Services phone numbers and information on support costs, please go to the following address on the World Wide Web:

http://www.microsoft.com/support/supportnet/overview/overview.asp
The English version of this fix should have the following file attributes or later:

   Date        Time    Version        Size      File name    Platform
   ------------------------------------------------------------------  

   12/29/99   05:57p   7.00.762   11,525,392   S70735A.exe   Alpha
   12/29/99   05:57p   7.00.762    5,021,968   S70735I.exe   Intel
 
NOTE: Due to file dependencies, the most recent hotfix or feature that contains the above files may also contain additional files.


WORKAROUND

To work around this problem, avoid performing SELECT operations while in a transaction or use an index hint to force the clustered index. For example, you can do the following to force the clustered index:


select * from (index = 1) TEST1 order by C2 


STATUS

Microsoft has confirmed this to be a problem in SQL Server version 7.0.


MORE INFORMATION

Bookmark Lookups allow fast random access to rows based on a bookmark value. A Bookmark Lookup uses the bookmark, which can be a row ID or a clustered key, to look up the corresponding row in table or clustered key.

The following example query plan generated by SQL Server uses a Bookmark Lookup with PREFETCH:


StmtText
                                                                                   
---------------------------------------------------------------------------------------------

  |--Bookmark Lookup(BOOKMARK:([Bmk1000]), OBJECT:([Northwind].[dbo].[TEST1]) WITH PREFETCH)

       |--Index Scan(OBJECT:([Northwind].[dbo].[TEST1].[CLUSTIND]), ORDERED) 

Additional query words: locks isolation read committed

Keywords : SSrvLock kbbug7.00
Version : winnt:7.0
Platform : winnt
Issue type : kbbug


Last Reviewed: January 14, 2000
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.