Finding Uneven Distribution Using Hash Functions - Teradata Database - Teradata Vantage NewSQL Engine

Teradata Vantage™ - Database Administration

Product
Teradata Database
Teradata Vantage NewSQL Engine
Release Number
16.20
Published
March 2019
Language
English (United States)
Last Update
2019-05-03
dita:mapPath
tgx1512080410608.ditamap
dita:ditavalPath
TD_DBS_16_20_Update1.ditaval
dita:id
ujp1472240543947
Product Category
Software
Teradata Vantage

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;