All Forums General
TD_Raj 22 posts Joined 05/10
29 Sep 2010
What role does last 16bit play in 32 bit ROW HASH

I learned that after hashing algorithm 32bit ROW HASH is generated.
First 16bit helps in determining AMP in which we will store our row.
However I want to know what role does last 16bit have?

Thanks

Jim Chapman 449 posts Joined 09/04
29 Sep 2010

Actually, in recent versions the first 20 bits of the hash are used to select the AMP. The entire 32-bit hash is used to determine the physical placement of the row within the hash. Thus rows with the same primary index value will be physically adjacent.

dashing201 22 posts Joined 05/10
29 Sep 2010

Hi Jim

I used to think that last 16bits are used to identify Table to which it belongs to.
Can you confirm if last 16bits act as Table ID or not ?

Jim Chapman 449 posts Joined 09/04
30 Sep 2010

No. The table ID is a separate 32-bit number.

abhi_insignia 11 posts Joined 06/11
04 Jan 2012

the 1st 16 bits tell the bucket number in the hash map which in turn points to the amp containing that row hash value. The 32 bits on a whole tell the AMP, the location of the row in the disk.

You must sign in to leave a comment.