~ubuntu-branches/ubuntu/precise/gnat-gps/precise

« back to all changes in this revision

Viewing changes to kernel/src_info/sn/snsrc/db-2.7.7/docs/api_cxx/DbInfo/set_flags.html

  • Committer: Package Import Robot
  • Author(s): Ludovic Brenta
  • Date: 2012-01-15 15:42:21 UTC
  • mfrom: (10.1.10 sid)
  • Revision ID: package-import@ubuntu.com-20120115154221-ccysuzvh02pkhuwq
Tags: 5.0-6
Rebuild against libgtkada 2.24.1.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<! "@(#)set_flags.so    10.9 (Sleepycat) 10/29/98">
2
 
<!Copyright 1997, 1998 by Sleepycat Software, Inc.  All rights reserved.>
3
 
<html>
4
 
<body bgcolor=white>
5
 
<head>
6
 
<title>Berkeley DB: DbInfo::set_flags</title>
7
 
<meta name="description" content="Berkeley DB: An embedded database programmatic toolkit.">
8
 
<meta name="keywords" content="embedded,database,programmatic,toolkit,b+tree,btr
9
 
ee,hash,hashing,transaction,transactions,locking,logging,access method,access me
10
 
thods,java,C,C++">
11
 
</head>
12
 
<h1>DbInfo::set_flags</h1>
13
 
<hr size=1 noshade>
14
 
<tt>
15
 
<h3>
16
 
<pre>
17
 
#include &lt;db_cxx.h&gt;
18
 
<p>
19
 
void DbInfo::set_flags(u_int32_t);
20
 
</pre>
21
 
</h3>
22
 
<h1>Description</h1>
23
 
<p>
24
 
The following additional flags may be specified for the Btree access method:
25
 
<dl compact>
26
 
<a name="DB_DUP">
27
 
<p><dt>DB_DUP<dd>Permit duplicate data items in the tree, i.e. insertion when the key of
28
 
the key/data pair being inserted already exists in the tree will be
29
 
successful.  The ordering of duplicates in the tree is determined by the
30
 
order of insertion, unless the ordering is otherwise specified by use of
31
 
a cursor or a duplicate comparison function.
32
 
It is an error to specify both DB_DUP and DB_RECNUM.
33
 
<a name="DB_DUPSORT">
34
 
<p><dt>DB_DUPSORT<dd>Sort duplicates within a set of data items.  If the application does not
35
 
specify a comparison function using the <a href="../../api_cxx/DbInfo/set_compare.html">DbInfo::set_compare</a> method,
36
 
a default, lexical comparison will be used.
37
 
<p>
38
 
Specifying that duplicates are to be sorted changes the behavior of the
39
 
<a href="../../api_cxx/Db/put.html">Db::put</a> operation as well as the <a href="../../api_cxx/Dbc/put.html">Dbc::put</a> operation when
40
 
the <a href="../../api_cxx/Dbc/put.html#DB_KEYFIRST">DB_KEYFIRST</a>, <a href="../../api_cxx/Dbc/put.html#DB_KEYLAST">DB_KEYLAST</a> and <a href="../../api_cxx/Dbc/get.html#DB_CURRENT">DB_CURRENT</a>
41
 
flags are specified.
42
 
<a name="DB_RECNUM">
43
 
<p><dt>DB_RECNUM<dd>
44
 
Support retrieval from btrees using record numbers.
45
 
For more information, see the DB_GET_RECNO flag to the <a href="../../api_cxx/Db/get.html">Db::get</a>
46
 
and <a href="../../api_cxx/Dbc/get.html">Dbc::get</a> methods.
47
 
<p>
48
 
Logical record numbers in btrees are mutable in the face of record
49
 
insertion or deletion.
50
 
See the DB_RENUMBER flag in the Recno access method information for
51
 
further discussion.
52
 
<p>
53
 
Maintaining record counts within a btree introduces a serious point of
54
 
contention, namely the page locations where the record counts are stored.
55
 
In addition, the entire tree must be locked during both insertions and
56
 
deletions, effectively single-threading the tree for those operations.
57
 
Specifying DB_RECNUM can result in serious performance degradation for
58
 
some applications and data sets.
59
 
<p>
60
 
It is an error to specify both DB_DUP and DB_RECNUM.
61
 
</dl>
62
 
<p>
63
 
The following additional flags may be specified for the Hash access method:
64
 
<dl compact>
65
 
<a name="DB_DUP">
66
 
<p><dt>DB_DUP<dd>Permit duplicate data items in the tree, i.e. insertion when the key of
67
 
the key/data pair being inserted already exists in the tree will be
68
 
successful.  The ordering of duplicates in the tree is determined by the
69
 
order of insertion, unless the ordering is otherwise specified by use of
70
 
a cursor or a duplicate comparison function.
71
 
<a name="DB_DUPSORT">
72
 
<p><dt>DB_DUPSORT<dd>Sort duplicates within a set of data items.  If the application does not
73
 
specify a comparison function using the <a href="../../api_cxx/DbInfo/set_compare.html">DbInfo::set_compare</a> method,
74
 
a default, lexical comparison will be used.
75
 
<p>
76
 
Specifying that duplicates are to be sorted changes the behavior of the
77
 
<a href="../../api_cxx/Db/put.html">Db::put</a> operation as well as the <a href="../../api_cxx/Dbc/put.html">Dbc::put</a> operation when
78
 
