All Forums Database 8 posts Joined 12/13
14 Feb 2014
How to find AMP numbe using Row-Hash value?

Dear Experts,
How to find AMP number using Row-Hash value. I have gone through something in a blog. Below one is the link.
Here for the PI value 55 Row-Hash is 11110000111100001111000011110000. For this they said AMP no=4. How they derived it?
Question may be silly, but I am beginner to TD. Please help me in understanding this.

dnoeth 4628 posts Joined 11/04
14 Feb 2014

Hi Sridhar,

there are three hash-related functions:

- HASHROW to get the hash

- HASHBUCKET to get the first 16/20-bits as an Integer, the so-called hash bucket number 

- HASHAMP to get the AMP on which a row is stored (i.e. a number between 0 and the number of AMPs on your system - 1)


HASHROW/HASHBUCKET return the same values on every TD system using the same hash-algorithm, but HASHAMP returns an AMP-number specific to your system.


So AMP 4 is just an example, on your system it will probably be a different number.

Dieter 8 posts Joined 12/13
17 Feb 2014

Hi Dieter,
I got it now. Thank you so much for helping me in this regard.

sgarlapa 88 posts Joined 03/13
18 Feb 2014

Hi Dieter,
 The Hassh values is of 32 bit.  HBN is the first 16/20 bits of hash value. Is there any significance of remaining bytes of hashvalue ?  or these bits reserved for future enhancements ?

M.Saeed Khurram 544 posts Joined 09/12
18 Feb 2014

The first 16 or 20 bits are used to find the proper amp from the hash map, but the full 32 bit row hash is stored within the row, and is used in row retrieval. 


You must sign in to leave a comment.