howto timestamp records in bsd db

From: Marc Tardif <intmktg_at_Gloria.CAM.ORG>
Date: 2000/06/08
Message-ID: <Pine.LNX.4.10.10006082142190.26728-100000_at_Gloria.CAM.ORG>#1/1


How can I timestamp records which are in a berkeley db hash table? Ultimately, I must be able to:
- maintain the database by removing old entries based on the timestamp;

  • and avoid sequential scans.

Of course, I will need to create one or more secondary databases. For example, one setup could be to use a btree to store the timestamp as key and the main hash table key as data. This would allow me to retrieve oldest records for maintenance by using R_FIRST. Problem is, if I update a record in the main hash table, there's no way to know which record to update in the timestamp table. To circumvent this problem, I could probably create a third table using the hash method to store the same key as the main hash table and the timestamp as the data. Problem with this method is that it seems like overkill. Two extra databases only for timestamps?! There must be a better solution..

Please let me know,
Marc Tardif Received on Thu Jun 08 2000 - 00:00:00 CEST

Original text of this message