Multiple Secondary Indexes and Composites - Advanced SQL Engine - Teradata Database

SQL Fundamentals

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Published
July 2021
Language
English (United States)
Last Update
2021-07-28
dita:mapPath
uhe1592872955107.ditamap
dita:ditavalPath
uhe1592872955107.ditaval
dita:id
B035-1141
lifecycle
previous
Product Category
Teradata Vantageā„¢

Database designers frequently define multiple secondary indexes on a table.

For example, the following statements define two secondary indexes on the EMPLOYEE table:

   CREATE INDEX (department_number) ON EMPLOYEE;
   CREATE INDEX (job_code) ON EMPLOYEE;

The WHERE clause in the following query specifies the columns that have the secondary indexes defined on them:

   SELECT last_name, first_name, salary_amount
   FROM employee
   WHERE department_number = 500
   AND job_code = 2147;

Whether the Optimizer chooses to include one, all, or none of the secondary indexes in its query plan depends entirely on their individual and composite selectivity.

Related Information

For more information on multiple and composite secondary index access, and other aspects of index selection, see Teradata Vantageā„¢ - Database Design, B035-1094.