Hi all,

I have an application where I have to create several indices on a database. 
I am planning to implement the indices as separate DBs. In the index DB, I 
have to store a pointer to the original record. As far as I can tell I have 
4 choices here:

1. Use my own ID for the records, and store this ID in the index DB. Keep 
the original DB sorted on this ID. Use binary search to find the record 
using the ID. This is not very efficient. I have use a hash search to get 
the ID from the index DB and then do a binary search. I also have to add an 
extra field to the DB.

2. Store the record index in the Index DB. This should give very fast access 
to the record. But, I have to update the index DB, every time I add or 
delete records.

3. Store the unique ID of the record in the index DB. This will get rid of 
the update problem. But, it seems DmFindRecordByID does a linear search thru 
the database header. For large number of records this may take a while.

4. Store the local ID of the record in the index DB. This will get rid of 
the update problem(??). Also, I can get very fast access to the record data 
by converting the local ID to a locked pointer. This seems to be the most 
efficient method. But, I am not sure if the local ID of a record changes 
while updating the database. Do you think this will work or there could be 
any other problem?

Thanks for your patience.

-Sugho-
______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com

Reply via email to