All Forums Database
16 Aug 2012
Compress in Teradata,how it works??

Hello All,

Question 1:    The below 3 statements are valid; I just want to know what is the difference in compression process in Teradata DB.

  • CUSTOMER_IDN  DECIMAL(15,0)  DEFAULT -99999 COMPRESS (-99999., 1., 3., 4., 10.)

Question 2:How to check ,weather compression table applied well or not?

Fred 1096 posts Joined 08/04
17 Aug 2012

1) First two examples compress only NULL.

Third one compresses the default value and four others, in addition to NULL.


2) The obvious way is to create two copies of the table, with and without compression, and compare the space used.

Or you could count the occurrences of the compressed values. You save space (8 bytes, in this case) for every value compressed, vs. adding at most 1 additional presence byte for every row (or no additional byte if there are enough spare presence bits left in the rowheader).

You must sign in to leave a comment.