the <a href="../../api_cxx/Dbc/put.html#DB_KEYFIRST">DB_KEYFIRST</a>, <a href="../../api_cxx/Dbc/put.html#DB_KEYLAST">DB_KEYLAST</a> and <a href="../../api_cxx/Dbc/get.html#DB_CURRENT">DB_CURRENT</a>
79
 
flags are specified.
80
 
</dl>
81
 
<p>
82
 
The following additional flags may be specified for the Recno access method:
83
 
<dl compact>
84
 
<p><dt>DB_DELIMITER<dd>
85
 
The <b>re_delim</b> value has been set.
86
 
<p><dt>DB_FIXEDLEN<dd>
87
 
The records are fixed-length, not byte delimited.
88
 
The <b>re_len</b> value specifies the length of the record,
89
 
and the <b>re_pad</b> value is used as the pad character.
90
 
<p>
91
 
Any records added to the database that are less than <b>re_len</b>
92
 
bytes long are automatically padded.
93
 
Any attempt to insert records into the database that are greater than
94
 
<b>re_len</b> bytes long will cause the call to fail immediately and
95
 
return an error.
96
 
<p><dt>DB_PAD<dd>
97
 
The <b>re_pad</b> field has been set.
98
 
<p><dt>DB_RENUMBER<dd>
99
 
Specifying the DB_RENUMBER flag causes the logical record numbers to be
100
 
mutable, and change as records are added to and deleted from the database.
101
 
For example, the deletion of record number 4 causes records numbered 5
102
 
and greater to be renumbered downward by 1.
103
 
If a cursor was positioned to record number 4 before the deletion,
104
 
it will reference the new record number 4, if any such record exists,
105
 
after the deletion.
106
 
If a cursor was positioned after record number 4 before the deletion,
107
 
it will be shifted downward 1 logical record,
108
 
continuing to reference the same record as it did before.
109
 
<p>
110
 
Using the <a href="../../api_cxx/Db/put.html">Db::put</a> or <a href="../../api_cxx/Dbc/put.html">Dbc::put</a> interfaces to create
111
 
new records will cause the creation of multiple records if the record
112
 
number is more than one greater than the largest record currently in the
113
 
database.
114
 
For example, creating record 28, when record 25 was previously the last
115
 
record in the database, will create records 26 and 27 as well as 28.
116
 
Attempts to retrieve records that were created in this manner will result
117
 
in an error return of DB_KEYEMPTY.
118
 
<p>
119
 
If a created record is not at the end of the database, all records following
120
 
the new record will be automatically renumbered upward by 1.
121
 
For example, the creation of a new record numbered 8 causes records
122
 
numbered 8 and greater to be renumbered upward by 1.
123
 
If a cursor was positioned to record number 8 or greater before the insertion,
124
 
it will be shifted upward 1 logical record,
125
 
continuing to reference the same record as it did before.
126
 
<p>
127
 
For these reasons,
128
 
concurrent access to a recno database with the DB_RENUMBER flag specified
129
 
may be largely meaningless, although it is supported.
130
 
<p><dt>DB_SNAPSHOT<dd>
131
 
This flag specifies that any specified <b>re_source</b> file be read in its
132
 
entirety when <a href="../../api_cxx/Db/open.html">Db::open</a> is called.
133
 
If this flag is not specified, the <b>re_source</b> file may be read lazily.
134
 
</dl>
135
 
<p>
136
 
<h1>Class</h1>
137
 
<a href="../../api_cxx/DbInfo/class.html">DbInfo</a>
138
 
<p>
139
 
<h1>See Also</h1>
140
 
<a href="../../api_cxx/DbInfo/set_bt_compare.html">DbInfo::set_bt_compare</a>,
141
 
<a href="../../api_cxx/DbInfo/set_bt_maxkey.html">DbInfo::set_bt_maxkey</a>,
142
 
<a href="../../api_cxx/DbInfo/set_bt_minkey.html">DbInfo::set_bt_minkey</a>,
143
 
<a href="../../api_cxx/DbInfo/set_bt_prefix.html">DbInfo::set_bt_prefix</a>,
144
 
<a href="../../api_cxx/DbInfo/set_cachesize.html">DbInfo::set_cachesize</a>,
145
 
<a href="../../api_cxx/DbInfo/set_compare.html">DbInfo::set_compare</a>,
146
 
DbInfo::set_flags,
147
 
<a href="../../api_cxx/DbInfo/set_h_ffactor.html">DbInfo::set_h_ffactor</a>,
148
 
<a href="../../api_cxx/DbInfo/set_h_hash.html">DbInfo::set_h_hash</a>,
149
 
<a href="../../api_cxx/DbInfo/set_h_nelem.html">DbInfo::set_h_nelem</a>,
150
 
<a href="../../api_cxx/DbInfo/set_lorder.html">DbInfo::set_lorder</a>,
151
 
<a href="../../api_cxx/DbInfo/set_malloc.html">DbInfo::set_malloc</a>,
152
 
<a href="../../api_cxx/DbInfo/set_pagesize.html">DbInfo::set_pagesize</a>,
153
 
<a href="../../api_cxx/DbInfo/set_re_delim.html">DbInfo::set_re_delim</a>,
154
 
<a href="../../api_cxx/DbInfo/set_re_len.html">DbInfo::set_re_len</a>,
155
 
<a href="../../api_cxx/DbInfo/set_re_pad.html">DbInfo::set_re_pad</a>
156
 
and
157
 
<a href="../../api_cxx/DbInfo/set_re_source.html">DbInfo::set_re_source</a>.
158
 
</tt>
159
 
</body>
160
 
</html>