15.10 - Example: Column-Partitioned Table With Default Autocompression - Teradata Database

Teradata Database SQL Data Definition Language Syntax and Examples

Product
Teradata Database
Release Number
15.10
Published
December 2015
Language
English (United States)
Last Update
2018-06-05
dita:mapPath
SQL_DDL_15_10.ditamap
dita:ditavalPath
ft:empty

This example defines a column-partitioned table where each column is in its own partition with system-determined COLUMN format except for column partition o_comment , which has user-specified ROW format and is explicitly defined not to have autocompression.

IF the value of the cost profile constant AutoCompressDefault is … THEN the column partitions other than o_comment
1 have autocompression.
2 do not have autocompression.
     CREATE TABLE orders (
       o_orderkey     INTEGER NOT NULL,
       o_custkey      INTEGER,
       o_orderstatus  CHARACTER(1) CASESPECIFIC,
       o_totalprice   DECIMAL(13,2) NOT NULL,
       o_orderdate    DATE FORMAT 'yyyy-mm-dd' NOT NULL,
       o_shippriority INTEGER,
       ROW(o_comment  VARCHAR(79)) NO AUTO COMPRESS)
     PARTITION BY COLUMN,
     UNIQUE INDEX (o_orderkey);

For more information about the AutoCompressDefault cost profile constant, see SQL Request and Transaction Processing, B035-1142.