Create table as..with data...with compression?

Database
Enthusiast

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!
3 REPLIES
Enthusiast

Re: Create table as..with data...with compression?

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;
Enthusiast

Re: Create table as..with data...with compression?

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;
Enthusiast

Re: Create table as..with data...with compression?

Thanks very much for your help.