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 > AbOuT v8's Data Compression

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-04-08, 18:31
linakichi linakichi is offline
Registered User
 
Join Date: Aug 2008
Posts: 45
AbOuT v8's Data Compression

Hi all,

I'm currently studying LUW's DB2 v8 at a Linux Redhat 4 Enterprise Edition in the "compression" section

I notice that there is value compression which would change row format so the new row format would :
- Make NULL stored with 3 bytes only
- Make VARCHAR, Long VARCHAR, and other variable-length data types consume 2 bytes less than usual
- Make INTEGER, CHAR, DECIMAL consume 2 bytes more than usual

Now, the question is, how does the old row format look like ??
At the old row format (before decompression), how would the data types stored ?
Isn't NULL always stored 3 bytes ? And when talking about 2 bytes less consuming variable-length data type, what does it actually mean ?

Variable length data types has 2 bytes of length part and 1 byte for the NULL indicator, right ? Will these part be "compressed" ???
Reply With Quote
  #2 (permalink)  
Old 12-05-08, 13:22
rdutton rdutton is offline
Registered User
 
Join Date: Dec 2008
Posts: 76
NULL: the datatype length + 1 byte for null indicator
A null timestamp is 11 bytes, not null is 10
Variable Length: 2 bytes for max length value + actual data length
Varchar(30) = "foo" is 5 bytes (if nullable, then 6 bytes)
Reply With Quote
  #3 (permalink)  
Old 12-05-08, 16:01
Peter.Vanroose Peter.Vanroose is offline
Registered User
 
Join Date: Sep 2004
Location: Belgium
Posts: 1,079
Quote:
Originally Posted by rdutton
A null timestamp is 11 bytes, not null is 10
Actually, a nullable (but not null) timestamp takes 11 bytes; a not-nullable timestamp takes 10 bytes.

Question: does a nullable varchar field, when effectively NULL, always take exactly 3 bytes?
__________________
--_Peter Vanroose,
__IBM Certified Database Administrator, DB2 9 for z/OS
__IBM Certified Application Developer
__ABIS Training and Consulting
__http://www.abis.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