Find Uneven Distribution | Teradata Vantage - 17.00 - 17.05 - Finding Uneven Distribution Using Hash Functions - Advanced SQL Engine - Teradata Database

Teradata Vantage™ - Database Administration

Product
Advanced SQL Engine
Teradata Database
Release Number
17.00
17.05
Published
June 2020
Language
English (United States)
Last Update
2021-01-22
dita:mapPath
rgu1556127906220.ditamap
dita:ditavalPath
lze1555437562152.ditaval

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;