DBAsupport.com Forums - Powered by vBulletin
Results 1 to 4 of 4

Thread: Calculating Row Size

  1. #1
    Join Date
    Sep 2005
    Posts
    46

    Calculating Row Size

    Hi all,
    I was trying to calculate the size of a single row in a table with user_tab_columns view. user_tab_columns.Data_length provides the size of each columns and I'm trying to add all of them. For date columns and character columns its working fine. But Data_length is showing 22 for all number columns regard less of its scale and precision. Hence I guess its not judicious to use user_tab_columns.Data_length for calculating the size of number columns. Can you please suggest a possible work around for the issue.

    regards
    Issac.

  2. #2
    Join Date
    Sep 2002
    Location
    England
    Posts
    7,334
    analyze the table - then get avg_row_len from user_tables

  3. #3
    Join Date
    Aug 2002
    Location
    Colorado Springs
    Posts
    5,253
    Code:
    select avg(vsize(my_num_col)) from my_table
    David Aldridge,
    "The Oracle Sponge"

    Senior Manager, Business Intelligence Development
    XM Satellite Radio
    Washington, DC

    Oracle ACE

  4. #4
    Join Date
    Aug 2002
    Location
    Colorado Springs
    Posts
    5,253
    ... and btw, the scale and precision of the number type has no effect on storage requirement.
    David Aldridge,
    "The Oracle Sponge"

    Senior Manager, Business Intelligence Development
    XM Satellite Radio
    Washington, DC

    Oracle ACE

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width