Page 1 of 1

hash file

Posted: Sun Jun 03, 2007 11:42 pm
by loe_ram13
what is the hashing algorithm used in HASH lookup???
What is the difference between static & dynamic hashing in Datastage??

Posted: Mon Jun 04, 2007 1:05 am
by ray.wurlod
Beware of the terminology. It's hashed file, therefore it's hashed lookup.
The hashing algorithm used in lookup is the one that is specified for the hashed file. There are two choices (GENERAL or SEQ.NUM) for dynamic hashed files, and seventeen choices for static hashed files. There are thus 19 separate algorithms that might be used, though GENERAL is very like Type 18 and SEQ.NUM is very like Type 2 - but they are not identical.
There is no such thing as static or dynamic hashing. Static hashed files have an unvarying number of groups ("pages") where records are stored; the hashing algorithm selects one of these (the correct one for the particular record key). Dynamic hashed files have a number of groups that may vary over time depending on the total volume of data stored in the file; the hashing algorithm selects one of these at the time the lookup is performed.

Posted: Mon Jun 04, 2007 2:41 am
by loe_ram13
ray.wurlod wrote:Beware of the terminology. It's hashed file, therefore it's hashed lookup.
The hashing algorithm used in lookup is the one that is specified for the hashed file. There are two choices ...
How are GENERAL & SEQ.NUM different??
Can u elaborate a little??
Thanks in advance...

Posted: Mon Jun 04, 2007 9:37 pm
by ray.wurlod
GENERAL is a totally general-purpose algorithm that attempts to get "random" (= "flat") distribution of records over the available groups. SEQ.NUM is biased towards numeric characters, and operates right-to-left (much like an odometer). It works best when the keys form an unbroken integer sequence.