Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
xiii29
Starting Member
13 Posts |
Posted - 2006-09-05 : 08:11:21
|
| Hi,I'm using a table with this definition :[UID_L] as uniqueidentifier (16)[UID_T] as uniqueidentifier (16)[Version] as Bigint (8).There is a PK on the two first columns (clustered).I was thinking that a line will take 16 + 16 + 8 + 8* = 48 bits = 6 octets.* : I know that there is more info that just the columns for a line. I estmated to 8 bits.I've created some tables (10) and with Sp_spaceused i get the size of the table. I take the result and mutiplie by 1024 and divide by the number of row ...What a suprise ==> 50 octets per line ...Any idea ?For info : number of lines in tables are between 100 000 and 300 000.Other info : I've a table with one more UID and one big int and if I do the same calcul I got 8 octets per line.Thanks for any answer |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2006-09-05 : 08:14:14
|
| The index you made takes space too!Peter LarssonHelsingborg, Sweden |
 |
|
|
xiii29
Starting Member
13 Posts |
Posted - 2006-09-05 : 08:28:17
|
| I test with no index on it and I got the same size ... |
 |
|
|
KenW
Constraint Violating Yak Guru
391 Posts |
Posted - 2006-09-06 : 15:53:27
|
| You're forgetting that SQL Server has fixed-size pages (8K, I think). If your data doesn't exactly fill every page, you have a little wasted space.Also, even if every single page is completely filled, but the number of rows * the row size isn't exactly a multiple of 8K, you'll have empty space at the end of the last page.Your calculations of 'octets per line' doesn't take this into account.Ken |
 |
|
|
|
|
|