Labels
- tips (17)
- interview questions (9)
- Performance tuning (6)
- INDEX (5)
- Timestamp tips (4)
- DBA (3)
- Teradata SQL Assistant (3)
- row number (3)
- statistics (3)
- fastload (2)
- BTEQ (1)
- Journal (1)
- Macro (1)
- MultiLoad (1)
- joins (1)
- lock (1)
- rank (1)

Wednesday, September 15, 2010
How can you view Data Distribution in Teradata ?
Teradata uses HASH values to store data in AMPs. To view data distribution we use Hash Functions.
Hash functions are usually used over primary index columns to find data distribution . We can identify skewness by using this concept .
Following query can be used to find hash values of PI columns
SELECT HASHAMP(HASHBUCKET(HASHROW(<PRIMARY INDEX>))) AS
"AMP#",COUNT(*)
FROM <TABLENAME>
GROUP BY 1
ORDER BY 2 DESC;
By looking at result , you query you can easily find out the Data Distribution across all AMPs in your system and further you can easily identify un-even data distribution.
definitions :
HASHROW - returns the row hash value for a given value
HASHBUCKET - the grouping of a specific hash value
HASHAMP - the AMP that is associated with the hash bucket
Labels:
tips
Subscribe to:
Post Comments (Atom)
i was searching this like everywhere n u gave it to me...... thank u :)
ReplyDeletereally helpfull for TD developers :)
ReplyDeleteThanks
ReplyDelete