Results 1 to 4 of 4
  1. #1
    Join Date
    Sep 2014
    Posts
    7

    Unanswered: How to calculate mas row length in a table

    Hi all,

    I need to make a estimation about what could be the maximum row length in a table taking into account the data type for all its columns. My first idea was to sum field length in syscat.columns for all the column in the table but I have noticed that that is not accurate because that field can store for example the precision in the colum is decimal and not the length for the column.
    Another idea was to get the length for every datatype from field LENGTH in syscat.datatypes, but in this case it is 0 for many of the datatypes, no would need to do some calculations for example for Binray(n) ... etc.

    Does anyone know an easy way to get this?.

    Thanks a lot in advance.

  2. #2
    Join Date
    Apr 2006
    Location
    Belgium
    Posts
    2,514
    Provided Answers: 11
    in reorgchk they use :
    Table size in bytes. Calculated as the product of the number of rows in the table (CARD) and the average row length. The average row length is computed as the sum of the average column lengths (AVGCOLLEN in SYSCOLUMNS) plus 10 bytes of row overhead. For long fields and LOBs only the approximate length of the descriptor is used. The actual long field or LOB data is not counted in TSIZE.
    Best Regards, Guy Przytula
    Database Software Consultant
    Good DBAs are not formed in a week or a month. They are created little by little, day by day. Protracted and patient effort is needed to develop good DBAs.
    Spoon feeding : To treat (another) in a way that discourages independent thought or action, as by overindulgence.
    DB2 UDB LUW Certified V7-V8-V9-V9.7-V10.1-V10.5 DB Admin - Advanced DBA -Dprop..
    Information Server Datastage Certified
    http://www.infocura.be

  3. #3
    Join Date
    Apr 2008
    Location
    Iasi, Romania
    Posts
    561
    Provided Answers: 2
    Florin Aparaschivei
    DB2 9.7, 10.5 on Windows
    Iasi, Romania

  4. #4
    Join Date
    Sep 2014
    Posts
    7
    Thans a lot for this link, I will check carefully.

    Cheers.

Posting Permissions

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