Alter a PTI Table Example | Teradata Vantage - 17.00 - Example: Alter a PTI Table - Teradata Database

Teradata Vantageā„¢ - Time Series Tables and Operations

prodname
Advanced SQL Engine
Teradata Database
vrm_release
17.00
created_date
June 2020
category
Programming Reference
featnum
B035-1208-170K

The table definition for this example includes an unnamed Primary Time Index.

CREATE TABLE ocean_buoy(c1 INTEGER, c2 INTEGER)
PRIMARY TIME INDEX(TIMESTAMP(2) WITH TIME ZONE, DATE '2016-01-03', HOURS(2));

You can use an ALTER TABLE statement to add a name for the PRIMARY TIME INDEX.

ALTER TABLE ocean_buoy MODIFY PRIMARY TIME INDEX my_pti_index;

A SHOW TABLE statement lists the table definition, which now includes a named PRIMARY TIME INDEX.

SHOW TABLE ocean_buoy;

CREATE SET TABLE ocean_buoy ,NO FALLBACK ,
     NO BEFORE JOURNAL,
     NO AFTER JOURNAL,
     CHECKSUM = DEFAULT,
     DEFAULT MERGEBLOCKRATIO,
     MAP = TD_MAP1
   (
      TD_TIMEBUCKET BIGINT NOT NULL GENERATED SYSTEM TIMECOLUMN,
      TD_TIMECODE TIMESTAMP(6) NOT NULL GENERATED TIMECOLUMN,
      TD_SEQNO INT NOT NULL GENERATED TIMECOLUMN,
      c1 INTEGER,
      c2 INTEGER)
 PRIMARY TIME INDEX my_pti_index (TIMESTAMP(6), DATE '2015-05-02', HOURS(1), COLUMNS(c1,c2), NONSEQUENCED);