Compression equality

Database
Highlighted

Compression equality

Hi there,
I am currently developing a stored procedure to attempt to detect and compress the top 10 values in all columns given a database and tablename.

I would like to know when compressing if I set say DECIMAL (9,2) COMPRESS (02.00)

Would that compress the value 2.0? As whilst technically they are the same value I don't know if Teradata will see them as strictly being equal.

Many Thanks

Mark


Accepted Solutions
Senior Apprentice

Re: Compression equality

Hi,

Yes it will. For numeric data types the dbms is smart enough to know that 02.00 is the same as 2.0.

Cheers,

Dave

Ward Analytics Ltd - information in motion
www: http://www.ward-analytics.com
1 ACCEPTED SOLUTION
3 REPLIES
Senior Apprentice

Re: Compression equality

Hi,

Yes it will. For numeric data types the dbms is smart enough to know that 02.00 is the same as 2.0.

Cheers,

Dave

Ward Analytics Ltd - information in motion
www: http://www.ward-analytics.com

Re: Compression equality

Thanks Dave :)
Teradata Employee

Re: Compression equality

Top 10 is perhaps not the best answer. Top 7 or top 15 might better choices if a fixed number is desired. The reason is that each power of two number of compressed values requires another compression bit in the record. Might as well use the full expressinve power of the bits that are required by the number of values. 10 values leaves 5 unused bit combinations in the 4 bits required.