MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Record length limitation

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database
View previous topic :: View next topic  
Author Message
videlord
Beginner


Joined: 09 Dec 2004
Posts: 147
Topics: 19

PostPosted: Thu Nov 24, 2005 10:20 pm    Post subject: Record length limitation Reply with quote

Why the record length of each record cannot be greater than 4056 bytes for 4K tabke space?
Every data page has 22-byte header, where is the other 18 bytes?

The following is copied from DB2 Administrator Guide:
Furthermore, the page size of the table space in which the table is defined limits the record length. If the table space is 4 KB, the record length of each record cannot be greater than 4056 bytes. Because of the 8-byte overhead for each record, the sum of column lengths cannot be greater than 4048 bytes (4056 minus the 8-byte overhead for a record).
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Sat Nov 26, 2005 8:59 am    Post subject: Reply with quote

videlord,
Quote:

Every data page has 22-byte header, where is the other 18 bytes?


Videlord,

Each page set is composed of several types of pages:
Code:

1. header page
2. space map pages
3. dictionary pages
4. data pages



The header page contains control information used by DB2 to manage and maintain the table space. For example, the OBID and DBID (internal object and database identifiers used by DB2) of the table space and database are maintained here, as well as information on logging. Each linear page set has one header page; every partition of a partitioned page set has its own header page. The header page is the first page of a VSAM data set.

Space map pages contain information pertaining to the amount of free space available on pages in a page set. A space map page outlines the space available for a range of pages.

Dictionary pages are used for table spaces that specify COMPRESS YES. Information is stored in the dictionary pages to help DB2 control compression and decompression. The dictionary pages are stored after the header page and first space map page, but before any data pages.

Data pages contain the user data for the table space or index page set. The layout of a data page depends on whether it is an index data page or a table space data page.

Hope this helps...

Cheers

kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
videlord
Beginner


Joined: 09 Dec 2004
Posts: 147
Topics: 19

PostPosted: Sun Nov 27, 2005 10:23 pm    Post subject: Reply with quote

kolusu,

Thanks for your explain about the page type in DB2.
But my question is about the data page (for table data). For a certain DB2 data page, why there is a such limitatoin for table record length: 4056 for 4K, 8138 for 8k ... Why it's not 4074 (4096 - 22) bytes?
Back to top
View user's profile Send private message
Manas Biswal
Intermediate


Joined: 29 Nov 2002
Posts: 382
Topics: 27
Location: Chennai, India

PostPosted: Mon Nov 28, 2005 10:31 am    Post subject: Reply with quote

videlord,

Your question set me thinking (and searching -Smile). I wonder why I have not wondered about that questions earlier.
It seems that DB2 allows 4074 bytes of data for a 4K tablespace if there are more than 1 records in a single page. But if a "single record" is there on a page, then it allows a maximum of 4056 bytes for that record.
Basically, to answer your question, DB2 does theoritically allow 4074 bytes in a 4K tablespace for data (although there are a lot of practical impediments to using 4074 bytes; for example the default PCTFREE is 5%), but thats only when there are more than 1 records in a tablespace.

As to why, it does not allow 4074 bytes for data for a single record in a 4K tablespace, I am still searching -SmileSmile.

HTH...Regards,
Manas
_________________
There is no path to peace. Peace is the path.
- Mahatma Gandhi (1869-1948)
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group