2
<!--Copyright 1997-2002 by Sleepycat Software, Inc.-->
3
<!--All rights reserved.-->
4
<!--See the file LICENSE for redistribution information.-->
7
<title>Berkeley DB: DB->set_pagesize</title>
8
<meta name="description" content="Berkeley DB: An embedded database programmatic toolkit.">
9
<meta name="keywords" content="embedded,database,programmatic,toolkit,b+tree,btree,hash,hashing,transaction,transactions,locking,logging,access method,access methods,java,C,C++">
12
<a name="2"><!--meow--></a>
13
<table width="100%"><tr valign=top>
15
<h1>DB->set_pagesize</h1>
18
<a href="../api_c/c_index.html"><img src="../images/api.gif" alt="API"></a><a href="../reftoc.html"><img src="../images/ref.gif" alt="Ref"></a>
26
DB->set_pagesize(DB *db, u_int32_t pagesize);
29
<p>Set the size of the pages used to hold items in the database, in bytes.
30
The minimum page size is 512 bytes, and the maximum page size is 64K
31
bytes. If the page size is not explicitly set, one is selected based
32
on the underlying filesystem I/O block size. The automatically selected
33
size has a lower limit of 512 bytes and an upper limit of 16K bytes.
34
<p>For information on tuning the Berkeley DB page size, see
35
<a href="../ref/am_conf/pagesize.html">Selecting a page size</a>.
36
<p>The DB->set_pagesize method configures a database, not only operations performed
37
using the specified <a href="../api_c/db_class.html">DB</a> handle.
38
<p>The DB->set_pagesize interface may not be called after the <a href="../api_c/db_open.html">DB->open</a>
40
If the database already exists when
41
<a href="../api_c/db_open.html">DB->open</a> is called, the information specified to DB->set_pagesize will
43
If creating additional databases in a file, the page size specified must
44
be consistent with the existing databases in the file or an error will
46
<p>The DB->set_pagesize method returns a non-zero error value on failure and 0 on success.
48
<p>The DB->set_pagesize method may fail and return a non-zero error for the following conditions:
50
<p><dt>EINVAL<dd>An invalid flag value or parameter was specified.
51
<p>Called after <a href="../api_c/db_open.html">DB->open</a> was called.
53
<p>The DB->set_pagesize method may fail and return a non-zero error for errors specified for other Berkeley DB and C library or system functions.
54
If a catastrophic error has occurred, the DB->set_pagesize method may fail and
55
return <a href="../ref/program/errorret.html#DB_RUNRECOVERY">DB_RUNRECOVERY</a>,
56
in which case all subsequent Berkeley DB calls will fail in the same way.
58
<a href="../api_c/db_class.html">DB</a>
60
<a href="../api_c/db_list.html">Databases and Related Methods</a>
62
<table width="100%"><tr><td><br></td><td align=right>
63
<a href="../api_c/c_index.html"><img src="../images/api.gif" alt="API"></a><a href="../reftoc.html"><img src="../images/ref.gif" alt="Ref"></a>
65
<p><font size=1><a href="http://www.sleepycat.com">Copyright Sleepycat Software</a></font>