OSDN Git Service

(split) Import translated manuals from JM CVS Repository.
[linuxjm/LDP_man-pages.git] / draft / man3 / btree.3
1 .\" Copyright (c) 1990, 1993
2 .\"     The Regents of the University of California.  All rights reserved.
3 .\"
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
6 .\" are met:
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\"    notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\"    notice, this list of conditions and the following disclaimer in the
11 .\"    documentation and/or other materials provided with the distribution.
12 .\" 3. All advertising materials mentioning features or use of this software
13 .\"    must display the following acknowledgement:
14 .\"     This product includes software developed by the University of
15 .\"     California, Berkeley and its contributors.
16 .\" 4. Neither the name of the University nor the names of its contributors
17 .\"    may be used to endorse or promote products derived from this software
18 .\"    without specific prior written permission.
19 .\"
20 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 .\" SUCH DAMAGE.
31 .\"
32 .\"     @(#)btree.3     8.4 (Berkeley) 8/18/94
33 .\"
34 .\" Japanese Version Copyright (c) 1999 Shouichi Saito
35 .\"     all rights reserved.
36 .\" Translated Mon Jul 26 21:43:11 JST 1999
37 .\"     by Shouichi Saito <ss236rx@ymg.urban.ne.jp>
38 .\" Proofed Mon Aug 16 1999 by NAKANO Takeo <nakano@apm.seikei.ac.jp>
39 .\"
40 .\"WORD:        access method           ¥¢¥¯¥»¥¹¥á¥½¥Ã¥É
41 .\"WORD:        prefix (comparison)     Á°ÃÖÈæ³Ó
42 .TH BTREE 3 1994-08-18 "" "Linux Programmer's Manual"
43 .UC 7
44 .SH Ì¾Á°
45 .\"O btree \- btree database access method
46 btree \- btree ¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ø¤Î¥¢¥¯¥»¥¹¥á¥½¥Ã¥É
47 .SH ½ñ¼°
48 .nf
49 .ft B
50 #include <sys/types.h>
51 #include <db.h>
52 .ft R
53 .fi
54 .SH ÀâÌÀ
55 .\"O The routine
56 .\"O .BR dbopen (3)
57 .\"O is the library interface to database files.
58 ¥ë¡¼¥Á¥ó
59 .BR dbopen (3)
60 ¤Ï¥Ç¡¼¥¿¥Ù¡¼¥¹¥Õ¥¡¥¤¥ë¤ËÂФ¹¤ë¥é¥¤¥Ö¥é¥ê¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Ç¤¢¤ë¡£
61 .\"O One of the supported file formats is btree files.
62 .\"O The general description of the database access methods is in
63 .\"O .BR dbopen (3),
64 .\"O this manual page describes only the btree specific information.
65 ¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¥Õ¥©¡¼¥Þ¥Ã¥È¤Î¤Ò¤È¤Ä¤Ë btree ¥Õ¥¡¥¤¥ë¤¬¤¢¤ë¡£
66 ¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ø¤Î¥¢¥¯¥»¥¹¥á¥½¥Ã¥É¤Ë´Ø¤¹¤ë°ìÈÌŪ¤Êµ­½Ò¤Ï
67 .BR dbopen (3)
68 ¤Ë½ñ¤«¤ì¤Æ¤¤¤ë¡£
69 ¤³¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Ç¤Ï btree ÆÃÍ­¤Î¾ðÊó¤Ë¤Ä¤¤¤Æ¤Î¤ßµ­½Ò¤¹¤ë¡£
70 .PP
71 .\"O The btree data structure is a sorted, balanced tree structure storing
72 .\"O associated key/data pairs.
73 btree ¥Ç¡¼¥¿¹½Â¤¤Ç¤Ï¡¢¥½¡¼¥È¤µ¤ì¤¿¥Ð¥é¥ó¥¹¥Ä¥ê¡¼¹½Â¤¤Ë
74 ¸ß¤¤¤Ë´ØÏ¢¤Å¤±¤é¤ì¤¿¥­¡¼/¥Ç¡¼¥¿ÂФò³ÊǼ¤·¤Æ¤¤¤ë¡£
75 .PP
76 .\"O The btree access method specific data structure provided to
77 .\"O .BR dbopen (3)
78 .\"O is defined in the
79 .\"O .I <db.h>
80 .\"O include file as follows:
81 .BR dbopen (3)
82 ¤ËÅϤµ¤ì¤ë btree ¥¢¥¯¥»¥¹¥á¥½¥Ã¥É¤ËÆÃÍ­¤Î¥Ç¡¼¥¿¹½Â¤ÂΤϡ¢
83 .I <db.h>
84 ¥¤¥ó¥¯¥ë¡¼¥É¥Õ¥¡¥¤¥ë¤Ç¼¡¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£
85 .sp
86 .in +4n
87 .nf
88
89 typedef struct {
90     unsigned long flags;
91     unsigned int  cachesize;
92     int           maxkeypage;
93     int           minkeypage;
94     unsigned int  psize;
95     int         (*compare)(const DBT *key1, const DBT *key2);
96     size_t      (*prefix)(const DBT *key1, const DBT *key2);
97     int           lorder;
98 } BTREEINFO;
99 .fi
100 .in
101 .sp
102 .\"O The elements of this structure are as follows:
103 ¤³¤Î¹½Â¤ÂΤÎÍ×ÁǤò°Ê²¼¤Ë¼¨¤¹¡£
104 .TP
105 .I flags
106 .\"O The flag value is specified by
107 .\"O .IR or 'ing
108 .\"O any of the following values:
109 .I flags
110 ¤ÎÃͤϰʲ¼¤ÎÃͤΤ¤¤º¤ì¤«¤«¡¢¤³¤ì¤é¤ÎÏÀÍýϤǻØÄꤵ¤ì¤ë¡£
111 .RS
112 .TP
113 .B R_DUP
114 .\"O Permit duplicate keys in the tree, that is,
115 .\"O permit insertion if the key to be
116 .\"O inserted already exists in the tree.
117 .\"O The default behavior, as described in
118 .\"O .BR dbopen (3),
119 .\"O is to overwrite a matching key when inserting a new key or to fail if
120 .\"O the
121 .\"O .B R_NOOVERWRITE
122 .\"O flag is specified.
123 ¥Ä¥ê¡¼¤ÎÃæ¤Ë¥­¡¼¤Î½ÅÊ£¤òµö¤¹¡£¤¹¤Ê¤ï¤Á¥Ä¥ê¡¼¤ÎÃæ¤ËÁÞÆþ¤µ¤ì¤è¤¦¤È¤·¤Æ¤¤¤ë
124 ¥­¡¼¤¬´û¤Ë¸ºß¤·¤Æ¤¤¤Æ¤â¡¢¤½¤ÎÁÞÆþ¤òµö²Ä¤¹¤ë¡£¥Ç¥Õ¥©¥ë¥È¤ÎÆ°ºî¤Ï
125 .BR dbopen (3)
126 ¤Ëµ­½Ò¤µ¤ì¤Æ¤¤¤ë¤è¤¦¤Ë¡¢¿·¤·¤¤¥­¡¼¤¬ÁÞÆþ¤µ¤ì¤ë¤È°ìÃפ·¤¿¥­¡¼¤ò¾å½ñ¤­¤¹¤ë¡£
127 ¤¢¤ë¤¤¤Ï
128 .B R_NOOVERWRITE
129 ¥Õ¥é¥°¤¬»ØÄꤵ¤ì¤Æ¤¤¤ë¤ÈÁÞÆþ¤Ë¼ºÇÔ¤¹¤ë¡£
130 .\"O The
131 .\"O .B R_DUP
132 .\"O flag is overridden by the
133 .\"O .B R_NOOVERWRITE
134 .\"O flag, and if the
135 .\"O .B R_NOOVERWRITE
136 .\"O flag is specified, attempts to insert duplicate keys into
137 .\"O the tree will fail.
138 .B R_DUP
139 ¥Õ¥é¥°¤Ï
140 .B R_NOOVERWRITE
141 ¥Õ¥é¥°¤Ë¤è¤Ã¤Æ¾å½ñ¤­¤µ¤ì¤ë¡£¤Ä¤Þ¤ê
142 .B R_NOOVERWRITE
143 ¥Õ¥é¥°¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¡¢¥Ä¥ê¡¼¤ËÊ£À½¥­¡¼¤òÁÞÆþ¤·¤è¤¦¤È¤¹¤ë¤È¼ºÇÔ¤¹¤ë¡£
144 .IP
145 .\"O If the database contains duplicate keys, the order of retrieval of
146 .\"O key/data pairs is undefined if the
147 .\"O .I get
148 .\"O routine is used, however,
149 .\"O .I seq
150 .\"O routine calls with the
151 .\"O .B R_CURSOR
152 .\"O flag set will always return the logical
153 .\"O "first" of any group of duplicate keys.
154 ¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ë¥­¡¼¤Î½ÅÊ£¤¬¤¢¤ë¤È¡¢
155 .I get
156 ¥ë¡¼¥Á¥ó¤ò»È¤Ã¤¿¾ì¹ç¤Î¥­¡¼/¥Ç¡¼¥¿ÂФμèÆÀ½ç¤Ï̤ÄêµÁ¤Ç¤¢¤ë¡£¤½¤ì¤ËÂФ·¡¢
157 .B R_CURSOR
158 ¥Õ¥é¥°¤ò¥»¥Ã¥È¤·¤Æ
159 .I seq
160 ¥ë¡¼¥Á¥ó¤ò»È¤¦¤È¡¢Ê£À½¥­¡¼¤Î¥°¥ë¡¼¥×¤ÎÃæ¤Î
161 ÏÀÍýŪ¤Ë¡ÖºÇ½é¡×¤Î¥­¡¼¤òɬ¤ºÊÖ¤·¤Æ¤¯¤ë¡£
162 .RE
163 .TP
164 .I cachesize
165 .\"O A suggested maximum size (in bytes) of the memory cache.
166 ÁÛÄꤵ¤ì¤ë¥á¥â¥ê¥­¥ã¥Ã¥·¥å¤ÎºÇÂ祵¥¤¥º (¥Ð¥¤¥Èñ°Ì)¡£
167 .\"O This value is
168 .\"O .I only
169 .\"O advisory, and the access method will allocate more memory rather than fail.
170 .\"O Since every search examines the root page of the tree, caching the most
171 .\"O recently used pages substantially improves access time.
172 ¤³¤ÎÃͤÏ
173 .I ¤¢¤¯¤Þ¤Ç
174 »²¹Í¤Ç¤¢¤ê¡¢¥¢¥¯¥»¥¹¥á¥½¥Ã¥É¤Ï¤³¤ÎÃͤò±Û¤¨¤¿¥á¥â¥ê¤Î
175 ³ä¤êÅö¤Æ¤ËÀ®¸ù¤¹¤ë¤³¤È¤â¤¢¤ë¡£
176 .\"O In addition, physical writes are delayed as long as possible, so a moderate
177 .\"O cache can reduce the number of I/O operations significantly.
178 ²Ã¤¨¤Æ¡¢ÊªÍýŪ¤Ê½ñ¤­¹þ¤ß¤Ï²Äǽ¤Ê¸Â¤êÃٱ䤵¤ì¤ë¤Î¤Ç¡¢
179 ¥­¥ã¥Ã¥·¥å¤ÎÂ礭¤µ¤òŬÅ٤ˤ·¤Æ¤ª¤±¤Ð I/O Áàºî¤Î²ó¿ô¤ò¤«¤Ê¤ê¸º¤é¤¹¤³¤È
180 ¤¬¤Ç¤­¤ë¡£
181 .\"O Obviously, using a cache increases (but only increases) the likelihood of
182 .\"O corruption or lost data if the system crashes while a tree is being modified.
183 ¤¢¤­¤é¤«¤Ë¥­¥ã¥Ã¥·¥å¤ò»È¤¦¤È¡¢¥Ä¥ê¡¼¤¬Êѹ¹¤µ¤ì¤Æ¤¤¤ëÅÓÃæ¤Ç
184 ¥·¥¹¥Æ¥à¤¬¥¯¥é¥Ã¥·¥å¤·¤¿¾ì¹ç¤Î¥Ç¡¼¥¿Ç˲õ¤ä¥Ç¡¼¥¿¥í¥¹¥È¤Î²ÄǽÀ­¤Ï
185 Áý¤¨¤ë (¤Þ¤¢¤Ç¤â¤½¤ì¤À¤±¤Î¤³¤È)¡£
186 .\"O If
187 .I cachesize
188 .\"O is 0 (no size is specified) a default cache is used.
189 ¤¬ 0 (¥µ¥¤¥º¤¬»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤) ¤Î¾ì¹ç¡¢¥Ç¥Õ¥©¥ë¥È¤Î¥­¥ã¥Ã¥·¥å¤¬»È¤ï¤ì¤ë¡£
190 .TP
191 .I maxkeypage
192 .\"O The maximum number of keys which will be stored on any single page.
193 .\"O Not currently implemented.
194 ñ°ì¥Ú¡¼¥¸¤ËǼ¤á¤é¤ì¤ëºÇÂ祭¡¼¿ô¤Ç¤¢¤ë¡£¸½ºß¼ÂÁõ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£
195 .\" The maximum number of keys which will be stored on any single page.
196 .\" Because of the way the btree data structure works,
197 .\" .I maxkeypage
198 .\" must always be greater than or equal to 2.
199 .\" If
200 .\" .I maxkeypage
201 .\" is 0 (no maximum number of keys is specified) the page fill factor is
202 .\" made as large as possible (which is almost invariably what is wanted).
203 .TP
204 .I minkeypage
205 .\"O The minimum number of keys which will be stored on any single page.
206 .\"O This value is used to determine which keys will be stored on overflow
207 .\"O pages, that is, if a key or data item is longer than the pagesize divided
208 .\"O by the minkeypage value, it will be stored on overflow pages instead
209 .\"O of in the page itself.
210 ñ°ì¥Ú¡¼¥¸¤ËǼ¤á¤é¤ì¤ëºÇ¾®¥­¡¼¿ô¤Ç¤¢¤ë¡£¤³¤ÎÃͤϡ¢¤É¤Î¥­¡¼¤ò
211 ¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¥Ú¡¼¥¸
212 ¤ËǼ¤á¤ë¤«·è¤á¤ë¤Î¤Ë»È¤ï¤ì¤ë¡£¤¹¤Ê¤ï¤Á¥­¡¼¤Þ¤¿¤Ï¥Ç¡¼¥¿¤¬
213 minkeypage ¤ÎÃͤÇʬ³ä¤µ¤ì¤¿¥Ú¡¼¥¸¥µ¥¤¥º¤è¤êÂ礭¤¤»þ¡¢¤½¤Î¥Ú¡¼¥¸¤ËǼ¤á
214 ¤ëÂå¤ï¤ê¤Ë¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¥Ú¡¼¥¸¤ËǼ¤á¤ë¤È¤¤¤¦¤³¤È¤Ç¤¢¤ë¡£
215 .\"O If
216 .I minkeypage
217 .\"O is 0 (no minimum number of keys is specified) a value of 2 is used.
218 ¤¬ 0 (¥­¡¼¤ÎºÇ¾®Ãͤ¬»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤) ¤Î¾ì¹ç¡¢ÃͤȤ·¤Æ 2 ¤¬»È¤ï¤ì¤ë¡£
219 .TP
220 .I psize
221 .\"O Page size is the size (in bytes) of the pages used for nodes in the tree.
222 .\"O The minimum page size is 512 bytes and the maximum page size is 64K.
223 ¥Ä¥ê¡¼¤ÎÃæ¤Î¥Î¡¼¥É¤Ë»È¤ï¤ì¤ë¥Ú¡¼¥¸¥µ¥¤¥º (¥Ð¥¤¥Èñ°Ì)¡£
224 ºÇ¾®ÃͤϠ512 ¥Ð¥¤¥È¤Ç¡¢ºÇÂçÃͤϠ64K ¤Ç¤¢¤ë¡£
225 .\"O If
226 .I psize
227 .\"O is 0 (no page size is specified) a page size is chosen based on the
228 .\"O underlying file system I/O block size.
229 ¤¬ 0 (¥Ú¡¼¥¸¥µ¥¤¥º¤¬»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤) ¤Î¾ì¹ç¡¢
230 ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î I/O ¥Ö¥í¥Ã¥¯¥µ¥¤¥º¤Ë´ð¤Å¤¤¤Æ·è¤á¤é¤ì¤ë¡£
231 .TP
232 .I compare
233 .\"O Compare is the key comparison function.
234 .I compare
235 ¤Ï¥­¡¼¤ÎÈæ³Ó´Ø¿ô¤Ç¤¢¤ë¡£
236 .\"O It must return an integer less than, equal to, or greater than zero if the
237 .\"O first key argument is considered to be respectively less than, equal to,
238 .\"O or greater than the second key argument.
239 ºÇ½é¤Î¥­¡¼°ú¿ô¤ËÂФ·¡¢ÆóÈÖÌܤΥ­¡¼°ú¿ô¤¬Â礭¤¤¾ì¹ç¤Ë¤ÏÀµ¤ÎÀ°¿ô¤ò¡¢
240 Ʊ¤¸¾ì¹ç¤Ë¤Ï¥¼¥í¤ò¡¢¾®¤µ¤¤¾ì¹ç¤Ë¤ÏÉé¤ÎÀ°¿ô¤òÊÖ¤¹¡£
241 .\"O The same comparison function must be used on a given tree every time it
242 .\"O is opened.
243 ¥Ä¥ê¡¼¤ò³«¤¯ºÝ¤Ë¤Ï¡¢¾ï¤ËƱ¤¸Èæ³Ó´Ø¿ô¤¬»È¤ï¤ì¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£
244 .\"O If
245 .I compare
246 .\"O is NULL (no comparison function is specified), the keys are compared
247 .\"O lexically, with shorter keys considered less than longer keys.
248 ¤¬ NULL (Èæ³Ó´Ø¿ô¤¬»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤) ¤Î¾ì¹ç¡¢
249 ¼­½ñŪ¤ËÈæ³Ó¤µ¤ì¤ë¡£Ã»¤¤¥­¡¼¤ÏŤ¤¥­¡¼¤è¤ê¾®¤µ¤¤¤³¤È¤Ë¤Ê¤ë¡£
250 .TP
251 .I prefix
252 .\"O Prefix is the prefix comparison function.
253 .I prefix
254 ¤ÏÁ°ÃÖÈæ³Ó´Ø¿ô¤Ç¤¢¤ë¡£
255 .\"O If specified, this routine must return the number of bytes of the second key
256 .\"O argument which are necessary to determine that it is greater than the first
257 .\"O key argument.
258 ¤³¤Î¥ë¡¼¥Á¥ó¤Ï (»ØÄꤵ¤ì¤¿¾ì¹ç¤Ë¤Ï)¡¢ÆóÈÖÌܤΥ­¡¼°ú¿ô¤Î
259 ¥Ð¥¤¥È¿ô¤òÊÖ¤µ¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£¤³¤ì¤ÏÆóÈÖÌܤΥ­¡¼°ú¿ô¤¬
260 °ìÈÖÌܤΥ­¡¼°ú¿ô¤è¤êÂ礭¤¤¤«¤É¤¦¤«·è¤á¤ë¤Î¤ËɬÍפǤ¢¤ë¡£
261 .\"NAKANO ¤Á¤ç¤Ã¤È°ÕÌ£¤ï¤«¤é¤ó...
262 .\"O If the keys are equal, the key length should be returned.
263 .\"O Note, the usefulness of this routine is very data-dependent, but, in some
264 .\"O data sets can produce significantly reduced tree sizes and search times.
265 ¥­¡¼¤¬Æ±¤¸¾ì¹ç¡¢¥­¡¼¤ÎŤµ¤¬Ê֤롣¤³¤Î¥ë¡¼¥Á¥ó¤¬Í­ÍѤ«¤É¤¦¤«¤Ï¡¢
266 ¥Ç¡¼¥¿¤Ë¶¯¤¯°Í¸¤¹¤ë¡£¤·¤«¤·¥Ç¡¼¥¿¥»¥Ã¥È¤Ë¤è¤Ã¤Æ¤Ï¡¢ÌÀ¤é¤«¤Ë¥Ä¥ê¡¼
267 ¤Î¥µ¥¤¥º¤È¸¡º÷»þ´Ö¤ò¸º¤é¤·¤Æ¤¯¤ì¤ë¡£
268 .\"O If
269 .\"O .I prefix
270 .\"O is NULL (no prefix function is specified),
271 .\"O .I and
272 .\"O no comparison function is specified, a default lexical comparison routine
273 .\"O is used.
274 .I prefix
275 ¤¬ NULL (prefix ´Ø¿ô¤¬»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤) ¤Ç¡¢
276 .I ¤«¤Ä
277 Èæ³Ó´Ø¿ô¤¬»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤¤È¡¢¥Ç¥Õ¥©¥ë¥È¤Î¼­½ñÈæ³Ó¥ë¡¼¥Á¥ó¤¬»È¤ï¤ì¤ë¡£
278 .\"O If
279 .\"O .I prefix
280 .\"O is NULL and a comparison routine is specified, no prefix comparison is
281 .\"O done.
282 .I prefix
283 ¤¬ NULL ¤ÇÈæ³Ó´Ø¿ô¤¬»ØÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ï¡¢Á°ÃÖÈæ³Ó¤Ï¹Ô¤ï¤ì¤Ê¤¤¡£
284 .TP
285 .I lorder
286 .\"O The byte order for integers in the stored database metadata.
287 .\"O The number should represent the order as an integer; for example,
288 .\"O big endian order would be the number 4,321.
289 .\"O If
290 .\"O .I lorder
291 .\"O is 0 (no order is specified) the current host order is used.
292 ¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ë³ÊǼ¤µ¤ì¤Æ¤¤¤ë¥á¥¿¥Ç¡¼¥¿¤ÎÀ°¿ôÃͤΥХ¤¥È¥ª¡¼¥À¡¼¡£
293 ¤³¤Î¿ô»ú¤Ï¡¢½ç½ø¤òÀ°¿ô¤Çɽ¤·¤¿¤â¤Î¤Ç¤¢¤ë¡£
294 Î㤨¤Ð¥Ó¥Ã¥°¥¨¥ó¥Ç¥£¥¢¥ó¤Ê¤é¡¢¤³¤Î¿ôÃͤϠ4,321 ¤È¤Ê¤ë¡£
295 .I lorder
296 ¤¬ 0 (»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤) ¤Î¾ì¹ç¡¢¸½ºß¤Î¥Û¥¹¥È
297 ¤Ç»È¤ï¤ì¤Æ¤¤¤ë¥Ð¥¤¥È¥ª¡¼¥À¡¼¤¬»È¤ï¤ì¤ë¡£
298 .PP
299 .\"O If the file already exists (and the
300 .\"O .B O_TRUNC
301 .\"O flag is not specified), the
302 .\"O values specified for the arguments
303 .\"O .IR flags ,
304 .\"O .I lorder
305 .\"O and
306 .\"O .I psize
307 .\"O are ignored
308 .\"O in favor of the values used when the tree was created.
309 ¥Õ¥¡¥¤¥ë¤¬´û¤Ë¸ºß¤·¤Æ¤¤¤ë (¤Þ¤¿¤Ï
310 .B O_TRUCT
311 ¥Õ¥é¥°¤¬»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤) ¤È¡¢
312 °ú¤­¿ô
313 .IR flag ,
314 .IR lorder ,
315 .I psize
316 ¤Ë»ØÄꤵ¤ì¤¿ÃͤÏ̵»ë¤µ¤ì¡¢
317 ¥Ä¥ê¡¼¤¬ºî¤é¤ì¤¿»þ¤Ë»È¤Ã¤¿Ãͤ¬ÍѤ¤¤é¤ì¤ë¡£
318 .PP
319 .\"O Forward sequential scans of a tree are from the least key to the greatest.
320 ¥Ä¥ê¡¼¤ÎÁ°Êý½ç¸¡º÷¤Ï¡¢ºÇ¾®¥­¡¼¤«¤éºÇÂ祭¡¼¤Ë¸þ¤«¤Ã¤Æ¹Ô¤ï¤ì¤ë¡£
321 .PP
322 .\"O Space freed up by deleting key/data pairs from the tree is never reclaimed,
323 .\"O although it is normally made available for reuse.
324 .\"O This means that the btree storage structure is grow-only.
325 .\"O The only solutions are to avoid excessive deletions, or to create a fresh
326 .\"O tree periodically from a scan of an existing one.
327 ¥Ä¥ê¡¼¤«¤é¥­¡¼/¥Ç¡¼¥¿ÂФ¬ºï½ü¤µ¤ì¤ë¤³¤È¤Ë¤è¤Ã¤Æ¤Ç¤­¤¿¥¹¥Ú¡¼¥¹¤Ï¡¢
328 Ä̾ïºÆÍøÍѤǤ­¤ë·Á¤Ë¤Ê¤Ã¤Æ¤¤¤ë¤¬ºÆÍøÍѤµ¤ì¤ë¤³¤È¤Ï̵¤¤¡£
329 ¤Ä¤Þ¤ê brtee µ­²±¹½Â¤¤ÏÈîÂ礹¤ë°ìÊý¤Ç¤¢¤ë¡£
330 Âкö¤Ï²áÅ٤κï½ü¤òÈò¤±¤ë¤«¡¢
331 ¸ºß¤¹¤ë¥Ä¥ê¡¼¤òÄ´¤Ù¤ÆÄê´üŪ¤Ë¿·¤·¤¤¥Ä¥ê¡¼¤òºî¤ë¤«¡¢¤À¤±¤Ç¤¢¤ë¡£
332 .PP
333 .\"O Searches, insertions, and deletions in a btree will all complete in
334 .\"O O lg base N where base is the average fill factor.
335 .\"O Often, inserting ordered data into btrees results in a low fill factor.
336 .\"O This implementation has been modified to make ordered insertion the best
337 .\"O case, resulting in a much better than normal page fill factor.
338 .SH ¥¨¥é¡¼
339 .\"O The
340 .\"O .I btree
341 .\"O access method routines may fail and set
342 .\"O .I errno
343 .\"O for any of the errors specified for the library routine
344 .\"O .BR dbopen (3).
345 .I btree
346 ¥¢¥¯¥»¥¹¥á¥½¥Ã¥É¥ë¡¼¥Á¥ó¤Ï¼ºÇÔ¤¹¤ë¤È¡¢¥é¥¤¥Ö¥é¥ê¥ë¡¼¥Á¥ó
347 .BR dbopen (3)
348 ¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë¥¨¥é¡¼¤Î¤¤¤º¤ì¤«¤ò
349 .I errno
350 ¤È¤·¤ÆÊÖ¤¹¡£
351 .\"O .SH BUGS
352 .SH ¥Ð¥°
353 .\"O Only big and little endian byte order is supported.
354 ¥Ð¥¤¥È¥ª¡¼¥À¡¼¤È¤·¤Æ¤Ï¥Ó¥Ã¥°¥¨¥ó¥Ç¥£¥¢¥ó¤È¥ê¥È¥ë¥¨¥ó¥Ç¥£¥¢¥ó¤Î¤ß¤¬
355 ¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¡£
356 .SH ´ØÏ¢¹àÌÜ
357 .BR dbopen (3),
358 .BR hash (3),
359 .BR mpool (3),
360 .BR recno (3)
361 .sp
362 .IR "The Ubiquitous B-tree" ,
363 Douglas Comer, ACM Comput. Surv. 11, 2 (June 1979), 121-138.
364 .sp
365 .IR "Prefix B-trees" ,
366 Bayer and Unterauer, ACM Transactions on Database Systems, Vol. 2, 1
367 (March 1977), 11-26.
368 .sp
369 .IR "The Art of Computer Programming Vol. 3: Sorting and Searching" ,
370 D.E. Knuth, 1968, pp 471-480.