Solved

How to avoid a  Costly BookMark Lookup

Posted on 2006-11-27
5
1,085 Views
Last Modified: 2008-02-01
Hi I have the following SQL. The Quey returns around 20,000 rows. The Exhibitior_List table  is being accessed via a Non clsutered index.
However all the rows are being looked up in the clustered index. The index depth is 2 for the clutered index. So I gather for each value found in the non clustred index there are2 page reads for the lookup. This appears to be costly as the lookup  is costing 76% of the query. The query takes about 1min 20 secs to run.  Is there any way I can aviod this lookup. I'm not sure if I can create a wide  covering index for all the rows being accessed in the query. Is this sensible considering there are about 8 or 9 columns. Is there any other strategy i can use to reduce the cost of the lookup. here is the query:




select   el.VAR_EL_NAME,el.VAR_EL_DESCRIPTION,el.K_EV_ID,el.K_EL_ID,el.VAR_EL_ADDRESS1,el.VAR_EL_ADDRESS2,el.VAR_EL_ADDRESS3,el.VCADDRESS4,el.dRegistrationDate,              
  el.VAR_EL_ALPHABETICALSORT,el.VAR_EL_FAX,el.VAR_EL_TEL,el.VAR_EL_WEB,              
  tc.*,iOrder,vcLastName,vcFirstName, 0


 from Exhibitor_List el  WITH (NOLOCK)  left outer join tblExhibitorParticipant tp (NOLOCK)              
   ON el.K_el_id = tp.iExhibitoriD              
             
 left outer join tblParticipant p              
   ON tp.iParticipantID = p.iParticipantID              
             
 left outer join tblCountries tc              
   ON tc.iCountryID = el.iCountryID              
               
   inner join tblContinent con (NOLOCK)              
   ON tc.iContinentID = con.iContinentID              
where  0=0              
and el.var_el_active <> 'N'          
and  el.K_EV_id =100458         and
        p. iEventid = 100458                
  and con.iContinentID=8856              
        ORDER BY dRegistrationDate
0
Comment
Question by:anwarmir
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 6

Expert Comment

by:btutt
ID: 18020405
Please show me the DDL for clustered index on the Exhibitor_List table.
0
 

Author Comment

by:anwarmir
ID: 18026988
clustered index is on el.K_el_id  which is an identity column
0
 
LVL 6

Expert Comment

by:btutt
ID: 18027902
And what is the fill factor on this index? That is why I wanted the full DDL.
0
 
LVL 4

Expert Comment

by:Sowmya_K
ID: 18036861
Hi anwarmir,

             You can try using a covering index. A covering index, which is a form of a composite index, includes all of the columns referenced in SELECT, JOIN, and WHERE clauses of a query. Because of this, the index contains the data you are looking for and SQL Server doesn't have to look up the actual data in the table, reducing logical and/or physical I/O, and boosting performance.
             Essentially, a Bookmark Lookup is telling you that the Query Processor had to look up the row columns it needs from a table or a clustered index, instead of being able to read it directly from a non-clustered index. Bookmark Lookups can reduce query performance because they produce extra disk I/O to retrieve the column data. So try using a covering index.

Hope this helps!
0
 
LVL 69

Accepted Solution

by:
Scott Pletcher earned 500 total points
ID: 18054674
>> The Exhibitior_List table is being accessed via a Non clsutered index. <<
Then you must have an index on el.K_EV_id (right?).

>> Is there any way I can aviod this lookup[?] << 
No; the only way to get from a non-clus idx to a row in a clus tbl is thru the clus idx.

>> [Is a] covering index [sensible] for all the rows being accessed in the query <<
No; too many columns and too wide.

>> Is there any other strategy i can use to reduce the cost of the lookup[?] <<
Unfortunately, probably not, other than general tuning on the base table itself (make sure fragmentation is low, table is reorg'ed periodically, etc.).
0

Featured Post

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

As technology users and professionals, we’re always learning. Our universal interest in advancing our knowledge of the trade is unmatched by most industries. It’s a curiosity that makes sense, given the climate of change. Within that, there lies a…
When table data gets too large to manage or queries take too long to execute the solution is often to buy bigger hardware or assign more CPUs and memory resources to the machine to solve the problem. However, the best, cheapest and most effective so…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…

632 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question