Alter a PTI Table Example | Teradata Vantage - 17.10 - Example: Alter a PTI Table - Advanced SQL Engine - Teradata Database

Teradata Vantageā„¢ - Time Series Tables and Operations

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Release Date
July 2021
Content Type
Programming Reference
Publication ID
B035-1208-171K
Language
English (United States)

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