Accessing Row Hash of a record

Database

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?
3 REPLIES

Re: Accessing Row Hash of a record

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

Re: Accessing Row Hash of a record

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

Re: Accessing Row Hash of a record

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