tags:

views:

25

answers:

1

I'll use this simple query as an example: Select MyColumn From MyTable Where PrimaryKeyColumn = 10.

Let's assume the table has no clustered index and there is a primary key on PrimaryKeyColumn.

If I understand correctly, the query plan will include an index seek on the primary key and a bookmark lookup on the table, using some sort of row pointer. I have two questions:

1) What is this row pointer?

2) How efficient is finding a row in the table using this row pointer?

Thanks very much.

+3  A: 

The bookmark on a heap (a table w/o a clustered index) is a physical address value (fileid:pageid:slotid). Looking up the bookmark is really fast, faster than a key seek in fact, but one may land on a 'forwarded record', which left in place another bookmark to follow, when you rinse cycle and repeat the process. Having plans that do non-clustered index scans that would require large volume lookups may trigger the 'index tipping point'.

Remus Rusanu
Agreed. Also keep in mind that index pages have a much higher chance of remaining in memory for long periods of time than heap data pages, so RID lookups may lead to more I/O, especially when forwarded records are involved.
bluefooted