Name
CREATE INDEX
Synopsis
CREATE [UNIQUE | BITMAP] INDEX [schema.]index_nameON {[schema.]table_name(column[ASC | DESC][,column[ASC | DESC] ...] | CLUSTER [schema.]cluster_name} [global_index_clause] [local_index_clause] [INITRANSinteger] [MAXTRANSinteger] [TABLESPACEtablespace_name] [STORAGE ( [INITIALinteger[K | M] ] [NEXTinteger[K | M] ] [MINEXTENTSinteger] [MAXEXTENTS {integer| UNLIMITED} ] [PCTINCREASEinteger] [FREELISTSinteger] [FREELIST GROUPSinteger] ) ] [PCTFREEinteger] [NOSORT | REVERSE] [LOGGING | NOLOGGING] [UNRECOVERABLE]
Creates an index (index_name) on one or more columns of a table (table_name) or cluster (cluster_name).
Keywords
- UNIQUE
Specifies that the index will be unique. That is, every row must have a unique value across all columns in the index.
- BITMAP
Specifies that the index is to be created as a bitmap index; you can specify ASC (ascending) or DESC (descending) for compatibility with DB2 syntax, but these have no effect.
- CLUSTER
Specifies the cluster for which the index is to be created.
- global_index_clause
Specifies that the index is to be a global partitioned index; the syntax is shown later in the global_index_clause section.
- local_index_clause
Specifies that the index is to be a local partitioned index. The syntax is shown later in the local_index_clause section.
- INITRANS
Changes the number of transaction entries allocated to each block in the index. The value may be in the range 1-255 and should not normally be changed from the default of 2.
- MAXTRANS ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access