calculation of row size

  • Following link gives nice information as how to calculate the row size:

    http://msdn.microsoft.com/en-us/library/aa933068(SQL.80).aspx#

    Although this was not told why 2 is added in row_size in following formula to calculate No of rows per page:

    Number of rows per page (Rows_Per_Page) = ( 8096 ) / (Row_Size + 2)

    Also the page header is not taken into consideration while calculating the no of rows per page.

    Regards,

    -MJ

    -MJ
    Please do not print mails and docx unless it is absolutely necessary. Spread environmental awareness.

  • i'm not sure why they're adding 2 but it does factor page header which is 96 bytes. There is one more factor to be considered, from the end of the page starts the row numbering in reverse direction. May be this 2 is for that purpose. not sure though..

    8192 bytes is the page size out of which 96 bytes is taken out for page header and remaining 8096 bytes is used for actual data.



    Pradeep Singh

  • Could you please elaborate on your following comment

    "There is one more factor to be considered, from the end of the page starts the row numbering in reverse direction. "

    -MJ

    -MJ
    Please do not print mails and docx unless it is absolutely necessary. Spread environmental awareness.

  • Row offsets for all rows present in a page are stored at the end of the page. the first offset is stored at the extreme end of the page which points towards the first record, next offset is placed before it which points to the 2nd row and so on... it keeps on increasing in reverse direction. I cant seem to find any relevent article on net as of now....



    Pradeep Singh

  • Nice info. But I am worried whether this is authenticated one

    -MJ

    -MJ
    Please do not print mails and docx unless it is absolutely necessary. Spread environmental awareness.

  • I managed to find the link to authenticate that.:-)

    http://msdn.microsoft.com/en-us/library/ms190969(SQL.90).aspx"> http://msdn.microsoft.com/en-us/library/ms190969(SQL.90).aspx

    The first picture on this site explains about row offsets..



    Pradeep Singh

  • This is really awesome information Praddep. Thanks for this. Don't we have any page footer as we have page header?

    -MJ
    Please do not print mails and docx unless it is absolutely necessary. Spread environmental awareness.

  • We dont have a page footer as far as i know. However, i may personally consider this row offset as page footer which contains information about row offsets on the page(unless the page is an empty one)



    Pradeep Singh

  • http://msdn.microsoft.com/en-us/library/ms178085.aspx

    7.Calculate the number of rows per page (8096 free bytes per page):

    Rows_Per_Page = 8096 / (Row_Size + 2)

    The value 2 in the formula is for the row's entry in the slot array of the page.

    HTH!

    MJ

Viewing 9 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic. Login to reply