Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Stairway to SQL Server Indexes: Step 6, Bookmarks


Stairway to SQL Server Indexes: Step 6, Bookmarks

Author
Message
David Durant
David Durant
Grasshopper
Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)

Group: General Forum Members
Points: 18 Visits: 23
Comments posted to this topic are about the item Stairway to SQL Server Indexes: Step 6, Bookmarks
Orlando Colamatteo
Orlando Colamatteo
SSCrazy Eights
SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)

Group: General Forum Members
Points: 8239 Visits: 14368
Thanks for the great article David!

From the article:

Therefore, each row in a database, at any given point in time, can be identified by three numbers; file number - page number - row number. This identifying composite of three numbers is called the row id, usually shortened to RID. Most tools that display SQL Server internals information will display these three numbers separated by colons (instead of hyphens). So the 12th row on the 77th page of file 1 would have a RID of 1:77:12.


You explained why SQL Server will use the RID as the Bookmark in a Heap's non-clustered index but how much space does the RID actually occupy on those index entries? i.e. is the RID comprised of 3 separate INTs and are they stored as such, using 12 bytes on each index entry?

__________________________________________________________________________________________________
There are no special teachers of virtue, because virtue is taught by the whole community. --Plato
Steve.Cornelius
Steve.Cornelius
Forum Newbie
Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)

Group: General Forum Members
Points: 4 Visits: 27
I see very little of value in this article. The readers are ever so slightly better informed after reading it, but have acquired no useful information. In fact if your conclusions, or lack thereof, are to be believed no decisions should be altered based on the entire topic. As such wouldn't it have been better not to publish it and thus save us all the time spent reading it? This strikes me as the sort of irrelevant waffle published by academics that gives academia a bad name.

Before your next article please try to establish that the topic is worth reading about before writing about it.
Orlando Colamatteo
Orlando Colamatteo
SSCrazy Eights
SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)

Group: General Forum Members
Points: 8239 Visits: 14368
opc.three (6/8/2011)
Thanks for the great article David!

From the article:

Therefore, each row in a database, at any given point in time, can be identified by three numbers; file number - page number - row number. This identifying composite of three numbers is called the row id, usually shortened to RID. Most tools that display SQL Server internals information will display these three numbers separated by colons (instead of hyphens). So the 12th row on the 77th page of file 1 would have a RID of 1:77:12.


You explained why SQL Server will use the RID as the Bookmark in a Heap's non-clustered index but how much space does the RID actually occupy on those index entries? i.e. is the RID comprised of 3 separate INTs and are they stored as such, using 12 bytes on each index entry?

I later learned the RID is 8 bytes.

http://www.sqlskills.com/blogs/paul/post/SQL-Server-2008-New-(undocumented)-physical-row-locator-function.aspx

__________________________________________________________________________________________________
There are no special teachers of virtue, because virtue is taught by the whole community. --Plato
Orlando Colamatteo
Orlando Colamatteo
SSCrazy Eights
SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)

Group: General Forum Members
Points: 8239 Visits: 14368
Steve.Cornelius (8/3/2011)
I see very little of value in this article. The readers are ever so slightly better informed after reading it, but have acquired no useful information. In fact if your conclusions, or lack thereof, are to be believed no decisions should be altered based on the entire topic. As such wouldn't it have been better not to publish it and thus save us all the time spent reading it? This strikes me as the sort of irrelevant waffle published by academics that gives academia a bad name.

Before your next article please try to establish that the topic is worth reading about before writing about it.

Why so harsh Steve? It's a "Stairways" article. All writers must consider their target audience. I thought the article was a great primer on bookmarks, indexes and heaps. The three guidelines laid out regarding choosing a clustering key are critical to remember. Even veterans can use some re-enforcement of the fundamentals from time to time. I thought the article was great!

__________________________________________________________________________________________________
There are no special teachers of virtue, because virtue is taught by the whole community. --Plato
Yusuf Bhiwandiwala
Yusuf Bhiwandiwala
Valued Member
Valued Member (51 reputation)Valued Member (51 reputation)Valued Member (51 reputation)Valued Member (51 reputation)Valued Member (51 reputation)Valued Member (51 reputation)Valued Member (51 reputation)Valued Member (51 reputation)

Group: General Forum Members
Points: 51 Visits: 403

Why so harsh Steve? It's a "Stairways" article. All writers must consider their target audience. I thought the article was a great primer on bookmarks, indexes and heaps. The three guidelines laid out regarding choosing a clustering key are critical to remember. Even veterans can use some re-enforcement of the fundamentals from time to time. I thought the article was great!


+1 to that. It is a very good article and as the stairway progresses will for sure leave the audience with a sound understanding of the working of the indexes.

We have used the non clustered indexes on a heap approach for tables that are not joined with other tables and where range queries are infrequently made.
Transaction tables forming part of entity-relationships though, as a general rule of thumb, are clustered.
roger.plowman
roger.plowman
SSChasing Mays
SSChasing Mays (618 reputation)SSChasing Mays (618 reputation)SSChasing Mays (618 reputation)SSChasing Mays (618 reputation)SSChasing Mays (618 reputation)SSChasing Mays (618 reputation)SSChasing Mays (618 reputation)SSChasing Mays (618 reputation)

Group: General Forum Members
Points: 618 Visits: 1121
I thought the article had good information, but perhaps more attention could have been paid to the characteristics of a good key, bringing up the whole surrogate key idea--unless that's another step on the stairway?
cdesmarais 49673
cdesmarais 49673
Ten Centuries
Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)

Group: General Forum Members
Points: 1163 Visits: 1423
I liked the article, but I think the "which is better" section is a little misleading. There are lots of good reasons to prefer tables with clustered indexes that were just out of scope for the article. Range data access, relationships, space management, etc.
dogramone
dogramone
SSChasing Mays
SSChasing Mays (630 reputation)SSChasing Mays (630 reputation)SSChasing Mays (630 reputation)SSChasing Mays (630 reputation)SSChasing Mays (630 reputation)SSChasing Mays (630 reputation)SSChasing Mays (630 reputation)SSChasing Mays (630 reputation)

Group: General Forum Members
Points: 630 Visits: 3619
Steve.Cornelius (8/3/2011)
I see very little of value in this article. The readers are ever so slightly better informed after reading it, but have acquired no useful information. In fact if your conclusions, or lack thereof, are to be believed no decisions should be altered based on the entire topic. As such wouldn't it have been better not to publish it and thus save us all the time spent reading it? This strikes me as the sort of irrelevant waffle published by academics that gives academia a bad name.

Before your next article please try to establish that the topic is worth reading about before writing about it.


Steve, I don;t understand why your first post is so negative. I have been following this series of articles and have found it most interesting on how the underlying disk structure funtions. This one added heaps to my knowledge (bad pun intended). Are you setting yourself up as "one to watch" due to extreme negativity and nastyness?



Steve.Cornelius
Steve.Cornelius
Forum Newbie
Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)

Group: General Forum Members
Points: 4 Visits: 27
Are you setting yourself up as "one to watch" due to extreme negativity and nastyness?
Please don't assign such petty motivations to me. I'm not one of these shallow idiots who thinks that attention=success. Now I've wasted enough time on this already.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search