Wednesday 18 August 2010

How many rows assigns Teradata to each AMP for a given table?

Teradata distributes table rows to different AMP's according to a hash value calculated from its primary key. The following query indicates how many rows fall into each AMP for a given table.

SELECT
HASHAMP (HASHBUCKET(HASHROW( col1, col2, col3 ))) AS AMP_NUM,
COUNT(*) as NUM_ROWS_PER_AMP
FROM
mytable
GROUP BY 1
ORDER BY 1;


It is useful to check whether your table is properly distributed or not!

No comments:

Post a Comment