views:

47

answers:

1

I'm using the C++ STL API to Berkeley DB 4.8, and I'm able to use bulk retrieval for a db_map or db_multimap const iterator created using begin(), but not one created from find() (or lower_bound() for multimaps).

I appreciate for single item random access uses of find() would be a waste to use bulk retrieval, but I want to access many records in btree order from my find() point forwards, so bulk retrieval would help me. The underlying C++ api appears to allow it, is it possible from the STl API?

A: 

I found a solution to this myself:

You need to overload the const_iterator lower_bound() method to include a BulkRetrievalOption argument just like begin(). This will internally create the interator instance using that argument just as begin() does but then move the iterator to the lower bound of the key value supplied.

Same would apply to a db_map::find

Bevan Brookfield