-
cursor traverse order of hash based database
Hi, I am trying to read key/data pairs within a range of buckets from
hash based berkeley db. I would like to avoid creating a secondary
index of bucket number for this purpose if possible.
Is there a fixed order of the cursor traverser in hash db (considering
the linear hash of bdb can be extented ) ?
If I use DBcursor->c_get() with DB_NEXT_NODUP and finish reading all
key/data paires in current bucket, will the cursor move to record in
next bucket (current bucket+1 or greater) of the hash db ? or it will
just pick a page that's physically next to current page ?
I think the cursor traverse order is obvious for b-tree based db. But
for hash bashed db,
I can't find a answer from
http://www.sleepycat.com/docs/api_c/dbc_get.html
Any suggestion will be appreciated. Thanks.
-
Re: cursor traverse order of hash based database
Hi,
I'm not sure at what are you referring when you are saying "physically
next"? At the way in which the operating system is reading the db from
the disk?
How does your data/keys pairs look like?
When you are retrieving data with DB_NEXT_NODUP, after the cursor will
finish to read all the key/data paires from the current bucket, the
cursor will move the the next bucket of the hash database.
Also, the same thing is valid for filling in records in the database.
If the estimate or fill factor are not set or are set too low, hash
tables will still expand gracefully as keys are entered, although a
slight performance degradation may be noticed.
Related documentation can be found here:
http://www.sleepycat.com/docs/ref/am_conf/h_hash.html
http://www.sleepycat.com/docs/api_c/db_set_h_nelem.html
Regards,
Bogdan Coman, Oracle