Memory Questions

  • I don't know why I can't figure this out right now..... been screwing around with it for a little over an hour now.....

    I would like to accomplish the following.

    1. Get average row size for a specific table.... (How much memory is each row using)

    a.Get row size for individual row from a specific table (should be able to figure this out if 1 gets answered

    The company I am with does not have a DBA and I am filling in the gaps as needed..... I just noticed with a weekly backup that our primary DB is growing by 200 megs each week... That is a bit of a concern for me and I am trying to figure out the main culprits....

    Thanks

  • Sorry guys... no need for this one....

    http://www.sqlservercentral.com/Forums/Topic159058-8-1.aspx?Highlight=row+size

    Don't know why I could not find it before.....

  • parackson (9/3/2008)


    I don't know why I can't figure this out right now..... been screwing around with it for a little over an hour now.....

    I would like to accomplish the following.

    1. Get average row size for a specific table.... (How much memory is each row using)

    a.Get row size for individual row from a specific table (should be able to figure this out if 1 gets answered

    The company I am with does not have a DBA and I am filling in the gaps as needed..... I just noticed with a weekly backup that our primary DB is growing by 200 megs each week... That is a bit of a concern for me and I am trying to figure out the main culprits....

    Thanks

    try:

    select record_count ,min_record_size_in_bytes, max_record_size_in_bytes, avg_record_size_in_bytes

    from sys.dm_db_index_physical_stats (17,OBJECT_ID('dba_table_stats'),NULL,NULL,'DETAILED')

    where index_level = 0


    * Noel

  • I am pretty sure that I have full permissions to this server but I get the following error from your script

    Msg 297, Level 16, State 12, Line 1

    The user does not have permission to perform this action.

    That makes no sense to me.... (Even tried it logging is as SA no luck)

    Thanks for a reply, however the link I put in the second post contained some great information.

  • Check out the "AverageRecordSize" in the return of the following...

    DBCC UPDATEUSAGE (0)

    DBCC SHOWCONTIG WITH TABLERESULTS

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

Viewing 5 posts - 1 through 4 (of 4 total)

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