Rules for Whether Join Indexes With Extra Tables Cover Queries - Advanced SQL Engine - Teradata Database

SQL Data Definition Language Detailed Topics

Advanced SQL Engine
Teradata Database
Release Number
July 2021
English (United States)
Last Update
Product Category
Teradata Vantage™

The following rules explain how to design a set of underlying base tables for a join index definition in such a way to ensure that the Optimizer selects the index for an access plan if it inner joins more tables than the query references. Such join indexes are referred to as broad join indexes. For more information on broad join indexes, see Restriction on Coverage by Join Indexes When a Join Index Definition References More Tables Than a Query, Teradata Vantage™ - Database Design, B035-1094, and Teradata Vantage™ - SQL Request and Transaction Processing, B035-1142.

IF there are more inner-joined tables in a join index definition than the number of tables referenced in a query and … THEN the Optimizer …
the extra joins are not made on foreign key-primary key columns in the underlying base tables does not consider the join index for the query plan.

This is because the presence of extra joins in the definition can either eliminate existing rows from the query evaluation or produce duplicate rows during optimization.

the extra joins are made on foreign key-primary key columns in the underlying base tables considers the join index for use in for the query plan.
both of the following conditions are true:
  • The join column set of the inner table in the extra outer join is unique
  • Either the inner table or both the inner and outer tables involved in the extra outer join are extra tables