Restrictions on Number of Hash Indexes Defined Per Base Table
The maximum number of secondary, hash, and join indexes that can be defined for a table is 32, in any combination. This includes the system‑defined unique secondary indexes used to implement PRIMARY KEY and UNIQUE constraints.
Each composite NUSI that specifies an ORDER BY clause counts as 2 consecutive indexes in this calculation (see “Importance of Consecutive Indexes for Value‑Ordered NUSIs” on page 485). You cannot define hash, or any other, indexes on global temporary trace tables. See “CREATE GLOBAL TEMPORARY TRACE TABLE” in SQL Data Definition Language Detailed Topics.
For example, suppose you have 4 tables, each with multiple secondary, hash, and join indexes defined on them.
Each of these combinations is valid, but they all operate at the boundaries of the defined limits.
Note that if any of the secondary indexes defined on tables 1, 2, or 3 is a NUPI defined with an ORDER BY clause, the defined limits are exceeded, and the last index you attempt to create on the table will fail. Because each NUPI defined with an ORDER BY clause counts as 2 consecutive indexes in the count against the maximum of 32 per table, you could define only 8 of them on Table_2, for example, if you also defined 16 join indexes on the table.