1<!--$Id: dbsizes.so,v 10.27 2005/02/24 20:51:50 bostic Exp $-->
2<!--Copyright (c) 1997,2008 Oracle.  All rights reserved.-->
3<!--See the file LICENSE for redistribution information.-->
4<html>
5<head>
6<title>Berkeley DB Reference Guide: Database limits</title>
7<meta name="description" content="Berkeley DB: An embedded database programmatic toolkit.">
8<meta name="keywords" content="embedded,database,programmatic,toolkit,btree,hash,hashing,transaction,transactions,locking,logging,access method,access methods,Java,C,C++">
9</head>
10<body bgcolor=white>
11<a name="2"><!--meow--></a>
12<table width="100%"><tr valign=top>
13<td><b><dl><dt>Berkeley DB Reference Guide:<dd>Access Methods</dl></b></td>
14<td align=right><a href="../am_misc/stability.html"><img src="../../images/prev.gif" alt="Prev"></a><a href="../toc.html"><img src="../../images/ref.gif" alt="Ref"></a><a href="../am_misc/diskspace.html"><img src="../../images/next.gif" alt="Next"></a>
15</td></tr></table>
16<p align=center><b>Database limits</b></p>
17<p>The largest database file that Berkeley DB can handle depends on the page size
18selected by the application.  Berkeley DB stores database file page numbers as
19unsigned 32-bit numbers and database file page sizes as unsigned 16-bit
20numbers.  Using the maximum database page size of 65536, this results in
21a maximum database file size of 2<sup>48</sup> (256 terabytes).  The
22minimum database page size is 512 bytes, which results in a minimum
23maximum database size of 2<sup>41</sup> (2 terabytes).</p>
24<p>The largest database file Berkeley DB can support is potentially further limited
25if the host system does not have filesystem support for files larger than
262<sup>32</sup>, including the ability to seek to absolute offsets within
27those files.</p>
28<p>The largest key or data item that Berkeley DB can support is 2<sup>32</sup>,
29or more likely limited by available memory.  Specifically, while key and
30data byte strings may be of essentially unlimited length, any one of
31them must fit into available memory so that it can be returned to the
32application.  As some of the Berkeley DB interfaces return both key and data
33items to the application, those interfaces will require that any
34key/data pair fit simultaneously into memory.  Further, as the access
35methods may need to compare key and data items with other key and data
36items, it may be a requirement that any two key or two data items fit
37into available memory.  Finally, when writing applications supporting
38transactions, it may be necessary to have an additional copy of any data
39item in memory for logging purposes.</p>
40<p>The maximum Btree depth is 255.</p>
41<table width="100%"><tr><td><br></td><td align=right><a href="../am_misc/stability.html"><img src="../../images/prev.gif" alt="Prev"></a><a href="../toc.html"><img src="../../images/ref.gif" alt="Ref"></a><a href="../am_misc/diskspace.html"><img src="../../images/next.gif" alt="Next"></a>
42</td></tr></table>
43<p><font size=1>Copyright (c) 1996,2008 Oracle.  All rights reserved.</font>
44</body>
45</html>
46