Select the product you need help with
PRB: Nested Loop Join That Uses A "BOOKMARK LOOKUP ...WITH PREFETCH" May Hold Locks LongerArticle ID: 260652 - View products that this article applies to. This article was previously published under Q260652 SYMPTOMS
If an execution plan uses a Nested loop join and a bookmark lookup, which uses the WITH PREFETCH clause, the locks are held for the duration of the nested loop joins determining the qualifying bookmarks. After the bookmark is used to fetch the outstanding column data and that data is placed in the output buffer, the lock is then released. This behavior may lead to the blocking of other system process ids (spids).
WORKAROUND
If you change the join hint from LOOP to either HASH or MERGE, the blocking does not occur.
MORE INFORMATION
This behavior can be illustrated by using the following example:
StmtText
---------------------------------------------------------------------------------------------------------------------------------------------
|--Bookmark Lookup(BOOKMARK:([Bmk1002]), OBJECT:([TestLoopJoin].[dbo].[person] AS [c]) WITH PREFETCH)
|--Nested Loops(Inner Join)
|--Nested Loops(Inner Join)
| |--Index Seek(OBJECT:([TestLoopJoin].[dbo].[tickler].[tickler_code] AS [a]), SEEK:([a].[tickler_code]='SPIRITEXT') ORDERED)
| |--Clustered Index Seek(OBJECT:([TestLoopJoin].[dbo].[member].[pk_member] AS [b]), SEEK:([b].[mbr_acct]=[a].[mbr_acct]) ORDERED)
|--Index Seek(OBJECT:([TestLoopJoin].[dbo].[person].[pk_person] AS [c]), SEEK:([c].[mstr_acct]=[b].[mstr_acct]) ORDERED)
The Bookmark Lookup logical and physical operator uses a bookmark (row ID or clustering key) to look up the corresponding row in the table or clustered index. The Argument column contains the bookmark label used to look up the row in the table or clustered index. The Argument column also contains the name of the table or clustered index in which the row is looked up. If the WITH PREFETCH clause appears in the Argument column, then the query processor has determined that it is optimal to use asynchronous prefetching (read-ahead) when looking up bookmarks in the table or clustered index. PropertiesArticle ID: 260652 - Last Review: October 17, 2003 - Revision: 3.2
|


Back to the top








