<h2class="title"style="clear: both"><aid="am_conf_logrec"></a>Logical record numbers</h2>
</div>
</div>
</div>
<p>The Berkeley DB Btree, Queue and Recno access methods can operate on logical
record numbers. Record numbers are 1-based, not 0-based, that is, the
first record in a database is record number 1.</p>
<p>In all cases for the Queue and Recno access methods, and when calling
the Btree access method using the <ahref="../api_reference/C/dbget.html"class="olink">DB->get()</a> and <ahref="../api_reference/C/dbcget.html"class="olink">DBC->get()</a> methods
with the <ahref="../api_reference/C/dbget.html#dbget_DB_SET_RECNO"class="olink">DB_SET_RECNO</a> flag specified, the <spanclass="bold"><strong>data</strong></span> field of
the key <ahref="../api_reference/C/dbt.html"class="olink">DBT</a> must be a pointer to a memory location of type
<spanclass="bold"><strong>db_recno_t</strong></span>, as typedef'd in the standard Berkeley DB include file.
The <spanclass="bold"><strong>size</strong></span> field of the key <ahref="../api_reference/C/dbt.html"class="olink">DBT</a> should be the size of that
type (for example, "sizeof(db_recno_t)" in the C programming language).
The <spanclass="bold"><strong>db_recno_t</strong></span> type is a 32-bit unsigned type, which limits the
number of logical records in a Queue or Recno database, and the maximum
logical record which may be directly retrieved from a Btree database,
to 4,294,967,295.</p>
<p>Record numbers in Recno databases can be configured to run in either
mutable or fixed mode: mutable, where logical record numbers change as
records are deleted or inserted, and fixed, where record numbers never
change regardless of the database operation. Record numbers in Queue
databases are always fixed, and never change regardless of the database
operation. Record numbers in Btree databases are always mutable, and
as records are deleted or inserted, the logical record number for other