Introduction to Data Management
Accessing Databases With NonStop SQL
15873 Tandem Computers Incorporated 3-7
Key-sequenced tables have rows of variable length. Rows are inserted in the table
in order of primary key value. Usually, you define the primary key as a set of one
or more columns in the table. Thus, if the primary key in an inventory table is the
part number of the item described in a row, the rows would be arranged in order
of part number. If there are no suitable columns to use for the primary key, the
system defines a special key column for this purpose. In a key-sequenced table,
you can update or delete the rows, and you can add new columns to the table.
Relative tables have fixed-length rows. The system inserts new rows in system
key order, where the value of the system key is the relative record number of the
associated file record. You can update or delete rows, and you can add new
columns up to the specified row length.
Entry-sequenced tables have variable-length rows. The system always inserts new
rows at the end of the table. The value of the system key is based on the order of
insertion, so an entry-sequenced table is basically a chronological one. You can
update rows but you cannot delete them. You can add new columns.
Because the key-sequenced structure has the fewest restrictions, most tables in
databases used for OLTP are key-sequenced tables. The other kinds of tables are used
in special cases: entry-sequenced tables when chronology is important, and relative
tables when direct access is important.
Partitioned Tables
If you have a very large table, or a table used at different geographic locations, you
can make your data more accessible by partitioning the table over multiple disk
volumes. These multiple volumes can be located on the same system, or on different
systems. A partitioned table appears in Figure 3-3; this is a key-sequenced table, with
the LOC column as the primary key.
Figure 3-3. A Partitioned Table
S8020-009
PARTLOCK Table
(Partition 1)
A10
A21
...
A94
2001
1403
...
3302
1100
21
...
200
PARTLOCK Table
(Partition 2)
G11
G68
...
G98
2002
6402
...
5502
20
6032
...
136
PARTLOCK Table
(Partition 3)
P11
P12
...
P87
2002
2003
...
3103
200
-100
...
300
$WHS1 (New York) $WHS2 (Los Angeles) $WHS3 (Montreal)
LOC PART QTY LOC PART QTY LOC PART QTY