Question about Hashed Files

Archive of postings to DataStageUsers@Oliver.com. This forum intended only as a reference and cannot be posted to.

Moderators: chulett, rschirm

Locked
admin
Posts: 8720
Joined: Sun Jan 12, 2003 11:26 pm

Question about Hashed Files

Post by admin »

Hi all,

I just want to know whether it's advisable to use multiple keys in a hashed
file. I always use hashed files but with a single key. If I use multiple
keys, will I encounter any problems?

Thanks!!

Regards,
Chi
<b>PLEASE READ</b>
Do not contact admin unless you have technical support or account questions. Do not send email or Private Messages about discussion topics to ADMIN. Contact the webmaster concerning abusive or offensive posts.
admin
Posts: 8720
Joined: Sun Jan 12, 2003 11:26 pm

Question about Hashed Files

Post by admin »

Hashed files can have more than one key column, from a metadata perspective. What happens is that the hashed file still only has one physical key (called @ID); if this is to contain more than one column a separator character is used (by default a "text mark", which can be specified via the @TM system variable). The individual key columns are defined in the file dictionary as virtual columns. There is also a storage location in the file dictionary that records any non-default separator character, and another that records the column names that make up the key.

There is a slight performance degradation when using multi-column keys with hashed files because, when you do a lookup based on your multi-column primary key, the underlying engine has to assemble the @ID value, which is then used as the argument to the hashing algorithm that locates the required record.

Even so, lookup performance using the entire key will still be quicker than performing a lookup against a remote database server.

Lookup performance using only part of the multi-column key, and lookup performance using anything other than an "equals" condition, will be horrible unless appropriate indexing is applied to the hashed file.


----- Original Message -----
From: "Chi Laborte"
Date: Mon, 22 Dec 2003 22:36:25 -0500
To:
Subject: Question about Hashed Files

> Hi all,
>
> I just want to know whether it's advisable to use multiple keys in a hashed
> file. I always use hashed files but with a single key. If I use multiple
> keys, will I encounter any problems?
>
> Thanks!!
>
> Regards,
> Chi
>
>
<b>PLEASE READ</b>
Do not contact admin unless you have technical support or account questions. Do not send email or Private Messages about discussion topics to ADMIN. Contact the webmaster concerning abusive or offensive posts.
Locked