Significance of primary key columns – HP Neoview Release 2.5 Software User Manual
Page 103
NOTE:
The columns used for hash keys appear in the PARTITION_ACCESS operator. The
FILE_SCAN operator does not show the hash keys for the table.
The presence or absence of hash key predicate values in the query text determines the type of
data access strategy, that is, whether one or all partitions are accessed, as follows:
•
Predicates on all hash key columns: the full hash key is available, which is used to limit
access to a specific data partition for each row.
•
Predicates on no hash key columns: all partitions for the table are accessed.
•
Predicates on partial hash key columns: all partitions for the table are accessed because the
full hash key is needed to limit access to a specific partition.
Predicates that appear on primary key columns that are also hash key columns for the table will
appear in the part_key_predicate field of the operator.
Significance of Primary Key Columns
The primary key columns serve as the store-by columns for the table. In each partition, rows are
stored in the order of the primary key columns. In addition, the primary key columns uniquely
identify each row in the table.
The presence or absence of predicates on the primary key columns in the query text can affect
performance in these ways:
•
Predicates on all primary key columns result in a unique scan of exactly one row (see the
FILE_SCAN_UNIQUE operator).
•
Predicates on no primary key columns result in a full table scan (unless secondary indexes
are present and useful to the query).
•
Predicates on leading (left-most) primary key columns result in a subset scan of the table.
The predicates values appear in the begin_key and end_key fields of the FILE_SCAN operator.
The disk process positions the start of the scan at the first row that matches the begin_key
value and scans sequentially through the last row that matches the end_key value.
•
Predicates on non-leading primary key columns may result in either a subset scan (through
MDAM) or a full scan of the table, as indicated in the operator.
•
Predicates on data columns (no primary key columns) results in a full table scan. The
predicate values on the data columns will appear in the executor_predicates field of the
operator.
Significance of Primary Key Columns
103