9. Extended Statements : Create Table (extended) : Constraint Index Options : Index = Index_Name Option
 
Share this page                  
Index = Index_Name Option
The INDEX = index_name option can be used for several purposes. If the named index already exists and is consistent with the columns constrained by the constraint definition, no new index is created. If the named index does not exist, the generated index created for constraint enforcement uses the name, index_name. Finally, if more than one constraint in the same table definition specifies INDEX = index_name with the same index_name, an index is generated with that name and is shared among the constraints.
In cases where an existing index is used for a constraint or a single index is shared among several constraints, the key columns of the index and the columns of the constraints must be compatible.
All other constraint with options perform the same function as the corresponding WITH options of the CREATE INDEX statement and the index related WITH options of the CREATE TABLE...AS SELECT statement. They are limited, however, to those options documented above. For example, the KEY and COMPRESSION options of CREATE INDEX and CREATE TABLE...AS SELECT are not supported for constraint definition.