Indexes can be created as partitioned or nonpartitioned. A partitioned index creates an individual index for each partition. A nonpartitioned index is a single index spanning all partitions of the table.
Partitioned indexes allow you to take advantage of improved optimization of queries. If a unique index is partitioned, columns specified in the index must be the same or a superset of the data partition key.
Use the CREATE INDEX statement to create indexes on partitioned tables. To create an index for each partition, use the PARTITIONED clause.
CREATE INDEX PRODLIB.SAMPLEINDEX ON PRODLIB.PAYROLL(EMPNUM) PARTITIONED
To create a single index that spans all partitions, use the NOT PARTITIONED clause.
CREATE INDEX PRODLIB.SAMPLEINDEX ON PRODLIB.PAYROLL(EMPNUM) NOT PARTITIONED
You can only create a partitioned Encoded Vector Index (EVI) over a partitioned table. You cannot create a nonpartitioned EVI over a partitioned table.
See the CREATE INDEX statement in the SQL Reference topic for more information about creating indexes for partitioned tables.
When creating an SQL unique index, unique constraint, or primary key constraint for a partitioned table, the following restrictions apply: