Berkeley DB Reference Guide: Upgrading Berkeley DB Applications
Description: Berkeley DB: An embedded database programmatic toolkit.
Keywords: embedded,database,programmatic,toolkit,b+tree,btree,hash,hashing,transaction,transactions,locking,logging,access method,access methods,java,C,C++

### Berkeley DB Reference Guide: Upgrading Berkeley DB Applications |

# Release 3.1: Btree/Recno statistics

The DB->stat interface field bt_nrecs has been removed, replaced by two fields: bt_nkeys and bt_ndata. The bt_nkeys field returns a count of the unique keys in the database. The bt_ndata field returns a count of the key/data pairs in the database. Neither exactly matches the previous value of the bt_nrecs field, which returned a count of keys in the database, but, in the case of Btree databases, could overcount as it sometimes counted duplicate data items as unique keys.

The application should be searched for any occurrences of DB->stat with the use of the bt_nrecs field. The field should be changed to be either bt_nkeys or bt_ndata, whichever is more appropriate.

Copyright Sleepycat Software