Defining Join Indexes - Advanced SQL Engine - Teradata Database

SQL Fundamentals

Product
Advanced SQL Engine
Teradata Database
Release Number
17.05
17.00
Published
June 2020
Language
English (United States)
Last Update
2021-01-24
dita:mapPath
zwv1557098532464.ditamap
dita:ditavalPath
lze1555437562152.ditaval
dita:id
B035-1141
lifecycle
previous
Product Category
Teradata Vantageâ„¢

To create a join index, use the CREATE JOIN INDEX statement.

For example, suppose that a common task is to look up customer orders by customer number and date. You might create a join index like the following, linking the customer table, the order table, and the order detail table:

   CREATE JOIN INDEX cust_ord2
   AS SELECT cust.customerid,cust.loc,ord.ordid,item,qty,odate
   FROM cust, ord, orditm
   WHERE cust.customerid = ord.customerid
   AND ord.ordid = orditm.ordid;