Berkeley DB Reference Guide:
Access Methods

PrevRefNext

Retrieving Btree records by number

The Btree access method optionally supports retrieval by logical record numbers). To configure a Btree to support record numbers, call the DB->set_flags function with the DB_RECNUM flag.

Configuring a Btree for record numbers should not be done lightly. While often useful, it requires that storing items into the database be single-threaded, which can severely impact application throughput. Generally it should be avoided in trees with a need for high write concurrency.

To determine a key's record number, use the DB_GET_RECNO flag to the DBcursor->c_get function.

To retrieve by record number, use the DB_SET_RECNO flag to the DB->get and DBcursor->c_get functions.

PrevRefNext

Copyright Sleepycat Software