Page 1 of 1

Hash File Different

Posted: Tue Jun 28, 2005 10:48 am
by snassimr
Hi !

I need help in hash files.

I need create hashfile 20000000 rows with 6 keys . It to slowly.
I want to create hash file with one key that is faster and go to Inputs-> Columns and add 5 keys that I needed before and use the file with 6 needed keys in another place.

I don't suceed because the some columns are empty when I do View data
What problem with this ?

Have anybody solved the issue of low writing another way?

Posted: Tue Jun 28, 2005 11:05 am
by sjacobk
If you are not doing a lookup inside your job, create a sequential file first.
And later when the hash file is required create the hash file. I think you need to specify all the six keys when you create the hash file. Hash file is just like a table and the keys acts as if it is the primary mentioned in the table.

Posted: Tue Jun 28, 2005 11:54 am
by ArndW
snassimr,

the hash mechanism in a default Hash file using the dynamic file type can be slow when writing a lot of data. If you ensure that your minimum modulus is not the default of 1 but a larger number when you create the file the speed at which data is written is much, much faster. You can search this forum for details.

If you declare a hash file with a compound key using just one key but at another place click on other columns as "key" fields you will not get correct results; the keys all need to be declared when you create the file and you need to use the same keys in all jobs when reading from or writing to this hash file.

Posted: Tue Jun 28, 2005 6:30 pm
by ray.wurlod
Your approach to add key columns does not work with hashed files. A hashed file must, at all times, use the key, the whole key and nothing but the key to determine the location of a record.

20000000 rows is an awful lot for a hashed file - do you REALLY need them all? Can you be selective about which rows are loaded, for example exclude out-of-date information?

You will definitely need to create the hashed file so that it can grow beyond 2GB - that is, with 64-bit internal addressing. Search the forum for how to achieve this. Since you will need a custom command for creating the hashed file, you can easily incorporate Arnd's suggestions about either (or both) preallocating disk space or using a static - rather than dynamic - hashed file.

Note, too, that such a large hashed file will not be able to use write cache, because it is larger than the biggest cache that can be allocated.