Database

turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

02-14-2014
06:55 AM

02-14-2014
06:55 AM

Dear Experts,

How to find AMP number using Row-Hash value. I have gone through something in a blog. Below one is the link.

http://www.teradatatech.com/?p=470

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.

Thanks,

Sridhar.

4 REPLIES

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

02-14-2014
07:23 AM

02-14-2014
07:23 AM

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)

SELECT HASHROW(55) AS hr, HASHBUCKET(hr) AS hb, HASHAMP(hb);

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.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

02-17-2014
06:39 PM

02-17-2014
06:39 PM

Hi Dieter,

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

Sridhar.

Highlighted
##
##### Re: How to find AMP numbe using Row-Hash value?

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

02-18-2014
02:20 AM

02-18-2014
02:20 AM

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 ?

--Sri

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

02-18-2014
02:51 AM

02-18-2014
02:51 AM

Sri,

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.

Khurram