SQL/MX 2.x Reference Manual (H06.04+)

SQL/MX Language Elements
HP NonStop SQL/MX Reference Manual540440-003
6-57
First (Partition) Keys
Table 6-2 compares construction of the clustering key for unique and nonunique
indexes.
First (Partition) Keys
The FIRST KEY option of the PARTITION clause specifies the beginning of the range
for a range partitioned table or index partition. The FIRST KEY clause specifies the
lowest values in the partition for columns stored in ascending order and the highest
values in the partition for columns stored in descending order. These column values
are referred to as the partitioning key.
You specify the first value allowed in the associated partition for that column of the
partitioning key as a literal. If there are more storage key columns than literal items, the
first key value for each remaining key column is the lowest or highest value for the data
type of the column (the lowest value for an ascending column and the highest value for
a descending column).
STORE BY key
column list
No Not applicable Key column list + SYSKEY
Yes DROPPABLE Key column list + SYSKEY.
Primary key enforced by unique
index.
Yes NOT
DROPPABLE
If STORE BY column list
matches the primary key column
list, NonStop SQL/MX uses the
STORE BY column list.
If STORE BY column list is a
prefix of or the same as the
primary key column list,
NonStop SQL/MX uses the
primary key column list.
Other combinations are not
supported and generate errors.
Table 6-2. Clustering Key for Indexes
Unique Nonunique
Clustering key indexedColumns indexedColumns+
ClusteringKeyOfTable
Default
partitioning key*
indexedColumns indexedColumns+
ClusteringKeyOfTable+
SYSKEY
* The columns of the default partitioning key are also the columns that are available for partitioning using the
PARTITION BY clause
Table 6-1. Construction of the Clustering Key (page2of2)
Primary Key
Specified
DROPPABLE
Attribute Clustering Key