15.00 - Join Index Definition - Teradata Database

Teradata Database Design

Product
Teradata Database
Release Number
15.00
Content Type
User Guide
Publication ID
B035-1094-015K
Language
English (United States)

Join Index Definition

The following statement defines a join index with a three-table join using both natural and outer joins.

     CREATE JOIN INDEX cust_order_join_line AS
      SELECT (l_orderkey, o_orderdate, c_nationkey, o_totalprice),  
             (l_partkey, l_quantity, l_extendedprice, l_shipdate)
      FROM (lineitem LEFT JOIN orders ON l_orderkey = o_orderkey)
      INNER JOIN customer ON o_custkey = c_custkey
      PRIMARY INDEX (l_orderkey);
 
     *** Index has been created. 
     *** Total elapsed time was 20 seconds.