1<?xml version="1.0" encoding="UTF-8" standalone="no"?> 2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 3<html xmlns="http://www.w3.org/1999/xhtml"> 4 <head> 5 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> 6 <title>Db::set_bt_minkey()</title> 7 <link rel="stylesheet" href="apiReference.css" type="text/css" /> 8 <meta name="generator" content="DocBook XSL Stylesheets V1.73.2" /> 9 <link rel="start" href="index.html" title="Berkeley DB C++ API Reference" /> 10 <link rel="up" href="db.html" title="Chapter 2. The Db Handle" /> 11 <link rel="prev" href="dbset_bt_compress.html" title="Db::set_bt_compress()" /> 12 <link rel="next" href="dbset_bt_prefix.html" title="Db::set_bt_prefix()" /> 13 </head> 14 <body> 15 <div class="navheader"> 16 <table width="100%" summary="Navigation header"> 17 <tr> 18 <th colspan="3" align="center">Db::set_bt_minkey()</th> 19 </tr> 20 <tr> 21 <td width="20%" align="left"><a accesskey="p" href="dbset_bt_compress.html">Prev</a> </td> 22 <th width="60%" align="center">Chapter 2. 23 The Db Handle 24 </th> 25 <td width="20%" align="right"> <a accesskey="n" href="dbset_bt_prefix.html">Next</a></td> 26 </tr> 27 </table> 28 <hr /> 29 </div> 30 <div class="sect1" lang="en" xml:lang="en"> 31 <div class="titlepage"> 32 <div> 33 <div> 34 <h2 class="title" style="clear: both"><a id="dbset_bt_minkey"></a>Db::set_bt_minkey()</h2> 35 </div> 36 </div> 37 </div> 38 <pre class="programlisting">#include <db_cxx.h> 39 40int 41Db::set_bt_minkey(u_int32_t bt_minkey);</pre> 42 <p> 43 Set the minimum number of key/data pairs intended to be stored on any 44 single Btree leaf page. 45 </p> 46 <p> 47 This value is used to determine if key or data items will be stored on 48 overflow pages instead of Btree leaf pages. For more information on 49 the specific algorithm used, see <a href="../../programmer_reference/bt_conf.html#am_conf_bt_minkey" class="olink">Minimum keys per page</a>. 50 The <span class="bold"><strong>bt_minkey</strong></span> value specified must be 51 at least 2; if <span class="bold"><strong>bt_minkey</strong></span> is not 52 explicitly set, a value of 2 is used. 53 </p> 54 <p> 55 The <code class="methodname">Db::set_bt_minkey()</code> method configures a database, not only 56 operations performed using the specified <a class="link" href="db.html" title="Chapter 2. The Db Handle">Db</a> 57 handle. 58 </p> 59 <p> 60 The <code class="methodname">Db::set_bt_minkey()</code> method may not be called after the 61 <a class="xref" href="dbopen.html" title="Db::open()">Db::open()</a> method is called. If 62 the database already exists when <a class="xref" href="dbopen.html" title="Db::open()">Db::open()</a> 63 is called, the information specified to <code class="methodname">Db::set_bt_minkey()</code> will be ignored. 64 </p> 65 <p> 66 The <code class="methodname">Db::set_bt_minkey()</code> <span> 67 68 <span> 69 method either returns a non-zero error value or throws an 70 exception that encapsulates a non-zero error value on 71 failure, and returns 0 on success. 72 </span> 73 </span> 74 </p> 75 <div class="sect2" lang="en" xml:lang="en"> 76 <div class="titlepage"> 77 <div> 78 <div> 79 <h3 class="title"><a id="id1644410"></a>Parameters</h3> 80 </div> 81 </div> 82 </div> 83 <div class="sect3" lang="en" xml:lang="en"> 84 <div class="titlepage"> 85 <div> 86 <div> 87 <h4 class="title"><a id="id1644414"></a>bt_minkey</h4> 88 </div> 89 </div> 90 </div> 91 <p> 92 The <span class="bold"><strong>bt_minkey</strong></span> parameter is the 93 minimum number of key/data pairs intended to be stored on any single 94 Btree leaf page. 95 </p> 96 </div> 97 </div> 98 <div class="sect2" lang="en" xml:lang="en"> 99 <div class="titlepage"> 100 <div> 101 <div> 102 <h3 class="title"><a id="id1644544"></a>Errors</h3> 103 </div> 104 </div> 105 </div> 106 <p> 107 The <code class="methodname">Db::set_bt_minkey()</code> <span> 108 109 <span> 110 method may fail and throw a <a class="link" href="dbexception.html" title="Chapter 6. The DbException Class">DbException</a> 111 exception, encapsulating one of the following non-zero errors, or return one 112 of the following non-zero errors: 113 </span> 114 </span> 115 </p> 116 <div class="sect3" lang="en" xml:lang="en"> 117 <div class="titlepage"> 118 <div> 119 <div> 120 <h4 class="title"><a id="id1644560"></a>EINVAL</h4> 121 </div> 122 </div> 123 </div> 124 <p> 125 If the method was called after <a class="xref" href="dbopen.html" title="Db::open()">Db::open()</a> 126 was called; or if an invalid flag value or parameter was specified. 127 </p> 128 </div> 129 </div> 130 <div class="sect2" lang="en" xml:lang="en"> 131 <div class="titlepage"> 132 <div> 133 <div> 134 <h3 class="title"><a id="id1644561"></a>Class</h3> 135 </div> 136 </div> 137 </div> 138 <p> 139 <a class="link" href="db.html" title="Chapter 2. The Db Handle">Db</a> 140 </p> 141 </div> 142 <div class="sect2" lang="en" xml:lang="en"> 143 <div class="titlepage"> 144 <div> 145 <div> 146 <h3 class="title"><a id="id1644539"></a>See Also</h3> 147 </div> 148 </div> 149 </div> 150 <p> 151 <a class="xref" href="db.html#dblist" title="Database and Related Methods">Database and Related Methods</a> 152 </p> 153 </div> 154 </div> 155 <div class="navfooter"> 156 <hr /> 157 <table width="100%" summary="Navigation footer"> 158 <tr> 159 <td width="40%" align="left"><a accesskey="p" href="dbset_bt_compress.html">Prev</a> </td> 160 <td width="20%" align="center"> 161 <a accesskey="u" href="db.html">Up</a> 162 </td> 163 <td width="40%" align="right"> <a accesskey="n" href="dbset_bt_prefix.html">Next</a></td> 164 </tr> 165 <tr> 166 <td width="40%" align="left" valign="top">Db::set_bt_compress() </td> 167 <td width="20%" align="center"> 168 <a accesskey="h" href="index.html">Home</a> 169 </td> 170 <td width="40%" align="right" valign="top"> Db::set_bt_prefix()</td> 171 </tr> 172 </table> 173 </div> 174 </body> 175</html> 176