I've been looking everywhere how I can improve my Teradata views performance by choosing the right primary index in my tables.
I have found multiple answers pointing to the same thing, by using this query to see how data is distributed through the AMPs :
SELECT HASHAMP(HASHBUCKET(HASHROW(<PRIMARY INDEX>))) AS
"AMP#",COUNT(*)
FROM <TABLENAME>
GROUP BY 1
ORDER BY 2 DESC;
I get that I need to have an even distribution, but is it better to have lots of target AMPs with few rows each or fewers AMPs but with less rows ?
Concrete example : On my table, choosing one index (product ID) says I'll distribute through 190 different AMPs whith each having up to 83 rows, and choosing two indexes (Product ID, Date) gets me 476 AMPs with each having up to 24 rows.