All Forums Database
lionelsubedi 2 posts Joined 07/12
30 Jul 2012
how does compress work in tables

Dear experts,

I am very new to teradata and  have TD query as:

CREATE SET TABLE tablename(

fieldname DECIMAL(15,2) COMPRESS (0.00 ,50.00 ,46.00 )

);

What the value will be entered in this fieldname if i insert 1000.594 in the table?

What is the difference between values of  DECIMAL(15,2)  and DECIMAL(15,2) COMPRESS (0.00 ,50.00 ,46.00 ) ?

 

 

Qaisar Kiani 337 posts Joined 11/05
31 Jul 2012

COMPRESSION is a teradata feature which allows the users to compress the most commonly appearing values in once column. Physically, the compressed values are stored in table header and not reapeating in each row thus saving some space. If a value other than the compressed list comes with a row, that takes its normal allocated space...

COMPRESS (.....) clause defines the values that are compressed.

In your case only 0.00, 50.00 and 46.00 are the values that will be compressed, so if you enter 1000.594 it is not compressed but consumes all the allocated bytes.

TD_WFS 2 posts Joined 02/13
19 Nov 2013

Hi
Yep ,as Qaisar said,If the compress the column values which they are repeating and keep those columns as compress,so we can save some space .We would observe the saved space ,If it is a huge data or there more repeating column values exist.
Here nothing much difference , DECIMAL(15,2)  are not compressing or not saving space and DECIMAL(15,2) COMPRESS (0.00 ,50.00 ,46.00 ) are compressing with repeated columns or are saving some space,Thats all
 
Thanks
 

Prathyusha GC 1 post Joined 01/14
20 Jan 2014

Hi,
Can you let me know what is the checksum and checksum default which is specified while creating a table.What is the use of it and how does it perform.
Thanks,
Prathyusha

You must sign in to leave a comment.