Page 1 of 1

Dynamic Hash file (create file) properties

Posted: Wed Jan 18, 2006 12:13 am
by RShiva
Apart from HFC is there any other alternateway to calculate the Hash file Properties for Type(30)Dynamic in create file options i.e Minimum modulus, selecting Hash algorithm using column length and display length

Posted: Wed Jan 18, 2006 1:12 am
by ArndW
When creating a new file the HFC is the only automated tool that will help you calculate these values. You can use the published information on Hashed files to manually calculate a ballpark figure. There are also the TCL commands HASH.AID and HASH.AID.DETAIL if I rememberc correctly - but they take existing data files and play through different configurations. Making a modulo too large doesn't impact performance, it just pre-reserves disk space; so erring on that side is not bad, only a modulo that is too small will give you bad performance.

Posted: Wed Jan 18, 2006 3:36 am
by ray.wurlod
There's also doing the arithmetic.

A hashed file is made up of a number of pages (groups) the size of which you decide (either 2KB or 4KB). You have a certain volume of data that you need to store; you also allow, say, 20% headroom. So, to store N bytes of data, you need (N + 20%) / (page_size) pages. That is a starting minimum modulus figure.

Be aware, however, that there is some storage overhead in hashed files; for k columns allow (14 + k) bytes per record if 32-bit addressing is in place or (22 + k) bytes per record if 64-bit addressing is in place.

Some additional complexity arises if there are likely to be oversized records that don't fit on pages (even HFC does not allow for these).