###

Berkeley DB Reference Guide:
  Access Methods

# Logical record numbers

The Berkeley DB Btree, Queue and Recno access methods can operate on logical record numbers. In all cases for the Queue and Recno access methods, and in some cases with the Btree access method, a record number is specified to reference a specific key/data pair. In the case of Btree supporting duplicate data items, the logical record number refers to a key and all of its data items.

Record numbers are 32-bit unsigned types, which limits the number of logical records in a database to 4,294,967,296. The first record in the database is record number 1.

Record numbers in Recno databases can be configured to run in either mutable or fixed mode: mutable, where logical record numbers change as records are deleted or inserted, and fixed, where record numbers never change regardless of the database operation. Record numbers in Btree databases are always mutable, and as records are deleted or inserted, the logical record number for other records in the database can change. See Logically renumbering records for more information.

Record numbers in Queue databases are always fixed, and never change regardless of the database operation.

Configuring Btree databases to support record numbers can severely limit the throughput of applications with multiple concurrent threads writing the database, because locations used to store record counts often become hot spots that many different threads all need to update.

Copyright Sleepycat Software