Saturday, January 15, 2011

How can you use HASH FUNCTIONS to view Data Distribution across all AMPs in Teradata?

How can you use HASH FUNCTIONS to view Data Distribution across all AMPs in Teradata?
Answers:

Hash Functions can be used to view the data distribution of rows for a chosen primary index.

SELECT HASHAMP(HASHBUCKET(HASHROW())) AS “AMP#”, COUNT(*) FROM GROUP BY 1 ORDER BY 2 DESC;

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

This is really good, by looking into the result set of above written 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.

1 comment:

  1. I'm extremely inspired along with your writing talents and also with the layout in your blog. Is that this a paid theme or did you modify it yourself? Either way keep up the nice high quality writing, it's rare to peer a nice blog like this one these days. Try here: How To Password Protect Folder In Four Easy Steps

    ReplyDelete