Create Index Statement; Syntax Description Of Create Index - HP Neoview SQL Reference Manual

Hide thumbs Also See for Neoview SQL:
Table of Contents

Advertisement

CREATE INDEX Statement

"Syntax Description of CREATE INDEX"

"Considerations for CREATE INDEX"
"Example of CREATE INDEX"
The CREATE INDEX statement creates a Neoview SQL index based on one or more columns of
a table. The CREATE VOLATILE INDEX statement creates a Neoview SQL index with a lifespan
that is limited to the SQL session that the index is created. Volatile indexes are dropped
automatically when the session ends. See
CREATE INDEX is a Neoview SQL extension.
CREATE [VOLATILE] [UNIQUE] INDEX index ON table
(column-name [ASC[ENDING] | DESC[ENDING]]
[,column-name [ASC[ENDING] | DESC[ENDING]]]...)
[populate-option]
[file-option]...
populate-option is: POPULATE | NO POPULATE
file-option is:
{HASH PARTITION BY (partitioning-column,
partitioning-column...)}
Syntax Description of CREATE INDEX
UNIQUE
specifies that the values (including NULL values) in the column or set of columns that make
up the index cannot contain more than one occurrence of the same value or set of values. For
indexes with multiple columns, the values of the columns as a group determine uniqueness,
not the values of the individual columns.
index
is an SQL identifier that specifies the simple name for the new index. You cannot qualify
index with its schema names. Indexes have their own namespace within a schema, so an
index name might be the same as a table or constraint name. However, no two indexes in a
schema can have the same name.
table
is the name of the table for which to create the index. See
column-name [ASC[ENDING] | DESC[ENDING]] [,column-name [ASC[ENDING] |
DESC[ENDING]]]...
specifies the columns in table to include in the index. The order of the columns in the index
need not correspond to the order of the columns in the table.
ASCENDING or DESCENDING specifies the storage and retrieval order for rows in the
index. The default is ASCENDING.
Rows are ordered by values in the first column specified for the index. If multiple index rows
share the same value for the first column, the values in the second column are used to order
the rows, and so forth. If duplicate index rows occur in a nonunique index, their order is
based on the sequence specified for the columns of the key of the underlying table. For
ordering (but not for other purposes), nulls are greater than other values.
populate-option
When you create an index and do not specify POPULATE or NO POPULATE, POPULATE
is assumed. If you create an index using NO POPULATE, you must later request a POPULATE
INDEX utility to actually load the data. See
60
SQL Statements
"Database Object Names" (page
"Database Object Names" (page
"POPULATE INDEX Utility" (page
242).
242).
220).

Advertisement

Table of Contents
loading

Table of Contents