SQL/MP Reference Manual
HP NonStop SQL/MP Reference Manual—523352-013
L-51
LOCKLENGTH File Attribute
FREE RESOURCES
ROLLBACK WORK
If you specify AUDITONLY, the process releases locks on audited objects only. You can
use this option if you want to hold locks on nonaudited objects throughout a series of
transactions.
Stopping or abnormal termination of a process frees any locks the process holds on
nonaudited tables. CLOSE and FREE RESOURCES release locks on nonaudited
tables.
LOCKLENGTH File Attribute
LOCKLENGTH is a Guardian file attribute that specifies the number of leading bytes
used to identify rows for generic locking. LOCKLENGTH applies to key-sequenced
tables and indexes.
num-bytes
is an integer between 0 and the number of bytes in the key that specifies the
number of leading bytes in the primary or clustering key (including SYSKEY if it
exists) to use to identify rows for generic locking.
LOCKLENGTH 0 (the default) indicates that the entire length of the primary or
clustering key should be used.
Consideration—LOCKLENGTH
Increasing LOCKLENGTH increases lock granularity, reducing the number of locks
issued and the amount of lock escalation. Reducing the number of locks improves
performance but reduces concurrency, because one lock controls a larger group of
rows.
Example—LOCKLENGTH
This example creates a table with a LOCKLENGTH that fits the first column of a two-
column key. Each row represents part of an order, and the first column is the order
number. When order-processing applications access the table, SQL issues a single
lock against all rows for an order. (The default LOCKLENGTH would cause a separate
lock for each row in the order.)
CREATE TABLE SALES.ODETAIL (
ORDERNUM NUMERIC (6) UNSIGNED, —Column length
PARTNUM NUMERIC (4) UNSIGNED, 6 bytes
QTY_ORDERED NUMERIC (5),
PRIMARY KEY ( ORDERNUM , PARTNUM ) —Key declaration
LOCKLENGTH num-bytes