Finding Uneven Distribution Using Hash Functions - Teradata Database

Teradata Database Administration

Product
Teradata Database
Release Number
15.10
Language
English (United States)
Last Update
2018-10-06
Product Category
Software

Finding Uneven Distribution Using Hash Functions

Use the following functions to identify uneven hash distribution of data.

 

Function

Definition

HASHAMP

AMP that owns the hash bucket

HASHBACKAMP

Fallback AMP that owns the hash bucket

HASHBUCKET

Grouping for the specific hash value

HASHROW

32 bits of row hash ID without the uniqueness field

HASHAMP Example

If you suspect distribution problems (skewing) among AMPS, the following is a sample of what you might enter for a three-column PI:

SELECT HASHAMP (HASHBUCKET (HASHROW (col_x, col_y, 
      col_z))), count (*)
FROM hash15
GROUP BY 1
ORDER BY 2 desc;

HASHROW Example

If you suspect collisions in a row hash, the following is a sample of what you might enter for a three-column PI:

SELECT HASHROW (col_x, col_y, col_z), count (*)
FROM hash15
GROUP BY 1
ORDER BY 2 desc
HAVING count(*) > 10;