Index Hash Mapping
The rows for primary‑indexed tables are distributed across the AMPS using a hashing algorithm (see “Teradata Database Hashing Algorithm” on page 225). The hashing algorithm computes a rowhash value based on the value of the primary index. The rowhash is a 32-bit value containing either a 16-bit hash bucket number with a 16-bit remainder or a 20‑bit hash bucket number with a 12‑bit remainder (see “Teradata Database Hashing Algorithm” on page 225).
The number of hash buckets for a Teradata system can be set to either 65,536 or 1,048,576, depending on the settings for the CurHashBucketSize and NewHashBucketSize parameters in DBS Control (see Utilities: Volume 1 (A-K) for details about the DBS Control utility. Also see “Number of Hash Buckets Per System” on page 229). The number of hash buckets for a system is a function of hash bucket size, with 16‑bit buckets producing 65,536 buckets per system and 20‑bit buckets defining 1,048,576 buckets per system (see “Number of Hash Buckets Per System” on page 229).
The hash buckets are distributed as evenly as possible among the AMPs on a system (see “Hash Maps” on page 229).
The BYNET interface maintains a hash map for each AMP, an index of which hash buckets are assigned to which AMPs, that is uses in combination with the hash bucket number in a row’s rowhash to determine the owning AMP. Row assignment is performed in a manner that ensures as equal a distribution of table rows as possible among all the AMPs in the configuration.