If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > DB2 row length

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-29-11, 05:55
Breako Breako is offline
Registered User
 
Join Date: Jan 2006
Posts: 119
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...
Reply With Quote
  #2 (permalink)  
Old 07-29-11, 06:04
przytula_guy przytula_guy is offline
Registered User
 
Join Date: Apr 2006
Location: Belgium
Posts: 1,159
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
DB2 UDB LUW Certified V7-V8-V9-V9.7 DB Admin - Dprop..
Information Server Datastage Certified
http://www.infocura.be
Reply With Quote
  #3 (permalink)  
Old 07-29-11, 06:37
sathyaram_s sathyaram_s is offline
Super Moderator
 
Join Date: Aug 2001
Location: UK
Posts: 4,534
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.
Reply With Quote
  #4 (permalink)  
Old 07-29-11, 06:42
Breako Breako is offline
Registered User
 
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?
Reply With Quote
  #5 (permalink)  
Old 07-29-11, 06:50
przytula_guy przytula_guy is offline
Registered User
 
Join Date: Apr 2006
Location: Belgium
Posts: 1,159
yes...............
__________________
Best Regards, Guy Przytula
Database Software Consultant
DB2 UDB LUW Certified V7-V8-V9-V9.7 DB Admin - Dprop..
Information Server Datastage Certified
http://www.infocura.be
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On