Skip to Content
Berkeley DB
book

Berkeley DB

by Sleepycat™ Software, Inc.
June 2001
Intermediate to advanced content levelIntermediate to advanced
688 pages
19h 18m
English
Sams
Content preview from Berkeley DB

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. Although 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.

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

The Berkeley DB Book

The Berkeley DB Book

Himanshu Yadava
Linux Recipes for Oracle DBAs

Linux Recipes for Oracle DBAs

Darl Kuhn, Charles Kim, Bernard Lopuz
Fedora Linux

Fedora Linux

Chris Tyler

Publisher Resources

ISBN: 0735710643Purchase book