15.00 - Outer Joins and Simple Join Indexes - Teradata Database

Teradata Database SQL Data Definition Language Detailed Topics

Product
Teradata Database
Release Number
15.00
Content Type
Programming Reference
Publication ID
B035-1184-015K
Language
English (United States)

Outer Joins and Simple Join Indexes

Because join indexes generated from inner joins do not preserve unmatched rows, you should always consider using outer joins to define simple join indexes. This practice empowers the join index to satisfy queries with fewer join conditions than those used to generate the index.

You can define a join index using both left and right outer joins, but full outer joins are prohibited.

Be aware that when you define a join index using an outer join, you must reference all the columns of the outer table in the select list of the join index definition. If any of the outer table columns are not referenced in the select list for the join index definition, Teradata Database returns an error to the requestor.

See “Restriction on Coverage by Join Indexes When a Join Index Definition References More Tables Than a Query” on page 386 and “Rules for Whether Join Indexes With Extra Tables Cover Queries” on page 390 for some special considerations about how to define outer joins to maximize the coverage possibilities of a join index.