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

SQL/MX Language Elements
HP NonStop SQL/MX Reference Manual540440-003
6-56
Keys
Keys
NonStop SQL/MX supports these types of keys:
Clustering Keys
First (Partition) Keys
Index Keys
Primary Keys
SYSKEYs
Clustering Keys
NonStop SQL/MX organizes records of a table or index by using a b-tree based on the
“clustering key”. Values of the clustering key act as logical row-ids. The set of columns
that make up the clustering key must guarantee uniqueness. If necessary, to guarantee
uniqueness, NonStop SQL/MX appends an additional key to the set of columns you
specify to define the clustering key as shown in Table 6-1 and Table 6-2. Any table or
index that enforces uniqueness must also have the property that its primary key is the
same as its clustering key.
You can update any column in the table that is not part of the clustering key. Note that
this differs from product versions prior to SQL/MX Release 2.x, in which the restriction
was that you could not update any column that is part of the primary key.
Table 6-1 compares construction of the clustering key for tables with various
combinations of the STORE BY and PRIMARY KEY options.
Table 6-1. Construction of the Clustering Key (page1of2)
Primary Key
Specified
DROPPABLE
Attribute Clustering Key
No STORE BY No Not applicable SYSKEY
Yes DROPPABLE SYSKEY
Primary key enforced by unique
index.
Yes NOT
DROPPABLE
Same as primary key
STORE BY
primary key
No Not applicable Not supported (error)
Yes DROPPABLE Not supported (error)
Yes NOT
DROPPABLE
Same as primary key