Page 1 of 1

hashed file with multiple keys

Posted: Thu Jul 07, 2005 3:43 am
by SeRpEnTmInD
Previously, i'm using a ORACLE OCI8 to load data
with a query a bind variables:

SELECT * FROM SOMETABLE
WHERE :1 BETWEEN FLD1 AND FLD2
AND :2 BETWEEN FLD3 AND FLD4

these are the key fields:
FLD1, FLD2, FLD3, FLD4

field non-key:
FLD5

i have no problem with this...

now, i want to do the same by using a hashed file,
my question is how will i do that with same definition as
the table...

i will use the hashed file for lookups...

thanks

Posted: Thu Jul 07, 2005 4:28 am
by ray.wurlod
Welcome aboard! :D

Hashed file can not be used for BETWEEN or any other kind of lookup apart from key = value. End of story. Search the forum for BETWEEN to see what I mean.

The reason is the way hashed files work. The record is found by applying a function to the key value returning the address of the page on which the record is located. There is no primary key index, there is no table scan; there is a single I/O. The function is also called the "hashing algorithm".

Posted: Thu Jul 07, 2005 7:06 pm
by SeRpEnTmInD
thanks ray.wurlod, now i understand...