August 6, 2009 at 2:00 pm
Hi:
Does anybody know how to determine the size of each single row on a table?
Thansk for the help.
August 6, 2009 at 2:13 pm
Do you mean the actual size of the stored data for each row, or do you mean the total possible size for the columns?
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
August 6, 2009 at 2:19 pm
The size of a row. I need this info to forecast the amount of space that certain table will occupied after X amount data inserts.
August 6, 2009 at 3:37 pm
fjmorales (8/6/2009)
The size of a row. I need this info to forecast the amount of space that certain table will occupied after X amount data inserts.
For real world capacity planning purposes you want to assume your table will be as good or bad organized/fragmented as it is today.
Having said that run:
EXEC sp_spaceused 'dbo.MyTable'
...
... return will be something like:
namerowsreserveddataindex_sizeunused
MyTable 329 272 KB136 KB96 KB40 KB
Just look at Data Space, Index Space and Row count; with that information at hand I'm sure you can infer space needed for whatever row population you are plainning for 😉
_____________________________________
Pablo (Paul) Berzukov
Author of Understanding Database Administration available at Amazon and other bookstores.
Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.August 6, 2009 at 7:43 pm
Heh... guess what happens when you do a search for the following in Books Online? 😉
[font="Arial Black"]Estimating the Size of a Table [/font]
--Jeff Moden
Change is inevitable... Change for the better is not.
August 6, 2009 at 9:52 pm
Rows_Per_Page = 8096 / (Row_Size + 2)
I've always been confused abt this part of the overall equation. How exactly adding 2 to the number of rows helps in finding rows per page?
Refer :- http://msdn.microsoft.com/en-us/library/ms189124.aspx
August 7, 2009 at 7:59 pm
ps (8/6/2009)
Rows_Per_Page = 8096 / (Row_Size + 2)I've always been confused abt this part of the overall equation. How exactly adding 2 to the number of rows helps in finding rows per page?
Refer :- http://msdn.microsoft.com/en-us/library/ms189124.aspx
It's not adding 2 to the number of rows... it's adding 2 to the row size.
--Jeff Moden
Change is inevitable... Change for the better is not.
August 7, 2009 at 8:17 pm
the extra two bytes are so they can store the physical address of the memory location of the row.
Lowell
August 9, 2009 at 9:36 am
Thanks Jeff and Lowell 🙂
August 9, 2009 at 10:48 am
You bet... thanks for the feedback, Pradeep...
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 10 posts - 1 through 9 (of 9 total)
You must be logged in to reply to this topic. Login to reply