开发者

Bookmark Lookups - How efficient is the lookup using a row pointer?

开发者 https://www.devze.com 2023-01-20 10:30 出处:网络
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.

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.


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'.

0

精彩评论

暂无评论...
验证码 换一张
取 消