1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238
|
.\" Copyright (c) 1990, 1993
.\" The Regents of the University of California. All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\" 3. All advertising materials mentioning features or use of this software
.\" must display the following acknowledgement:
.\" This product includes software developed by the University of
.\" California, Berkeley and its contributors.
.\" 4. Neither the name of the University nor the names of its contributors
.\" may be used to endorse or promote products derived from this software
.\" without specific prior written permission.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.\" @(#)btree.3 8.4 (Berkeley) 8/18/94
.\"
.\" Japanese Version Copyright (c) 1999 Shouichi Saito
.\" all rights reserved.
.\" Translated Mon Jul 26 21:43:11 JST 1999
.\" by Shouichi Saito <ss236rx@ymg.urban.ne.jp>
.\" Proofed Mon Aug 16 1999 by NAKANO Takeo <nakano@apm.seikei.ac.jp>
.\"
.\"WORD: access method å
.\"WORD: prefix (comparison)
.TH BTREE 3 1994-08-18 "" "Linux Programmer's Manual"
.UC 7
.SH ̾
btree \- btree ǡ١ؤΥå
.SH
.nf
.ft B
#include <sys/types.h>
#include <db.h>
.ft R
.fi
.SH
롼
.BR dbopen (3)
ϥǡ١եФ饤֥ꥤեǤ롣
ݡȤƤեեޥåȤΤҤȤĤ btree ե뤬롣
ǡ١ؤΥåɤ˴ؤŪʵҤ
.BR dbopen (3)
˽Ƥ롣
Υޥ˥奢ڡǤ btree ͭξˤĤƤΤߵҤ롣
.PP
btree ǡ¤ǤϡȤ줿Хĥ¤
ߤ˴ϢŤ줿/ǡФǼƤ롣
.PP
.BR dbopen (3)
Ϥ btree åɤͭΥǡ¤Τϡ
.I <db.h>
롼ɥեǼΤ褦Ƥ롣
.sp
.in +4n
.nf
typedef struct {
unsigned long flags;
unsigned int cachesize;
int maxkeypage;
int minkeypage;
unsigned int psize;
int (*compare)(const DBT *key1, const DBT *key2);
size_t (*prefix)(const DBT *key1, const DBT *key2);
int lorder;
} BTREEINFO;
.fi
.in
.sp
ι¤ΤǤʲ˼
.TP
.I flags
.I flags
ͤϰʲͤΤ줫¤ǻꤵ롣
.RS
.TP
.B R_DUP
ĥ˥νʣʤĥ褦ȤƤ
¸ߤƤƤ⡢Ĥ롣ǥեȤư
.BR dbopen (3)
˵ҤƤ褦ˡȰפ롣
뤤
.B R_NOOVERWRITE
ե饰ꤵƤ˼Ԥ롣
.B R_DUP
ե饰
.B R_NOOVERWRITE
ե饰ˤäƾ롣Ĥޤ
.B R_NOOVERWRITE
ե饰ꤵ줿硢ĥʣ褦ȤȼԤ롣
.IP
ǡ١˥νʣȡ
.I get
롼ȤäΥ/ǡФμ̤Ǥ롣Ф
.B R_CURSOR
ե饰åȤ
.I seq
롼ȤȡʣΥ롼פ
ŪˡֺǽפΥɬ֤Ƥ롣
.RE
.TP
.I cachesize
ꤵꥭåκ祵 (Хñ)
ͤ
.I ޤ
ͤǤꡢåɤϤͤۤ
Ƥ뤳Ȥ⤢롣
äơʪŪʽߤϲǽʸ¤ٱ䤵Τǡ
å礭Ŭ٤ˤƤ I/O βʤ긺餹
Ǥ롣
餫˥åȤȡĥѹƤ
ƥबå夷Υǡ˲ǡȤβǽ
(ޤǤ⤽Τ)
.I cachesize
0 (ꤵƤʤ) ξ硢ǥեȤΥå夬Ȥ롣
.TP
.I maxkeypage
ñڡǼ祭Ǥ롣Ƥʤ
.\" The maximum number of keys which will be stored on any single page.
.\" Because of the way the btree data structure works,
.\" .I maxkeypage
.\" must always be greater than or equal to 2.
.\" If
.\" .I maxkeypage
.\" is 0 (no maximum number of keys is specified) the page fill factor is
.\" made as large as possible (which is almost invariably what is wanted).
.TP
.I minkeypage
ñڡǼǾǤ롣ͤϡɤΥ
Сեڡ
Ǽ뤫Τ˻Ȥ롣ʤޤϥǡ
minkeypage ͤʬ䤵줿ڡ礭ΥڡǼ
˥СեڡǼȤȤǤ롣
.I minkeypage
0 (κǾͤꤵƤʤ) ξ硢ͤȤ 2 Ȥ롣
.TP
.I psize
ĥΥΡɤ˻Ȥڡ (Хñ)
Ǿͤ 512 ХȤǡͤ 64K Ǥ롣
.I psize
0 (ڡꤵƤʤ) ξ硢
ե륷ƥ I/O ֥å˴ŤƷ롣
.TP
.I compare
.I compare
ϥӴؿǤ롣
ǽΥФܤΥ礭ˤ
Ʊˤϥˤ֤
ĥݤˤϡƱӴؿȤʤФʤʤ
.I compare
NULL (ӴؿꤵƤʤ) ξ硢
ŪӤ롣ûĹ꾮Ȥˤʤ롣
.TP
.I prefix
.I prefix
ӴؿǤ롣
Υ롼 (ꤵ줿ˤ)ܤΥ
Хȿ֤ʤƤϤʤʤܤΥ
ܤΥ礭ɤΤɬפǤ롣
.\"NAKANO äỌ̇̄狼...
Ʊ硢Ĺ֤롣Υ롼ͭѤɤϡ
ǡ˶¸롣ǡåȤˤäƤϡ餫˥ĥ
Υȸ֤餷Ƥ롣
.I prefix
NULL (prefix ؿꤵƤʤ) ǡ
.I
ӴؿꤵƤʤȡǥեȤμӥ롼Ȥ롣
.I prefix
NULL ӴؿꤵƤϡӤϹԤʤ
.TP
.I lorder
ǡ١˳ǼƤǡͤΥХȥ
οϡɽΤǤ롣
㤨Хӥåǥʤ顢οͤ 4,321 Ȥʤ롣
.I lorder
0 (ꤵƤʤ) ξ硢ߤΥۥ
ǻȤƤХȥȤ롣
.PP
ե뤬¸ߤƤ (ޤ
.B O_TRUCT
ե饰ꤵƤʤ) ȡ
.IR flag ,
.IR lorder ,
.I psize
˻ꤵ줿̵ͤ뤵졢
ĥ줿˻ȤäͤѤ롣
.PP
ĥ縡ϡǾ祭˸äƹԤ롣
.PP
ĥ饭/ǡФ뤳ȤˤäƤǤڡϡ
̾ѤǤˤʤäƤ뤬Ѥ뤳Ȥ̵
Ĥޤ brtee ¤礹Ǥ롣
кϲ٤κ뤫
¸ߤĥĴ٤Ū˿ĥ뤫Ǥ롣
.PP
.SH 顼
.I btree
åɥ롼ϼԤȡ饤֥롼
.BR dbopen (3)
Ƥ륨顼Τ줫
.I errno
Ȥ֤
.SH Х
ХȥȤƤϥӥåǥȥȥ륨ǥΤߤ
ݡȤƤ롣
.SH Ϣ
.BR dbopen (3),
.BR hash (3),
.BR mpool (3),
.BR recno (3)
.sp
.IR "The Ubiquitous B-tree" ,
Douglas Comer, ACM Comput. Surv. 11, 2 (June 1979), 121-138.
.sp
.IR "Prefix B-trees" ,
Bayer and Unterauer, ACM Transactions on Database Systems, Vol. 2, 1
(March 1977), 11-26.
.sp
.IR "The Art of Computer Programming Vol. 3: Sorting and Searching" ,
D.E. Knuth, 1968, pp 471-480.
|