B+Tree persistent indexing data structure. B+Trees are optimized for block-based, random I/O storage because they store multiple keys on one tree node (called
BPage
). In addition, the leaf nodes directly contain (inline) the values associated with the keys, allowing a single (or sequential) disk read of all the values on the page.
B+Trees are n-airy, yeilding log(N) search cost. They are self-balancing, preventing search performance degradation when the size of the tree grows.
Keys and associated values must be Serializable
objects. The user is responsible to supply a serializable Comparator
object to be used for the ordering of entries, which are also called Tuple
. The B+Tree allows traversing the keys in forward and reverse order using a TupleBrowser obtained from the browse() methods.
This implementation does not directly support duplicate keys, but it is possible to handle duplicates by inlining or referencing an object collection as a value.
There is no limit on key size or value size, but it is recommended to keep both as small as possible to reduce disk I/O. This is especially true for the key size, which impacts all non-leaf BPage
objects.
@author Alex Boisvert
@version $Id: BTree.java,v 1.6 2005/06/25 23:12:31 doomdark Exp $