Compress in Teradata,how it works??

Database

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) COMPRESS DEFAULT -99999.
  • CUSTOMER_IDN COMPRESS DECIMAL(15,0)
  • 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?

Tags (1)
1 REPLY
Teradata Employee

Re: Compress in Teradata,how it works??

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