15.00 - Defining a Simple Join Index on a Binary Join Result - Teradata Database

Teradata Database Design

prodname
Teradata Database
vrm_release
15.00
category
User Guide
featnum
B035-1094-015K

Defining a Simple Join Index on a Binary Join Result

Table Definitions

Suppose you define the following customer and orders tables.

     CREATE TABLE customer (
       c_custkey    INTEGER NOT NULL,
       c_name       CHARACTER(26) NOT NULL,
       c_address    VARCHAR(41),
       c_nationkey  INTEGER,
       c_phone      CHARACTER(16),
       c_acctbal    DECIMAL(13,2),
       c_mktsegment CHARACTER(21),
       c_comment    VARCHAR(127))
     PRIMARY INDEX(c_custkey);
 
     CREATE TABLE orders (
       o_orderkey      INTEGER NOT NULL,
       o_date          DATE FORMAT ‘yyyy-mm-dd’,
       o_status        CHARACTER(1),
       o_custkey       INTEGER,
       o_totalprice    DECIMAL(13,2),
       o_orderpriority CHARACTER(21),
       o_clerk         CHARACTER(16),
       o_shippriority  INTEGER,
       o_comment       VARCHAR(79))
     UNIQUE PRIMARY INDEX(o_orderkey);