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'.
精彩评论