Berkeley DB Reference Guide: Access Methods
Полезная информация

Berkeley DB Reference Guide: Access Methods

Retrieving Btree records by number (DB_RECNUM)

The Btree access method optionally supports retrieval by logical record number. To configure a Btree database for record numbers, set the DB_RECNUM flag in the DB_INFO structure.

Configuring a Btree for record numbers should not be done lightly. While useful, it introduces a severe hot-spot in the database when storing key/data items, and can severely impact application throughput.

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