All Forums Analytics
Sankalp.C 45 posts Joined 08/13
10 Dec 2013
For AMP Number HASHMAP()+1

To find the number of Amps the query we use is -
Sel Hashmap()+1.
But why we add one saying "+1".

M.Saeed Khurram 544 posts Joined 09/12
10 Dec 2013

Is there any HASHMAP function exist? I know only about HASHAMP function.
I believe its typo :), well I think it is due to the fact that the amp numbers start from 0 so if there are 100 amps, then the function will return 99, and you have to add 1 to get the correct number of amps.
 

Khurram

Sankalp.C 45 posts Joined 08/13
10 Dec 2013

Sorry! for the Typo. :)
another thoughts I come across from sites is that it is because one amp is not perticulerly use for table calculations as it handles the locking strategies.

M.Saeed Khurram 544 posts Joined 09/12
10 Dec 2013

Yes, the basic purpose of hashamp function is to analyse the row distriution base on PI values. The query used for this purpose is:

SELECT HASHAMP(HASHBUCKET(HASHROW(PI_COLUMN))) AS AMP, COUNT(*)
FROM TABLE
Group by 1
Order by 1
;

 

Khurram

Sankalp.C 45 posts Joined 08/13
11 Dec 2013

thanks!

Dany3R9 18 posts Joined 03/14
03 Jul 2014

thanks for the infos.
 

ahmed2502 11 posts Joined 12/12
15 Jul 2014

We add '1' cause the AMP numbering starts from 0 (zero), not 1 (one).
If your system has 32 Amps, the amps are numbered from 0 to 31. HashAmp() gives the max amp number and you add 1 to find the total number of amps.

You must sign in to leave a comment.