All Forums Database
gaurav_wani 2 posts Joined 07/06
01 Feb 2007
Accessing Row Hash of a record

Is it possible to access the row-id or row-hash of a particular record in teradata? If yes, could you please tell me a of doing it?

Luckyhansh 30 posts Joined 08/06
08 Feb 2007

select rowhash( primary index of the record) not very sure about it ,i seldom use this function,perhaps you may refer to Teradata Trainning material described very clearly in it

textures21 12 posts Joined 01/05
09 Feb 2007

The rowhash function is awesome! In fact, using it is one of the best ways to understand data distribution in TD.SELECT count(*), hashamp(hashbucket(hashrow([primary_index_val]))), [primary_index_val]FROM[yourtable]GROUP BY hashamp(hashbucket(hashrow([primary_index_val]))), [primary_index_val]Will show you exactly how rows are getting distributed to the amps in the system. These are tremendously handy when you are in the process of evaluating primary index choices, etc... or trying to understand what AMP a session might be skewing on (we, for example, look at the hashamp value of any default values used in user sessions to understand how they will impact aggregate function processing)...hope this helps...-pt

Luckyhansh 30 posts Joined 08/06
12 Feb 2007

Thanks Perter:-)I have gone home to look my books ,same results

You must sign in to leave a comment.