Bookmark Lookup question

  • I have a query that is doing a bookmark lookup and I am looking to see if I can eliminate that lookup.

    The execution plan tells me that the lookup is occurring in a particular table but all fields for this table used within the query are indexed.

    Is there a way to determine which field is causing the bookmark lookup?

  • Can you confirm that the table that the bookmark lookup is being performed upon is using the correct index? ie the one that you created to cover it.

    From the sounds of things the index is either missing a field or two, or failing that the optimizer has decided against using it for some reason.

  • You'll need to post the DDL of the tables & indexes. It's just guesswork without that.

     

  • It seems to be caused by SELECT @var = MAX(datefield) FROM dbo.Table INNER JOIN etc.

    The datefield is indexed but is not a clustered index so I would guess that the index isn't being used.

    I worked out that it was MAX(datefield) by trial and error but there must be a better way of doing this.

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply