Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2008
    Posts
    45

    Unanswered: 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" ???

  2. #2
    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)

  3. #3
    Join Date
    Sep 2004
    Location
    Belgium
    Posts
    1,126
    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/

Posting Permissions

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