All Forums Database
Marcus Connolly 16 posts Joined 07/10
01 Dec 2010
Create table as..with data...with compression?

Hi there,
I'm just wondering if this feature exists? Am looking at running 'Create table As....' script and would come in handy if I could specify some compression values in the process to save space/improve table performance etc. We are running Teradata version 12 and can't see anything about this in the manuals. Is it just a case of adding the compression later once the new table is created?

Does anyone know if this feature exists in future releases?

Thanks!

Jimm 298 posts Joined 09/07
01 Dec 2010

I ran the following on TD12; it has been around for a while though.

Create Table CT1
(PK Smallint Not Null
, VC Varchar(12)
, SI Smallint
, CF Char(3) )
Unique Primary Index (PK)
;

Insert Into CT1 Values (1,'',0,'');
Insert Into CT1 Values (2,Null,Null,Null);
Insert Into CT1 Values (3,'hi',12,'hi');

Create Table CT2
(PK
, VC
, SI
, CF Compress 'hi')
As (Select * From CT1)
With Data
Unique Primary Index (PK);

Show Table CT2;

Karam 75 posts Joined 07/09
01 Dec 2010

Though a bit sideline observation but stats do carry over with CREATE TABLE.

CT DATABASE_A.TABLE_A AS DATABASE_B.TABLE_B WITH DATA AND STATS;

Marcus Connolly 16 posts Joined 07/10
07 Dec 2010

Thanks very much for your help.

You must sign in to leave a comment.