October 16, 2010 at 12:20 pm
I just read through this thread, and what I found interesting was what was missing (or, I just failed to see it...)
The keys in a clustered index are used in all non-clustered indexes (and if there isn't a clustered index, the hidden "Row ID" column (mentioned above) is used) to provide a lookup path back to the row. This means that in addition to a GUID column, the 16 bytes it takes up in storage space is also used in all non-clustered indexes. An integer identity column only uses 4 bytes. So, using an integer uses only 1/4 the space in the table, and saves 12 bytes * # rows * # non-clustered indexes. The space savings can really add up.
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
October 18, 2010 at 12:57 am
WayneS (10/16/2010)
I just read through this thread, and what I found interesting was what was missing (or, I just failed to see it...)The keys in a clustered index are used in all non-clustered indexes (and if there isn't a clustered index, the hidden "Row ID" column (mentioned above) is used) to provide a lookup path back to the row. This means that in addition to a GUID column, the 16 bytes it takes up in storage space is also used in all non-clustered indexes. An integer identity column only uses 4 bytes. So, using an integer uses only 1/4 the space in the table, and saves 12 bytes * # rows * # non-clustered indexes. The space savings can really add up.
That is indeed an extra negative side effect. ( caused by the way sqlserver implemented clustering indexes )
Johan
Learn to play, play to learn !
Dont drive faster than your guardian angel can fly ...
but keeping both feet on the ground wont get you anywhere :w00t:
- How to post Performance Problems
- How to post data/code to get the best help[/url]
- How to prevent a sore throat after hours of presenting ppt
press F1 for solution, press shift+F1 for urgent solution 😀
Need a bit of Powershell? How about this
Who am I ? Sometimes this is me but most of the time this is me
October 18, 2010 at 9:13 am
WayneS (10/16/2010)
I just read through this thread, and what I found interesting was what was missing (or, I just failed to see it...)The keys in a clustered index are used in all non-clustered indexes (and if there isn't a clustered index, the hidden "Row ID" column (mentioned above) is used) to provide a lookup path back to the row. This means that in addition to a GUID column, the 16 bytes it takes up in storage space is also used in all non-clustered indexes. An integer identity column only uses 4 bytes. So, using an integer uses only 1/4 the space in the table, and saves 12 bytes * # rows * # non-clustered indexes. The space savings can really add up.
Yes, a very good point. Hadn't thought of that.
Rob Schripsema
Propack, Inc.
Viewing 3 posts - 16 through 17 (of 17 total)
You must be logged in to reply to this topic. Login to reply