Results 1 to 5 of 5

Thread: DB2 row length

  1. #1
    Join Date
    Jan 2006
    Posts
    119

    Unanswered: DB2 row length

    Hi,
    I am just trying to understand what the ROW lenght means exactly in DB2.

    My understanding is that the maxium row length is in proportion to the page size.

    According to this, it states the row limits:

    http://ptgmedia.pearsoncmg.com/image...loads/appd.pdf

    4KB Pages --- 4,056 bytes
    8KB Pages --- 8,138 bytes
    16KB pages --- 16,330 bytes
    32KB pages --- 32,714 bytes

    Ok so say I have columns of varchars that are 100 bytes each. Does this mean I can only have 40 such columns (max) in a row if my page size is 4KB?

    What happens in the cases of CLOBs?

    A CLOB can up to 2,147,483,647 bytes?

    Surely this will smash row length limits no matter what the size is?

    Enlighten me...

  2. #2
    Join Date
    Apr 2006
    Location
    Belgium
    Posts
    2,514
    Provided Answers: 11
    I presume the length is calculated whenever create table is executed and does not allow you to create a table with a rowlength that potentialy is larger than a page
    a row must fit entirely on a page
    lobs are special objects and use large tabelspaces - pages can be chained together to create a large logical page
    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
    Aug 2001
    Location
    UK
    Posts
    4,650
    As Guy says, LOB is stored seperately and therefore does not impact the table row width.
    The Inline lobs are different though. They count towards the row width.

    HTH

    Sathyaram
    Visit the new-look IDUG Website , register to gain access to the excellent content.

  4. #4
    Join Date
    Jan 2006
    Posts
    119
    Quote Originally Posted by sathyaram_s View Post
    As Guy says, LOB is stored seperately and therefore does not impact the table row width.
    The Inline lobs are different though. They count towards the row width.

    HTH

    Sathyaram
    So I am correct? If I have columns of varchars that are 100 bytes each, I can only have 40 such columns (max) in a row if my page size is 4KB?

  5. #5
    Join Date
    Apr 2006
    Location
    Belgium
    Posts
    2,514
    Provided Answers: 11
    yes...............
    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

Posting Permissions

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