Nonunique indexes

You can use nonunique indexes to improve the performance of data access when the values of the columns in the index are not necessarily unique.

Recommendation: Do not create nonunique indexes on very small tables, because scans of the tables are more efficient than using indexes.

To create nonunique indexes, use the SQL CREATE INDEX statement. For nonunique indexes, DB2® allows users and programs to enter duplicate values in a key column.

Begin general-use programming interface information.
Example: Assume that more than one employee is named David Brown. Consider an index that is defined on the FIRSTNME and LASTNAME columns of the EMP table.
CREATE INDEX EMPNAME
   ON EMP (FIRSTNME, LASTNAME);

This index is an example of a nonunique index that can contain duplicate entries.

End general-use programming interface information.