How to check size of the table with compress and without

Database

How to check size of the table with compress and without

Hi, pls can you explain me how COMPRESS works ? 

I created this tables :

create table db.no_compres

(id integer , 

 Valu integer);

 create table db.compres

(id integer,

 Valu integer compress -2 );

Data in those tables are  id <1,300> and Valu {-2}

Finding the size of tables 

SELECT tableName, SUM(CURRENTPERM) ACTUALSPACE,

 (MAX(CURRENTPERM)*(HASHAMP()+1)) EFFECTIVESPACE

  FROM DBC.TABLESIZE WHERE DATABASENAME = 'db' AND TABLENAME IN ('no_compres','compres')

  group by tableName;

Result: 

TableName                    ACTUALSPACE      EFFECTIVESPACE

compres                       143 360,00         147 456,00

no_compres                   143 360,00         147 456,00

How is it possible that the results are same ?

Thank you a lot. :)

1 REPLY
Teradata Employee

Re: How to check size of the table with compress and without

With a single row, the difference is only 4 bytes, which is much smaller than the minimum data block size.

What you are seeing in TableSize reflects a table header on every AMP, plus one additional data block on one AMP.